Skip to content

Commit

Permalink
Merge branch 'jul/migrate-fake-oidc-endpoint' into 'master'
Browse files Browse the repository at this point in the history
fix(tests): migrate fake-oidc endpoints to /issuers/fake-oidc

See merge request TankerHQ/sdk-js!1028
  • Loading branch information
JMounier committed Jul 19, 2024
2 parents df9aa08 + b37e2c1 commit dceb38f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/functional-tests/src/helpers/AppHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class AppHelper {
});
}

async setOidc(provider: 'google' | 'pro-sante-bas' | 'pro-sante-bas-no-expiry' | 'fake-oidc' = 'google') {
async setOidc(provider: 'google' | 'pro-sante-bas' | 'pro-sante-bas-no-expiry' | 'fake-oidc' = 'google', oidc_provider_group_id: string = 'AYBa9RHeILz7WKXm4DL3pmVufbP2-ihlKBl9c0hgHVk') {
const providers = {
google: oidcSettings.googleAuth.clientId,
'pro-sante-bas': 'doctolib-dev',
Expand All @@ -65,14 +65,15 @@ export class AppHelper {
google: 'https://accounts.google.com',
'pro-sante-bas': 'https://auth.bas.psc.esante.gouv.fr/auth/realms/esante-wallet',
'pro-sante-bas-no-expiry': 'https://auth.bas.psc.esante.gouv.fr/auth/realms/esante-wallet',
'fake-oidc': `${oidcSettings.fakeOidc.url}/issuer`,
'fake-oidc': `${oidcSettings.fakeOidc.url}/issuers/main`,
};

return this._update({
oidc_providers: [{
display_name: provider,
issuer: providersIssuer[provider],
client_id: providers[provider],
oidc_provider_group_id,
ignore_token_expiration: provider === 'pro-sante-bas-no-expiry',
}],
}) as Promise<{ app: { oidc_providers: Array<{ id: string, display_name: string }> } }>;
Expand Down
2 changes: 1 addition & 1 deletion packages/functional-tests/src/verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ export const generateVerificationTests = (args: TestArgs) => {
describe('verification by oidc authorization code', () => {
let provider: { id: string, display_name: string };

const setFakeOidcSubjectCookie = async (subject: string) => fetch(`${oidcSettings.fakeOidc.url}/issuer/subject`, {
const setFakeOidcSubjectCookie = async (subject: string) => fetch(`${oidcSettings.fakeOidc.url}/issuers/main/subject`, {
method: 'POST',
body: JSON.stringify({ subject }),
credentials: 'include',
Expand Down

0 comments on commit dceb38f

Please sign in to comment.