Skip to content

Commit

Permalink
fix: make oidc clientId optional (#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
mogusbi-motech committed May 8, 2023
1 parent 2ef9b20 commit 55f6c11
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/__tests__/validation/__snapshots__/auth.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ exports[`Valdiation Invalid should validate a Lambda with invalid functionName a

exports[`Valdiation Invalid should validate a Lambda with missing config 1`] = `"/authentication: must have required property 'config'"`;

exports[`Valdiation Invalid should validate a OIDC with empty config 1`] = `
"/authentication/config: must have required property 'issuer'
/authentication/config: must have required property 'clientId'"
`;
exports[`Valdiation Invalid should validate a OIDC with empty config 1`] = `"/authentication/config: must have required property 'issuer'"`;

exports[`Valdiation Invalid should validate a OIDC with invalid config 1`] = `
"/authentication/config/issuer: must be string
Expand Down
14 changes: 14 additions & 0 deletions src/__tests__/validation/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ describe('Valdiation', () => {
},
} as AppSyncConfigInput,
},
{
name: 'OIDC without a clientId',
config: {
...basicConfig,
authentication: {
type: 'OPENID_CONNECT',
config: {
issuer: 'https://auth.example.com',
iatTTL: 3600,
authTTL: 3600,
},
},
} as AppSyncConfigInput,
},
{
name: 'IAM',
config: {
Expand Down
2 changes: 1 addition & 1 deletion src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const appSyncSchema = {
iatTTL: { type: 'number' },
authTTL: { type: 'number' },
},
required: ['issuer', 'clientId'],
required: ['issuer'],
},
iamAuth: {
type: 'object',
Expand Down

0 comments on commit 55f6c11

Please sign in to comment.