UNPKG

@kya-os/mcp-i

Version:

The TypeScript MCP framework with identity features built-in

1 lines 2.22 kB
"use strict";exports.id=67,exports.ids=[67],exports.modules={4987:(e,r,o)=>{o.d(r,{C:()=>n});var t=o(76982),s=o(16928),c=o(51362);const n=e=>{const r=(0,t.createHash)("sha1").update(e).digest("hex");return(0,s.join)((0,c.R)(),".aws","sso","cache",`${r}.json`)}},48440:(e,r,o)=>{o.d(r,{a:()=>c,v:()=>n});var t=o(91943),s=o(4987);const c={},n=async e=>{if(c[e])return c[e];const r=(0,s.C)(e),o=await(0,t.readFile)(r,"utf8");return JSON.parse(o)}},68448:(e,r,o)=>{o.d(r,{fromProcess:()=>l});var t=o(6721),s=o(76682),c=o(84122),n=o(74692),i=o(35317),a=o(39023),d=o(53243);const l=(e={})=>async({callerClientConfig:r}={})=>{e.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const o=await(0,t.Y)(e);return(async(e,r,o)=>{const t=r[e];if(!r[e])throw new c.C(`Profile ${e} could not be found in shared credentials file.`,{logger:o});{const s=t.credential_process;if(void 0===s)throw new c.C(`Profile ${e} did not contain credential_process.`,{logger:o});{const t=(0,a.promisify)(n.Z?.getTokenRecord?.().exec??i.exec);try{const{stdout:o}=await t(s);let c;try{c=JSON.parse(o.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return((e,r,o)=>{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.`)}let t=r.AccountId;!t&&o?.[e]?.aws_account_id&&(t=o[e].aws_account_id);const s={accessKeyId:r.AccessKeyId,secretAccessKey:r.SecretAccessKey,...r.SessionToken&&{sessionToken:r.SessionToken},...r.Expiration&&{expiration:new Date(r.Expiration)},...r.CredentialScope&&{credentialScope:r.CredentialScope},...t&&{accountId:t}};return(0,d.g)(s,"CREDENTIALS_PROCESS","w"),s})(e,c,r)}catch(e){throw new c.C(e.message,{logger:o})}}}})((0,s.Bz)({profile:e.profile??r?.profile}),o,e.logger)}},74692:(e,r,o)=>{o.d(r,{Z:()=>c});var t=o(48440),s=o(71078);const c={getFileRecord:()=>s.Jj,interceptFile(e,r){s.Jj[e]=Promise.resolve(r)},getTokenRecord:()=>t.a,interceptToken(e,r){t.a[e]=r}}}};