"use strict";exports.id=681,exports.ids=[681],exports.modules={45681:(e,r,o)=>{o.r(r),o.d(r,{fromProcess:()=>c});var s=o(3054),t=o(18112),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)}}};
//# sourceMappingURL=681-bundle.js.map