hobots 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/215.index.js +1 -0
- package/261.index.js +1 -0
- package/271.index.js +1 -0
- package/310.index.js +1 -0
- package/320.index.js +1 -0
- package/368.index.js +1 -0
- package/433.index.js +1 -0
- package/485.index.js +1 -0
- package/639.index.js +1 -0
- package/681.index.js +1 -0
- package/708.index.js +1 -0
- package/783.index.js +1 -0
- package/802.index.js +1 -0
- package/822.index.js +1 -0
- package/834.index.js +1 -0
- package/905.index.js +1 -0
- package/924.index.js +1 -0
- package/987.index.js +1 -0
- package/index.js +2 -0
- package/index.js.LICENSE.txt +25 -0
- package/package.json +5 -0
package/215.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=215,exports.ids=[215],exports.modules={69215:(e,t,a)=>{a.d(t,{ENV_CMDS_FULL_URI:()=>p,ENV_CMDS_RELATIVE_URI:()=>m,fromContainerMetadata:()=>f,fromInstanceMetadata:()=>P,getInstanceMetadataEndpoint:()=>T,httpRequest:()=>i});var n=a(25933),r=a(87016),o=a(20181),s=a(58611);function i(e){return new Promise(((t,a)=>{const r=(0,s.request)({method:"GET",...e,hostname:e.hostname?.replace(/^\[(.+)\]$/,"$1")});r.on("error",(e=>{a(Object.assign(new n.mZ("Unable to connect to instance metadata service"),e)),r.destroy()})),r.on("timeout",(()=>{a(new n.mZ("TimeoutError from instance metadata service")),r.destroy()})),r.on("response",(e=>{const{statusCode:s=400}=e;(s<200||300<=s)&&(a(Object.assign(new n.mZ("Error response received from instance metadata service"),{statusCode:s})),r.destroy());const i=[];e.on("data",(e=>{i.push(e)})),e.on("end",(()=>{t(o.Buffer.concat(i)),r.destroy()}))})),r.end()}))}const c=e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.AccessKeyId&&"string"==typeof e.SecretAccessKey&&"string"==typeof e.Token&&"string"==typeof e.Expiration,l=e=>({accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:new Date(e.Expiration)}),d=({maxRetries:e=0,timeout:t=1e3})=>({maxRetries:e,timeout:t}),u=(e,t)=>{let a=e();for(let n=0;n<t;n++)a=a.catch(e);return a},p="AWS_CONTAINER_CREDENTIALS_FULL_URI",m="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",g="AWS_CONTAINER_AUTHORIZATION_TOKEN",f=(e={})=>{const{timeout:t,maxRetries:a}=d(e);return()=>u((async()=>{const a=await y({logger:e.logger}),r=JSON.parse(await h(t,a));if(!c(r))throw new n.C1("Invalid response received from instance metadata service.",{logger:e.logger});return l(r)}),a)},h=async(e,t)=>(process.env[g]&&(t.headers={...t.headers,Authorization:process.env[g]}),(await i({...t,timeout:e})).toString()),v={localhost:!0,"127.0.0.1":!0},w={"http:":!0,"https:":!0},y=async({logger:e})=>{if(process.env[m])return{hostname:"169.254.170.2",path:process.env[m]};if(process.env[p]){const t=(0,r.parse)(process.env[p]);if(!t.hostname||!(t.hostname in v))throw new n.C1(`${t.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:e});if(!t.protocol||!(t.protocol in w))throw new n.C1(`${t.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:e});return{...t,port:t.port?parseInt(t.port,10):void 0}}throw new n.C1(`The container metadata credential provider cannot be used unless the ${m} or ${p} environment variable is set`,{tryNextLink:!1,logger:e})};var E=a(42362);class I extends n.C1{constructor(e,t=!0){super(e,t),this.tryNextLink=t,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,I.prototype)}}var _,A=a(23776);!function(e){e.IPv4="http://169.254.169.254",e.IPv6="http://[fd00:ec2::254]"}(_||(_={}));const S={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:e=>e.ec2_metadata_service_endpoint,default:void 0};var C;!function(e){e.IPv4="IPv4",e.IPv6="IPv6"}(C||(C={}));const b={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE,configFileSelector:e=>e.ec2_metadata_service_endpoint_mode,default:C.IPv4},T=async()=>(0,A.D)(await x()||await D()),x=async()=>(0,E.Z)(S)(),D=async()=>{const e=await(0,E.Z)(b)();switch(e){case C.IPv4:return _.IPv4;case C.IPv6:return _.IPv6;default:throw new Error(`Unsupported endpoint mode: ${e}. Select from ${Object.values(C)}`)}},N=(e,t)=>{const a=300+Math.floor(300*Math.random()),n=new Date(Date.now()+1e3*a);t.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(n)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);const r=e.originalExpiration??e.expiration;return{...e,...r?{originalExpiration:r}:{},expiration:n}},k="/latest/meta-data/iam/security-credentials/",M="AWS_EC2_METADATA_V1_DISABLED",R="ec2_metadata_v1_disabled",O="x-aws-ec2-metadata-token",P=(e={})=>((e,t={})=>{const a=t?.logger||console;let n;return async()=>{let t;try{t=await e(),t.expiration&&t.expiration.getTime()<Date.now()&&(t=N(t,a))}catch(e){if(!n)throw e;a.warn("Credential renew failed: ",e),t=N(n,a)}return n=t,t}})(V(e),{logger:e.logger}),V=(e={})=>{let t=!1;const{logger:a,profile:r}=e,{timeout:o,maxRetries:s}=d(e),i=async(a,o)=>{if(t||null==o.headers?.[O]){let t=!1,a=!1;const o=await(0,E.Z)({environmentVariableSelector:t=>{const r=t[M];if(a=!!r&&"false"!==r,void 0===r)throw new n.C1(`${M} not set in env, checking config file next.`,{logger:e.logger});return a},configFileSelector:e=>{const a=e[R];return t=!!a&&"false"!==a,t},default:!1},{profile:r})();if(e.ec2MetadataV1Disabled||o){const n=[];throw e.ec2MetadataV1Disabled&&n.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"),t&&n.push(`config file profile (${R})`),a&&n.push(`process environment variable (${M})`),new I(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${n.join(", ")}].`)}}const s=(await u((async()=>{let e;try{e=await $(o)}catch(e){throw 401===e.statusCode&&(t=!1),e}return e}),a)).trim();return u((async()=>{let a;try{a=await K(s,o,e)}catch(e){throw 401===e.statusCode&&(t=!1),e}return a}),a)};return async()=>{const e=await T();if(t)return a?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),i(s,{...e,timeout:o});{let n;try{n=(await L({...e,timeout:o})).toString()}catch(n){if(400===n?.statusCode)throw Object.assign(n,{message:"EC2 Metadata token request returned error"});return("TimeoutError"===n.message||[403,404,405].includes(n.statusCode))&&(t=!0),a?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),i(s,{...e,timeout:o})}return i(s,{...e,headers:{[O]:n},timeout:o})}}},L=async e=>i({...e,path:"/latest/api/token",method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),$=async e=>(await i({...e,path:k})).toString(),K=async(e,t,a)=>{const r=JSON.parse((await i({...t,path:k+e})).toString());if(!c(r))throw new n.C1("Invalid response received from instance metadata service.",{logger:a.logger});return l(r)}}};
|
package/261.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=261,exports.ids=[261],exports.modules={21261:(e,s,o)=>{o.d(s,{fromSSO:()=>u});var n=o(25933),t=o(65123);const r="To refresh this SSO session run 'aws sso login' with the corresponding profile.",i={},a=e=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new n.Jh(`Token is expired. ${r}`,!1)},c=(e,s,o=!1)=>{if(void 0===s)throw new n.Jh(`Value not present for '${e}' in SSO Token${o?". Cannot refresh":""}. ${r}`,!1)};var l=o(79896);const{writeFile:g}=l.promises,w=new Date(0),f=(e={})=>async()=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");const s=await(0,t.YU)(e),l=(0,t.Bz)(e),f=s[l];if(!f)throw new n.Jh(`Profile '${l}' could not be found in shared credentials file.`,!1);if(!f.sso_session)throw new n.Jh(`Profile '${l}' is missing required property 'sso_session'.`);const d=f.sso_session,h=(await(0,t.qw)(e))[d];if(!h)throw new n.Jh(`Sso session '${d}' could not be found in shared credentials file.`,!1);for(const e of["sso_start_url","sso_region"])if(!h[e])throw new n.Jh(`Sso session '${d}' is missing required property '${e}'.`,!1);h.sso_start_url;const u=h.sso_region;let S;try{S=await(0,t.vf)(d)}catch(e){throw new n.Jh(`The SSO session token associated with profile=${l} was not found or is invalid. ${r}`,!1)}c("accessToken",S.accessToken),c("expiresAt",S.expiresAt);const{accessToken:p,expiresAt:_}=S,k={token:p,expiration:new Date(_)};if(k.expiration.getTime()-Date.now()>3e5)return k;if(Date.now()-w.getTime()<3e4)return a(k),k;c("clientId",S.clientId,!0),c("clientSecret",S.clientSecret,!0),c("refreshToken",S.refreshToken,!0);try{w.setTime(Date.now());const e=await(async(e,s)=>{const{CreateTokenCommand:n}=await o.e(708).then(o.bind(o,3708)),t=await(async e=>{const{SSOOIDCClient:s}=await o.e(708).then(o.bind(o,3708));if(i[e])return i[e];const n=new s({region:e});return i[e]=n,n})(s);return t.send(new n({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))})(S,u);c("accessToken",e.accessToken),c("expiresIn",e.expiresIn);const s=new Date(Date.now()+1e3*e.expiresIn);try{await((e,s)=>{const o=(0,t.C9)(e),n=JSON.stringify(s,null,2);return g(o,n)})(d,{...S,accessToken:e.accessToken,expiresAt:s.toISOString(),refreshToken:e.refreshToken})}catch(e){}return{token:e.accessToken,expiration:s}}catch(e){return a(k),k}},d=!1,h=async({ssoStartUrl:e,ssoSession:s,ssoAccountId:r,ssoRegion:i,ssoRoleName:a,ssoClient:c,clientConfig:l,profile:g,logger:w})=>{let h;const u="To refresh this SSO session run aws sso login with the corresponding profile.";if(s)try{const e=await f({profile:g})();h={accessToken:e.token,expiresAt:new Date(e.expiration).toISOString()}}catch(e){throw new n.C1(e.message,{tryNextLink:d,logger:w})}else try{h=await(0,t.vf)(e)}catch(e){throw new n.C1(`The SSO session associated with this profile is invalid. ${u}`,{tryNextLink:d,logger:w})}if(new Date(h.expiresAt).getTime()-Date.now()<=0)throw new n.C1(`The SSO session associated with this profile has expired. ${u}`,{tryNextLink:d,logger:w});const{accessToken:S}=h,{SSOClient:p,GetRoleCredentialsCommand:_}=await o.e(924).then(o.bind(o,74924)),k=c||new p(Object.assign({},l??{},{region:l?.region??i}));let m;try{m=await k.send(new _({accountId:r,roleName:a,accessToken:S}))}catch(e){throw new n.C1(e,{tryNextLink:d,logger:w})}const{roleCredentials:{accessKeyId:y,secretAccessKey:T,sessionToken:C,expiration:x,credentialScope:O}={}}=m;if(!(y&&T&&C&&x))throw new n.C1("SSO returns an invalid temporary credential.",{tryNextLink:d,logger:w});return{accessKeyId:y,secretAccessKey:T,sessionToken:C,expiration:new Date(x),credentialScope:O}},u=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");const{ssoStartUrl:s,ssoAccountId:o,ssoRegion:r,ssoRoleName:i,ssoSession:a}=e,{ssoClient:c}=e,l=(0,t.Bz)(e);if(s||o||r||i||a){if(s&&o&&r&&i)return h({ssoStartUrl:s,ssoSession:a,ssoAccountId:o,ssoRegion:r,ssoRoleName:i,ssoClient:c,clientConfig:e.clientConfig,profile:l});throw new n.C1('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger})}{const o=(await(0,t.YU)(e))[l];if(!o)throw new n.C1(`Profile ${l} was not found.`,{logger:e.logger});if(!(g=o)||"string"!=typeof g.sso_start_url&&"string"!=typeof g.sso_account_id&&"string"!=typeof g.sso_session&&"string"!=typeof g.sso_region&&"string"!=typeof g.sso_role_name)throw new n.C1(`Profile ${l} is not configured with SSO credentials.`,{logger:e.logger});if(o?.sso_session){const i=(await(0,t.qw)(e))[o.sso_session],a=` configurations in profile ${l} and sso-session ${o.sso_session}`;if(r&&r!==i.sso_region)throw new n.C1("Conflicting SSO region"+a,{tryNextLink:!1,logger:e.logger});if(s&&s!==i.sso_start_url)throw new n.C1("Conflicting SSO start_url"+a,{tryNextLink:!1,logger:e.logger});o.sso_region=i.sso_region,o.sso_start_url=i.sso_start_url}const{sso_start_url:i,sso_account_id:a,sso_region:w,sso_role_name:f,sso_session:d}=((e,s)=>{const{sso_start_url:o,sso_account_id:t,sso_region:r,sso_role_name:i}=e;if(!(o&&t&&r&&i))throw new n.C1(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:s});return e})(o,e.logger);return h({ssoStartUrl:i,ssoSession:d,ssoAccountId:a,ssoRegion:w,ssoRoleName:f,ssoClient:c,clientConfig:e.clientConfig,profile:l})}var g}}};
|
package/271.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=271,exports.ids=[271],exports.modules={24271:(e,r,n)=>{n.d(r,{fromIni:()=>l});var o=n(42654),t=n(25933);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(320).then(n.bind(n,80320));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(834).then(n.bind(n,30834)),{fromContainerMetadata:i}=await n.e(215).then(n.bind(n,69215));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(215).then(n.bind(n,69215));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,53734));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(783).then(n.bind(n,11783)).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,44681)).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(802).then(n.bind(n,2802));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)}}};
|
package/310.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=310,exports.ids=[310],exports.modules={14310:(e,r,o)=>{o.r(r),o.d(r,{fromProcess:()=>c});var s=o(65123),t=o(25933),i=o(35317),n=o(39023);const c=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const r=await(0,s.YU)(e);return(async(e,r,o)=>{const s=r[e];if(!r[e])throw new t.C1(`Profile ${e} could not be found in shared credentials file.`,{logger:o});{const r=s.credential_process;if(void 0===r)throw new t.C1(`Profile ${e} did not contain credential_process.`,{logger:o});{const s=(0,n.promisify)(i.exec);try{const{stdout:o}=await s(r);let t;try{t=JSON.parse(o.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return((e,r)=>{if(1!==r.Version)throw Error(`Profile ${e} credential_process did not return Version 1.`);if(void 0===r.AccessKeyId||void 0===r.SecretAccessKey)throw Error(`Profile ${e} credential_process returned invalid credentials.`);if(r.Expiration){const o=new Date;if(new Date(r.Expiration)<o)throw Error(`Profile ${e} credential_process returned expired credentials.`)}return{accessKeyId:r.AccessKeyId,secretAccessKey:r.SecretAccessKey,...r.SessionToken&&{sessionToken:r.SessionToken},...r.Expiration&&{expiration:new Date(r.Expiration)},...r.CredentialScope&&{credentialScope:r.CredentialScope}}})(e,t)}catch(e){throw new t.C1(e.message,{logger:o})}}}})((0,s.Bz)(e),r,e.logger)}}};
|
package/320.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=320,exports.ids=[320],exports.modules={80320:(e,t,n)=>{n.d(t,{getDefaultRoleAssumer:()=>dn,getDefaultRoleAssumerWithWebIdentity:()=>un});var s=n(9661),o=n(44455),r=n(33323);const i={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class a extends r.TJ{constructor(e){super(e),Object.setPrototypeOf(this,a.prototype)}}class c extends a{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,c.prototype)}}class l extends a{constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e}),this.name="MalformedPolicyDocumentException",this.$fault="client",Object.setPrototypeOf(this,l.prototype)}}class d extends a{constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e}),this.name="PackedPolicyTooLargeException",this.$fault="client",Object.setPrototypeOf(this,d.prototype)}}class u extends a{constructor(e){super({name:"RegionDisabledException",$fault:"client",...e}),this.name="RegionDisabledException",this.$fault="client",Object.setPrototypeOf(this,u.prototype)}}class p extends a{constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e}),this.name="IDPRejectedClaimException",this.$fault="client",Object.setPrototypeOf(this,p.prototype)}}class h extends a{constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e}),this.name="InvalidIdentityTokenException",this.$fault="client",Object.setPrototypeOf(this,h.prototype)}}class m extends a{constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e}),this.name="IDPCommunicationErrorException",this.$fault="client",Object.setPrototypeOf(this,m.prototype)}}class g extends a{constructor(e){super({name:"InvalidAuthorizationMessageException",$fault:"client",...e}),this.name="InvalidAuthorizationMessageException",this.$fault="client",Object.setPrototypeOf(this,g.prototype)}}const y=e=>({...e,...e.SecretAccessKey&&{SecretAccessKey:r.$H}}),f=e=>({...e,...e.Credentials&&{Credentials:y(e.Credentials)}}),P=e=>({...e,...e.WebIdentityToken&&{WebIdentityToken:r.$H}}),w=e=>({...e,...e.Credentials&&{Credentials:y(e.Credentials)}});var v=n(13175),S=n(69462);const E=async(e,t)=>{const n=re;let s;return s=Le({...j(e,t),[ae]:le,[We]:ie}),oe(t,n,"/",void 0,s)},b=async(e,t)=>{const n=re;let s;return s=Le({...z(e,t),[ae]:pe,[We]:ie}),oe(t,n,"/",void 0,s)},I=async(e,t)=>{if(e.statusCode>=300)return A(e,t);const n=await(0,v.t_)(e.body,t);let s={};return s=N(n.AssumeRoleResult,t),{$metadata:ne(e),...s}},x=async(e,t)=>{if(e.statusCode>=300)return A(e,t);const n=await(0,v.t_)(e.body,t);let s={};return s=V(n.AssumeRoleWithWebIdentityResult,t),{$metadata:ne(e),...s}},A=async(e,t)=>{const n={...e,body:await(0,v.FI)(e.body,t)},s=Ge(e,n.body);switch(s){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await C(n,t);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await T(n,t);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await K(n,t);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await O(n,t);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await R(n,t);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await D(n,t);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await k(n,t);case"InvalidAuthorizationMessageException":case"com.amazonaws.sts#InvalidAuthorizationMessageException":throw await $(n,t);default:const o=n.body;return se({output:e,parsedBody:o.Error,errorCode:s})}},C=async(e,t)=>{const n=e.body,s=Z(n.Error,t),o=new c({$metadata:ne(e),...s});return(0,r.Mw)(o,n)},k=async(e,t)=>{const n=e.body,s=_(n.Error,t),o=new m({$metadata:ne(e),...s});return(0,r.Mw)(o,n)},R=async(e,t)=>{const n=e.body,s=J(n.Error,t),o=new p({$metadata:ne(e),...s});return(0,r.Mw)(o,n)},$=async(e,t)=>{const n=e.body,s=Y(n.Error,t),o=new g({$metadata:ne(e),...s});return(0,r.Mw)(o,n)},D=async(e,t)=>{const n=e.body,s=Q(n.Error,t),o=new h({$metadata:ne(e),...s});return(0,r.Mw)(o,n)},T=async(e,t)=>{const n=e.body,s=X(n.Error,t),o=new l({$metadata:ne(e),...s});return(0,r.Mw)(o,n)},K=async(e,t)=>{const n=e.body,s=ee(n.Error,t),o=new d({$metadata:ne(e),...s});return(0,r.Mw)(o,n)},O=async(e,t)=>{const n=e.body,s=te(n.Error,t),o=new u({$metadata:ne(e),...s});return(0,r.Mw)(o,n)},j=(e,t)=>{const n={};if(null!=e[ke]&&(n[ke]=e[ke]),null!=e[Re]&&(n[Re]=e[Re]),null!=e[Ee]){const s=M(e[Ee],t);0===e[Ee]?.length&&(n.PolicyArns=[]),Object.entries(s).forEach((([e,t])=>{n[`PolicyArns.${e}`]=t}))}if(null!=e[Se]&&(n[Se]=e[Se]),null!=e[fe]&&(n[fe]=e[fe]),null!=e[je]){const s=L(e[je],t);0===e[je]?.length&&(n.Tags=[]),Object.entries(s).forEach((([e,t])=>{n[`Tags.${e}`]=t}))}if(null!=e[Me]){const s=U(e[Me],t);0===e[Me]?.length&&(n.TransitiveTagKeys=[]),Object.entries(s).forEach((([e,t])=>{n[`TransitiveTagKeys.${e}`]=t}))}if(null!=e[we]&&(n[we]=e[we]),null!=e[Ke]&&(n[Ke]=e[Ke]),null!=e[ze]&&(n[ze]=e[ze]),null!=e[Te]&&(n[Te]=e[Te]),null!=e[Ie]){const s=F(e[Ie],t);0===e[Ie]?.length&&(n.ProvidedContexts=[]),Object.entries(s).forEach((([e,t])=>{n[`ProvidedContexts.${e}`]=t}))}return n},z=(e,t)=>{const n={};if(null!=e[ke]&&(n[ke]=e[ke]),null!=e[Re]&&(n[Re]=e[Re]),null!=e[Fe]&&(n[Fe]=e[Fe]),null!=e[xe]&&(n[xe]=e[xe]),null!=e[Ee]){const s=M(e[Ee],t);0===e[Ee]?.length&&(n.PolicyArns=[]),Object.entries(s).forEach((([e,t])=>{n[`PolicyArns.${e}`]=t}))}return null!=e[Se]&&(n[Se]=e[Se]),null!=e[fe]&&(n[fe]=e[fe]),n},M=(e,t)=>{const n={};let s=1;for(const o of e){if(null===o)continue;const e=W(o,t);Object.entries(e).forEach((([e,t])=>{n[`member.${s}.${e}`]=t})),s++}return n},W=(e,t)=>{const n={};return null!=e[He]&&(n[He]=e[He]),n},q=(e,t)=>{const n={};return null!=e[be]&&(n[be]=e[be]),null!=e[ye]&&(n[ye]=e[ye]),n},F=(e,t)=>{const n={};let s=1;for(const t of e){if(null===t)continue;const e=q(t);Object.entries(e).forEach((([e,t])=>{n[`member.${s}.${e}`]=t})),s++}return n},H=(e,t)=>{const n={};return null!=e[ve]&&(n[ve]=e[ve]),null!=e[qe]&&(n[qe]=e[qe]),n},U=(e,t)=>{const n={};let s=1;for(const t of e)null!==t&&(n[`member.${s}`]=t,s++);return n},L=(e,t)=>{const n={};let s=1;for(const t of e){if(null===t)continue;const e=H(t);Object.entries(e).forEach((([e,t])=>{n[`member.${s}.${e}`]=t})),s++}return n},G=(e,t)=>{const n={};return null!=e[de]&&(n[de]=(0,r.lK)(e[de])),null!=e[he]&&(n[he]=(0,r.lK)(e[he])),n},N=(e,t)=>{const n={};return null!=e[ge]&&(n[ge]=B(e[ge],t)),null!=e[ue]&&(n[ue]=G(e[ue])),null!=e[Ae]&&(n[Ae]=(0,r.xW)(e[Ae])),null!=e[Te]&&(n[Te]=(0,r.lK)(e[Te])),n},V=(e,t)=>{const n={};return null!=e[ge]&&(n[ge]=B(e[ge],t)),null!=e[De]&&(n[De]=(0,r.lK)(e[De])),null!=e[ue]&&(n[ue]=G(e[ue])),null!=e[Ae]&&(n[Ae]=(0,r.xW)(e[Ae])),null!=e[Ce]&&(n[Ce]=(0,r.lK)(e[Ce])),null!=e[me]&&(n[me]=(0,r.lK)(e[me])),null!=e[Te]&&(n[Te]=(0,r.lK)(e[Te])),n},B=(e,t)=>{const n={};return null!=e[ce]&&(n[ce]=(0,r.lK)(e[ce])),null!=e[$e]&&(n[$e]=(0,r.lK)(e[$e])),null!=e[Oe]&&(n[Oe]=(0,r.lK)(e[Oe])),null!=e[Pe]&&(n[Pe]=(0,r.Y0)((0,r.t_)(e[Pe]))),n},Z=(e,t)=>{const n={};return null!=e[Ue]&&(n[Ue]=(0,r.lK)(e[Ue])),n},_=(e,t)=>{const n={};return null!=e[Ue]&&(n[Ue]=(0,r.lK)(e[Ue])),n},J=(e,t)=>{const n={};return null!=e[Ue]&&(n[Ue]=(0,r.lK)(e[Ue])),n},Y=(e,t)=>{const n={};return null!=e[Ue]&&(n[Ue]=(0,r.lK)(e[Ue])),n},Q=(e,t)=>{const n={};return null!=e[Ue]&&(n[Ue]=(0,r.lK)(e[Ue])),n},X=(e,t)=>{const n={};return null!=e[Ue]&&(n[Ue]=(0,r.lK)(e[Ue])),n},ee=(e,t)=>{const n={};return null!=e[Ue]&&(n[Ue]=(0,r.lK)(e[Ue])),n},te=(e,t)=>{const n={};return null!=e[Ue]&&(n[Ue]=(0,r.lK)(e[Ue])),n},ne=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),se=(0,r.jr)(a),oe=async(e,t,n,s,o)=>{const{hostname:r,protocol:i="https",port:a,path:c}=await e.endpoint(),l={protocol:i,hostname:r,port:a,method:"POST",path:c.endsWith("/")?c.slice(0,-1)+n:c+n,headers:t};return void 0!==s&&(l.hostname=s),void 0!==o&&(l.body=o),new S.Kd(l)},re={"content-type":"application/x-www-form-urlencoded"},ie="2011-06-15",ae="Action",ce="AccessKeyId",le="AssumeRole",de="AssumedRoleId",ue="AssumedRoleUser",pe="AssumeRoleWithWebIdentity",he="Arn",me="Audience",ge="Credentials",ye="ContextAssertion",fe="DurationSeconds",Pe="Expiration",we="ExternalId",ve="Key",Se="Policy",Ee="PolicyArns",be="ProviderArn",Ie="ProvidedContexts",xe="ProviderId",Ae="PackedPolicySize",Ce="Provider",ke="RoleArn",Re="RoleSessionName",$e="SecretAccessKey",De="SubjectFromWebIdentityToken",Te="SourceIdentity",Ke="SerialNumber",Oe="SessionToken",je="Tags",ze="TokenCode",Me="TransitiveTagKeys",We="Version",qe="Value",Fe="WebIdentityToken",He="arn",Ue="message",Le=e=>Object.entries(e).map((([e,t])=>(0,r.$6)(e)+"="+(0,r.$6)(t))).join("&"),Ge=(e,t)=>void 0!==t.Error?.Code?t.Error.Code:404==e.statusCode?"NotFound":void 0;class Ne extends(r.uB.classBuilder().ep({...i}).m((function(e,t,n,r){return[(0,o.TM)(n,this.serialize,this.deserialize),(0,s.rD)(n,e.getEndpointParameterInstructions())]})).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,f).ser(E).de(I).build()){}class Ve extends(r.uB.classBuilder().ep({...i}).m((function(e,t,n,r){return[(0,o.TM)(n,this.serialize,this.deserialize),(0,s.rD)(n,e.getEndpointParameterInstructions())]})).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").f(P,w).ser(b).de(x).build()){}const Be="us-east-1",Ze=async(e,t,n)=>{const s="function"==typeof e?await e():e,o="function"==typeof t?await t():t;return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${s} (provider)`,`${o} (parent client)`,`${Be} (STS default)`),s??o??Be};var _e=n(43497),Je=n(88773),Ye=n(61115),Qe=n(44033),Xe=n(26659),et=n(78486),tt=n(77239),nt=n(69172),st=n(59735),ot=n(50914);const rt=async(e,t,n)=>({operation:(0,ot.u)(t).operation,region:await(0,ot.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),it=e=>{const t=[];switch(e.operation){case"AssumeRoleWithSAML":case"AssumeRoleWithWebIdentity":t.push({schemeId:"smithy.api#noAuth"});break;default:t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e))}return t};var at=n(70108),ct=n(86574),lt=n(28425),dt=n(72156),ut=n(96679),pt=n(42362),ht=n(17379),mt=n(94006),gt=n(95261),yt=n(23776),ft=n(21778),Pt=n(32982),wt=n(12941),vt=n(26399);const St="required",Et="type",bt="fn",It="argv",xt="ref",At=!1,Ct=!0,kt="booleanEquals",Rt="stringEquals",$t="sigv4",Dt="us-east-1",Tt="endpoint",Kt="https://sts.{Region}.{PartitionResult#dnsSuffix}",Ot="tree",jt="error",zt="getAttr",Mt={[St]:!1,[Et]:"String"},Wt={[St]:!0,default:!1,[Et]:"Boolean"},qt={[xt]:"Endpoint"},Ft={[bt]:"isSet",[It]:[{[xt]:"Region"}]},Ht={[xt]:"Region"},Ut={[bt]:"aws.partition",[It]:[Ht],assign:"PartitionResult"},Lt={[xt]:"UseFIPS"},Gt={[xt]:"UseDualStack"},Nt={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:$t,signingName:"sts",signingRegion:Dt}]},headers:{}},Vt={},Bt={conditions:[{[bt]:Rt,[It]:[Ht,"aws-global"]}],[Tt]:Nt,[Et]:Tt},Zt={[bt]:kt,[It]:[Lt,!0]},_t={[bt]:kt,[It]:[Gt,!0]},Jt={[bt]:zt,[It]:[{[xt]:"PartitionResult"},"supportsFIPS"]},Yt={[xt]:"PartitionResult"},Qt={[bt]:kt,[It]:[!0,{[bt]:zt,[It]:[Yt,"supportsDualStack"]}]},Xt=[{[bt]:"isSet",[It]:[qt]}],en=[Zt],tn=[_t],nn={version:"1.0",parameters:{Region:Mt,UseDualStack:Wt,UseFIPS:Wt,Endpoint:Mt,UseGlobalEndpoint:Wt},rules:[{conditions:[{[bt]:kt,[It]:[{[xt]:"UseGlobalEndpoint"},Ct]},{[bt]:"not",[It]:Xt},Ft,Ut,{[bt]:kt,[It]:[Lt,At]},{[bt]:kt,[It]:[Gt,At]}],rules:[{conditions:[{[bt]:Rt,[It]:[Ht,"ap-northeast-1"]}],endpoint:Nt,[Et]:Tt},{conditions:[{[bt]:Rt,[It]:[Ht,"ap-south-1"]}],endpoint:Nt,[Et]:Tt},{conditions:[{[bt]:Rt,[It]:[Ht,"ap-southeast-1"]}],endpoint:Nt,[Et]:Tt},{conditions:[{[bt]:Rt,[It]:[Ht,"ap-southeast-2"]}],endpoint:Nt,[Et]:Tt},Bt,{conditions:[{[bt]:Rt,[It]:[Ht,"ca-central-1"]}],endpoint:Nt,[Et]:Tt},{conditions:[{[bt]:Rt,[It]:[Ht,"eu-central-1"]}],endpoint:Nt,[Et]:Tt},{conditions:[{[bt]:Rt,[It]:[Ht,"eu-north-1"]}],endpoint:Nt,[Et]:Tt},{conditions:[{[bt]:Rt,[It]:[Ht,"eu-west-1"]}],endpoint:Nt,[Et]:Tt},{conditions:[{[bt]:Rt,[It]:[Ht,"eu-west-2"]}],endpoint:Nt,[Et]:Tt},{conditions:[{[bt]:Rt,[It]:[Ht,"eu-west-3"]}],endpoint:Nt,[Et]:Tt},{conditions:[{[bt]:Rt,[It]:[Ht,"sa-east-1"]}],endpoint:Nt,[Et]:Tt},{conditions:[{[bt]:Rt,[It]:[Ht,Dt]}],endpoint:Nt,[Et]:Tt},{conditions:[{[bt]:Rt,[It]:[Ht,"us-east-2"]}],endpoint:Nt,[Et]:Tt},{conditions:[{[bt]:Rt,[It]:[Ht,"us-west-1"]}],endpoint:Nt,[Et]:Tt},{conditions:[{[bt]:Rt,[It]:[Ht,"us-west-2"]}],endpoint:Nt,[Et]:Tt},{endpoint:{url:Kt,properties:{authSchemes:[{name:$t,signingName:"sts",signingRegion:"{Region}"}]},headers:Vt},[Et]:Tt}],[Et]:Ot},{conditions:Xt,rules:[{conditions:en,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[Et]:jt},{conditions:tn,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[Et]:jt},{endpoint:{url:qt,properties:Vt,headers:Vt},[Et]:Tt}],[Et]:Ot},{conditions:[Ft],rules:[{conditions:[Ut],rules:[{conditions:[Zt,_t],rules:[{conditions:[{[bt]:kt,[It]:[Ct,Jt]},Qt],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Vt,headers:Vt},[Et]:Tt}],[Et]:Ot},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[Et]:jt}],[Et]:Ot},{conditions:en,rules:[{conditions:[{[bt]:kt,[It]:[Jt,Ct]}],rules:[{conditions:[{[bt]:Rt,[It]:[{[bt]:zt,[It]:[Yt,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:Vt,headers:Vt},[Et]:Tt},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Vt,headers:Vt},[Et]:Tt}],[Et]:Ot},{error:"FIPS is enabled but this partition does not support FIPS",[Et]:jt}],[Et]:Ot},{conditions:tn,rules:[{conditions:[Qt],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Vt,headers:Vt},[Et]:Tt}],[Et]:Ot},{error:"DualStack is enabled but this partition does not support DualStack",[Et]:jt}],[Et]:Ot},Bt,{endpoint:{url:Kt,properties:Vt,headers:Vt},[Et]:Tt}],[Et]:Ot}],[Et]:Ot},{error:"Invalid Configuration: Missing Region",[Et]:jt}]},sn=(e,t={})=>(0,vt.sO)(nn,{endpointParams:e,logger:t.logger});vt.mw.aws=wt.UF;var on=n(36397);var rn=n(19538);const an=e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,s=e.credentials;return{setHttpAuthScheme(e){const n=t.findIndex((t=>t.schemeId===e.schemeId));-1===n?t.push(e):t.splice(n,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider:()=>n,setCredentials(e){s=e},credentials:()=>s}};class cn extends r.Kj{constructor(...[e]){const t=(n=(e=>{(0,r.I9)(process.version);const t=(0,on.I)(e),n=()=>t().then(r.lT),s=(e=>({apiVersion:"2011-06-15",base64Decoder:e?.base64Decoder??ft.E,base64Encoder:e?.base64Encoder??ft.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??sn,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??it,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new ct.f},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new et.mR}],logger:e?.logger??new r.N4,serviceId:e?.serviceId??"STS",urlParser:e?.urlParser??yt.D,utf8Decoder:e?.utf8Decoder??Pt.ar,utf8Encoder:e?.utf8Encoder??Pt.Pq}))(e);return(0,at.I)(process.version),{...s,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??mt.n,credentialDefaultProvider:e?.credentialDefaultProvider??lt.v6,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,dt.mJ)({serviceId:s.serviceId,clientVersion:"3.606.0"}),httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4")||(async e=>await(0,lt.v6)(e?.__config||{})()),signer:new ct.f},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new et.mR}],maxAttempts:e?.maxAttempts??(0,pt.Z)(nt.qs),region:e?.region??(0,pt.Z)(Xe.GG,Xe.zH),requestHandler:ht.$c.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,pt.Z)({...nt.kN,default:async()=>(await n()).retryMode||gt.L0}),sha256:e?.sha256??ut.V.bind(null,"sha256"),streamCollector:e?.streamCollector??ht.kv,useDualstackEndpoint:e?.useDualstackEndpoint??(0,pt.Z)(Xe.e$),useFipsEndpoint:e?.useFipsEndpoint??(0,pt.Z)(Xe.Ko)}})(e||{}),{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,useGlobalEndpoint:n.useGlobalEndpoint??!1,defaultSigningName:"sts"});var n;const o=(0,Xe.TD)(t),i=(0,s.Co)(o),a=(0,nt.$z)(i),c=(0,_e.OV)(a),l=((e,t)=>{const n={...(0,rn.Rq)(e),...(0,r.xA)(e),...(0,S.eS)(e),...an(e)};return t.forEach((e=>e.configure(n))),{...e,...(0,rn.$3)(n),...(0,r.uv)(n),...(0,S.jt)(n),...(s=n,{httpAuthSchemes:s.httpAuthSchemes(),httpAuthSchemeProvider:s.httpAuthSchemeProvider(),credentials:s.credentials()})};var s})((e=>{const t=(n=e,{...n,stsClientCtor:cn});var n;return{...(0,st.h)(t)}})((0,Qe.Dc)(c)),e?.extensions||[]);super(l),this.config=l,this.middlewareStack.use((0,nt.ey)(this.config)),this.middlewareStack.use((0,tt.vK)(this.config)),this.middlewareStack.use((0,_e.TC)(this.config)),this.middlewareStack.use((0,Je.Y7)(this.config)),this.middlewareStack.use((0,Ye.n4)(this.config)),this.middlewareStack.use((0,Qe.sM)(this.config)),this.middlewareStack.use((0,et.wB)(this.config,{httpAuthSchemeParametersProvider:this.getDefaultHttpAuthSchemeParametersProvider(),identityProviderConfigProvider:this.getIdentityProviderConfigProvider()})),this.middlewareStack.use((0,et.lW)(this.config))}destroy(){super.destroy()}getDefaultHttpAuthSchemeParametersProvider(){return rt}getIdentityProviderConfigProvider(){return async e=>new et.h$({"aws.auth#sigv4":e.credentials})}}const ln=(e,t)=>t?class extends e{constructor(e){super(e);for(const e of t)this.middlewareStack.use(e)}}:e,dn=(e={},t)=>((e,t)=>{let n,s;return async(o,r)=>{if(s=o,!n){const{logger:o=e?.parentClientConfig?.logger,region:r,requestHandler:i=e?.parentClientConfig?.requestHandler,credentialProviderLogger:a}=e,c=await Ze(r,e?.parentClientConfig?.region,a);n=new t({credentialDefaultProvider:()=>async()=>s,region:c,requestHandler:i,logger:o})}const{Credentials:i}=await n.send(new Ne(r));if(!i||!i.AccessKeyId||!i.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${r.RoleArn}`);return{accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,sessionToken:i.SessionToken,expiration:i.Expiration,credentialScope:i.CredentialScope}}})(e,ln(cn,t)),un=(e={},t)=>((e,t)=>{let n;return async s=>{if(!n){const{logger:s=e?.parentClientConfig?.logger,region:o,requestHandler:r=e?.parentClientConfig?.requestHandler,credentialProviderLogger:i}=e,a=await Ze(o,e?.parentClientConfig?.region,i);n=new t({region:a,requestHandler:r,logger:s})}const{Credentials:o}=await n.send(new Ve(s));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${s.RoleArn}`);return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration,credentialScope:o.CredentialScope}}})(e,ln(cn,t))}};
|
package/368.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=368,exports.ids=[368],exports.modules={59368:(e,n,o)=>{o.r(n),o.d(n,{fromTokenFile:()=>s,fromWebToken:()=>t});var i=o(25933),r=o(79896);const t=e=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");const{roleArn:n,roleSessionName:i,webIdentityToken:r,providerId:t,policyArns:s,policy:d,durationSeconds:l}=e;let{roleAssumerWithWebIdentity:c}=e;if(!c){const{getDefaultRoleAssumerWithWebIdentity:n}=await o.e(433).then(o.bind(o,56433));c=n({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:e.parentClientConfig},e.clientPlugins)}return c({RoleArn:n,RoleSessionName:i??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:r,ProviderId:t,PolicyArns:s,Policy:d,DurationSeconds:l})},s=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const n=e?.webIdentityTokenFile??process.env.AWS_WEB_IDENTITY_TOKEN_FILE,o=e?.roleArn??process.env.AWS_ROLE_ARN,s=e?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!n||!o)throw new i.C1("Web identity configuration not specified",{logger:e.logger});return t({...e,webIdentityToken:(0,r.readFileSync)(n,{encoding:"ascii"}),roleArn:o,roleSessionName:s})()}}};
|
package/433.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=433,exports.ids=[433],exports.modules={56433:(e,t,n)=>{n.d(t,{getDefaultRoleAssumer:()=>hn,getDefaultRoleAssumerWithWebIdentity:()=>mn});var s=n(50355),o=n(44455),r=n(17245);const i={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class a extends r.TJ{constructor(e){super(e),Object.setPrototypeOf(this,a.prototype)}}class c extends a{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,c.prototype)}}class l extends a{constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e}),this.name="MalformedPolicyDocumentException",this.$fault="client",Object.setPrototypeOf(this,l.prototype)}}class d extends a{constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e}),this.name="PackedPolicyTooLargeException",this.$fault="client",Object.setPrototypeOf(this,d.prototype)}}class u extends a{constructor(e){super({name:"RegionDisabledException",$fault:"client",...e}),this.name="RegionDisabledException",this.$fault="client",Object.setPrototypeOf(this,u.prototype)}}class p extends a{constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e}),this.name="IDPRejectedClaimException",this.$fault="client",Object.setPrototypeOf(this,p.prototype)}}class h extends a{constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e}),this.name="InvalidIdentityTokenException",this.$fault="client",Object.setPrototypeOf(this,h.prototype)}}class m extends a{constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e}),this.name="IDPCommunicationErrorException",this.$fault="client",Object.setPrototypeOf(this,m.prototype)}}class g extends a{constructor(e){super({name:"InvalidAuthorizationMessageException",$fault:"client",...e}),this.name="InvalidAuthorizationMessageException",this.$fault="client",Object.setPrototypeOf(this,g.prototype)}}const y=e=>({...e,...e.SecretAccessKey&&{SecretAccessKey:r.$H}}),f=e=>({...e,...e.Credentials&&{Credentials:y(e.Credentials)}}),P=e=>({...e,...e.WebIdentityToken&&{WebIdentityToken:r.$H}}),w=e=>({...e,...e.Credentials&&{Credentials:y(e.Credentials)}});var v=n(92876),E=n(71980);const S=(e,t)=>(0,E.w)(e,t).then((e=>{if(e.length){const t=new v.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(e,t)=>""===t.trim()&&t.includes("\n")?"":void 0});let n;t.addEntity("#xD","\r"),t.addEntity("#10","\n");try{n=t.parse(e,!0)}catch(t){throw t&&"object"==typeof t&&Object.defineProperty(t,"$responseBodyText",{value:e}),t}const s="#text",o=Object.keys(n)[0],i=n[o];return i[s]&&(i[o]=i[s],delete i[s]),(0,r.rm)(i)}return{}})),b=async(e,t)=>{const n=await S(e,t);return n.Error&&(n.Error.message=n.Error.message??n.Error.Message),n};var I=n(69462);const x=async(e,t)=>{const n=ce;let s;return s=Be({...W(e,t),[de]:pe,[Fe]:le}),ae(t,n,"/",void 0,s)},A=async(e,t)=>{const n=ce;let s;return s=Be({...q(e,t),[de]:ge,[Fe]:le}),ae(t,n,"/",void 0,s)},C=async(e,t)=>{if(e.statusCode>=300)return R(e,t);const n=await S(e.body,t);let s={};return s=Z(n.AssumeRoleResult,t),{$metadata:re(e),...s}},k=async(e,t)=>{if(e.statusCode>=300)return R(e,t);const n=await S(e.body,t);let s={};return s=_(n.AssumeRoleWithWebIdentityResult,t),{$metadata:re(e),...s}},R=async(e,t)=>{const n={...e,body:await b(e.body,t)},s=Ge(e,n.body);switch(s){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await $(n,t);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await j(n,t);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await M(n,t);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await z(n,t);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await T(n,t);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await O(n,t);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await D(n,t);case"InvalidAuthorizationMessageException":case"com.amazonaws.sts#InvalidAuthorizationMessageException":throw await K(n,t);default:const o=n.body;return ie({output:e,parsedBody:o.Error,errorCode:s})}},$=async(e,t)=>{const n=e.body,s=Y(n.Error,t),o=new c({$metadata:re(e),...s});return(0,r.Mw)(o,n)},D=async(e,t)=>{const n=e.body,s=X(n.Error,t),o=new m({$metadata:re(e),...s});return(0,r.Mw)(o,n)},T=async(e,t)=>{const n=e.body,s=Q(n.Error,t),o=new p({$metadata:re(e),...s});return(0,r.Mw)(o,n)},K=async(e,t)=>{const n=e.body,s=ee(n.Error,t),o=new g({$metadata:re(e),...s});return(0,r.Mw)(o,n)},O=async(e,t)=>{const n=e.body,s=te(n.Error,t),o=new h({$metadata:re(e),...s});return(0,r.Mw)(o,n)},j=async(e,t)=>{const n=e.body,s=ne(n.Error,t),o=new l({$metadata:re(e),...s});return(0,r.Mw)(o,n)},M=async(e,t)=>{const n=e.body,s=se(n.Error,t),o=new d({$metadata:re(e),...s});return(0,r.Mw)(o,n)},z=async(e,t)=>{const n=e.body,s=oe(n.Error,t),o=new u({$metadata:re(e),...s});return(0,r.Mw)(o,n)},W=(e,t)=>{const n={};if(null!=e[De]&&(n[De]=e[De]),null!=e[Te]&&(n[Te]=e[Te]),null!=e[xe]){const s=H(e[xe],t);0===e[xe]?.length&&(n.PolicyArns=[]),Object.entries(s).forEach((([e,t])=>{n[`PolicyArns.${e}`]=t}))}if(null!=e[Ie]&&(n[Ie]=e[Ie]),null!=e[ve]&&(n[ve]=e[ve]),null!=e[We]){const s=B(e[We],t);0===e[We]?.length&&(n.Tags=[]),Object.entries(s).forEach((([e,t])=>{n[`Tags.${e}`]=t}))}if(null!=e[He]){const s=N(e[He],t);0===e[He]?.length&&(n.TransitiveTagKeys=[]),Object.entries(s).forEach((([e,t])=>{n[`TransitiveTagKeys.${e}`]=t}))}if(null!=e[Se]&&(n[Se]=e[Se]),null!=e[Me]&&(n[Me]=e[Me]),null!=e[qe]&&(n[qe]=e[qe]),null!=e[je]&&(n[je]=e[je]),null!=e[Ce]){const s=L(e[Ce],t);0===e[Ce]?.length&&(n.ProvidedContexts=[]),Object.entries(s).forEach((([e,t])=>{n[`ProvidedContexts.${e}`]=t}))}return n},q=(e,t)=>{const n={};if(null!=e[De]&&(n[De]=e[De]),null!=e[Te]&&(n[Te]=e[Te]),null!=e[Le]&&(n[Le]=e[Le]),null!=e[ke]&&(n[ke]=e[ke]),null!=e[xe]){const s=H(e[xe],t);0===e[xe]?.length&&(n.PolicyArns=[]),Object.entries(s).forEach((([e,t])=>{n[`PolicyArns.${e}`]=t}))}return null!=e[Ie]&&(n[Ie]=e[Ie]),null!=e[ve]&&(n[ve]=e[ve]),n},H=(e,t)=>{const n={};let s=1;for(const o of e){if(null===o)continue;const e=F(o,t);Object.entries(e).forEach((([e,t])=>{n[`member.${s}.${e}`]=t})),s++}return n},F=(e,t)=>{const n={};return null!=e[Ve]&&(n[Ve]=e[Ve]),n},U=(e,t)=>{const n={};return null!=e[Ae]&&(n[Ae]=e[Ae]),null!=e[we]&&(n[we]=e[we]),n},L=(e,t)=>{const n={};let s=1;for(const t of e){if(null===t)continue;const e=U(t);Object.entries(e).forEach((([e,t])=>{n[`member.${s}.${e}`]=t})),s++}return n},V=(e,t)=>{const n={};return null!=e[be]&&(n[be]=e[be]),null!=e[Ue]&&(n[Ue]=e[Ue]),n},N=(e,t)=>{const n={};let s=1;for(const t of e)null!==t&&(n[`member.${s}`]=t,s++);return n},B=(e,t)=>{const n={};let s=1;for(const t of e){if(null===t)continue;const e=V(t);Object.entries(e).forEach((([e,t])=>{n[`member.${s}.${e}`]=t})),s++}return n},G=(e,t)=>{const n={};return null!=e[he]&&(n[he]=(0,r.lK)(e[he])),null!=e[ye]&&(n[ye]=(0,r.lK)(e[ye])),n},Z=(e,t)=>{const n={};return null!=e[Pe]&&(n[Pe]=J(e[Pe],t)),null!=e[me]&&(n[me]=G(e[me])),null!=e[Re]&&(n[Re]=(0,r.xW)(e[Re])),null!=e[je]&&(n[je]=(0,r.lK)(e[je])),n},_=(e,t)=>{const n={};return null!=e[Pe]&&(n[Pe]=J(e[Pe],t)),null!=e[Oe]&&(n[Oe]=(0,r.lK)(e[Oe])),null!=e[me]&&(n[me]=G(e[me])),null!=e[Re]&&(n[Re]=(0,r.xW)(e[Re])),null!=e[$e]&&(n[$e]=(0,r.lK)(e[$e])),null!=e[fe]&&(n[fe]=(0,r.lK)(e[fe])),null!=e[je]&&(n[je]=(0,r.lK)(e[je])),n},J=(e,t)=>{const n={};return null!=e[ue]&&(n[ue]=(0,r.lK)(e[ue])),null!=e[Ke]&&(n[Ke]=(0,r.lK)(e[Ke])),null!=e[ze]&&(n[ze]=(0,r.lK)(e[ze])),null!=e[Ee]&&(n[Ee]=(0,r.Y0)((0,r.t_)(e[Ee]))),n},Y=(e,t)=>{const n={};return null!=e[Ne]&&(n[Ne]=(0,r.lK)(e[Ne])),n},X=(e,t)=>{const n={};return null!=e[Ne]&&(n[Ne]=(0,r.lK)(e[Ne])),n},Q=(e,t)=>{const n={};return null!=e[Ne]&&(n[Ne]=(0,r.lK)(e[Ne])),n},ee=(e,t)=>{const n={};return null!=e[Ne]&&(n[Ne]=(0,r.lK)(e[Ne])),n},te=(e,t)=>{const n={};return null!=e[Ne]&&(n[Ne]=(0,r.lK)(e[Ne])),n},ne=(e,t)=>{const n={};return null!=e[Ne]&&(n[Ne]=(0,r.lK)(e[Ne])),n},se=(e,t)=>{const n={};return null!=e[Ne]&&(n[Ne]=(0,r.lK)(e[Ne])),n},oe=(e,t)=>{const n={};return null!=e[Ne]&&(n[Ne]=(0,r.lK)(e[Ne])),n},re=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),ie=(0,r.jr)(a),ae=async(e,t,n,s,o)=>{const{hostname:r,protocol:i="https",port:a,path:c}=await e.endpoint(),l={protocol:i,hostname:r,port:a,method:"POST",path:c.endsWith("/")?c.slice(0,-1)+n:c+n,headers:t};return void 0!==s&&(l.hostname=s),void 0!==o&&(l.body=o),new I.Kd(l)},ce={"content-type":"application/x-www-form-urlencoded"},le="2011-06-15",de="Action",ue="AccessKeyId",pe="AssumeRole",he="AssumedRoleId",me="AssumedRoleUser",ge="AssumeRoleWithWebIdentity",ye="Arn",fe="Audience",Pe="Credentials",we="ContextAssertion",ve="DurationSeconds",Ee="Expiration",Se="ExternalId",be="Key",Ie="Policy",xe="PolicyArns",Ae="ProviderArn",Ce="ProvidedContexts",ke="ProviderId",Re="PackedPolicySize",$e="Provider",De="RoleArn",Te="RoleSessionName",Ke="SecretAccessKey",Oe="SubjectFromWebIdentityToken",je="SourceIdentity",Me="SerialNumber",ze="SessionToken",We="Tags",qe="TokenCode",He="TransitiveTagKeys",Fe="Version",Ue="Value",Le="WebIdentityToken",Ve="arn",Ne="message",Be=e=>Object.entries(e).map((([e,t])=>(0,r.$6)(e)+"="+(0,r.$6)(t))).join("&"),Ge=(e,t)=>void 0!==t.Error?.Code?t.Error.Code:404==e.statusCode?"NotFound":void 0;class Ze extends(r.uB.classBuilder().ep({...i}).m((function(e,t,n,r){return[(0,o.TM)(n,this.serialize,this.deserialize),(0,s.rD)(n,e.getEndpointParameterInstructions())]})).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,f).ser(x).de(C).build()){}class _e extends(r.uB.classBuilder().ep({...i}).m((function(e,t,n,r){return[(0,o.TM)(n,this.serialize,this.deserialize),(0,s.rD)(n,e.getEndpointParameterInstructions())]})).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").f(P,w).ser(A).de(k).build()){}const Je="us-east-1",Ye=async(e,t,n)=>{const s="function"==typeof e?await e():e,o="function"==typeof t?await t():t;return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${s} (provider)`,`${o} (parent client)`,`${Je} (STS default)`),s??o??Je};var Xe=n(58365),Qe=n(20998),et=n(27039),tt=n(18884),nt=n(5728),st=n(37251),ot=n(77239),rt=n(30914),it=n(54083),at=n(50914);const ct=async(e,t,n)=>({operation:(0,at.u)(t).operation,region:await(0,at.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),lt=e=>{const t=[];switch(e.operation){case"AssumeRoleWithSAML":case"AssumeRoleWithWebIdentity":t.push({schemeId:"smithy.api#noAuth"});break;default:t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e))}return t};var dt=n(10440),ut=n(90329),pt=n(38700),ht=n(65793),mt=n(96679),gt=n(33746),yt=n(53246),ft=n(94006),Pt=n(95261),wt=n(23776),vt=n(21778),Et=n(32982),St=n(70508),bt=n(5729);const It="required",xt="type",At="fn",Ct="argv",kt="ref",Rt=!1,$t=!0,Dt="booleanEquals",Tt="stringEquals",Kt="sigv4",Ot="us-east-1",jt="endpoint",Mt="https://sts.{Region}.{PartitionResult#dnsSuffix}",zt="tree",Wt="error",qt="getAttr",Ht={[It]:!1,[xt]:"String"},Ft={[It]:!0,default:!1,[xt]:"Boolean"},Ut={[kt]:"Endpoint"},Lt={[At]:"isSet",[Ct]:[{[kt]:"Region"}]},Vt={[kt]:"Region"},Nt={[At]:"aws.partition",[Ct]:[Vt],assign:"PartitionResult"},Bt={[kt]:"UseFIPS"},Gt={[kt]:"UseDualStack"},Zt={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:Kt,signingName:"sts",signingRegion:Ot}]},headers:{}},_t={},Jt={conditions:[{[At]:Tt,[Ct]:[Vt,"aws-global"]}],[jt]:Zt,[xt]:jt},Yt={[At]:Dt,[Ct]:[Bt,!0]},Xt={[At]:Dt,[Ct]:[Gt,!0]},Qt={[At]:qt,[Ct]:[{[kt]:"PartitionResult"},"supportsFIPS"]},en={[kt]:"PartitionResult"},tn={[At]:Dt,[Ct]:[!0,{[At]:qt,[Ct]:[en,"supportsDualStack"]}]},nn=[{[At]:"isSet",[Ct]:[Ut]}],sn=[Yt],on=[Xt],rn={version:"1.0",parameters:{Region:Ht,UseDualStack:Ft,UseFIPS:Ft,Endpoint:Ht,UseGlobalEndpoint:Ft},rules:[{conditions:[{[At]:Dt,[Ct]:[{[kt]:"UseGlobalEndpoint"},$t]},{[At]:"not",[Ct]:nn},Lt,Nt,{[At]:Dt,[Ct]:[Bt,Rt]},{[At]:Dt,[Ct]:[Gt,Rt]}],rules:[{conditions:[{[At]:Tt,[Ct]:[Vt,"ap-northeast-1"]}],endpoint:Zt,[xt]:jt},{conditions:[{[At]:Tt,[Ct]:[Vt,"ap-south-1"]}],endpoint:Zt,[xt]:jt},{conditions:[{[At]:Tt,[Ct]:[Vt,"ap-southeast-1"]}],endpoint:Zt,[xt]:jt},{conditions:[{[At]:Tt,[Ct]:[Vt,"ap-southeast-2"]}],endpoint:Zt,[xt]:jt},Jt,{conditions:[{[At]:Tt,[Ct]:[Vt,"ca-central-1"]}],endpoint:Zt,[xt]:jt},{conditions:[{[At]:Tt,[Ct]:[Vt,"eu-central-1"]}],endpoint:Zt,[xt]:jt},{conditions:[{[At]:Tt,[Ct]:[Vt,"eu-north-1"]}],endpoint:Zt,[xt]:jt},{conditions:[{[At]:Tt,[Ct]:[Vt,"eu-west-1"]}],endpoint:Zt,[xt]:jt},{conditions:[{[At]:Tt,[Ct]:[Vt,"eu-west-2"]}],endpoint:Zt,[xt]:jt},{conditions:[{[At]:Tt,[Ct]:[Vt,"eu-west-3"]}],endpoint:Zt,[xt]:jt},{conditions:[{[At]:Tt,[Ct]:[Vt,"sa-east-1"]}],endpoint:Zt,[xt]:jt},{conditions:[{[At]:Tt,[Ct]:[Vt,Ot]}],endpoint:Zt,[xt]:jt},{conditions:[{[At]:Tt,[Ct]:[Vt,"us-east-2"]}],endpoint:Zt,[xt]:jt},{conditions:[{[At]:Tt,[Ct]:[Vt,"us-west-1"]}],endpoint:Zt,[xt]:jt},{conditions:[{[At]:Tt,[Ct]:[Vt,"us-west-2"]}],endpoint:Zt,[xt]:jt},{endpoint:{url:Mt,properties:{authSchemes:[{name:Kt,signingName:"sts",signingRegion:"{Region}"}]},headers:_t},[xt]:jt}],[xt]:zt},{conditions:nn,rules:[{conditions:sn,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[xt]:Wt},{conditions:on,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[xt]:Wt},{endpoint:{url:Ut,properties:_t,headers:_t},[xt]:jt}],[xt]:zt},{conditions:[Lt],rules:[{conditions:[Nt],rules:[{conditions:[Yt,Xt],rules:[{conditions:[{[At]:Dt,[Ct]:[$t,Qt]},tn],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:_t,headers:_t},[xt]:jt}],[xt]:zt},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[xt]:Wt}],[xt]:zt},{conditions:sn,rules:[{conditions:[{[At]:Dt,[Ct]:[Qt,$t]}],rules:[{conditions:[{[At]:Tt,[Ct]:[{[At]:qt,[Ct]:[en,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:_t,headers:_t},[xt]:jt},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:_t,headers:_t},[xt]:jt}],[xt]:zt},{error:"FIPS is enabled but this partition does not support FIPS",[xt]:Wt}],[xt]:zt},{conditions:on,rules:[{conditions:[tn],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:_t,headers:_t},[xt]:jt}],[xt]:zt},{error:"DualStack is enabled but this partition does not support DualStack",[xt]:Wt}],[xt]:zt},Jt,{endpoint:{url:Mt,properties:_t,headers:_t},[xt]:jt}],[xt]:zt}],[xt]:zt},{error:"Invalid Configuration: Missing Region",[xt]:Wt}]},an=(e,t={})=>(0,bt.sO)(rn,{endpointParams:e,logger:t.logger});bt.mw.aws=St.UF;var cn=n(12689);var ln=n(32953);const dn=e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,s=e.credentials;return{setHttpAuthScheme(e){const n=t.findIndex((t=>t.schemeId===e.schemeId));-1===n?t.push(e):t.splice(n,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider:()=>n,setCredentials(e){s=e},credentials:()=>s}};class un extends r.Kj{constructor(...[e]){const t=(n=(e=>{(0,r.I9)(process.version);const t=(0,cn.I)(e),n=()=>t().then(r.lT),s=(e=>({apiVersion:"2011-06-15",base64Decoder:e?.base64Decoder??vt.E,base64Encoder:e?.base64Encoder??vt.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??an,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??lt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new ut.f},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new st.mR}],logger:e?.logger??new r.N4,serviceId:e?.serviceId??"STS",urlParser:e?.urlParser??wt.D,utf8Decoder:e?.utf8Decoder??Et.ar,utf8Encoder:e?.utf8Encoder??Et.Pq}))(e);return(0,dt.I)(process.version),{...s,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??ft.n,credentialDefaultProvider:e?.credentialDefaultProvider??pt.v6,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,ht.mJ)({serviceId:s.serviceId,clientVersion:"3.614.0"}),httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4")||(async e=>await(0,pt.v6)(e?.__config||{})()),signer:new ut.f},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new st.mR}],maxAttempts:e?.maxAttempts??(0,gt.Z)(rt.qs),region:e?.region??(0,gt.Z)(nt.GG,nt.zH),requestHandler:yt.$c.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,gt.Z)({...rt.kN,default:async()=>(await n()).retryMode||Pt.L0}),sha256:e?.sha256??mt.V.bind(null,"sha256"),streamCollector:e?.streamCollector??yt.kv,useDualstackEndpoint:e?.useDualstackEndpoint??(0,gt.Z)(nt.e$),useFipsEndpoint:e?.useFipsEndpoint??(0,gt.Z)(nt.Ko)}})(e||{}),{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,useGlobalEndpoint:n.useGlobalEndpoint??!1,defaultSigningName:"sts"});var n;const o=(0,nt.TD)(t),i=(0,s.Co)(o),a=(0,rt.$z)(i),c=(0,Xe.OV)(a),l=((e,t)=>{const n={...(0,ln.Rq)(e),...(0,r.xA)(e),...(0,I.eS)(e),...dn(e)};return t.forEach((e=>e.configure(n))),{...e,...(0,ln.$3)(n),...(0,r.uv)(n),...(0,I.jt)(n),...(s=n,{httpAuthSchemes:s.httpAuthSchemes(),httpAuthSchemeProvider:s.httpAuthSchemeProvider(),credentials:s.credentials()})};var s})((e=>{const t=(n=e,{...n,stsClientCtor:un});var n;return{...(0,it.h)(t)}})((0,tt.Dc)(c)),e?.extensions||[]);super(l),this.config=l,this.middlewareStack.use((0,rt.ey)(this.config)),this.middlewareStack.use((0,ot.vK)(this.config)),this.middlewareStack.use((0,Xe.TC)(this.config)),this.middlewareStack.use((0,Qe.Y7)(this.config)),this.middlewareStack.use((0,et.n4)(this.config)),this.middlewareStack.use((0,tt.sM)(this.config)),this.middlewareStack.use((0,st.wB)(this.config,{httpAuthSchemeParametersProvider:this.getDefaultHttpAuthSchemeParametersProvider(),identityProviderConfigProvider:this.getIdentityProviderConfigProvider()})),this.middlewareStack.use((0,st.lW)(this.config))}destroy(){super.destroy()}getDefaultHttpAuthSchemeParametersProvider(){return ct}getIdentityProviderConfigProvider(){return async e=>new st.h$({"aws.auth#sigv4":e.credentials})}}const pn=(e,t)=>t?class extends e{constructor(e){super(e);for(const e of t)this.middlewareStack.use(e)}}:e,hn=(e={},t)=>((e,t)=>{let n,s;return async(o,r)=>{if(s=o,!n){const{logger:o=e?.parentClientConfig?.logger,region:r,requestHandler:i=e?.parentClientConfig?.requestHandler,credentialProviderLogger:a}=e,c=await Ye(r,e?.parentClientConfig?.region,a);n=new t({credentialDefaultProvider:()=>async()=>s,region:c,requestHandler:i,logger:o})}const{Credentials:i}=await n.send(new Ze(r));if(!i||!i.AccessKeyId||!i.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${r.RoleArn}`);return{accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,sessionToken:i.SessionToken,expiration:i.Expiration,credentialScope:i.CredentialScope}}})(e,pn(un,t)),mn=(e={},t)=>((e,t)=>{let n;return async s=>{if(!n){const{logger:s=e?.parentClientConfig?.logger,region:o,requestHandler:r=e?.parentClientConfig?.requestHandler,credentialProviderLogger:i}=e,a=await Ye(o,e?.parentClientConfig?.region,i);n=new t({region:a,requestHandler:r,logger:s})}const{Credentials:o}=await n.send(new _e(s));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${s.RoleArn}`);return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration,credentialScope:o.CredentialScope}}})(e,pn(un,t))}};
|
package/485.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=485,exports.ids=[485],exports.modules={97485:(e,t,r)=>{r.d(t,{CreateTokenCommand:()=>Le,SSOOIDCClient:()=>ce});var o=r(43497),s=r(88773),n=r(61115),i=r(44033),a=r(26659),c=r(78486),d=r(77239),p=r(9661),l=r(69172),u=r(33323),h=r(59735),m=r(50914);const y=async(e,t,r)=>({operation:(0,m.u)(t).operation,region:await(0,m.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),f=e=>{const t=[];switch(e.operation){case"CreateToken":case"RegisterClient":case"StartDeviceAuthorization":t.push({schemeId:"smithy.api#noAuth"});break;default:t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e))}return t},w={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var x=r(70108),g=r(28425),v=r(72156),b=r(96679),E=r(42362),S=r(17379),I=r(94006),P=r(95261),O=r(86574),$=r(23776),k=r(21778),j=r(32982),T=r(12941),C=r(26399);const _="required",D="fn",K="argv",A="ref",z=!0,R="isSet",M="booleanEquals",U="error",q="endpoint",H="tree",F="PartitionResult",G="getAttr",V={[_]:!1,type:"String"},B={[_]:!0,default:!1,type:"Boolean"},J={[A]:"Endpoint"},L={[D]:M,[K]:[{[A]:"UseFIPS"},!0]},N={[D]:M,[K]:[{[A]:"UseDualStack"},!0]},Z={},Y={[D]:G,[K]:[{[A]:F},"supportsFIPS"]},W={[A]:F},X={[D]:M,[K]:[!0,{[D]:G,[K]:[W,"supportsDualStack"]}]},Q=[L],ee=[N],te=[{[A]:"Region"}],re={version:"1.0",parameters:{Region:V,UseDualStack:B,UseFIPS:B,Endpoint:V},rules:[{conditions:[{[D]:R,[K]:[J]}],rules:[{conditions:Q,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:U},{conditions:ee,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:U},{endpoint:{url:J,properties:Z,headers:Z},type:q}],type:H},{conditions:[{[D]:R,[K]:te}],rules:[{conditions:[{[D]:"aws.partition",[K]:te,assign:F}],rules:[{conditions:[L,N],rules:[{conditions:[{[D]:M,[K]:[z,Y]},X],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Z,headers:Z},type:q}],type:H},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:U}],type:H},{conditions:Q,rules:[{conditions:[{[D]:M,[K]:[Y,z]}],rules:[{conditions:[{[D]:"stringEquals",[K]:[{[D]:G,[K]:[W,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:Z,headers:Z},type:q},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Z,headers:Z},type:q}],type:H},{error:"FIPS is enabled but this partition does not support FIPS",type:U}],type:H},{conditions:ee,rules:[{conditions:[X],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Z,headers:Z},type:q}],type:H},{error:"DualStack is enabled but this partition does not support DualStack",type:U}],type:H},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:Z,headers:Z},type:q}],type:H}],type:H},{error:"Invalid Configuration: Missing Region",type:U}]},oe=(e,t={})=>(0,C.sO)(re,{endpointParams:e,logger:t.logger});C.mw.aws=T.UF;var se=r(36397);var ne=r(19538),ie=r(69462);const ae=e=>{const t=e.httpAuthSchemes;let r=e.httpAuthSchemeProvider,o=e.credentials;return{setHttpAuthScheme(e){const r=t.findIndex((t=>t.schemeId===e.schemeId));-1===r?t.push(e):t.splice(r,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){r=e},httpAuthSchemeProvider:()=>r,setCredentials(e){o=e},credentials:()=>o}};class ce extends u.Kj{constructor(...[e]){const t=(e=>{(0,u.I9)(process.version);const t=(0,se.I)(e),r=()=>t().then(u.lT),o=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??k.E,base64Encoder:e?.base64Encoder??k.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??oe,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??f,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new O.f},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new c.mR}],logger:e?.logger??new u.N4,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??$.D,utf8Decoder:e?.utf8Decoder??j.ar,utf8Encoder:e?.utf8Encoder??j.Pq}))(e);return(0,x.I)(process.version),{...o,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??I.n,credentialDefaultProvider:e?.credentialDefaultProvider??g.v6,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,v.mJ)({serviceId:o.serviceId,clientVersion:"3.606.0"}),maxAttempts:e?.maxAttempts??(0,E.Z)(l.qs),region:e?.region??(0,E.Z)(a.GG,a.zH),requestHandler:S.$c.create(e?.requestHandler??r),retryMode:e?.retryMode??(0,E.Z)({...l.kN,default:async()=>(await r()).retryMode||P.L0}),sha256:e?.sha256??b.V.bind(null,"sha256"),streamCollector:e?.streamCollector??S.kv,useDualstackEndpoint:e?.useDualstackEndpoint??(0,E.Z)(a.e$),useFipsEndpoint:e?.useFipsEndpoint??(0,E.Z)(a.Ko)}})(e||{}),r=(m=t,{...m,useDualstackEndpoint:m.useDualstackEndpoint??!1,useFipsEndpoint:m.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"});var m;const y=(0,a.TD)(r),w=(0,p.Co)(y),T=(0,l.$z)(w),C=(0,o.OV)(T);var _;const D=((e,t)=>{const r={...(0,ne.Rq)(e),...(0,u.xA)(e),...(0,ie.eS)(e),...ae(e)};return t.forEach((e=>e.configure(r))),{...e,...(0,ne.$3)(r),...(0,u.uv)(r),...(0,ie.jt)(r),...(o=r,{httpAuthSchemes:o.httpAuthSchemes(),httpAuthSchemeProvider:o.httpAuthSchemeProvider(),credentials:o.credentials()})};var o})((_=(0,i.Dc)(C),{...(0,h.h)(_)}),e?.extensions||[]);super(D),this.config=D,this.middlewareStack.use((0,l.ey)(this.config)),this.middlewareStack.use((0,d.vK)(this.config)),this.middlewareStack.use((0,o.TC)(this.config)),this.middlewareStack.use((0,s.Y7)(this.config)),this.middlewareStack.use((0,n.n4)(this.config)),this.middlewareStack.use((0,i.sM)(this.config)),this.middlewareStack.use((0,c.wB)(this.config,{httpAuthSchemeParametersProvider:this.getDefaultHttpAuthSchemeParametersProvider(),identityProviderConfigProvider:this.getIdentityProviderConfigProvider()})),this.middlewareStack.use((0,c.lW)(this.config))}destroy(){super.destroy()}getDefaultHttpAuthSchemeParametersProvider(){return y}getIdentityProviderConfigProvider(){return async e=>new c.h$({"aws.auth#sigv4":e.credentials})}}var de=r(44455);class pe extends u.TJ{constructor(e){super(e),Object.setPrototypeOf(this,pe.prototype)}}class le extends pe{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,le.prototype),this.error=e.error,this.error_description=e.error_description}}class ue extends pe{constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e}),this.name="AuthorizationPendingException",this.$fault="client",Object.setPrototypeOf(this,ue.prototype),this.error=e.error,this.error_description=e.error_description}}class he extends pe{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,he.prototype),this.error=e.error,this.error_description=e.error_description}}class me extends pe{constructor(e){super({name:"InternalServerException",$fault:"server",...e}),this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,me.prototype),this.error=e.error,this.error_description=e.error_description}}class ye extends pe{constructor(e){super({name:"InvalidClientException",$fault:"client",...e}),this.name="InvalidClientException",this.$fault="client",Object.setPrototypeOf(this,ye.prototype),this.error=e.error,this.error_description=e.error_description}}class fe extends pe{constructor(e){super({name:"InvalidGrantException",$fault:"client",...e}),this.name="InvalidGrantException",this.$fault="client",Object.setPrototypeOf(this,fe.prototype),this.error=e.error,this.error_description=e.error_description}}class we extends pe{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,we.prototype),this.error=e.error,this.error_description=e.error_description}}class xe extends pe{constructor(e){super({name:"InvalidScopeException",$fault:"client",...e}),this.name="InvalidScopeException",this.$fault="client",Object.setPrototypeOf(this,xe.prototype),this.error=e.error,this.error_description=e.error_description}}class ge extends pe{constructor(e){super({name:"SlowDownException",$fault:"client",...e}),this.name="SlowDownException",this.$fault="client",Object.setPrototypeOf(this,ge.prototype),this.error=e.error,this.error_description=e.error_description}}class ve extends pe{constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e}),this.name="UnauthorizedClientException",this.$fault="client",Object.setPrototypeOf(this,ve.prototype),this.error=e.error,this.error_description=e.error_description}}class be extends pe{constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e}),this.name="UnsupportedGrantTypeException",this.$fault="client",Object.setPrototypeOf(this,be.prototype),this.error=e.error,this.error_description=e.error_description}}class Ee extends pe{constructor(e){super({name:"InvalidRequestRegionException",$fault:"client",...e}),this.name="InvalidRequestRegionException",this.$fault="client",Object.setPrototypeOf(this,Ee.prototype),this.error=e.error,this.error_description=e.error_description,this.endpoint=e.endpoint,this.region=e.region}}class Se extends pe{constructor(e){super({name:"InvalidClientMetadataException",$fault:"client",...e}),this.name="InvalidClientMetadataException",this.$fault="client",Object.setPrototypeOf(this,Se.prototype),this.error=e.error,this.error_description=e.error_description}}class Ie extends pe{constructor(e){super({name:"InvalidRedirectUriException",$fault:"client",...e}),this.name="InvalidRedirectUriException",this.$fault="client",Object.setPrototypeOf(this,Ie.prototype),this.error=e.error,this.error_description=e.error_description}}const Pe=e=>({...e,...e.clientSecret&&{clientSecret:u.$H},...e.refreshToken&&{refreshToken:u.$H},...e.codeVerifier&&{codeVerifier:u.$H}}),Oe=e=>({...e,...e.accessToken&&{accessToken:u.$H},...e.refreshToken&&{refreshToken:u.$H},...e.idToken&&{idToken:u.$H}});var $e=r(68609);const ke=async(e,t)=>{const r=(0,c.lI)(e,t);let o;return r.bp("/token"),o=JSON.stringify((0,u.s)(e,{clientId:[],clientSecret:[],code:[],codeVerifier:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:e=>(0,u.Ss)(e)})),r.m("POST").h({"content-type":"application/json"}).b(o),r.build()},je=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return Te(e,t);const r=(0,u.Tj)({$metadata:Je(e)}),o=(0,u.Y0)((0,u.Xk)(await(0,$e.Y2)(e.body,t)),"body"),s=(0,u.s)(o,{accessToken:u.lK,expiresIn:u.ET,idToken:u.lK,refreshToken:u.lK,tokenType:u.lK});return Object.assign(r,s),r},Te=async(e,t)=>{const r={...e,body:await(0,$e.CG)(e.body,t)},o=(0,$e.cJ)(e,r.body);switch(o){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await _e(r,t);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await De(r,t);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await Ke(r,t);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await Ae(r,t);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await ze(r,t);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await Me(r,t);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await qe(r,t);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await Fe(r,t);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await Ge(r,t);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await Ve(r,t);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await Be(r,t);case"InvalidRequestRegionException":case"com.amazonaws.ssooidc#InvalidRequestRegionException":throw await He(r,t);case"InvalidClientMetadataException":case"com.amazonaws.ssooidc#InvalidClientMetadataException":throw await Re(r,t);case"InvalidRedirectUriException":case"com.amazonaws.ssooidc#InvalidRedirectUriException":throw await Ue(r,t);default:const s=r.body;return Ce({output:e,parsedBody:s,errorCode:o})}},Ce=(0,u.jr)(pe),_e=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new le({$metadata:Je(e),...r});return(0,u.Mw)(n,e.body)},De=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new ue({$metadata:Je(e),...r});return(0,u.Mw)(n,e.body)},Ke=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new he({$metadata:Je(e),...r});return(0,u.Mw)(n,e.body)},Ae=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new me({$metadata:Je(e),...r});return(0,u.Mw)(n,e.body)},ze=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new ye({$metadata:Je(e),...r});return(0,u.Mw)(n,e.body)},Re=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new Se({$metadata:Je(e),...r});return(0,u.Mw)(n,e.body)},Me=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new fe({$metadata:Je(e),...r});return(0,u.Mw)(n,e.body)},Ue=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new Ie({$metadata:Je(e),...r});return(0,u.Mw)(n,e.body)},qe=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new we({$metadata:Je(e),...r});return(0,u.Mw)(n,e.body)},He=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{endpoint:u.lK,error:u.lK,error_description:u.lK,region:u.lK});Object.assign(r,s);const n=new Ee({$metadata:Je(e),...r});return(0,u.Mw)(n,e.body)},Fe=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new xe({$metadata:Je(e),...r});return(0,u.Mw)(n,e.body)},Ge=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new ge({$metadata:Je(e),...r});return(0,u.Mw)(n,e.body)},Ve=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new ve({$metadata:Je(e),...r});return(0,u.Mw)(n,e.body)},Be=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new be({$metadata:Je(e),...r});return(0,u.Mw)(n,e.body)},Je=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});class Le extends(u.uB.classBuilder().ep({...w}).m((function(e,t,r,o){return[(0,de.TM)(r,this.serialize,this.deserialize),(0,p.rD)(r,e.getEndpointParameterInstructions())]})).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f(Pe,Oe).ser(ke).de(je).build()){}},68609:(e,t,r)=>{r.d(t,{CG:()=>n,Y2:()=>s,cJ:()=>i});var o=r(22392);const s=(e,t)=>(0,o.w)(e,t).then((e=>{if(e.length)try{return JSON.parse(e)}catch(t){throw"SyntaxError"===t?.name&&Object.defineProperty(t,"$responseBodyText",{value:e}),t}return{}})),n=async(e,t)=>{const r=await s(e,t);return r.message=r.message??r.Message,r},i=(e,t)=>{const r=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},o=(s=e.headers,Object.keys(s).find((e=>e.toLowerCase()==="x-amzn-errortype".toLowerCase())));var s;return void 0!==o?r(e.headers[o]):void 0!==t.code?r(t.code):void 0!==t.__type?r(t.__type):void 0}}};
|
package/639.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=639,exports.ids=[639],exports.modules={30639:(e,t,a)=>{a.d(t,{ENV_CMDS_FULL_URI:()=>p,ENV_CMDS_RELATIVE_URI:()=>m,fromContainerMetadata:()=>f,fromInstanceMetadata:()=>P,getInstanceMetadataEndpoint:()=>T,httpRequest:()=>i});var n=a(25933),r=a(87016),o=a(20181),s=a(58611);function i(e){return new Promise(((t,a)=>{const r=(0,s.request)({method:"GET",...e,hostname:e.hostname?.replace(/^\[(.+)\]$/,"$1")});r.on("error",(e=>{a(Object.assign(new n.mZ("Unable to connect to instance metadata service"),e)),r.destroy()})),r.on("timeout",(()=>{a(new n.mZ("TimeoutError from instance metadata service")),r.destroy()})),r.on("response",(e=>{const{statusCode:s=400}=e;(s<200||300<=s)&&(a(Object.assign(new n.mZ("Error response received from instance metadata service"),{statusCode:s})),r.destroy());const i=[];e.on("data",(e=>{i.push(e)})),e.on("end",(()=>{t(o.Buffer.concat(i)),r.destroy()}))})),r.end()}))}const c=e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.AccessKeyId&&"string"==typeof e.SecretAccessKey&&"string"==typeof e.Token&&"string"==typeof e.Expiration,l=e=>({accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:new Date(e.Expiration)}),d=({maxRetries:e=0,timeout:t=1e3})=>({maxRetries:e,timeout:t}),u=(e,t)=>{let a=e();for(let n=0;n<t;n++)a=a.catch(e);return a},p="AWS_CONTAINER_CREDENTIALS_FULL_URI",m="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",g="AWS_CONTAINER_AUTHORIZATION_TOKEN",f=(e={})=>{const{timeout:t,maxRetries:a}=d(e);return()=>u((async()=>{const a=await y({logger:e.logger}),r=JSON.parse(await h(t,a));if(!c(r))throw new n.C1("Invalid response received from instance metadata service.",{logger:e.logger});return l(r)}),a)},h=async(e,t)=>(process.env[g]&&(t.headers={...t.headers,Authorization:process.env[g]}),(await i({...t,timeout:e})).toString()),v={localhost:!0,"127.0.0.1":!0},w={"http:":!0,"https:":!0},y=async({logger:e})=>{if(process.env[m])return{hostname:"169.254.170.2",path:process.env[m]};if(process.env[p]){const t=(0,r.parse)(process.env[p]);if(!t.hostname||!(t.hostname in v))throw new n.C1(`${t.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:e});if(!t.protocol||!(t.protocol in w))throw new n.C1(`${t.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:e});return{...t,port:t.port?parseInt(t.port,10):void 0}}throw new n.C1(`The container metadata credential provider cannot be used unless the ${m} or ${p} environment variable is set`,{tryNextLink:!1,logger:e})};var E=a(33746);class I extends n.C1{constructor(e,t=!0){super(e,t),this.tryNextLink=t,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,I.prototype)}}var _,A=a(23776);!function(e){e.IPv4="http://169.254.169.254",e.IPv6="http://[fd00:ec2::254]"}(_||(_={}));const S={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:e=>e.ec2_metadata_service_endpoint,default:void 0};var C;!function(e){e.IPv4="IPv4",e.IPv6="IPv6"}(C||(C={}));const b={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE,configFileSelector:e=>e.ec2_metadata_service_endpoint_mode,default:C.IPv4},T=async()=>(0,A.D)(await x()||await D()),x=async()=>(0,E.Z)(S)(),D=async()=>{const e=await(0,E.Z)(b)();switch(e){case C.IPv4:return _.IPv4;case C.IPv6:return _.IPv6;default:throw new Error(`Unsupported endpoint mode: ${e}. Select from ${Object.values(C)}`)}},N=(e,t)=>{const a=300+Math.floor(300*Math.random()),n=new Date(Date.now()+1e3*a);t.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(n)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);const r=e.originalExpiration??e.expiration;return{...e,...r?{originalExpiration:r}:{},expiration:n}},k="/latest/meta-data/iam/security-credentials/",M="AWS_EC2_METADATA_V1_DISABLED",R="ec2_metadata_v1_disabled",O="x-aws-ec2-metadata-token",P=(e={})=>((e,t={})=>{const a=t?.logger||console;let n;return async()=>{let t;try{t=await e(),t.expiration&&t.expiration.getTime()<Date.now()&&(t=N(t,a))}catch(e){if(!n)throw e;a.warn("Credential renew failed: ",e),t=N(n,a)}return n=t,t}})(V(e),{logger:e.logger}),V=(e={})=>{let t=!1;const{logger:a,profile:r}=e,{timeout:o,maxRetries:s}=d(e),i=async(a,o)=>{if(t||null==o.headers?.[O]){let t=!1,a=!1;const o=await(0,E.Z)({environmentVariableSelector:t=>{const r=t[M];if(a=!!r&&"false"!==r,void 0===r)throw new n.C1(`${M} not set in env, checking config file next.`,{logger:e.logger});return a},configFileSelector:e=>{const a=e[R];return t=!!a&&"false"!==a,t},default:!1},{profile:r})();if(e.ec2MetadataV1Disabled||o){const n=[];throw e.ec2MetadataV1Disabled&&n.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"),t&&n.push(`config file profile (${R})`),a&&n.push(`process environment variable (${M})`),new I(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${n.join(", ")}].`)}}const s=(await u((async()=>{let e;try{e=await $(o)}catch(e){throw 401===e.statusCode&&(t=!1),e}return e}),a)).trim();return u((async()=>{let a;try{a=await K(s,o,e)}catch(e){throw 401===e.statusCode&&(t=!1),e}return a}),a)};return async()=>{const e=await T();if(t)return a?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),i(s,{...e,timeout:o});{let n;try{n=(await L({...e,timeout:o})).toString()}catch(n){if(400===n?.statusCode)throw Object.assign(n,{message:"EC2 Metadata token request returned error"});return("TimeoutError"===n.message||[403,404,405].includes(n.statusCode))&&(t=!0),a?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),i(s,{...e,timeout:o})}return i(s,{...e,headers:{[O]:n},timeout:o})}}},L=async e=>i({...e,path:"/latest/api/token",method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),$=async e=>(await i({...e,path:k})).toString(),K=async(e,t,a)=>{const r=JSON.parse((await i({...t,path:k+e})).toString());if(!c(r))throw new n.C1("Invalid response received from instance metadata service.",{logger:a.logger});return l(r)}}};
|
package/681.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=681,exports.ids=[681],exports.modules={44681:(e,r,o)=>{o.r(r),o.d(r,{fromProcess:()=>c});var s=o(42654),t=o(25933),i=o(35317),n=o(39023);const c=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const r=await(0,s.YU)(e);return(async(e,r,o)=>{const s=r[e];if(!r[e])throw new t.C1(`Profile ${e} could not be found in shared credentials file.`,{logger:o});{const r=s.credential_process;if(void 0===r)throw new t.C1(`Profile ${e} did not contain credential_process.`,{logger:o});{const s=(0,n.promisify)(i.exec);try{const{stdout:o}=await s(r);let t;try{t=JSON.parse(o.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return((e,r)=>{if(1!==r.Version)throw Error(`Profile ${e} credential_process did not return Version 1.`);if(void 0===r.AccessKeyId||void 0===r.SecretAccessKey)throw Error(`Profile ${e} credential_process returned invalid credentials.`);if(r.Expiration){const o=new Date;if(new Date(r.Expiration)<o)throw Error(`Profile ${e} credential_process returned expired credentials.`)}return{accessKeyId:r.AccessKeyId,secretAccessKey:r.SecretAccessKey,...r.SessionToken&&{sessionToken:r.SessionToken},...r.Expiration&&{expiration:new Date(r.Expiration)},...r.CredentialScope&&{credentialScope:r.CredentialScope}}})(e,t)}catch(e){throw new t.C1(e.message,{logger:o})}}}})((0,s.Bz)(e),r,e.logger)}}};
|
package/708.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=708,exports.ids=[708],exports.modules={3708:(e,t,r)=>{r.d(t,{CreateTokenCommand:()=>Je,SSOOIDCClient:()=>ce});var o=r(58365),s=r(20998),n=r(27039),i=r(18884),a=r(5728),c=r(37251),d=r(77239),p=r(50355),l=r(30914),u=r(17245),h=r(54083),m=r(50914);const y=async(e,t,r)=>({operation:(0,m.u)(t).operation,region:await(0,m.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),f=e=>{const t=[];switch(e.operation){case"CreateToken":case"RegisterClient":case"StartDeviceAuthorization":t.push({schemeId:"smithy.api#noAuth"});break;default:t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e))}return t},w={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var g=r(10440),x=r(38700),v=r(65793),b=r(96679),E=r(33746),S=r(53246),I=r(94006),P=r(95261),O=r(90329),$=r(23776),k=r(21778),j=r(32982),T=r(70508),C=r(5729);const _="required",D="fn",K="argv",A="ref",R=!0,z="isSet",M="booleanEquals",U="error",q="endpoint",H="tree",F="PartitionResult",G="getAttr",V={[_]:!1,type:"String"},B={[_]:!0,default:!1,type:"Boolean"},Z={[A]:"Endpoint"},J={[D]:M,[K]:[{[A]:"UseFIPS"},!0]},N={[D]:M,[K]:[{[A]:"UseDualStack"},!0]},L={},Y={[D]:G,[K]:[{[A]:F},"supportsFIPS"]},W={[A]:F},X={[D]:M,[K]:[!0,{[D]:G,[K]:[W,"supportsDualStack"]}]},Q=[J],ee=[N],te=[{[A]:"Region"}],re={version:"1.0",parameters:{Region:V,UseDualStack:B,UseFIPS:B,Endpoint:V},rules:[{conditions:[{[D]:z,[K]:[Z]}],rules:[{conditions:Q,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:U},{conditions:ee,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:U},{endpoint:{url:Z,properties:L,headers:L},type:q}],type:H},{conditions:[{[D]:z,[K]:te}],rules:[{conditions:[{[D]:"aws.partition",[K]:te,assign:F}],rules:[{conditions:[J,N],rules:[{conditions:[{[D]:M,[K]:[R,Y]},X],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:L,headers:L},type:q}],type:H},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:U}],type:H},{conditions:Q,rules:[{conditions:[{[D]:M,[K]:[Y,R]}],rules:[{conditions:[{[D]:"stringEquals",[K]:[{[D]:G,[K]:[W,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:L,headers:L},type:q},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:L,headers:L},type:q}],type:H},{error:"FIPS is enabled but this partition does not support FIPS",type:U}],type:H},{conditions:ee,rules:[{conditions:[X],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:L,headers:L},type:q}],type:H},{error:"DualStack is enabled but this partition does not support DualStack",type:U}],type:H},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:L,headers:L},type:q}],type:H}],type:H},{error:"Invalid Configuration: Missing Region",type:U}]},oe=(e,t={})=>(0,C.sO)(re,{endpointParams:e,logger:t.logger});C.mw.aws=T.UF;var se=r(12689);var ne=r(32953),ie=r(69462);const ae=e=>{const t=e.httpAuthSchemes;let r=e.httpAuthSchemeProvider,o=e.credentials;return{setHttpAuthScheme(e){const r=t.findIndex((t=>t.schemeId===e.schemeId));-1===r?t.push(e):t.splice(r,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){r=e},httpAuthSchemeProvider:()=>r,setCredentials(e){o=e},credentials:()=>o}};class ce extends u.Kj{constructor(...[e]){const t=(e=>{(0,u.I9)(process.version);const t=(0,se.I)(e),r=()=>t().then(u.lT),o=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??k.E,base64Encoder:e?.base64Encoder??k.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??oe,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??f,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new O.f},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new c.mR}],logger:e?.logger??new u.N4,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??$.D,utf8Decoder:e?.utf8Decoder??j.ar,utf8Encoder:e?.utf8Encoder??j.Pq}))(e);return(0,g.I)(process.version),{...o,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??I.n,credentialDefaultProvider:e?.credentialDefaultProvider??x.v6,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,v.mJ)({serviceId:o.serviceId,clientVersion:"3.614.0"}),maxAttempts:e?.maxAttempts??(0,E.Z)(l.qs),region:e?.region??(0,E.Z)(a.GG,a.zH),requestHandler:S.$c.create(e?.requestHandler??r),retryMode:e?.retryMode??(0,E.Z)({...l.kN,default:async()=>(await r()).retryMode||P.L0}),sha256:e?.sha256??b.V.bind(null,"sha256"),streamCollector:e?.streamCollector??S.kv,useDualstackEndpoint:e?.useDualstackEndpoint??(0,E.Z)(a.e$),useFipsEndpoint:e?.useFipsEndpoint??(0,E.Z)(a.Ko)}})(e||{}),r=(m=t,{...m,useDualstackEndpoint:m.useDualstackEndpoint??!1,useFipsEndpoint:m.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"});var m;const y=(0,a.TD)(r),w=(0,p.Co)(y),T=(0,l.$z)(w),C=(0,o.OV)(T);var _;const D=((e,t)=>{const r={...(0,ne.Rq)(e),...(0,u.xA)(e),...(0,ie.eS)(e),...ae(e)};return t.forEach((e=>e.configure(r))),{...e,...(0,ne.$3)(r),...(0,u.uv)(r),...(0,ie.jt)(r),...(o=r,{httpAuthSchemes:o.httpAuthSchemes(),httpAuthSchemeProvider:o.httpAuthSchemeProvider(),credentials:o.credentials()})};var o})((_=(0,i.Dc)(C),{...(0,h.h)(_)}),e?.extensions||[]);super(D),this.config=D,this.middlewareStack.use((0,l.ey)(this.config)),this.middlewareStack.use((0,d.vK)(this.config)),this.middlewareStack.use((0,o.TC)(this.config)),this.middlewareStack.use((0,s.Y7)(this.config)),this.middlewareStack.use((0,n.n4)(this.config)),this.middlewareStack.use((0,i.sM)(this.config)),this.middlewareStack.use((0,c.wB)(this.config,{httpAuthSchemeParametersProvider:this.getDefaultHttpAuthSchemeParametersProvider(),identityProviderConfigProvider:this.getIdentityProviderConfigProvider()})),this.middlewareStack.use((0,c.lW)(this.config))}destroy(){super.destroy()}getDefaultHttpAuthSchemeParametersProvider(){return y}getIdentityProviderConfigProvider(){return async e=>new c.h$({"aws.auth#sigv4":e.credentials})}}var de=r(44455);class pe extends u.TJ{constructor(e){super(e),Object.setPrototypeOf(this,pe.prototype)}}class le extends pe{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,le.prototype),this.error=e.error,this.error_description=e.error_description}}class ue extends pe{constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e}),this.name="AuthorizationPendingException",this.$fault="client",Object.setPrototypeOf(this,ue.prototype),this.error=e.error,this.error_description=e.error_description}}class he extends pe{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,he.prototype),this.error=e.error,this.error_description=e.error_description}}class me extends pe{constructor(e){super({name:"InternalServerException",$fault:"server",...e}),this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,me.prototype),this.error=e.error,this.error_description=e.error_description}}class ye extends pe{constructor(e){super({name:"InvalidClientException",$fault:"client",...e}),this.name="InvalidClientException",this.$fault="client",Object.setPrototypeOf(this,ye.prototype),this.error=e.error,this.error_description=e.error_description}}class fe extends pe{constructor(e){super({name:"InvalidGrantException",$fault:"client",...e}),this.name="InvalidGrantException",this.$fault="client",Object.setPrototypeOf(this,fe.prototype),this.error=e.error,this.error_description=e.error_description}}class we extends pe{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,we.prototype),this.error=e.error,this.error_description=e.error_description}}class ge extends pe{constructor(e){super({name:"InvalidScopeException",$fault:"client",...e}),this.name="InvalidScopeException",this.$fault="client",Object.setPrototypeOf(this,ge.prototype),this.error=e.error,this.error_description=e.error_description}}class xe extends pe{constructor(e){super({name:"SlowDownException",$fault:"client",...e}),this.name="SlowDownException",this.$fault="client",Object.setPrototypeOf(this,xe.prototype),this.error=e.error,this.error_description=e.error_description}}class ve extends pe{constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e}),this.name="UnauthorizedClientException",this.$fault="client",Object.setPrototypeOf(this,ve.prototype),this.error=e.error,this.error_description=e.error_description}}class be extends pe{constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e}),this.name="UnsupportedGrantTypeException",this.$fault="client",Object.setPrototypeOf(this,be.prototype),this.error=e.error,this.error_description=e.error_description}}class Ee extends pe{constructor(e){super({name:"InvalidRequestRegionException",$fault:"client",...e}),this.name="InvalidRequestRegionException",this.$fault="client",Object.setPrototypeOf(this,Ee.prototype),this.error=e.error,this.error_description=e.error_description,this.endpoint=e.endpoint,this.region=e.region}}class Se extends pe{constructor(e){super({name:"InvalidClientMetadataException",$fault:"client",...e}),this.name="InvalidClientMetadataException",this.$fault="client",Object.setPrototypeOf(this,Se.prototype),this.error=e.error,this.error_description=e.error_description}}class Ie extends pe{constructor(e){super({name:"InvalidRedirectUriException",$fault:"client",...e}),this.name="InvalidRedirectUriException",this.$fault="client",Object.setPrototypeOf(this,Ie.prototype),this.error=e.error,this.error_description=e.error_description}}const Pe=e=>({...e,...e.clientSecret&&{clientSecret:u.$H},...e.refreshToken&&{refreshToken:u.$H},...e.codeVerifier&&{codeVerifier:u.$H}}),Oe=e=>({...e,...e.accessToken&&{accessToken:u.$H},...e.refreshToken&&{refreshToken:u.$H},...e.idToken&&{idToken:u.$H}});var $e=r(35709);const ke=async(e,t)=>{const r=(0,c.lI)(e,t);let o;return r.bp("/token"),o=JSON.stringify((0,u.s)(e,{clientId:[],clientSecret:[],code:[],codeVerifier:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:e=>(0,u.Ss)(e)})),r.m("POST").h({"content-type":"application/json"}).b(o),r.build()},je=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return Te(e,t);const r=(0,u.Tj)({$metadata:Ze(e)}),o=(0,u.Y0)((0,u.Xk)(await(0,$e.Y2)(e.body,t)),"body"),s=(0,u.s)(o,{accessToken:u.lK,expiresIn:u.ET,idToken:u.lK,refreshToken:u.lK,tokenType:u.lK});return Object.assign(r,s),r},Te=async(e,t)=>{const r={...e,body:await(0,$e.CG)(e.body,t)},o=(0,$e.cJ)(e,r.body);switch(o){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await _e(r,t);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await De(r,t);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await Ke(r,t);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await Ae(r,t);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await Re(r,t);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await Me(r,t);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await qe(r,t);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await Fe(r,t);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await Ge(r,t);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await Ve(r,t);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await Be(r,t);case"InvalidRequestRegionException":case"com.amazonaws.ssooidc#InvalidRequestRegionException":throw await He(r,t);case"InvalidClientMetadataException":case"com.amazonaws.ssooidc#InvalidClientMetadataException":throw await ze(r,t);case"InvalidRedirectUriException":case"com.amazonaws.ssooidc#InvalidRedirectUriException":throw await Ue(r,t);default:const s=r.body;return Ce({output:e,parsedBody:s,errorCode:o})}},Ce=(0,u.jr)(pe),_e=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new le({$metadata:Ze(e),...r});return(0,u.Mw)(n,e.body)},De=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new ue({$metadata:Ze(e),...r});return(0,u.Mw)(n,e.body)},Ke=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new he({$metadata:Ze(e),...r});return(0,u.Mw)(n,e.body)},Ae=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new me({$metadata:Ze(e),...r});return(0,u.Mw)(n,e.body)},Re=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new ye({$metadata:Ze(e),...r});return(0,u.Mw)(n,e.body)},ze=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new Se({$metadata:Ze(e),...r});return(0,u.Mw)(n,e.body)},Me=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new fe({$metadata:Ze(e),...r});return(0,u.Mw)(n,e.body)},Ue=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new Ie({$metadata:Ze(e),...r});return(0,u.Mw)(n,e.body)},qe=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new we({$metadata:Ze(e),...r});return(0,u.Mw)(n,e.body)},He=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{endpoint:u.lK,error:u.lK,error_description:u.lK,region:u.lK});Object.assign(r,s);const n=new Ee({$metadata:Ze(e),...r});return(0,u.Mw)(n,e.body)},Fe=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new ge({$metadata:Ze(e),...r});return(0,u.Mw)(n,e.body)},Ge=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new xe({$metadata:Ze(e),...r});return(0,u.Mw)(n,e.body)},Ve=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new ve({$metadata:Ze(e),...r});return(0,u.Mw)(n,e.body)},Be=async(e,t)=>{const r=(0,u.Tj)({}),o=e.body,s=(0,u.s)(o,{error:u.lK,error_description:u.lK});Object.assign(r,s);const n=new be({$metadata:Ze(e),...r});return(0,u.Mw)(n,e.body)},Ze=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});class Je extends(u.uB.classBuilder().ep({...w}).m((function(e,t,r,o){return[(0,de.TM)(r,this.serialize,this.deserialize),(0,p.rD)(r,e.getEndpointParameterInstructions())]})).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f(Pe,Oe).ser(ke).de(je).build()){}}};
|
package/783.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=783,exports.ids=[783],exports.modules={11783:(e,n,o)=>{o.r(n),o.d(n,{fromTokenFile:()=>s,fromWebToken:()=>t});var i=o(25933),r=o(79896);const t=e=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");const{roleArn:n,roleSessionName:i,webIdentityToken:r,providerId:t,policyArns:s,policy:d,durationSeconds:l}=e;let{roleAssumerWithWebIdentity:c}=e;if(!c){const{getDefaultRoleAssumerWithWebIdentity:n}=await o.e(320).then(o.bind(o,80320));c=n({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:e.parentClientConfig},e.clientPlugins)}return c({RoleArn:n,RoleSessionName:i??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:r,ProviderId:t,PolicyArns:s,Policy:d,DurationSeconds:l})},s=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const n=e?.webIdentityTokenFile??process.env.AWS_WEB_IDENTITY_TOKEN_FILE,o=e?.roleArn??process.env.AWS_ROLE_ARN,s=e?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!n||!o)throw new i.C1("Web identity configuration not specified",{logger:e.logger});return t({...e,webIdentityToken:(0,r.readFileSync)(n,{encoding:"ascii"}),roleArn:o,roleSessionName:s})()}}};
|
package/802.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=802,exports.ids=[802],exports.modules={2802:(e,s,o)=>{o.d(s,{fromSSO:()=>u});var n=o(25933),t=o(42654);const r="To refresh this SSO session run 'aws sso login' with the corresponding profile.",i={},a=e=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new n.Jh(`Token is expired. ${r}`,!1)},c=(e,s,o=!1)=>{if(void 0===s)throw new n.Jh(`Value not present for '${e}' in SSO Token${o?". Cannot refresh":""}. ${r}`,!1)};var l=o(79896);const{writeFile:g}=l.promises,w=new Date(0),f=(e={})=>async()=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");const s=await(0,t.YU)(e),l=(0,t.Bz)(e),f=s[l];if(!f)throw new n.Jh(`Profile '${l}' could not be found in shared credentials file.`,!1);if(!f.sso_session)throw new n.Jh(`Profile '${l}' is missing required property 'sso_session'.`);const d=f.sso_session,h=(await(0,t.qw)(e))[d];if(!h)throw new n.Jh(`Sso session '${d}' could not be found in shared credentials file.`,!1);for(const e of["sso_start_url","sso_region"])if(!h[e])throw new n.Jh(`Sso session '${d}' is missing required property '${e}'.`,!1);h.sso_start_url;const u=h.sso_region;let S;try{S=await(0,t.vf)(d)}catch(e){throw new n.Jh(`The SSO session token associated with profile=${l} was not found or is invalid. ${r}`,!1)}c("accessToken",S.accessToken),c("expiresAt",S.expiresAt);const{accessToken:p,expiresAt:_}=S,k={token:p,expiration:new Date(_)};if(k.expiration.getTime()-Date.now()>3e5)return k;if(Date.now()-w.getTime()<3e4)return a(k),k;c("clientId",S.clientId,!0),c("clientSecret",S.clientSecret,!0),c("refreshToken",S.refreshToken,!0);try{w.setTime(Date.now());const e=await(async(e,s)=>{const{CreateTokenCommand:n}=await o.e(485).then(o.bind(o,97485)),t=await(async e=>{const{SSOOIDCClient:s}=await o.e(485).then(o.bind(o,97485));if(i[e])return i[e];const n=new s({region:e});return i[e]=n,n})(s);return t.send(new n({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))})(S,u);c("accessToken",e.accessToken),c("expiresIn",e.expiresIn);const s=new Date(Date.now()+1e3*e.expiresIn);try{await((e,s)=>{const o=(0,t.C9)(e),n=JSON.stringify(s,null,2);return g(o,n)})(d,{...S,accessToken:e.accessToken,expiresAt:s.toISOString(),refreshToken:e.refreshToken})}catch(e){}return{token:e.accessToken,expiration:s}}catch(e){return a(k),k}},d=!1,h=async({ssoStartUrl:e,ssoSession:s,ssoAccountId:r,ssoRegion:i,ssoRoleName:a,ssoClient:c,clientConfig:l,profile:g,logger:w})=>{let h;const u="To refresh this SSO session run aws sso login with the corresponding profile.";if(s)try{const e=await f({profile:g})();h={accessToken:e.token,expiresAt:new Date(e.expiration).toISOString()}}catch(e){throw new n.C1(e.message,{tryNextLink:d,logger:w})}else try{h=await(0,t.vf)(e)}catch(e){throw new n.C1(`The SSO session associated with this profile is invalid. ${u}`,{tryNextLink:d,logger:w})}if(new Date(h.expiresAt).getTime()-Date.now()<=0)throw new n.C1(`The SSO session associated with this profile has expired. ${u}`,{tryNextLink:d,logger:w});const{accessToken:S}=h,{SSOClient:p,GetRoleCredentialsCommand:_}=await o.e(905).then(o.bind(o,77905)),k=c||new p(Object.assign({},l??{},{region:l?.region??i}));let m;try{m=await k.send(new _({accountId:r,roleName:a,accessToken:S}))}catch(e){throw new n.C1(e,{tryNextLink:d,logger:w})}const{roleCredentials:{accessKeyId:y,secretAccessKey:T,sessionToken:C,expiration:x,credentialScope:O}={}}=m;if(!(y&&T&&C&&x))throw new n.C1("SSO returns an invalid temporary credential.",{tryNextLink:d,logger:w});return{accessKeyId:y,secretAccessKey:T,sessionToken:C,expiration:new Date(x),credentialScope:O}},u=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");const{ssoStartUrl:s,ssoAccountId:o,ssoRegion:r,ssoRoleName:i,ssoSession:a}=e,{ssoClient:c}=e,l=(0,t.Bz)(e);if(s||o||r||i||a){if(s&&o&&r&&i)return h({ssoStartUrl:s,ssoSession:a,ssoAccountId:o,ssoRegion:r,ssoRoleName:i,ssoClient:c,clientConfig:e.clientConfig,profile:l});throw new n.C1('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger})}{const o=(await(0,t.YU)(e))[l];if(!o)throw new n.C1(`Profile ${l} was not found.`,{logger:e.logger});if(!(g=o)||"string"!=typeof g.sso_start_url&&"string"!=typeof g.sso_account_id&&"string"!=typeof g.sso_session&&"string"!=typeof g.sso_region&&"string"!=typeof g.sso_role_name)throw new n.C1(`Profile ${l} is not configured with SSO credentials.`,{logger:e.logger});if(o?.sso_session){const i=(await(0,t.qw)(e))[o.sso_session],a=` configurations in profile ${l} and sso-session ${o.sso_session}`;if(r&&r!==i.sso_region)throw new n.C1("Conflicting SSO region"+a,{tryNextLink:!1,logger:e.logger});if(s&&s!==i.sso_start_url)throw new n.C1("Conflicting SSO start_url"+a,{tryNextLink:!1,logger:e.logger});o.sso_region=i.sso_region,o.sso_start_url=i.sso_start_url}const{sso_start_url:i,sso_account_id:a,sso_region:w,sso_role_name:f,sso_session:d}=((e,s)=>{const{sso_start_url:o,sso_account_id:t,sso_region:r,sso_role_name:i}=e;if(!(o&&t&&r&&i))throw new n.C1(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:s});return e})(o,e.logger);return h({ssoStartUrl:i,ssoSession:d,ssoAccountId:a,ssoRegion:w,ssoRoleName:f,ssoClient:c,clientConfig:e.clientConfig,profile:l})}var g}}};
|
package/822.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=822,exports.ids=[822],exports.modules={76822:(e,r,n)=>{n.d(r,{fromIni:()=>l});var o=n(65123),t=n(25933);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(433).then(n.bind(n,56433));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(987).then(n.bind(n,51987)),{fromContainerMetadata:i}=await n.e(639).then(n.bind(n,30639));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(639).then(n.bind(n,30639));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,92));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(368).then(n.bind(n,59368)).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(310).then(n.bind(n,14310)).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(261).then(n.bind(n,21261));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)}}};
|
package/834.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=834,exports.ids=[834],exports.modules={30834:(e,t,r)=>{r.d(t,{fromHttp:()=>d});var o=r(17379),n=r(25933),s=r(91943),a=r.n(s),i=r(69462),c=r(33323),l=r(28134);const d=(e={})=>{let t;e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");const r=e.awsContainerCredentialsRelativeUri??process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,s=e.awsContainerCredentialsFullUri??process.env.AWS_CONTAINER_CREDENTIALS_FULL_URI,d=e.awsContainerAuthorizationToken??process.env.AWS_CONTAINER_AUTHORIZATION_TOKEN,h=e.awsContainerAuthorizationTokenFile??process.env.AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE,p="NoOpLogger"!==e.logger?.constructor?.name&&e.logger?e.logger.warn:console.warn;if(r&&s&&(p("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),p("awsContainerCredentialsFullUri will take precedence.")),d&&h&&(p("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),p("awsContainerAuthorizationToken will take precedence.")),s)t=s;else{if(!r)throw new n.C1("No HTTP credential provider host provided.\nSet AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.",{logger:e.logger});t=`http://169.254.170.2${r}`}const u=new URL(t);((e,t)=>{if("https:"!==e.protocol&&"169.254.170.2"!==e.hostname&&"169.254.170.23"!==e.hostname&&"[fd00:ec2::23]"!==e.hostname){if(e.hostname.includes("[")){if("[::1]"===e.hostname||"[0000:0000:0000:0000:0000:0000:0000:0001]"===e.hostname)return}else{if("localhost"===e.hostname)return;const t=e.hostname.split("."),r=e=>{const t=parseInt(e,10);return 0<=t&&t<=255};if("127"===t[0]&&r(t[1])&&r(t[2])&&r(t[3])&&4===t.length)return}throw new n.C1("URL not accepted. It must either be HTTPS or match one of the following:\n - loopback CIDR 127.0.0.0/8 or [::1/128]\n - ECS container host 169.254.170.2\n - EKS container host 169.254.170.23 or [fd00:ec2::23]",{logger:t})}})(u,e.logger);const g=new o.$c({requestTimeout:e.timeout??1e3,connectionTimeout:e.timeout??1e3});return w=async()=>{const t=function(e){return new i.Kd({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce(((e,[t,r])=>(e[t]=r,e)),{}),fragment:e.hash})}(u);d?t.headers.Authorization=d:h&&(t.headers.Authorization=(await a().readFile(h)).toString());try{return async function(e,t){const r=(0,l.c9)(e.body),o=await r.transformToString();if(200===e.statusCode){const e=JSON.parse(o);if("string"!=typeof e.AccessKeyId||"string"!=typeof e.SecretAccessKey||"string"!=typeof e.Token||"string"!=typeof e.Expiration)throw new n.C1("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:t});return{accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:(0,c.EI)(e.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let r={};try{r=JSON.parse(o)}catch(e){}throw Object.assign(new n.C1(`Server responded with status: ${e.statusCode}`,{logger:t}),{Code:r.Code,Message:r.Message})}throw new n.C1(`Server responded with status: ${e.statusCode}`,{logger:t})}((await g.handle(t)).response)}catch(t){throw new n.C1(String(t),{logger:e.logger})}},C=e.maxRetries??3,A=e.timeout??1e3,async()=>{for(let e=0;e<C;++e)try{return await w()}catch(e){await new Promise((e=>setTimeout(e,A)))}return await w()};var w,C,A}}};
|
package/905.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=905,exports.ids=[905],exports.modules={68609:(e,t,s)=>{s.d(t,{CG:()=>r,Y2:()=>n,cJ:()=>i});var o=s(22392);const n=(e,t)=>(0,o.w)(e,t).then((e=>{if(e.length)try{return JSON.parse(e)}catch(t){throw"SyntaxError"===t?.name&&Object.defineProperty(t,"$responseBodyText",{value:e}),t}return{}})),r=async(e,t)=>{const s=await n(e,t);return s.message=s.message??s.Message,s},i=(e,t)=>{const s=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},o=(n=e.headers,Object.keys(n).find((e=>e.toLowerCase()==="x-amzn-errortype".toLowerCase())));var n;return void 0!==o?s(e.headers[o]):void 0!==t.code?s(t.code):void 0!==t.__type?s(t.__type):void 0}},77905:(e,t,s)=>{s.d(t,{GetRoleCredentialsCommand:()=>T,SSOClient:()=>qe});var o=s(9661),n=s(44455),r=s(33323);const i={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class a extends r.TJ{constructor(e){super(e),Object.setPrototypeOf(this,a.prototype)}}class c extends a{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,c.prototype)}}class d extends a{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,d.prototype)}}class u extends a{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,u.prototype)}}class p extends a{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,p.prototype)}}const l=e=>({...e,...e.accessToken&&{accessToken:r.$H}}),h=e=>({...e,...e.secretAccessKey&&{secretAccessKey:r.$H},...e.sessionToken&&{sessionToken:r.$H}}),m=e=>({...e,...e.roleCredentials&&{roleCredentials:h(e.roleCredentials)}});var y=s(68609),g=s(78486);const f=async(e,t)=>{const s=(0,g.lI)(e,t),o=(0,r.Tj)({},k,{[j]:e[R]});s.bp("/federation/credentials");const n=(0,r.Tj)({[D]:[,(0,r.Y0)(e[O],"roleName")],[A]:[,(0,r.Y0)(e[C],"accountId")]});return s.m("GET").h(o).q(n).b(void 0),s.build()},v=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return S(e,t);const s=(0,r.Tj)({$metadata:E(e)}),o=(0,r.Y0)((0,r.Xk)(await(0,y.Y2)(e.body,t)),"body"),n=(0,r.s)(o,{roleCredentials:r.Ss});return Object.assign(s,n),s},S=async(e,t)=>{const s={...e,body:await(0,y.CG)(e.body,t)},o=(0,y.cJ)(e,s.body);switch(o){case"InvalidRequestException":case"com.amazonaws.sso#InvalidRequestException":throw await w(s,t);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await b(s,t);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await x(s,t);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await I(s,t);default:const n=s.body;return P({output:e,parsedBody:n,errorCode:o})}},P=(0,r.jr)(a),w=async(e,t)=>{const s=(0,r.Tj)({}),o=e.body,n=(0,r.s)(o,{message:r.lK});Object.assign(s,n);const i=new c({$metadata:E(e),...s});return(0,r.Mw)(i,e.body)},b=async(e,t)=>{const s=(0,r.Tj)({}),o=e.body,n=(0,r.s)(o,{message:r.lK});Object.assign(s,n);const i=new d({$metadata:E(e),...s});return(0,r.Mw)(i,e.body)},x=async(e,t)=>{const s=(0,r.Tj)({}),o=e.body,n=(0,r.s)(o,{message:r.lK});Object.assign(s,n);const i=new u({$metadata:E(e),...s});return(0,r.Mw)(i,e.body)},I=async(e,t)=>{const s=(0,r.Tj)({}),o=e.body,n=(0,r.s)(o,{message:r.lK});Object.assign(s,n);const i=new p({$metadata:E(e),...s});return(0,r.Mw)(i,e.body)},E=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),k=e=>!(null==e||""===e||Object.getOwnPropertyNames(e).includes("length")&&0==e.length||Object.getOwnPropertyNames(e).includes("size")&&0==e.size),C="accountId",R="accessToken",A="account_id",O="roleName",D="role_name",j="x-amz-sso_bearer_token";class T extends(r.uB.classBuilder().ep({...i}).m((function(e,t,s,r){return[(0,n.TM)(s,this.serialize,this.deserialize),(0,o.rD)(s,e.getEndpointParameterInstructions())]})).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").f(l,m).ser(f).de(v).build()){}var q=s(43497),z=s(88773),$=s(61115),F=s(44033),M=s(26659),U=s(77239),H=s(69172),N=s(59735),G=s(50914);const K=async(e,t,s)=>({operation:(0,G.u)(t).operation,region:await(0,G.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),L=e=>{const t=[];switch(e.operation){case"GetRoleCredentials":case"ListAccountRoles":case"ListAccounts":case"Logout":t.push({schemeId:"smithy.api#noAuth"});break;default:t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e))}return t};var _=s(70108),B=s(72156),Y=s(96679),J=s(42362),Z=s(17379),V=s(94006),W=s(95261),X=s(86574),Q=s(23776),ee=s(21778),te=s(32982),se=s(12941),oe=s(26399);const ne="required",re="fn",ie="argv",ae="ref",ce=!0,de="isSet",ue="booleanEquals",pe="error",le="endpoint",he="tree",me="PartitionResult",ye="getAttr",ge={[ne]:!1,type:"String"},fe={[ne]:!0,default:!1,type:"Boolean"},ve={[ae]:"Endpoint"},Se={[re]:ue,[ie]:[{[ae]:"UseFIPS"},!0]},Pe={[re]:ue,[ie]:[{[ae]:"UseDualStack"},!0]},we={},be={[re]:ye,[ie]:[{[ae]:me},"supportsFIPS"]},xe={[ae]:me},Ie={[re]:ue,[ie]:[!0,{[re]:ye,[ie]:[xe,"supportsDualStack"]}]},Ee=[Se],ke=[Pe],Ce=[{[ae]:"Region"}],Re={version:"1.0",parameters:{Region:ge,UseDualStack:fe,UseFIPS:fe,Endpoint:ge},rules:[{conditions:[{[re]:de,[ie]:[ve]}],rules:[{conditions:Ee,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:pe},{conditions:ke,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:pe},{endpoint:{url:ve,properties:we,headers:we},type:le}],type:he},{conditions:[{[re]:de,[ie]:Ce}],rules:[{conditions:[{[re]:"aws.partition",[ie]:Ce,assign:me}],rules:[{conditions:[Se,Pe],rules:[{conditions:[{[re]:ue,[ie]:[ce,be]},Ie],rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:we,headers:we},type:le}],type:he},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:pe}],type:he},{conditions:Ee,rules:[{conditions:[{[re]:ue,[ie]:[be,ce]}],rules:[{conditions:[{[re]:"stringEquals",[ie]:[{[re]:ye,[ie]:[xe,"name"]},"aws-us-gov"]}],endpoint:{url:"https://portal.sso.{Region}.amazonaws.com",properties:we,headers:we},type:le},{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:we,headers:we},type:le}],type:he},{error:"FIPS is enabled but this partition does not support FIPS",type:pe}],type:he},{conditions:ke,rules:[{conditions:[Ie],rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:we,headers:we},type:le}],type:he},{error:"DualStack is enabled but this partition does not support DualStack",type:pe}],type:he},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:we,headers:we},type:le}],type:he}],type:he},{error:"Invalid Configuration: Missing Region",type:pe}]},Ae=(e,t={})=>(0,oe.sO)(Re,{endpointParams:e,logger:t.logger});oe.mw.aws=se.UF;var Oe=s(36397);var De=s(19538),je=s(69462);const Te=e=>{const t=e.httpAuthSchemes;let s=e.httpAuthSchemeProvider,o=e.credentials;return{setHttpAuthScheme(e){const s=t.findIndex((t=>t.schemeId===e.schemeId));-1===s?t.push(e):t.splice(s,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){s=e},httpAuthSchemeProvider:()=>s,setCredentials(e){o=e},credentials:()=>o}};class qe extends r.Kj{constructor(...[e]){const t=(e=>{(0,r.I9)(process.version);const t=(0,Oe.I)(e),s=()=>t().then(r.lT),o=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??ee.E,base64Encoder:e?.base64Encoder??ee.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Ae,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??L,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new X.f},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new g.mR}],logger:e?.logger??new r.N4,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??Q.D,utf8Decoder:e?.utf8Decoder??te.ar,utf8Encoder:e?.utf8Encoder??te.Pq}))(e);return(0,_.I)(process.version),{...o,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??V.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,B.mJ)({serviceId:o.serviceId,clientVersion:"3.598.0"}),maxAttempts:e?.maxAttempts??(0,J.Z)(H.qs),region:e?.region??(0,J.Z)(M.GG,M.zH),requestHandler:Z.$c.create(e?.requestHandler??s),retryMode:e?.retryMode??(0,J.Z)({...H.kN,default:async()=>(await s()).retryMode||W.L0}),sha256:e?.sha256??Y.V.bind(null,"sha256"),streamCollector:e?.streamCollector??Z.kv,useDualstackEndpoint:e?.useDualstackEndpoint??(0,J.Z)(M.e$),useFipsEndpoint:e?.useFipsEndpoint??(0,J.Z)(M.Ko)}})(e||{}),s=(n=t,{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"});var n;const i=(0,M.TD)(s),a=(0,o.Co)(i),c=(0,H.$z)(a),d=(0,q.OV)(c);var u;const p=((e,t)=>{const s={...(0,De.Rq)(e),...(0,r.xA)(e),...(0,je.eS)(e),...Te(e)};return t.forEach((e=>e.configure(s))),{...e,...(0,De.$3)(s),...(0,r.uv)(s),...(0,je.jt)(s),...(o=s,{httpAuthSchemes:o.httpAuthSchemes(),httpAuthSchemeProvider:o.httpAuthSchemeProvider(),credentials:o.credentials()})};var o})((u=(0,F.Dc)(d),{...(0,N.h)(u)}),e?.extensions||[]);super(p),this.config=p,this.middlewareStack.use((0,H.ey)(this.config)),this.middlewareStack.use((0,U.vK)(this.config)),this.middlewareStack.use((0,q.TC)(this.config)),this.middlewareStack.use((0,z.Y7)(this.config)),this.middlewareStack.use((0,$.n4)(this.config)),this.middlewareStack.use((0,F.sM)(this.config)),this.middlewareStack.use((0,g.wB)(this.config,{httpAuthSchemeParametersProvider:this.getDefaultHttpAuthSchemeParametersProvider(),identityProviderConfigProvider:this.getIdentityProviderConfigProvider()})),this.middlewareStack.use((0,g.lW)(this.config))}destroy(){super.destroy()}getDefaultHttpAuthSchemeParametersProvider(){return K}getIdentityProviderConfigProvider(){return async e=>new g.h$({"aws.auth#sigv4":e.credentials})}}}};
|
package/924.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=924,exports.ids=[924],exports.modules={74924:(e,t,s)=>{s.d(t,{GetRoleCredentialsCommand:()=>q,SSOClient:()=>Te});var o=s(50355),n=s(44455),r=s(17245);const i={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class a extends r.TJ{constructor(e){super(e),Object.setPrototypeOf(this,a.prototype)}}class c extends a{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,c.prototype)}}class d extends a{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,d.prototype)}}class u extends a{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,u.prototype)}}class p extends a{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,p.prototype)}}const l=e=>({...e,...e.accessToken&&{accessToken:r.$H}}),h=e=>({...e,...e.secretAccessKey&&{secretAccessKey:r.$H},...e.sessionToken&&{sessionToken:r.$H}}),m=e=>({...e,...e.roleCredentials&&{roleCredentials:h(e.roleCredentials)}});var y=s(35709),g=s(37251);const f=async(e,t)=>{const s=(0,g.lI)(e,t),o=(0,r.Tj)({},k,{[j]:e[C]});s.bp("/federation/credentials");const n=(0,r.Tj)({[O]:[,(0,r.Y0)(e[D],"roleName")],[A]:[,(0,r.Y0)(e[R],"accountId")]});return s.m("GET").h(o).q(n).b(void 0),s.build()},P=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return S(e,t);const s=(0,r.Tj)({$metadata:E(e)}),o=(0,r.Y0)((0,r.Xk)(await(0,y.Y2)(e.body,t)),"body"),n=(0,r.s)(o,{roleCredentials:r.Ss});return Object.assign(s,n),s},S=async(e,t)=>{const s={...e,body:await(0,y.CG)(e.body,t)},o=(0,y.cJ)(e,s.body);switch(o){case"InvalidRequestException":case"com.amazonaws.sso#InvalidRequestException":throw await w(s,t);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await b(s,t);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await x(s,t);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await I(s,t);default:const n=s.body;return v({output:e,parsedBody:n,errorCode:o})}},v=(0,r.jr)(a),w=async(e,t)=>{const s=(0,r.Tj)({}),o=e.body,n=(0,r.s)(o,{message:r.lK});Object.assign(s,n);const i=new c({$metadata:E(e),...s});return(0,r.Mw)(i,e.body)},b=async(e,t)=>{const s=(0,r.Tj)({}),o=e.body,n=(0,r.s)(o,{message:r.lK});Object.assign(s,n);const i=new d({$metadata:E(e),...s});return(0,r.Mw)(i,e.body)},x=async(e,t)=>{const s=(0,r.Tj)({}),o=e.body,n=(0,r.s)(o,{message:r.lK});Object.assign(s,n);const i=new u({$metadata:E(e),...s});return(0,r.Mw)(i,e.body)},I=async(e,t)=>{const s=(0,r.Tj)({}),o=e.body,n=(0,r.s)(o,{message:r.lK});Object.assign(s,n);const i=new p({$metadata:E(e),...s});return(0,r.Mw)(i,e.body)},E=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),k=e=>!(null==e||""===e||Object.getOwnPropertyNames(e).includes("length")&&0==e.length||Object.getOwnPropertyNames(e).includes("size")&&0==e.size),R="accountId",C="accessToken",A="account_id",D="roleName",O="role_name",j="x-amz-sso_bearer_token";class q extends(r.uB.classBuilder().ep({...i}).m((function(e,t,s,r){return[(0,n.TM)(s,this.serialize,this.deserialize),(0,o.rD)(s,e.getEndpointParameterInstructions())]})).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").f(l,m).ser(f).de(P).build()){}var T=s(58365),z=s(20998),$=s(27039),F=s(18884),M=s(5728),U=s(77239),H=s(30914),N=s(54083),K=s(50914);const G=async(e,t,s)=>({operation:(0,K.u)(t).operation,region:await(0,K.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),B=e=>{const t=[];switch(e.operation){case"GetRoleCredentials":case"ListAccountRoles":case"ListAccounts":case"Logout":t.push({schemeId:"smithy.api#noAuth"});break;default:t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e))}return t};var L=s(10440),Y=s(65793),Z=s(96679),V=s(33746),_=s(53246),J=s(94006),W=s(95261),X=s(90329),Q=s(23776),ee=s(21778),te=s(32982),se=s(70508),oe=s(5729);const ne="required",re="fn",ie="argv",ae="ref",ce=!0,de="isSet",ue="booleanEquals",pe="error",le="endpoint",he="tree",me="PartitionResult",ye="getAttr",ge={[ne]:!1,type:"String"},fe={[ne]:!0,default:!1,type:"Boolean"},Pe={[ae]:"Endpoint"},Se={[re]:ue,[ie]:[{[ae]:"UseFIPS"},!0]},ve={[re]:ue,[ie]:[{[ae]:"UseDualStack"},!0]},we={},be={[re]:ye,[ie]:[{[ae]:me},"supportsFIPS"]},xe={[ae]:me},Ie={[re]:ue,[ie]:[!0,{[re]:ye,[ie]:[xe,"supportsDualStack"]}]},Ee=[Se],ke=[ve],Re=[{[ae]:"Region"}],Ce={version:"1.0",parameters:{Region:ge,UseDualStack:fe,UseFIPS:fe,Endpoint:ge},rules:[{conditions:[{[re]:de,[ie]:[Pe]}],rules:[{conditions:Ee,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:pe},{conditions:ke,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:pe},{endpoint:{url:Pe,properties:we,headers:we},type:le}],type:he},{conditions:[{[re]:de,[ie]:Re}],rules:[{conditions:[{[re]:"aws.partition",[ie]:Re,assign:me}],rules:[{conditions:[Se,ve],rules:[{conditions:[{[re]:ue,[ie]:[ce,be]},Ie],rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:we,headers:we},type:le}],type:he},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:pe}],type:he},{conditions:Ee,rules:[{conditions:[{[re]:ue,[ie]:[be,ce]}],rules:[{conditions:[{[re]:"stringEquals",[ie]:[{[re]:ye,[ie]:[xe,"name"]},"aws-us-gov"]}],endpoint:{url:"https://portal.sso.{Region}.amazonaws.com",properties:we,headers:we},type:le},{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:we,headers:we},type:le}],type:he},{error:"FIPS is enabled but this partition does not support FIPS",type:pe}],type:he},{conditions:ke,rules:[{conditions:[Ie],rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:we,headers:we},type:le}],type:he},{error:"DualStack is enabled but this partition does not support DualStack",type:pe}],type:he},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:we,headers:we},type:le}],type:he}],type:he},{error:"Invalid Configuration: Missing Region",type:pe}]},Ae=(e,t={})=>(0,oe.sO)(Ce,{endpointParams:e,logger:t.logger});oe.mw.aws=se.UF;var De=s(12689);var Oe=s(32953),je=s(69462);const qe=e=>{const t=e.httpAuthSchemes;let s=e.httpAuthSchemeProvider,o=e.credentials;return{setHttpAuthScheme(e){const s=t.findIndex((t=>t.schemeId===e.schemeId));-1===s?t.push(e):t.splice(s,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){s=e},httpAuthSchemeProvider:()=>s,setCredentials(e){o=e},credentials:()=>o}};class Te extends r.Kj{constructor(...[e]){const t=(e=>{(0,r.I9)(process.version);const t=(0,De.I)(e),s=()=>t().then(r.lT),o=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??ee.E,base64Encoder:e?.base64Encoder??ee.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Ae,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??B,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new X.f},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new g.mR}],logger:e?.logger??new r.N4,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??Q.D,utf8Decoder:e?.utf8Decoder??te.ar,utf8Encoder:e?.utf8Encoder??te.Pq}))(e);return(0,L.I)(process.version),{...o,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??J.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,Y.mJ)({serviceId:o.serviceId,clientVersion:"3.614.0"}),maxAttempts:e?.maxAttempts??(0,V.Z)(H.qs),region:e?.region??(0,V.Z)(M.GG,M.zH),requestHandler:_.$c.create(e?.requestHandler??s),retryMode:e?.retryMode??(0,V.Z)({...H.kN,default:async()=>(await s()).retryMode||W.L0}),sha256:e?.sha256??Z.V.bind(null,"sha256"),streamCollector:e?.streamCollector??_.kv,useDualstackEndpoint:e?.useDualstackEndpoint??(0,V.Z)(M.e$),useFipsEndpoint:e?.useFipsEndpoint??(0,V.Z)(M.Ko)}})(e||{}),s=(n=t,{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"});var n;const i=(0,M.TD)(s),a=(0,o.Co)(i),c=(0,H.$z)(a),d=(0,T.OV)(c);var u;const p=((e,t)=>{const s={...(0,Oe.Rq)(e),...(0,r.xA)(e),...(0,je.eS)(e),...qe(e)};return t.forEach((e=>e.configure(s))),{...e,...(0,Oe.$3)(s),...(0,r.uv)(s),...(0,je.jt)(s),...(o=s,{httpAuthSchemes:o.httpAuthSchemes(),httpAuthSchemeProvider:o.httpAuthSchemeProvider(),credentials:o.credentials()})};var o})((u=(0,F.Dc)(d),{...(0,N.h)(u)}),e?.extensions||[]);super(p),this.config=p,this.middlewareStack.use((0,H.ey)(this.config)),this.middlewareStack.use((0,U.vK)(this.config)),this.middlewareStack.use((0,T.TC)(this.config)),this.middlewareStack.use((0,z.Y7)(this.config)),this.middlewareStack.use((0,$.n4)(this.config)),this.middlewareStack.use((0,F.sM)(this.config)),this.middlewareStack.use((0,g.wB)(this.config,{httpAuthSchemeParametersProvider:this.getDefaultHttpAuthSchemeParametersProvider(),identityProviderConfigProvider:this.getIdentityProviderConfigProvider()})),this.middlewareStack.use((0,g.lW)(this.config))}destroy(){super.destroy()}getDefaultHttpAuthSchemeParametersProvider(){return G}getIdentityProviderConfigProvider(){return async e=>new g.h$({"aws.auth#sigv4":e.credentials})}}}};
|
package/987.index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=987,exports.ids=[987],exports.modules={51987:(e,t,r)=>{r.d(t,{fromHttp:()=>d});var o=r(53246),n=r(25933),s=r(91943),a=r.n(s),i=r(69462),c=r(17245),l=r(54431);const d=(e={})=>{let t;e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");const r=e.awsContainerCredentialsRelativeUri??process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,s=e.awsContainerCredentialsFullUri??process.env.AWS_CONTAINER_CREDENTIALS_FULL_URI,d=e.awsContainerAuthorizationToken??process.env.AWS_CONTAINER_AUTHORIZATION_TOKEN,h=e.awsContainerAuthorizationTokenFile??process.env.AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE,p="NoOpLogger"!==e.logger?.constructor?.name&&e.logger?e.logger.warn:console.warn;if(r&&s&&(p("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),p("awsContainerCredentialsFullUri will take precedence.")),d&&h&&(p("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),p("awsContainerAuthorizationToken will take precedence.")),s)t=s;else{if(!r)throw new n.C1("No HTTP credential provider host provided.\nSet AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.",{logger:e.logger});t=`http://169.254.170.2${r}`}const u=new URL(t);((e,t)=>{if("https:"!==e.protocol&&"169.254.170.2"!==e.hostname&&"169.254.170.23"!==e.hostname&&"[fd00:ec2::23]"!==e.hostname){if(e.hostname.includes("[")){if("[::1]"===e.hostname||"[0000:0000:0000:0000:0000:0000:0000:0001]"===e.hostname)return}else{if("localhost"===e.hostname)return;const t=e.hostname.split("."),r=e=>{const t=parseInt(e,10);return 0<=t&&t<=255};if("127"===t[0]&&r(t[1])&&r(t[2])&&r(t[3])&&4===t.length)return}throw new n.C1("URL not accepted. It must either be HTTPS or match one of the following:\n - loopback CIDR 127.0.0.0/8 or [::1/128]\n - ECS container host 169.254.170.2\n - EKS container host 169.254.170.23 or [fd00:ec2::23]",{logger:t})}})(u,e.logger);const g=new o.$c({requestTimeout:e.timeout??1e3,connectionTimeout:e.timeout??1e3});return w=async()=>{const t=function(e){return new i.Kd({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce(((e,[t,r])=>(e[t]=r,e)),{}),fragment:e.hash})}(u);d?t.headers.Authorization=d:h&&(t.headers.Authorization=(await a().readFile(h)).toString());try{return async function(e,t){const r=(0,l.c9)(e.body),o=await r.transformToString();if(200===e.statusCode){const e=JSON.parse(o);if("string"!=typeof e.AccessKeyId||"string"!=typeof e.SecretAccessKey||"string"!=typeof e.Token||"string"!=typeof e.Expiration)throw new n.C1("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:t});return{accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:(0,c.EI)(e.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let r={};try{r=JSON.parse(o)}catch(e){}throw Object.assign(new n.C1(`Server responded with status: ${e.statusCode}`,{logger:t}),{Code:r.Code,Message:r.Message})}throw new n.C1(`Server responded with status: ${e.statusCode}`,{logger:t})}((await g.handle(t)).response)}catch(t){throw new n.C1(String(t),{logger:e.logger})}},C=e.maxRetries??3,A=e.timeout??1e3,async()=>{for(let e=0;e<C;++e)try{return await w()}catch(e){await new Promise((e=>setTimeout(e,A)))}return await w()};var w,C,A}}};
|