@@ -5,8 +5,8 @@ import winston from 'winston';
55import { createAuthRouter } from '../../../src/apis/auth' ;
66import { createAuthMiddleware } from '../../../src/auth/authenticator' ;
77import { STANDALONE_REQUEST_CONTEXT } from '../../../src/auth/identity' ;
8- import { OidcAuthenticator } from '../../../src/auth/oidcAuthenticator' ;
98import { disableOidcAuth , initOidc } from '../../../src/auth/oidc' ;
9+ import { OidcAuthenticator } from '../../../src/auth/oidcAuthenticator' ;
1010import { StandaloneAuthenticator } from '../../../src/auth/standaloneAuthenticator' ;
1111import configuration from '../../../src/config' ;
1212
@@ -230,7 +230,7 @@ describe('auth router (auth enabled)', () => {
230230 expect . arrayContaining ( [ 'openid' , 'profile' , 'email' , 'groups' ] ) ,
231231 ) ;
232232 expect ( JSON . parse ( authUrl . searchParams . get ( 'claims' ) ?? '{}' ) ) . toEqual ( {
233- id_token : { sub : { essential : true } , groups : { essential : true } , name : { essential : true } } ,
233+ id_token : { sub : { essential : true } , groups : { essential : true } } ,
234234 } ) ;
235235 expect ( cookieValue ( setCookies ( res ) , STATE_COOKIE ) ) . toBeTruthy ( ) ;
236236 } ) ;
@@ -256,7 +256,7 @@ describe('auth router (auth enabled)', () => {
256256 ) ;
257257 expect ( authUrl . searchParams . get ( 'scope' ) ?. split ( ' ' ) ) . not . toContain ( 'groups' ) ;
258258 expect ( JSON . parse ( authUrl . searchParams . get ( 'claims' ) ?? '{}' ) ) . toEqual ( {
259- id_token : { sub : { essential : true } , roles : { essential : true } , name : { essential : true } } ,
259+ id_token : { sub : { essential : true } , roles : { essential : true } } ,
260260 } ) ;
261261 } ) ;
262262
@@ -297,7 +297,6 @@ describe('auth router (auth enabled)', () => {
297297 id_token : {
298298 sub : { essential : true } ,
299299 groups : { essential : true } ,
300- name : { essential : true } ,
301300 email : { essential : true } ,
302301 } ,
303302 } ) ;
@@ -342,10 +341,9 @@ describe('auth router (auth enabled)', () => {
342341 // No `error` code → this is our own validation failure, so the attacker-supplied
343342 // description must not be reflected; the reason stays generic.
344343 const crafted = 'Your%20account%20is%20compromised%2C%20call%201-800-EVIL' ;
345- const res = await createTestAuthRouter ( { oidcClient } ) . request (
346- `/callback?state=any&error_description=${ crafted } ` ,
347- { redirect : 'manual' } ,
348- ) ;
344+ const res = await createTestAuthRouter ( { oidcClient } ) . request ( `/callback?state=any&error_description=${ crafted } ` , {
345+ redirect : 'manual' ,
346+ } ) ;
349347 expect ( res . status ) . toBe ( 302 ) ;
350348 expect ( res . headers . get ( 'location' ) ) . toBe ( '/?error=login_failed' ) ;
351349 } ) ;
@@ -380,13 +378,10 @@ describe('auth router (auth enabled)', () => {
380378 }
381379
382380 const token = await createIdToken ( ) ;
383- const res = await createTestAuthRouter ( { oidcClient : restrictedClient } ) . request (
384- '/callback?code=abc&state=spent' ,
385- {
386- redirect : 'manual' ,
387- headers : { Cookie : `${ ID_TOKEN_COOKIE } =${ token } ` } ,
388- } ,
389- ) ;
381+ const res = await createTestAuthRouter ( { oidcClient : restrictedClient } ) . request ( '/callback?code=abc&state=spent' , {
382+ redirect : 'manual' ,
383+ headers : { Cookie : `${ ID_TOKEN_COOKIE } =${ token } ` } ,
384+ } ) ;
390385 expect ( res . status ) . toBe ( 302 ) ;
391386 expect ( res . headers . get ( 'location' ) ) . toBe ( '/?error=login_failed' ) ;
392387 expect (
0 commit comments