Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JwtModule datasource #1355

Merged
merged 1 commit into from
Apr 4, 2024
Merged

Add JwtModule datasource #1355

merged 1 commit into from
Apr 4, 2024

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Apr 3, 2024

Summary

This adds the JwtModule datasource as part of a test implementation for SiWe authentication, breaking down #1321 for review.

It leverages the jsonwebtoken package which is the "highest up" the dependency tree for JWT management, not requiring manual interfacing with signatures.

Changes

  • Add JWT_ISSUER and JWT_SECRET env. vars.
  • Add JwtModule/JwtService, adhering to IJwtService:
    • sign accepts a payload and date validity options, explicitly adding the secret and issuer.
    • verify accepts a payload, explicitly adding the secret and issuer.
  • Appropriate test coverage for the above.

@iamacook iamacook self-assigned this Apr 3, 2024
@iamacook iamacook marked this pull request as ready for review April 3, 2024 10:38
@iamacook iamacook requested a review from a team as a code owner April 3, 2024 10:38
@coveralls
Copy link

Pull Request Test Coverage Report for Build 8537310941

Details

  • 9 of 16 (56.25%) changed or added relevant lines in 3 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.09%) to 93.051%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/datasources/jwt/jwt.service.interface.ts 0 1 0.0%
src/datasources/jwt/jwt.module.ts 0 6 0.0%
Files with Coverage Reduction New Missed Lines %
src/routes/transactions/entities/tests/human-description.builder.ts 3 60.0%
Totals Coverage Status
Change from base Build 8525317361: -0.09%
Covered Lines: 6499
Relevant Lines: 6735

💛 - Coveralls

@iamacook iamacook changed the title Add JwtService datasource Add JwtModule datasource Apr 3, 2024
@iamacook iamacook merged commit 1c172c5 into main Apr 4, 2024
16 checks passed
@iamacook iamacook deleted the jwt-service branch April 4, 2024 11:22
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.

3 participants