"use strict";exports.id=687,exports.ids=[687],exports.modules={11687:(e,o,r)=>{r.d(o,{fromTokenFile:()=>d});var t=r(82729);class n extends Error{constructor(e,o=!0){let r,t=!0;"boolean"==typeof o?(r=void 0,t=o):null!=o&&"object"==typeof o&&(r=o.logger,t=o.tryNextLink??!0),super(e),this.name="ProviderError",this.tryNextLink=t,Object.setPrototypeOf(this,n.prototype),r?.debug?.(`@smithy/property-provider ${t?"->":"(!)"} ${e}`)}static from(e,o=!0){return Object.assign(new this(e.message,o),e)}}class i extends n{constructor(e,o=!0){super(e,o),this.name="CredentialsProviderError",Object.setPrototypeOf(this,i.prototype)}}var s=r(79896);const l="AWS_WEB_IDENTITY_TOKEN_FILE",d=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const o=e?.webIdentityTokenFile??process.env[l],n=e?.roleArn??process.env.AWS_ROLE_ARN,d=e?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!o||!n)throw new i("Web identity configuration not specified",{logger:e.logger});const c=await(e=>async o=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");const{roleArn:t,roleSessionName:n,webIdentityToken:i,providerId:s,policyArns:l,policy:d,durationSeconds:c}=e;let{roleAssumerWithWebIdentity:a}=e;if(!a){const{getDefaultRoleAssumerWithWebIdentity:t}=await Promise.all([r.e(163),r.e(507)]).then(r.bind(r,5507));a=t({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...o?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return a({RoleArn:t,RoleSessionName:n??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:i,ProviderId:s,PolicyArns:l,Policy:d,DurationSeconds:c})})({...e,webIdentityToken:(0,s.readFileSync)(o,{encoding:"ascii"}),roleArn:n,roleSessionName:d})();return o===process.env[l]&&(0,t.g)(c,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h"),c}}};
//# sourceMappingURL=687-bundle.js.map