@@ -52,14 +52,15 @@ jest.mock("@aws-sdk/client-sso", () => {
52
52
return {
53
53
...actual ,
54
54
SSOClient : class {
55
+ public constructor ( public config : any ) { }
55
56
async send ( ) {
56
57
return {
57
58
roleCredentials : {
58
59
accessKeyId : "SSO_ACCESS_KEY_ID" ,
59
60
secretAccessKey : "SSO_SECRET_ACCESS_KEY" ,
60
61
sessionToken : "SSO_SESSION_TOKEN" ,
61
62
expiration : new Date ( "3000-01-01T00:00:00.000Z" ) ,
62
- credentialScope : "us-sso-1" ,
63
+ credentialScope : "us-sso-1-" + this . config . region ,
63
64
} ,
64
65
} ;
65
66
}
@@ -285,11 +286,12 @@ describe("credential-provider-node integration test", () => {
285
286
describe ( "fromSSO" , ( ) => {
286
287
it ( "should resolve SSO credentials if legacy SSO parameters are supplied directly" , async ( ) => {
287
288
sts = new STS ( {
288
- region : "us-sso-1" ,
289
+ // this is lower priority than the ssoRegion.
290
+ region : "us-sso-region-2" ,
289
291
credentials : defaultProvider ( {
290
292
ssoStartUrl : "SSO_START_URL" ,
291
293
ssoAccountId : "1234" ,
292
- ssoRegion : "us-sso-1" ,
294
+ ssoRegion : "us-sso-region- 1" ,
293
295
ssoRoleName : "sso-role" ,
294
296
} ) ,
295
297
requestHandler : mockRequestHandler ,
@@ -301,7 +303,7 @@ describe("credential-provider-node integration test", () => {
301
303
secretAccessKey : "SSO_SECRET_ACCESS_KEY" ,
302
304
sessionToken : "SSO_SESSION_TOKEN" ,
303
305
expiration : new Date ( "3000-01-01T00:00:00.000Z" ) ,
304
- credentialScope : "us-sso-1" ,
306
+ credentialScope : "us-sso-1-us-sso-region-1 " ,
305
307
} ) ;
306
308
} ) ;
307
309
} ) ;
@@ -429,12 +431,12 @@ describe("credential-provider-node integration test", () => {
429
431
430
432
it ( "should resolve SSO credentials if the profile is an SSO profile" , async ( ) => {
431
433
iniProfileData [ "sso-session.ssoNew" ] = {
432
- sso_region : "us-sso-1" ,
434
+ sso_region : "us-sso-region- 1" ,
433
435
sso_start_url : "SSO_START_URL" ,
434
436
sso_registration_scopes : "sso:account:access" ,
435
437
} ;
436
438
Object . assign ( iniProfileData . default , {
437
- sso_region : "us-sso-1" ,
439
+ sso_region : "us-sso-region- 1" ,
438
440
sso_session : "ssoNew" ,
439
441
sso_account_id : "1234" ,
440
442
sso_role_name : "integration-test" ,
@@ -446,7 +448,7 @@ describe("credential-provider-node integration test", () => {
446
448
secretAccessKey : "SSO_SECRET_ACCESS_KEY" ,
447
449
sessionToken : "SSO_SESSION_TOKEN" ,
448
450
expiration : new Date ( "3000-01-01T00:00:00.000Z" ) ,
449
- credentialScope : "us-sso-1" ,
451
+ credentialScope : "us-sso-1-us-sso-region-1 " ,
450
452
} ) ;
451
453
} ) ;
452
454
} ) ;
0 commit comments