1+ "use strict" ;
2+ exports . id = 427 ;
3+ exports . ids = [ 427 ] ;
4+ exports . modules = {
5+
6+ /***/ 8792 :
7+ /***/ ( ( __unused_webpack_module , exports , __webpack_require__ ) => {
8+
9+
10+ Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
11+ exports . fromTokenFile = void 0 ;
12+ const client_1 = __webpack_require__ ( 8639 ) ;
13+ const property_provider_1 = __webpack_require__ ( 1238 ) ;
14+ const shared_ini_file_loader_1 = __webpack_require__ ( 4964 ) ;
15+ const fs_1 = __webpack_require__ ( 9896 ) ;
16+ const fromWebToken_1 = __webpack_require__ ( 9272 ) ;
17+ const ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE" ;
18+ const ENV_ROLE_ARN = "AWS_ROLE_ARN" ;
19+ const ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME" ;
20+ const fromTokenFile = ( init = { } ) => async ( awsIdentityProperties ) => {
21+ init . logger ?. debug ( "@aws-sdk/credential-provider-web-identity - fromTokenFile" ) ;
22+ const webIdentityTokenFile = init ?. webIdentityTokenFile ?? process . env [ ENV_TOKEN_FILE ] ;
23+ const roleArn = init ?. roleArn ?? process . env [ ENV_ROLE_ARN ] ;
24+ const roleSessionName = init ?. roleSessionName ?? process . env [ ENV_ROLE_SESSION_NAME ] ;
25+ if ( ! webIdentityTokenFile || ! roleArn ) {
26+ throw new property_provider_1 . CredentialsProviderError ( "Web identity configuration not specified" , {
27+ logger : init . logger ,
28+ } ) ;
29+ }
30+ const credentials = await ( 0 , fromWebToken_1 . fromWebToken ) ( {
31+ ...init ,
32+ webIdentityToken : shared_ini_file_loader_1 . externalDataInterceptor ?. getTokenRecord ?. ( ) [ webIdentityTokenFile ] ??
33+ ( 0 , fs_1 . readFileSync ) ( webIdentityTokenFile , { encoding : "ascii" } ) ,
34+ roleArn,
35+ roleSessionName,
36+ } ) ( awsIdentityProperties ) ;
37+ if ( webIdentityTokenFile === process . env [ ENV_TOKEN_FILE ] ) {
38+ ( 0 , client_1 . setCredentialFeature ) ( credentials , "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN" , "h" ) ;
39+ }
40+ return credentials ;
41+ } ;
42+ exports . fromTokenFile = fromTokenFile ;
43+
44+
45+ /***/ } ) ,
46+
47+ /***/ 9272 :
48+ /***/ ( function ( __unused_webpack_module , exports , __webpack_require__ ) {
49+
50+
51+ var __createBinding = ( this && this . __createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
52+ if ( k2 === undefined ) k2 = k ;
53+ var desc = Object . getOwnPropertyDescriptor ( m , k ) ;
54+ if ( ! desc || ( "get" in desc ? ! m . __esModule : desc . writable || desc . configurable ) ) {
55+ desc = { enumerable : true , get : function ( ) { return m [ k ] ; } } ;
56+ }
57+ Object . defineProperty ( o , k2 , desc ) ;
58+ } ) : ( function ( o , m , k , k2 ) {
59+ if ( k2 === undefined ) k2 = k ;
60+ o [ k2 ] = m [ k ] ;
61+ } ) ) ;
62+ var __setModuleDefault = ( this && this . __setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
63+ Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
64+ } ) : function ( o , v ) {
65+ o [ "default" ] = v ;
66+ } ) ;
67+ var __importStar = ( this && this . __importStar ) || ( function ( ) {
68+ var ownKeys = function ( o ) {
69+ ownKeys = Object . getOwnPropertyNames || function ( o ) {
70+ var ar = [ ] ;
71+ for ( var k in o ) if ( Object . prototype . hasOwnProperty . call ( o , k ) ) ar [ ar . length ] = k ;
72+ return ar ;
73+ } ;
74+ return ownKeys ( o ) ;
75+ } ;
76+ return function ( mod ) {
77+ if ( mod && mod . __esModule ) return mod ;
78+ var result = { } ;
79+ if ( mod != null ) for ( var k = ownKeys ( mod ) , i = 0 ; i < k . length ; i ++ ) if ( k [ i ] !== "default" ) __createBinding ( result , mod , k [ i ] ) ;
80+ __setModuleDefault ( result , mod ) ;
81+ return result ;
82+ } ;
83+ } ) ( ) ;
84+ Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
85+ exports . fromWebToken = void 0 ;
86+ const fromWebToken = ( init ) => async ( awsIdentityProperties ) => {
87+ init . logger ?. debug ( "@aws-sdk/credential-provider-web-identity - fromWebToken" ) ;
88+ const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init ;
89+ let { roleAssumerWithWebIdentity } = init ;
90+ if ( ! roleAssumerWithWebIdentity ) {
91+ const { getDefaultRoleAssumerWithWebIdentity } = await Promise . resolve ( ) . then ( ( ) => __importStar ( __webpack_require__ ( 2801 ) ) ) ;
92+ roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity ( {
93+ ...init . clientConfig ,
94+ credentialProviderLogger : init . logger ,
95+ parentClientConfig : {
96+ ...awsIdentityProperties ?. callerClientConfig ,
97+ ...init . parentClientConfig ,
98+ } ,
99+ } , init . clientPlugins ) ;
100+ }
101+ return roleAssumerWithWebIdentity ( {
102+ RoleArn : roleArn ,
103+ RoleSessionName : roleSessionName ?? `aws-sdk-js-session-${ Date . now ( ) } ` ,
104+ WebIdentityToken : webIdentityToken ,
105+ ProviderId : providerId ,
106+ PolicyArns : policyArns ,
107+ Policy : policy ,
108+ DurationSeconds : durationSeconds ,
109+ } ) ;
110+ } ;
111+ exports . fromWebToken = fromWebToken ;
112+
113+
114+ /***/ } ) ,
115+
116+ /***/ 2427 :
117+ /***/ ( ( __unused_webpack_module , exports , __webpack_require__ ) => {
118+
119+
120+
121+ var fromTokenFile = __webpack_require__ ( 8792 ) ;
122+ var fromWebToken = __webpack_require__ ( 9272 ) ;
123+
124+
125+
126+ Object . keys ( fromTokenFile ) . forEach ( function ( k ) {
127+ if ( k !== 'default' && ! Object . prototype . hasOwnProperty . call ( exports , k ) ) Object . defineProperty ( exports , k , {
128+ enumerable : true ,
129+ get : function ( ) { return fromTokenFile [ k ] ; }
130+ } ) ;
131+ } ) ;
132+ Object . keys ( fromWebToken ) . forEach ( function ( k ) {
133+ if ( k !== 'default' && ! Object . prototype . hasOwnProperty . call ( exports , k ) ) Object . defineProperty ( exports , k , {
134+ enumerable : true ,
135+ get : function ( ) { return fromWebToken [ k ] ; }
136+ } ) ;
137+ } ) ;
138+
139+
140+ /***/ } )
141+
142+ } ;
143+ ;
0 commit comments