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

fix: make oidc clientId optional #599

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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