1
- import { Authentication } from '../Authentication ' ;
1
+ import { BasicAuthentication } from '../BasicAuthentication ' ;
2
2
import { CRED_KEY } from '../../utils/constants' ;
3
3
import { DEFAULT_CONFIG } from '../../test-utils/test-utils' ;
4
4
@@ -22,7 +22,7 @@ jest.mock('../StsClient', () => ({
22
22
const IDENTITY_POOL_ID = 'us-west-2:a-b-c-d' ;
23
23
const GUEST_ROLE_ARN = 'arn:aws:iam::123:role/Unauth' ;
24
24
25
- describe ( 'Authentication tests' , ( ) => {
25
+ describe ( 'BasicAuthentication tests' , ( ) => {
26
26
beforeEach ( ( ) => {
27
27
mockGetId . mockReset ( ) ;
28
28
mockGetIdToken . mockReset ( ) ;
@@ -54,7 +54,7 @@ describe('Authentication tests', () => {
54
54
guestRoleArn : GUEST_ROLE_ARN
55
55
}
56
56
} ;
57
- const auth = new Authentication ( config ) ;
57
+ const auth = new BasicAuthentication ( config ) ;
58
58
59
59
localStorage . setItem (
60
60
CRED_KEY ,
@@ -88,7 +88,7 @@ describe('Authentication tests', () => {
88
88
guestRoleArn : GUEST_ROLE_ARN
89
89
}
90
90
} ;
91
- const auth = new Authentication ( config ) ;
91
+ const auth = new BasicAuthentication ( config ) ;
92
92
93
93
localStorage . setItem ( CRED_KEY , 'corrupt' ) ;
94
94
@@ -107,7 +107,7 @@ describe('Authentication tests', () => {
107
107
108
108
test ( 'when credential is not in localStorage then authentication chain retrieves credential from basic authflow' , async ( ) => {
109
109
// Init
110
- const auth = new Authentication ( {
110
+ const auth = new BasicAuthentication ( {
111
111
...DEFAULT_CONFIG ,
112
112
...{
113
113
identityPoolId : IDENTITY_POOL_ID ,
@@ -139,7 +139,7 @@ describe('Authentication tests', () => {
139
139
}
140
140
} ;
141
141
142
- const auth = new Authentication ( config ) ;
142
+ const auth = new BasicAuthentication ( config ) ;
143
143
144
144
localStorage . setItem (
145
145
CRED_KEY ,
@@ -181,7 +181,7 @@ describe('Authentication tests', () => {
181
181
sessionToken : 'z'
182
182
} ) ;
183
183
184
- const auth = new Authentication ( {
184
+ const auth = new BasicAuthentication ( {
185
185
...DEFAULT_CONFIG ,
186
186
...{
187
187
identityPoolId : IDENTITY_POOL_ID ,
@@ -210,7 +210,7 @@ describe('Authentication tests', () => {
210
210
throw e ;
211
211
} ) ;
212
212
// Init
213
- const auth = new Authentication ( {
213
+ const auth = new BasicAuthentication ( {
214
214
...DEFAULT_CONFIG ,
215
215
...{
216
216
identityPoolId : IDENTITY_POOL_ID ,
@@ -230,7 +230,7 @@ describe('Authentication tests', () => {
230
230
throw e ;
231
231
} ) ;
232
232
// Init
233
- const auth = new Authentication ( {
233
+ const auth = new BasicAuthentication ( {
234
234
...DEFAULT_CONFIG ,
235
235
...{
236
236
identityPoolId : IDENTITY_POOL_ID ,
@@ -250,7 +250,7 @@ describe('Authentication tests', () => {
250
250
throw e ;
251
251
} ) ;
252
252
// Init
253
- const auth = new Authentication ( {
253
+ const auth = new BasicAuthentication ( {
254
254
...DEFAULT_CONFIG ,
255
255
...{
256
256
identityPoolId : IDENTITY_POOL_ID ,
@@ -272,7 +272,7 @@ describe('Authentication tests', () => {
272
272
guestRoleArn : GUEST_ROLE_ARN
273
273
}
274
274
} ;
275
- const auth = new Authentication ( config ) ;
275
+ const auth = new BasicAuthentication ( config ) ;
276
276
277
277
// Run
278
278
await auth . ChainAnonymousCredentialsProvider ( ) ;
@@ -321,7 +321,7 @@ describe('Authentication tests', () => {
321
321
guestRoleArn : GUEST_ROLE_ARN
322
322
}
323
323
} ;
324
- const auth = new Authentication ( config ) ;
324
+ const auth = new BasicAuthentication ( config ) ;
325
325
326
326
// Run
327
327
await auth . ChainAnonymousCredentialsProvider ( ) ;
@@ -358,7 +358,7 @@ describe('Authentication tests', () => {
358
358
guestRoleArn : GUEST_ROLE_ARN
359
359
}
360
360
} ;
361
- const auth = new Authentication ( config ) ;
361
+ const auth = new BasicAuthentication ( config ) ;
362
362
363
363
// Run
364
364
const credentials = await auth . ChainAnonymousCredentialsProvider ( ) ;
@@ -396,7 +396,7 @@ describe('Authentication tests', () => {
396
396
guestRoleArn : GUEST_ROLE_ARN
397
397
}
398
398
} ;
399
- const auth = new Authentication ( config ) ;
399
+ const auth = new BasicAuthentication ( config ) ;
400
400
401
401
// Run
402
402
await auth . ChainAnonymousCredentialsProvider ( ) ;
0 commit comments