Skip to content

Commit

Permalink
please pass
Browse files Browse the repository at this point in the history
  • Loading branch information
macrael committed Jan 22, 2024
1 parent d7711dc commit 3504b4c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { newJWTLib } from '../jwt'
// Hard coding this for now, next job is to run this config to this app.
const jwtLib = newJWTLib({
issuer: 'fakeIssuer',
signingKey: 'notrandom',
signingKey: Buffer.from('123af', 'hex'),
expirationDurationS: 90 * 24 * 60 * 60, // 90 days
})

Expand Down
14 changes: 7 additions & 7 deletions services/app-api/src/jwt/jwt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('jwtLib', () => {
it('works symmetricly', () => {
const jwt = newJWTLib({
issuer: 'mctest',
signingKey: 'foo', //pragma: allowlist secret
signingKey: Buffer.from('123af', 'hex'),
expirationDurationS: 1000,
})

Expand All @@ -27,13 +27,13 @@ describe('jwtLib', () => {
it('errors with wrong issuer', () => {
const jwtWriter = newJWTLib({
issuer: 'wrong',
signingKey: 'foo',
signingKey: Buffer.from('123af', 'hex'),
expirationDurationS: 1000,
})

const jwtReader = newJWTLib({
issuer: 'mctest',
signingKey: 'foo',
signingKey: Buffer.from('123af', 'hex'),
expirationDurationS: 1000,
})

Expand All @@ -49,13 +49,13 @@ describe('jwtLib', () => {
it('errors with bad expiration', () => {
const jwtWriter = newJWTLib({
issuer: 'mctest',
signingKey: 'foo',
signingKey: Buffer.from('123af', 'hex'),
expirationDurationS: 0,
})

const jwtReader = newJWTLib({
issuer: 'mctest',
signingKey: 'foo',
signingKey: Buffer.from('123af', 'hex'),
expirationDurationS: 1000,
})

Expand All @@ -77,7 +77,7 @@ describe('jwtLib', () => {

const jwtReader = newJWTLib({
issuer: 'mctest',
signingKey: 'foo',
signingKey: Buffer.from('123af', 'hex'),
expirationDurationS: 1000,
})

Expand All @@ -93,7 +93,7 @@ describe('jwtLib', () => {
it('errors with bogus JWT', () => {
const jwtReader = newJWTLib({
issuer: 'mctest',
signingKey: 'foo',
signingKey: Buffer.from('123af', 'hex'),
expirationDurationS: 1000,
})

Expand Down
2 changes: 1 addition & 1 deletion services/app-api/src/resolvers/APIKey/createAPIKey.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('createAPIKey', () => {
it('creates a new API key', async () => {
const jwt = newJWTLib({
issuer: 'mctestiss',
signingKey: 'foo',
signingKey: Buffer.from('123af', 'hex'),
expirationDurationS: 1000,
})

Expand Down
2 changes: 1 addition & 1 deletion services/app-api/src/testHelpers/gqlHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const constructTestPostgresServer = async (opts?: {
opts?.jwt ||
newJWTLib({
issuer: 'mcreviewtest',
signingKey: 'foo',
signingKey: Buffer.from('123af', 'hex'),
expirationDurationS: 1000,
})

Expand Down
1 change: 1 addition & 0 deletions services/infra-api/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ resources:
Name: 'api_jwt_secret_${sls:stage}'
Description: 'Dynamically generated secret for JWT signing/validation'
GenerateSecretString:
SecretStringTemplate: '{}'
GenerateStringKey: jwtsigningkey
PasswordLength: 128
ExcludePunctuation: true
Expand Down

0 comments on commit 3504b4c

Please sign in to comment.