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,MAAM,IAAI,iBAAiB,yBAAyB,iDAAiD,2CAAsD,CAAE,OAAQ,EAAQ,QAAS,EAGpL,QAAU,CAAC,EAAQ,CAAC,IAAM,OAAS,sBAAuB,CAAC,KAC7D,MAAM,EAAO,IACN,EACH,mBAAoB,IACb,KACA,EAAM,qBAGjB,EAAK,QAAQ,MAAM,8CACnB,MAAM,QAAiB,oBAAoB,gBAAgB,GAC3D,OAAO,mBAAmB,oBAAoB,eAAe,CACzD,QAAS,EAAM,SAAW,GAAoB,UAC9C,EAAU,EAAK,EAGvB,QAAQ,QAAU","file":"/npm/@aws-sdk/credential-provider-ini@3.936.0/dist-cjs/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@aws-sdk/credential-provider-ini@3.936.0/dist-cjs/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nvar sharedIniFileLoader = require('@smithy/shared-ini-file-loader');\nvar propertyProvider = require('@smithy/property-provider');\nvar client = require('@aws-sdk/core/client');\nvar credentialProviderLogin = require('@aws-sdk/credential-provider-login');\n\nconst resolveCredentialSource = (credentialSource, profileName, logger) => {\n    const sourceProvidersMap = {\n        EcsContainer: async (options) => {\n            const { fromHttp } = await import('@aws-sdk/credential-provider-http');\n            const { fromContainerMetadata } = await import('@smithy/credential-provider-imds');\n            logger?.debug(\"@aws-sdk/credential-provider-ini - credential_source is EcsContainer\");\n            return async () => propertyProvider.chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);\n        },\n        Ec2InstanceMetadata: async (options) => {\n            logger?.debug(\"@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata\");\n            const { fromInstanceMetadata } = await import('@smithy/credential-provider-imds');\n            return async () => fromInstanceMetadata(options)().then(setNamedProvider);\n        },\n        Environment: async (options) => {\n            logger?.debug(\"@aws-sdk/credential-provider-ini - credential_source is Environment\");\n            const { fromEnv } = await import('@aws-sdk/credential-provider-env');\n            return async () => fromEnv(options)().then(setNamedProvider);\n        },\n    };\n    if (credentialSource in sourceProvidersMap) {\n        return sourceProvidersMap[credentialSource];\n    }\n    else {\n        throw new propertyProvider.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, ` +\n            `expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger });\n    }\n};\nconst setNamedProvider = (creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_NAMED_PROVIDER\", \"p\");\n\nconst isAssumeRoleProfile = (arg, { profile = \"default\", logger } = {}) => {\n    return (Boolean(arg) &&\n        typeof arg === \"object\" &&\n        typeof arg.role_arn === \"string\" &&\n        [\"undefined\", \"string\"].indexOf(typeof arg.role_session_name) > -1 &&\n        [\"undefined\", \"string\"].indexOf(typeof arg.external_id) > -1 &&\n        [\"undefined\", \"string\"].indexOf(typeof arg.mfa_serial) > -1 &&\n        (isAssumeRoleWithSourceProfile(arg, { profile, logger }) || isCredentialSourceProfile(arg, { profile, logger })));\n};\nconst isAssumeRoleWithSourceProfile = (arg, { profile, logger }) => {\n    const withSourceProfile = typeof arg.source_profile === \"string\" && typeof arg.credential_source === \"undefined\";\n    if (withSourceProfile) {\n        logger?.debug?.(`    ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`);\n    }\n    return withSourceProfile;\n};\nconst isCredentialSourceProfile = (arg, { profile, logger }) => {\n    const withProviderProfile = typeof arg.credential_source === \"string\" && typeof arg.source_profile === \"undefined\";\n    if (withProviderProfile) {\n        logger?.debug?.(`    ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`);\n    }\n    return withProviderProfile;\n};\nconst resolveAssumeRoleCredentials = async (profileName, profiles, options, visitedProfiles = {}, resolveProfileData) => {\n    options.logger?.debug(\"@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)\");\n    const profileData = profiles[profileName];\n    const { source_profile, region } = profileData;\n    if (!options.roleAssumer) {\n        const { getDefaultRoleAssumer } = await import('@aws-sdk/nested-clients/sts');\n        options.roleAssumer = getDefaultRoleAssumer({\n            ...options.clientConfig,\n            credentialProviderLogger: options.logger,\n            parentClientConfig: {\n                ...options?.parentClientConfig,\n                region: region ?? options?.parentClientConfig?.region,\n            },\n        }, options.clientPlugins);\n    }\n    if (source_profile && source_profile in visitedProfiles) {\n        throw new propertyProvider.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile` +\n            ` ${sharedIniFileLoader.getProfileName(options)}. Profiles visited: ` +\n            Object.keys(visitedProfiles).join(\", \"), { logger: options.logger });\n    }\n    options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`);\n    const sourceCredsProvider = source_profile\n        ? resolveProfileData(source_profile, profiles, options, {\n            ...visitedProfiles,\n            [source_profile]: true,\n        }, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {}))\n        : (await resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options))();\n    if (isCredentialSourceWithoutRoleArn(profileData)) {\n        return sourceCredsProvider.then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SOURCE_PROFILE\", \"o\"));\n    }\n    else {\n        const params = {\n            RoleArn: profileData.role_arn,\n            RoleSessionName: profileData.role_session_name || `aws-sdk-js-${Date.now()}`,\n            ExternalId: profileData.external_id,\n            DurationSeconds: parseInt(profileData.duration_seconds || \"3600\", 10),\n        };\n        const { mfa_serial } = profileData;\n        if (mfa_serial) {\n            if (!options.mfaCodeProvider) {\n                throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, { logger: options.logger, tryNextLink: false });\n            }\n            params.SerialNumber = mfa_serial;\n            params.TokenCode = await options.mfaCodeProvider(mfa_serial);\n        }\n        const sourceCreds = await sourceCredsProvider;\n        return options.roleAssumer(sourceCreds, params).then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SOURCE_PROFILE\", \"o\"));\n    }\n};\nconst isCredentialSourceWithoutRoleArn = (section) => {\n    return !section.role_arn && !!section.credential_source;\n};\n\nconst isLoginProfile = (data) => {\n    return Boolean(data && data.login_session);\n};\nconst resolveLoginCredentials = async (profileName, options) => {\n    const credentials = await credentialProviderLogin.fromLoginCredentials({\n        ...options,\n        profile: profileName,\n    })();\n    return client.setCredentialFeature(credentials, \"CREDENTIALS_PROFILE_LOGIN\", \"AC\");\n};\n\nconst isProcessProfile = (arg) => Boolean(arg) && typeof arg === \"object\" && typeof arg.credential_process === \"string\";\nconst resolveProcessCredentials = async (options, profile) => import('@aws-sdk/credential-provider-process').then(({ fromProcess }) => fromProcess({\n    ...options,\n    profile,\n})().then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_PROCESS\", \"v\")));\n\nconst resolveSsoCredentials = async (profile, profileData, options = {}) => {\n    const { fromSSO } = await import('@aws-sdk/credential-provider-sso');\n    return fromSSO({\n        profile,\n        logger: options.logger,\n        parentClientConfig: options.parentClientConfig,\n        clientConfig: options.clientConfig,\n    })().then((creds) => {\n        if (profileData.sso_session) {\n            return client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SSO\", \"r\");\n        }\n        else {\n            return client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_SSO_LEGACY\", \"t\");\n        }\n    });\n};\nconst isSsoProfile = (arg) => arg &&\n    (typeof arg.sso_start_url === \"string\" ||\n        typeof arg.sso_account_id === \"string\" ||\n        typeof arg.sso_session === \"string\" ||\n        typeof arg.sso_region === \"string\" ||\n        typeof arg.sso_role_name === \"string\");\n\nconst isStaticCredsProfile = (arg) => Boolean(arg) &&\n    typeof arg === \"object\" &&\n    typeof arg.aws_access_key_id === \"string\" &&\n    typeof arg.aws_secret_access_key === \"string\" &&\n    [\"undefined\", \"string\"].indexOf(typeof arg.aws_session_token) > -1 &&\n    [\"undefined\", \"string\"].indexOf(typeof arg.aws_account_id) > -1;\nconst resolveStaticCredentials = async (profile, options) => {\n    options?.logger?.debug(\"@aws-sdk/credential-provider-ini - resolveStaticCredentials\");\n    const credentials = {\n        accessKeyId: profile.aws_access_key_id,\n        secretAccessKey: profile.aws_secret_access_key,\n        sessionToken: profile.aws_session_token,\n        ...(profile.aws_credential_scope && { credentialScope: profile.aws_credential_scope }),\n        ...(profile.aws_account_id && { accountId: profile.aws_account_id }),\n    };\n    return client.setCredentialFeature(credentials, \"CREDENTIALS_PROFILE\", \"n\");\n};\n\nconst isWebIdentityProfile = (arg) => Boolean(arg) &&\n    typeof arg === \"object\" &&\n    typeof arg.web_identity_token_file === \"string\" &&\n    typeof arg.role_arn === \"string\" &&\n    [\"undefined\", \"string\"].indexOf(typeof arg.role_session_name) > -1;\nconst resolveWebIdentityCredentials = async (profile, options) => import('@aws-sdk/credential-provider-web-identity').then(({ fromTokenFile }) => fromTokenFile({\n    webIdentityTokenFile: profile.web_identity_token_file,\n    roleArn: profile.role_arn,\n    roleSessionName: profile.role_session_name,\n    roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,\n    logger: options.logger,\n    parentClientConfig: options.parentClientConfig,\n})().then((creds) => client.setCredentialFeature(creds, \"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN\", \"q\")));\n\nconst resolveProfileData = async (profileName, profiles, options, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => {\n    const data = profiles[profileName];\n    if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) {\n        return resolveStaticCredentials(data, options);\n    }\n    if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, { profile: profileName, logger: options.logger })) {\n        return resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles, resolveProfileData);\n    }\n    if (isStaticCredsProfile(data)) {\n        return resolveStaticCredentials(data, options);\n    }\n    if (isWebIdentityProfile(data)) {\n        return resolveWebIdentityCredentials(data, options);\n    }\n    if (isProcessProfile(data)) {\n        return resolveProcessCredentials(options, profileName);\n    }\n    if (isSsoProfile(data)) {\n        return await resolveSsoCredentials(profileName, data, options);\n    }\n    if (isLoginProfile(data)) {\n        return resolveLoginCredentials(profileName, options);\n    }\n    throw new propertyProvider.CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger });\n};\n\nconst fromIni = (_init = {}) => async ({ callerClientConfig } = {}) => {\n    const init = {\n        ..._init,\n        parentClientConfig: {\n            ...callerClientConfig,\n            ..._init.parentClientConfig,\n        },\n    };\n    init.logger?.debug(\"@aws-sdk/credential-provider-ini - fromIni\");\n    const profiles = await sharedIniFileLoader.parseKnownFiles(init);\n    return resolveProfileData(sharedIniFileLoader.getProfileName({\n        profile: _init.profile ?? callerClientConfig?.profile,\n    }), profiles, init);\n};\n\nexports.fromIni = fromIni;\n"]}