Skip to content

feat: Auth Guard Common#92

Open
cbolles wants to merge 6 commits intomainfrom
feature/cbolles/auth-guard
Open

feat: Auth Guard Common#92
cbolles wants to merge 6 commits intomainfrom
feature/cbolles/auth-guard

Conversation

@cbolles
Copy link
Member

@cbolles cbolles commented Aug 8, 2023

Description

  • Add JWT Auth Guard to common package
  • Factory and direct instantiation

Checklist

  • This PR can be reviewed in under 30 minutes
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have assigned reviewers to this PR.

Example Usage

  AuthModule.registerAsync({
    inject: [ConfigService, HttpService],
    imports: [ConfigModule, HttpModule],
    useFactory: async (configService: ConfigService, httpService: HttpService) => {
      const publicKeyURL = configService.getOrThrow('auth.publicKeyUrl');
      const publicKey = await AuthModule.getPublicKeyHelper(publicKeyURL, httpService);
      return {
        publicKey,
        signOptions: {
          algorithm: 'RS256'
        }
      }
    }
  })

@cbolles cbolles requested a review from gregfrasco August 8, 2023 20:10
@codacy-production
Copy link

Coverage summary from Codacy

Merging #92 (7e1ce08) into main (886ad70) - See PR on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (886ad70) 868 403 46.43%
Head commit (7e1ce08) 868 (+0) 403 (+0) 46.43% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#92) 11 11 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@codacy-production
Copy link

Coverage summary from Codacy

Merging #92 (7e1ce08) into main (886ad70) - See PR on Codacy

Coverage variation Diff coverage
Report missing for 886ad70[^1] 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (886ad70) 868 403 46.43%
Head commit (7e1ce08) 868 403 46.43%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#92) 11 11 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant