"use strict";exports.id=982,exports.ids=[982],exports.modules={3982:(e,r,n)=>{n.d(r,{fromIni:()=>l});var o=n(3054),t=n(18112);const i=e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.aws_access_key_id&&"string"==typeof e.aws_secret_access_key&&["undefined","string"].indexOf(typeof e.aws_session_token)>-1,s=(e,r)=>(r?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials"),Promise.resolve({accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token,credentialScope:e.aws_credential_scope})),a=async(e,r,l,c={})=>{const d=r[e];if(Object.keys(c).length>0&&i(d))return s(d,l);if(((e,{profile:r="default",logger:n}={})=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.role_arn&&["undefined","string"].indexOf(typeof e.role_session_name)>-1&&["undefined","string"].indexOf(typeof e.external_id)>-1&&["undefined","string"].indexOf(typeof e.mfa_serial)>-1&&(((e,{profile:r,logger:n})=>{const o="string"==typeof e.source_profile&&void 0===e.credential_source;return o&&n?.debug?.(`    ${r} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`),o})(e,{profile:r,logger:n})||((e,{profile:r,logger:n})=>{const o="string"==typeof e.credential_source&&void 0===e.source_profile;return o&&n?.debug?.(`    ${r} isCredentialSourceProfile credential_source=${e.credential_source}`),o})(e,{profile:r,logger:n})))(d,{profile:e,logger:l.logger}))return(async(e,r,i,s={})=>{i.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");const l=r[e];if(!i.roleAssumer){const{getDefaultRoleAssumer:e}=await n.e(136).then(n.bind(n,98136));i.roleAssumer=e({...i.clientConfig,credentialProviderLogger:i.logger,parentClientConfig:i?.parentClientConfig},i.clientPlugins)}const{source_profile:c}=l;if(c&&c in s)throw new t.C1(`Detected a cycle attempting to resolve credentials for profile ${(0,o.Bz)(i)}. Profiles visited: `+Object.keys(s).join(", "),{logger:i.logger});i.logger?.debug("@aws-sdk/credential-provider-ini - finding credential resolver using "+(c?`source_profile=[${c}]`:`profile=[${e}]`));const d=c?a(c,{...r,[c]:{...r[c],role_arn:l.role_arn??r[c].role_arn}},i,{...s,[c]:!0}):(await((e,r,o)=>{const i={EcsContainer:async e=>{const{fromHttp:r}=await n.e(56).then(n.bind(n,26056)),{fromContainerMetadata:i}=await n.e(897).then(n.bind(n,47897));return o?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),(0,t.cy)(r(e??{}),i(e))},Ec2InstanceMetadata:async e=>{o?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");const{fromInstanceMetadata:r}=await n.e(897).then(n.bind(n,47897));return r(e)},Environment:async e=>{o?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");const{fromEnv:r}=await Promise.resolve().then(n.bind(n,73946));return r(e)}};if(e in i)return i[e];throw new t.C1(`Unsupported credential source in profile ${r}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:o})})(l.credential_source,e,i.logger)(i))(),f={RoleArn:l.role_arn,RoleSessionName:l.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:l.external_id,DurationSeconds:parseInt(l.duration_seconds||"3600",10)},{mfa_serial:g}=l;if(g){if(!i.mfaCodeProvider)throw new t.C1(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:i.logger,tryNextLink:!1});f.SerialNumber=g,f.TokenCode=await i.mfaCodeProvider(g)}const u=await d;return i.roleAssumer(u,f)})(e,r,l,c);if(i(d))return s(d,l);if(f=d,Boolean(f)&&"object"==typeof f&&"string"==typeof f.web_identity_token_file&&"string"==typeof f.role_arn&&["undefined","string"].indexOf(typeof f.role_session_name)>-1)return(async(e,r)=>n.e(841).then(n.bind(n,71841)).then((({fromTokenFile:n})=>n({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:r.roleAssumerWithWebIdentity,logger:r.logger,parentClientConfig:r.parentClientConfig})())))(d,l);var f;if((e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.credential_process)(d))return(async(e,r)=>n.e(681).then(n.bind(n,45681)).then((({fromProcess:n})=>n({...e,profile:r})())))(l,e);if((e=>e&&("string"==typeof e.sso_start_url||"string"==typeof e.sso_account_id||"string"==typeof e.sso_session||"string"==typeof e.sso_region||"string"==typeof e.sso_role_name))(d))return await(async(e,r={})=>{const{fromSSO:o}=await n.e(310).then(n.bind(n,13310));return o({profile:e,logger:r.logger})()})(e,l);throw new t.C1(`Could not resolve credentials using profile: [${e}] in configuration/credentials file(s).`,{logger:l.logger})},l=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");const r=await(0,o.YU)(e);return a((0,o.Bz)(e),r,e)}}};
//# sourceMappingURL=982-bundle.js.map