@artik0din/turbogha 1.0.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"762.index.js","mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":[".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/auth/httpAuthSchemeProvider.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/endpointResolver.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/endpoint/ruleset.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.js",".././node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/runtimeConfig.shared.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveHttpAuthSchemeConfig = exports.defaultSigninHttpAuthSchemeProvider = exports.defaultSigninHttpAuthSchemeParametersProvider = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst util_middleware_1 = require(\"@smithy/util-middleware\");\nconst defaultSigninHttpAuthSchemeParametersProvider = async (config, context, input) => {\n return {\n operation: (0, util_middleware_1.getSmithyContext)(context).operation,\n region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||\n (() => {\n throw new Error(\"expected `region` to be configured for `aws.auth#sigv4`\");\n })(),\n };\n};\nexports.defaultSigninHttpAuthSchemeParametersProvider = defaultSigninHttpAuthSchemeParametersProvider;\nfunction createAwsAuthSigv4HttpAuthOption(authParameters) {\n return {\n schemeId: \"aws.auth#sigv4\",\n signingProperties: {\n name: \"signin\",\n region: authParameters.region,\n },\n propertiesExtractor: (config, context) => ({\n signingProperties: {\n config,\n context,\n },\n }),\n };\n}\nfunction createSmithyApiNoAuthHttpAuthOption(authParameters) {\n return {\n schemeId: \"smithy.api#noAuth\",\n };\n}\nconst defaultSigninHttpAuthSchemeProvider = (authParameters) => {\n const options = [];\n switch (authParameters.operation) {\n case \"CreateOAuth2Token\": {\n options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n break;\n }\n default: {\n options.push(createAwsAuthSigv4HttpAuthOption(authParameters));\n }\n }\n return options;\n};\nexports.defaultSigninHttpAuthSchemeProvider = defaultSigninHttpAuthSchemeProvider;\nconst resolveHttpAuthSchemeConfig = (config) => {\n const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);\n return Object.assign(config_0, {\n authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),\n });\n};\nexports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultEndpointResolver = void 0;\nconst util_endpoints_1 = require(\"@aws-sdk/util-endpoints\");\nconst util_endpoints_2 = require(\"@smithy/util-endpoints\");\nconst ruleset_1 = require(\"./ruleset\");\nconst cache = new util_endpoints_2.EndpointCache({\n size: 50,\n params: [\"Endpoint\", \"Region\", \"UseDualStack\", \"UseFIPS\"],\n});\nconst defaultEndpointResolver = (endpointParams, context = {}) => {\n return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {\n endpointParams: endpointParams,\n logger: context.logger,\n }));\n};\nexports.defaultEndpointResolver = defaultEndpointResolver;\nutil_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ruleSet = void 0;\nconst u = \"required\", v = \"fn\", w = \"argv\", x = \"ref\";\nconst a = true, b = \"isSet\", c = \"booleanEquals\", d = \"error\", e = \"endpoint\", f = \"tree\", g = \"PartitionResult\", h = \"stringEquals\", i = { [u]: true, \"default\": false, \"type\": \"boolean\" }, j = { [u]: false, \"type\": \"string\" }, k = { [x]: \"Endpoint\" }, l = { [v]: c, [w]: [{ [x]: \"UseFIPS\" }, true] }, m = { [v]: c, [w]: [{ [x]: \"UseDualStack\" }, true] }, n = {}, o = { [v]: \"getAttr\", [w]: [{ [x]: g }, \"name\"] }, p = { [v]: c, [w]: [{ [x]: \"UseFIPS\" }, false] }, q = { [v]: c, [w]: [{ [x]: \"UseDualStack\" }, false] }, r = { [v]: \"getAttr\", [w]: [{ [x]: g }, \"supportsFIPS\"] }, s = { [v]: c, [w]: [true, { [v]: \"getAttr\", [w]: [{ [x]: g }, \"supportsDualStack\"] }] }, t = [{ [x]: \"Region\" }];\nconst _data = { version: \"1.0\", parameters: { UseDualStack: i, UseFIPS: i, Endpoint: j, Region: j }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: [l], error: \"Invalid Configuration: FIPS and custom endpoint are not supported\", type: d }, { rules: [{ conditions: [m], error: \"Invalid Configuration: Dualstack and custom endpoint are not supported\", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }], type: f }, { rules: [{ conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: \"aws.partition\", [w]: t, assign: g }], rules: [{ conditions: [{ [v]: h, [w]: [o, \"aws\"] }, p, q], endpoint: { url: \"https://{Region}.signin.aws.amazon.com\", properties: n, headers: n }, type: e }, { conditions: [{ [v]: h, [w]: [o, \"aws-cn\"] }, p, q], endpoint: { url: \"https://{Region}.signin.amazonaws.cn\", properties: n, headers: n }, type: e }, { conditions: [{ [v]: h, [w]: [o, \"aws-us-gov\"] }, p, q], endpoint: { url: \"https://{Region}.signin.amazonaws-us-gov.com\", properties: n, headers: n }, type: e }, { conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, r] }, s], rules: [{ endpoint: { url: \"https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: n, headers: n }, type: e }], type: f }, { error: \"FIPS and DualStack are enabled, but this partition does not support one or both\", type: d }], type: f }, { conditions: [l, q], rules: [{ conditions: [{ [v]: c, [w]: [r, a] }], rules: [{ endpoint: { url: \"https://signin-fips.{Region}.{PartitionResult#dnsSuffix}\", properties: n, headers: n }, type: e }], type: f }, { error: \"FIPS is enabled but this partition does not support FIPS\", type: d }], type: f }, { conditions: [p, m], rules: [{ conditions: [s], rules: [{ endpoint: { url: \"https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}\", properties: n, headers: n }, type: e }], type: f }, { error: \"DualStack is enabled but this partition does not support DualStack\", type: d }], type: f }, { endpoint: { url: \"https://signin.{Region}.{PartitionResult#dnsSuffix}\", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: \"Invalid Configuration: Missing Region\", type: d }], type: f }] };\nexports.ruleSet = _data;\n","'use strict';\n\nvar middlewareHostHeader = require('@aws-sdk/middleware-host-header');\nvar middlewareLogger = require('@aws-sdk/middleware-logger');\nvar middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');\nvar middlewareUserAgent = require('@aws-sdk/middleware-user-agent');\nvar configResolver = require('@smithy/config-resolver');\nvar core = require('@smithy/core');\nvar schema = require('@smithy/core/schema');\nvar middlewareContentLength = require('@smithy/middleware-content-length');\nvar middlewareEndpoint = require('@smithy/middleware-endpoint');\nvar middlewareRetry = require('@smithy/middleware-retry');\nvar smithyClient = require('@smithy/smithy-client');\nvar httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');\nvar runtimeConfig = require('./runtimeConfig');\nvar regionConfigResolver = require('@aws-sdk/region-config-resolver');\nvar protocolHttp = require('@smithy/protocol-http');\n\nconst resolveClientEndpointParameters = (options) => {\n return Object.assign(options, {\n useDualstackEndpoint: options.useDualstackEndpoint ?? false,\n useFipsEndpoint: options.useFipsEndpoint ?? false,\n defaultSigningName: \"signin\",\n });\n};\nconst commonParams = {\n UseFIPS: { type: \"builtInParams\", name: \"useFipsEndpoint\" },\n Endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n Region: { type: \"builtInParams\", name: \"region\" },\n UseDualStack: { type: \"builtInParams\", name: \"useDualstackEndpoint\" },\n};\n\nconst getHttpAuthExtensionConfiguration = (runtimeConfig) => {\n const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;\n let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;\n let _credentials = runtimeConfig.credentials;\n return {\n setHttpAuthScheme(httpAuthScheme) {\n const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n if (index === -1) {\n _httpAuthSchemes.push(httpAuthScheme);\n }\n else {\n _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n }\n },\n httpAuthSchemes() {\n return _httpAuthSchemes;\n },\n setHttpAuthSchemeProvider(httpAuthSchemeProvider) {\n _httpAuthSchemeProvider = httpAuthSchemeProvider;\n },\n httpAuthSchemeProvider() {\n return _httpAuthSchemeProvider;\n },\n setCredentials(credentials) {\n _credentials = credentials;\n },\n credentials() {\n return _credentials;\n },\n };\n};\nconst resolveHttpAuthRuntimeConfig = (config) => {\n return {\n httpAuthSchemes: config.httpAuthSchemes(),\n httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n credentials: config.credentials(),\n };\n};\n\nconst resolveRuntimeExtensions = (runtimeConfig, extensions) => {\n const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));\n extensions.forEach((extension) => extension.configure(extensionConfiguration));\n return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));\n};\n\nclass SigninClient extends smithyClient.Client {\n config;\n constructor(...[configuration]) {\n const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});\n super(_config_0);\n this.initConfig = _config_0;\n const _config_1 = resolveClientEndpointParameters(_config_0);\n const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);\n const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);\n const _config_4 = configResolver.resolveRegionConfig(_config_3);\n const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);\n const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);\n const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);\n const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);\n this.config = _config_8;\n this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));\n this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));\n this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));\n this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));\n this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));\n this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));\n this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));\n this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {\n httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSigninHttpAuthSchemeParametersProvider,\n identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({\n \"aws.auth#sigv4\": config.credentials,\n }),\n }));\n this.middlewareStack.use(core.getHttpSigningPlugin(this.config));\n }\n destroy() {\n super.destroy();\n }\n}\n\nlet SigninServiceException$1 = class SigninServiceException extends smithyClient.ServiceException {\n constructor(options) {\n super(options);\n Object.setPrototypeOf(this, SigninServiceException.prototype);\n }\n};\n\nlet AccessDeniedException$1 = class AccessDeniedException extends SigninServiceException$1 {\n name = \"AccessDeniedException\";\n $fault = \"client\";\n error;\n constructor(opts) {\n super({\n name: \"AccessDeniedException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, AccessDeniedException.prototype);\n this.error = opts.error;\n }\n};\nlet InternalServerException$1 = class InternalServerException extends SigninServiceException$1 {\n name = \"InternalServerException\";\n $fault = \"server\";\n error;\n constructor(opts) {\n super({\n name: \"InternalServerException\",\n $fault: \"server\",\n ...opts,\n });\n Object.setPrototypeOf(this, InternalServerException.prototype);\n this.error = opts.error;\n }\n};\nlet TooManyRequestsError$1 = class TooManyRequestsError extends SigninServiceException$1 {\n name = \"TooManyRequestsError\";\n $fault = \"client\";\n error;\n constructor(opts) {\n super({\n name: \"TooManyRequestsError\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, TooManyRequestsError.prototype);\n this.error = opts.error;\n }\n};\nlet ValidationException$1 = class ValidationException extends SigninServiceException$1 {\n name = \"ValidationException\";\n $fault = \"client\";\n error;\n constructor(opts) {\n super({\n name: \"ValidationException\",\n $fault: \"client\",\n ...opts,\n });\n Object.setPrototypeOf(this, ValidationException.prototype);\n this.error = opts.error;\n }\n};\n\nconst _ADE = \"AccessDeniedException\";\nconst _AT = \"AccessToken\";\nconst _COAT = \"CreateOAuth2Token\";\nconst _COATR = \"CreateOAuth2TokenRequest\";\nconst _COATRB = \"CreateOAuth2TokenRequestBody\";\nconst _COATRBr = \"CreateOAuth2TokenResponseBody\";\nconst _COATRr = \"CreateOAuth2TokenResponse\";\nconst _ISE = \"InternalServerException\";\nconst _RT = \"RefreshToken\";\nconst _TMRE = \"TooManyRequestsError\";\nconst _VE = \"ValidationException\";\nconst _aKI = \"accessKeyId\";\nconst _aT = \"accessToken\";\nconst _c = \"client\";\nconst _cI = \"clientId\";\nconst _cV = \"codeVerifier\";\nconst _co = \"code\";\nconst _e = \"error\";\nconst _eI = \"expiresIn\";\nconst _gT = \"grantType\";\nconst _h = \"http\";\nconst _hE = \"httpError\";\nconst _iT = \"idToken\";\nconst _jN = \"jsonName\";\nconst _m = \"message\";\nconst _rT = \"refreshToken\";\nconst _rU = \"redirectUri\";\nconst _s = \"server\";\nconst _sAK = \"secretAccessKey\";\nconst _sT = \"sessionToken\";\nconst _sm = \"smithy.ts.sdk.synthetic.com.amazonaws.signin\";\nconst _tI = \"tokenInput\";\nconst _tO = \"tokenOutput\";\nconst _tT = \"tokenType\";\nconst n0 = \"com.amazonaws.signin\";\nvar RefreshToken = [0, n0, _RT, 8, 0];\nvar AccessDeniedException = [\n -3,\n n0,\n _ADE,\n {\n [_e]: _c,\n },\n [_e, _m],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(AccessDeniedException, AccessDeniedException$1);\nvar AccessToken = [\n 3,\n n0,\n _AT,\n 8,\n [_aKI, _sAK, _sT],\n [\n [\n 0,\n {\n [_jN]: _aKI,\n },\n ],\n [\n 0,\n {\n [_jN]: _sAK,\n },\n ],\n [\n 0,\n {\n [_jN]: _sT,\n },\n ],\n ],\n];\nvar CreateOAuth2TokenRequest = [\n 3,\n n0,\n _COATR,\n 0,\n [_tI],\n [[() => CreateOAuth2TokenRequestBody, 16]],\n];\nvar CreateOAuth2TokenRequestBody = [\n 3,\n n0,\n _COATRB,\n 0,\n [_cI, _gT, _co, _rU, _cV, _rT],\n [\n [\n 0,\n {\n [_jN]: _cI,\n },\n ],\n [\n 0,\n {\n [_jN]: _gT,\n },\n ],\n 0,\n [\n 0,\n {\n [_jN]: _rU,\n },\n ],\n [\n 0,\n {\n [_jN]: _cV,\n },\n ],\n [\n () => RefreshToken,\n {\n [_jN]: _rT,\n },\n ],\n ],\n];\nvar CreateOAuth2TokenResponse = [\n 3,\n n0,\n _COATRr,\n 0,\n [_tO],\n [[() => CreateOAuth2TokenResponseBody, 16]],\n];\nvar CreateOAuth2TokenResponseBody = [\n 3,\n n0,\n _COATRBr,\n 0,\n [_aT, _tT, _eI, _rT, _iT],\n [\n [\n () => AccessToken,\n {\n [_jN]: _aT,\n },\n ],\n [\n 0,\n {\n [_jN]: _tT,\n },\n ],\n [\n 1,\n {\n [_jN]: _eI,\n },\n ],\n [\n () => RefreshToken,\n {\n [_jN]: _rT,\n },\n ],\n [\n 0,\n {\n [_jN]: _iT,\n },\n ],\n ],\n];\nvar InternalServerException = [\n -3,\n n0,\n _ISE,\n {\n [_e]: _s,\n [_hE]: 500,\n },\n [_e, _m],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(InternalServerException, InternalServerException$1);\nvar TooManyRequestsError = [\n -3,\n n0,\n _TMRE,\n {\n [_e]: _c,\n [_hE]: 429,\n },\n [_e, _m],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(TooManyRequestsError, TooManyRequestsError$1);\nvar ValidationException = [\n -3,\n n0,\n _VE,\n {\n [_e]: _c,\n [_hE]: 400,\n },\n [_e, _m],\n [0, 0],\n];\nschema.TypeRegistry.for(n0).registerError(ValidationException, ValidationException$1);\nvar SigninServiceException = [-3, _sm, \"SigninServiceException\", 0, [], []];\nschema.TypeRegistry.for(_sm).registerError(SigninServiceException, SigninServiceException$1);\nvar CreateOAuth2Token = [\n 9,\n n0,\n _COAT,\n {\n [_h]: [\"POST\", \"/v1/token\", 200],\n },\n () => CreateOAuth2TokenRequest,\n () => CreateOAuth2TokenResponse,\n];\n\nclass CreateOAuth2TokenCommand extends smithyClient.Command\n .classBuilder()\n .ep(commonParams)\n .m(function (Command, cs, config, o) {\n return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n})\n .s(\"Signin\", \"CreateOAuth2Token\", {})\n .n(\"SigninClient\", \"CreateOAuth2TokenCommand\")\n .sc(CreateOAuth2Token)\n .build() {\n}\n\nconst commands = {\n CreateOAuth2TokenCommand,\n};\nclass Signin extends SigninClient {\n}\nsmithyClient.createAggregatedClient(commands, Signin);\n\nconst OAuth2ErrorCode = {\n AUTHCODE_EXPIRED: \"AUTHCODE_EXPIRED\",\n INSUFFICIENT_PERMISSIONS: \"INSUFFICIENT_PERMISSIONS\",\n INVALID_REQUEST: \"INVALID_REQUEST\",\n SERVER_ERROR: \"server_error\",\n TOKEN_EXPIRED: \"TOKEN_EXPIRED\",\n USER_CREDENTIALS_CHANGED: \"USER_CREDENTIALS_CHANGED\",\n};\n\nObject.defineProperty(exports, \"$Command\", {\n enumerable: true,\n get: function () { return smithyClient.Command; }\n});\nObject.defineProperty(exports, \"__Client\", {\n enumerable: true,\n get: function () { return smithyClient.Client; }\n});\nexports.AccessDeniedException = AccessDeniedException$1;\nexports.CreateOAuth2TokenCommand = CreateOAuth2TokenCommand;\nexports.InternalServerException = InternalServerException$1;\nexports.OAuth2ErrorCode = OAuth2ErrorCode;\nexports.Signin = Signin;\nexports.SigninClient = SigninClient;\nexports.SigninServiceException = SigninServiceException$1;\nexports.TooManyRequestsError = TooManyRequestsError$1;\nexports.ValidationException = ValidationException$1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst tslib_1 = require(\"tslib\");\nconst package_json_1 = tslib_1.__importDefault(require(\"../../../package.json\"));\nconst core_1 = require(\"@aws-sdk/core\");\nconst util_user_agent_node_1 = require(\"@aws-sdk/util-user-agent-node\");\nconst config_resolver_1 = require(\"@smithy/config-resolver\");\nconst hash_node_1 = require(\"@smithy/hash-node\");\nconst middleware_retry_1 = require(\"@smithy/middleware-retry\");\nconst node_config_provider_1 = require(\"@smithy/node-config-provider\");\nconst node_http_handler_1 = require(\"@smithy/node-http-handler\");\nconst util_body_length_node_1 = require(\"@smithy/util-body-length-node\");\nconst util_retry_1 = require(\"@smithy/util-retry\");\nconst runtimeConfig_shared_1 = require(\"./runtimeConfig.shared\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst util_defaults_mode_node_1 = require(\"@smithy/util-defaults-mode-node\");\nconst smithy_client_2 = require(\"@smithy/smithy-client\");\nconst getRuntimeConfig = (config) => {\n (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);\n const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);\n const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);\n const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);\n (0, core_1.emitWarningIfUnsupportedVersion)(process.version);\n const loaderConfig = {\n profile: config?.profile,\n logger: clientSharedValues.logger,\n };\n return {\n ...clientSharedValues,\n ...config,\n runtime: \"node\",\n defaultsMode,\n authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),\n bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,\n defaultUserAgentProvider: config?.defaultUserAgentProvider ??\n (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),\n maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),\n region: config?.region ??\n (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),\n requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),\n retryMode: config?.retryMode ??\n (0, node_config_provider_1.loadConfig)({\n ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,\n default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,\n }, config),\n sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, \"sha256\"),\n streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,\n useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),\n userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRuntimeConfig = void 0;\nconst core_1 = require(\"@aws-sdk/core\");\nconst protocols_1 = require(\"@aws-sdk/core/protocols\");\nconst core_2 = require(\"@smithy/core\");\nconst smithy_client_1 = require(\"@smithy/smithy-client\");\nconst url_parser_1 = require(\"@smithy/url-parser\");\nconst util_base64_1 = require(\"@smithy/util-base64\");\nconst util_utf8_1 = require(\"@smithy/util-utf8\");\nconst httpAuthSchemeProvider_1 = require(\"./auth/httpAuthSchemeProvider\");\nconst endpointResolver_1 = require(\"./endpoint/endpointResolver\");\nconst getRuntimeConfig = (config) => {\n return {\n apiVersion: \"2023-01-01\",\n base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,\n base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,\n disableHostPrefix: config?.disableHostPrefix ?? false,\n endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,\n extensions: config?.extensions ?? [],\n httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSigninHttpAuthSchemeProvider,\n httpAuthSchemes: config?.httpAuthSchemes ?? [\n {\n schemeId: \"aws.auth#sigv4\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"aws.auth#sigv4\"),\n signer: new core_1.AwsSdkSigV4Signer(),\n },\n {\n schemeId: \"smithy.api#noAuth\",\n identityProvider: (ipc) => ipc.getIdentityProvider(\"smithy.api#noAuth\") || (async () => ({})),\n signer: new core_2.NoAuthSigner(),\n },\n ],\n logger: config?.logger ?? new smithy_client_1.NoOpLogger(),\n protocol: config?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: \"com.amazonaws.signin\" }),\n serviceId: config?.serviceId ?? \"Signin\",\n urlParser: config?.urlParser ?? url_parser_1.parseUrl,\n utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,\n utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,\n };\n};\nexports.getRuntimeConfig = getRuntimeConfig;\n"],"names":[],"sourceRoot":""}
@@ -0,0 +1,533 @@
1
+ export const id = 869;
2
+ export const ids = [869];
3
+ export const modules = {
4
+
5
+ /***/ 75869:
6
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7
+
8
+
9
+
10
+ var sharedIniFileLoader = __webpack_require__(94964);
11
+ var propertyProvider = __webpack_require__(71238);
12
+ var client = __webpack_require__(5152);
13
+ var credentialProviderLogin = __webpack_require__(84072);
14
+
15
+ const resolveCredentialSource = (credentialSource, profileName, logger) => {
16
+ const sourceProvidersMap = {
17
+ EcsContainer: async (options) => {
18
+ const { fromHttp } = await __webpack_require__.e(/* import() */ 605).then(__webpack_require__.bind(__webpack_require__, 98605));
19
+ const { fromContainerMetadata } = await __webpack_require__.e(/* import() */ 566).then(__webpack_require__.t.bind(__webpack_require__, 40566, 19));
20
+ logger?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer");
21
+ return async () => propertyProvider.chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);
22
+ },
23
+ Ec2InstanceMetadata: async (options) => {
24
+ logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");
25
+ const { fromInstanceMetadata } = await __webpack_require__.e(/* import() */ 566).then(__webpack_require__.t.bind(__webpack_require__, 40566, 19));
26
+ return async () => fromInstanceMetadata(options)().then(setNamedProvider);
27
+ },
28
+ Environment: async (options) => {
29
+ logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
30
+ const { fromEnv } = await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 55606, 19));
31
+ return async () => fromEnv(options)().then(setNamedProvider);
32
+ },
33
+ };
34
+ if (credentialSource in sourceProvidersMap) {
35
+ return sourceProvidersMap[credentialSource];
36
+ }
37
+ else {
38
+ throw new propertyProvider.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, ` +
39
+ `expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger });
40
+ }
41
+ };
42
+ const setNamedProvider = (creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_NAMED_PROVIDER", "p");
43
+
44
+ const isAssumeRoleProfile = (arg, { profile = "default", logger } = {}) => {
45
+ return (Boolean(arg) &&
46
+ typeof arg === "object" &&
47
+ typeof arg.role_arn === "string" &&
48
+ ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 &&
49
+ ["undefined", "string"].indexOf(typeof arg.external_id) > -1 &&
50
+ ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 &&
51
+ (isAssumeRoleWithSourceProfile(arg, { profile, logger }) || isCredentialSourceProfile(arg, { profile, logger })));
52
+ };
53
+ const isAssumeRoleWithSourceProfile = (arg, { profile, logger }) => {
54
+ const withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined";
55
+ if (withSourceProfile) {
56
+ logger?.debug?.(` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`);
57
+ }
58
+ return withSourceProfile;
59
+ };
60
+ const isCredentialSourceProfile = (arg, { profile, logger }) => {
61
+ const withProviderProfile = typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined";
62
+ if (withProviderProfile) {
63
+ logger?.debug?.(` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`);
64
+ }
65
+ return withProviderProfile;
66
+ };
67
+ const resolveAssumeRoleCredentials = async (profileName, profiles, options, visitedProfiles = {}, resolveProfileData) => {
68
+ options.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");
69
+ const profileData = profiles[profileName];
70
+ const { source_profile, region } = profileData;
71
+ if (!options.roleAssumer) {
72
+ const { getDefaultRoleAssumer } = await __webpack_require__.e(/* import() */ 136).then(__webpack_require__.t.bind(__webpack_require__, 1136, 23));
73
+ options.roleAssumer = getDefaultRoleAssumer({
74
+ ...options.clientConfig,
75
+ credentialProviderLogger: options.logger,
76
+ parentClientConfig: {
77
+ ...options?.parentClientConfig,
78
+ region: region ?? options?.parentClientConfig?.region,
79
+ },
80
+ }, options.clientPlugins);
81
+ }
82
+ if (source_profile && source_profile in visitedProfiles) {
83
+ throw new propertyProvider.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile` +
84
+ ` ${sharedIniFileLoader.getProfileName(options)}. Profiles visited: ` +
85
+ Object.keys(visitedProfiles).join(", "), { logger: options.logger });
86
+ }
87
+ options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`);
88
+ const sourceCredsProvider = source_profile
89
+ ? resolveProfileData(source_profile, profiles, options, {
90
+ ...visitedProfiles,
91
+ [source_profile]: true,
92
+ }, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {}))
93
+ : (await resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options))();
94
+ if (isCredentialSourceWithoutRoleArn(profileData)) {
95
+ return sourceCredsProvider.then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o"));
96
+ }
97
+ else {
98
+ const params = {
99
+ RoleArn: profileData.role_arn,
100
+ RoleSessionName: profileData.role_session_name || `aws-sdk-js-${Date.now()}`,
101
+ ExternalId: profileData.external_id,
102
+ DurationSeconds: parseInt(profileData.duration_seconds || "3600", 10),
103
+ };
104
+ const { mfa_serial } = profileData;
105
+ if (mfa_serial) {
106
+ if (!options.mfaCodeProvider) {
107
+ throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, { logger: options.logger, tryNextLink: false });
108
+ }
109
+ params.SerialNumber = mfa_serial;
110
+ params.TokenCode = await options.mfaCodeProvider(mfa_serial);
111
+ }
112
+ const sourceCreds = await sourceCredsProvider;
113
+ return options.roleAssumer(sourceCreds, params).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o"));
114
+ }
115
+ };
116
+ const isCredentialSourceWithoutRoleArn = (section) => {
117
+ return !section.role_arn && !!section.credential_source;
118
+ };
119
+
120
+ const isLoginProfile = (data) => {
121
+ return Boolean(data && data.login_session);
122
+ };
123
+ const resolveLoginCredentials = async (profileName, options) => {
124
+ const credentials = await credentialProviderLogin.fromLoginCredentials({
125
+ ...options,
126
+ profile: profileName,
127
+ })();
128
+ return client.setCredentialFeature(credentials, "CREDENTIALS_PROFILE_LOGIN", "AC");
129
+ };
130
+
131
+ const isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string";
132
+ const resolveProcessCredentials = async (options, profile) => __webpack_require__.e(/* import() */ 360).then(__webpack_require__.t.bind(__webpack_require__, 75360, 19)).then(({ fromProcess }) => fromProcess({
133
+ ...options,
134
+ profile,
135
+ })().then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_PROCESS", "v")));
136
+
137
+ const resolveSsoCredentials = async (profile, profileData, options = {}) => {
138
+ const { fromSSO } = await __webpack_require__.e(/* import() */ 998).then(__webpack_require__.t.bind(__webpack_require__, 60998, 19));
139
+ return fromSSO({
140
+ profile,
141
+ logger: options.logger,
142
+ parentClientConfig: options.parentClientConfig,
143
+ clientConfig: options.clientConfig,
144
+ })().then((creds) => {
145
+ if (profileData.sso_session) {
146
+ return client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO", "r");
147
+ }
148
+ else {
149
+ return client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO_LEGACY", "t");
150
+ }
151
+ });
152
+ };
153
+ const isSsoProfile = (arg) => arg &&
154
+ (typeof arg.sso_start_url === "string" ||
155
+ typeof arg.sso_account_id === "string" ||
156
+ typeof arg.sso_session === "string" ||
157
+ typeof arg.sso_region === "string" ||
158
+ typeof arg.sso_role_name === "string");
159
+
160
+ const isStaticCredsProfile = (arg) => Boolean(arg) &&
161
+ typeof arg === "object" &&
162
+ typeof arg.aws_access_key_id === "string" &&
163
+ typeof arg.aws_secret_access_key === "string" &&
164
+ ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1 &&
165
+ ["undefined", "string"].indexOf(typeof arg.aws_account_id) > -1;
166
+ const resolveStaticCredentials = async (profile, options) => {
167
+ options?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");
168
+ const credentials = {
169
+ accessKeyId: profile.aws_access_key_id,
170
+ secretAccessKey: profile.aws_secret_access_key,
171
+ sessionToken: profile.aws_session_token,
172
+ ...(profile.aws_credential_scope && { credentialScope: profile.aws_credential_scope }),
173
+ ...(profile.aws_account_id && { accountId: profile.aws_account_id }),
174
+ };
175
+ return client.setCredentialFeature(credentials, "CREDENTIALS_PROFILE", "n");
176
+ };
177
+
178
+ const isWebIdentityProfile = (arg) => Boolean(arg) &&
179
+ typeof arg === "object" &&
180
+ typeof arg.web_identity_token_file === "string" &&
181
+ typeof arg.role_arn === "string" &&
182
+ ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1;
183
+ const resolveWebIdentityCredentials = async (profile, options) => __webpack_require__.e(/* import() */ 956).then(__webpack_require__.t.bind(__webpack_require__, 29956, 23)).then(({ fromTokenFile }) => fromTokenFile({
184
+ webIdentityTokenFile: profile.web_identity_token_file,
185
+ roleArn: profile.role_arn,
186
+ roleSessionName: profile.role_session_name,
187
+ roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,
188
+ logger: options.logger,
189
+ parentClientConfig: options.parentClientConfig,
190
+ })().then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN", "q")));
191
+
192
+ const resolveProfileData = async (profileName, profiles, options, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => {
193
+ const data = profiles[profileName];
194
+ if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) {
195
+ return resolveStaticCredentials(data, options);
196
+ }
197
+ if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, { profile: profileName, logger: options.logger })) {
198
+ return resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles, resolveProfileData);
199
+ }
200
+ if (isStaticCredsProfile(data)) {
201
+ return resolveStaticCredentials(data, options);
202
+ }
203
+ if (isWebIdentityProfile(data)) {
204
+ return resolveWebIdentityCredentials(data, options);
205
+ }
206
+ if (isProcessProfile(data)) {
207
+ return resolveProcessCredentials(options, profileName);
208
+ }
209
+ if (isSsoProfile(data)) {
210
+ return await resolveSsoCredentials(profileName, data, options);
211
+ }
212
+ if (isLoginProfile(data)) {
213
+ return resolveLoginCredentials(profileName, options);
214
+ }
215
+ throw new propertyProvider.CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger });
216
+ };
217
+
218
+ const fromIni = (_init = {}) => async ({ callerClientConfig } = {}) => {
219
+ const init = {
220
+ ..._init,
221
+ parentClientConfig: {
222
+ ...callerClientConfig,
223
+ ..._init.parentClientConfig,
224
+ },
225
+ };
226
+ init.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");
227
+ const profiles = await sharedIniFileLoader.parseKnownFiles(init);
228
+ return resolveProfileData(sharedIniFileLoader.getProfileName({
229
+ profile: _init.profile ?? callerClientConfig?.profile,
230
+ }), profiles, init);
231
+ };
232
+
233
+ exports.fromIni = fromIni;
234
+
235
+
236
+ /***/ }),
237
+
238
+ /***/ 84072:
239
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
240
+
241
+
242
+
243
+ var client = __webpack_require__(5152);
244
+ var propertyProvider = __webpack_require__(71238);
245
+ var sharedIniFileLoader = __webpack_require__(94964);
246
+ var protocolHttp = __webpack_require__(72356);
247
+ var node_crypto = __webpack_require__(77598);
248
+ var node_fs = __webpack_require__(73024);
249
+ var node_os = __webpack_require__(48161);
250
+ var node_path = __webpack_require__(76760);
251
+
252
+ class LoginCredentialsFetcher {
253
+ profileData;
254
+ init;
255
+ callerClientConfig;
256
+ static REFRESH_THRESHOLD = 5 * 60 * 1000;
257
+ constructor(profileData, init, callerClientConfig) {
258
+ this.profileData = profileData;
259
+ this.init = init;
260
+ this.callerClientConfig = callerClientConfig;
261
+ }
262
+ async loadCredentials() {
263
+ const token = await this.loadToken();
264
+ if (!token) {
265
+ throw new propertyProvider.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`, { tryNextLink: false, logger: this.logger });
266
+ }
267
+ const accessToken = token.accessToken;
268
+ const now = Date.now();
269
+ const expiryTime = new Date(accessToken.expiresAt).getTime();
270
+ const timeUntilExpiry = expiryTime - now;
271
+ if (timeUntilExpiry <= LoginCredentialsFetcher.REFRESH_THRESHOLD) {
272
+ return this.refresh(token);
273
+ }
274
+ return {
275
+ accessKeyId: accessToken.accessKeyId,
276
+ secretAccessKey: accessToken.secretAccessKey,
277
+ sessionToken: accessToken.sessionToken,
278
+ accountId: accessToken.accountId,
279
+ expiration: new Date(accessToken.expiresAt),
280
+ };
281
+ }
282
+ get logger() {
283
+ return this.init?.logger;
284
+ }
285
+ get loginSession() {
286
+ return this.profileData.login_session;
287
+ }
288
+ async refresh(token) {
289
+ const { SigninClient, CreateOAuth2TokenCommand } = await __webpack_require__.e(/* import() */ 762).then(__webpack_require__.t.bind(__webpack_require__, 99762, 19));
290
+ const { logger, userAgentAppId } = this.callerClientConfig ?? {};
291
+ const isH2 = (requestHandler) => {
292
+ return requestHandler?.metadata?.handlerProtocol === "h2";
293
+ };
294
+ const requestHandler = isH2(this.callerClientConfig?.requestHandler)
295
+ ? undefined
296
+ : this.callerClientConfig?.requestHandler;
297
+ const region = this.profileData.region ?? (await this.callerClientConfig?.region?.()) ?? process.env.AWS_REGION;
298
+ const client = new SigninClient({
299
+ credentials: {
300
+ accessKeyId: "",
301
+ secretAccessKey: "",
302
+ },
303
+ region,
304
+ requestHandler,
305
+ logger,
306
+ userAgentAppId,
307
+ ...this.init?.clientConfig,
308
+ });
309
+ this.createDPoPInterceptor(client.middlewareStack);
310
+ const commandInput = {
311
+ tokenInput: {
312
+ clientId: token.clientId,
313
+ refreshToken: token.refreshToken,
314
+ grantType: "refresh_token",
315
+ },
316
+ };
317
+ try {
318
+ const response = await client.send(new CreateOAuth2TokenCommand(commandInput));
319
+ const { accessKeyId, secretAccessKey, sessionToken } = response.tokenOutput?.accessToken ?? {};
320
+ const { refreshToken, expiresIn } = response.tokenOutput ?? {};
321
+ if (!accessKeyId || !secretAccessKey || !sessionToken || !refreshToken) {
322
+ throw new propertyProvider.CredentialsProviderError("Token refresh response missing required fields", {
323
+ logger: this.logger,
324
+ tryNextLink: false,
325
+ });
326
+ }
327
+ const expiresInMs = (expiresIn ?? 900) * 1000;
328
+ const expiration = new Date(Date.now() + expiresInMs);
329
+ const updatedToken = {
330
+ ...token,
331
+ accessToken: {
332
+ ...token.accessToken,
333
+ accessKeyId: accessKeyId,
334
+ secretAccessKey: secretAccessKey,
335
+ sessionToken: sessionToken,
336
+ expiresAt: expiration.toISOString(),
337
+ },
338
+ refreshToken: refreshToken,
339
+ };
340
+ await this.saveToken(updatedToken);
341
+ const newAccessToken = updatedToken.accessToken;
342
+ return {
343
+ accessKeyId: newAccessToken.accessKeyId,
344
+ secretAccessKey: newAccessToken.secretAccessKey,
345
+ sessionToken: newAccessToken.sessionToken,
346
+ accountId: newAccessToken.accountId,
347
+ expiration,
348
+ };
349
+ }
350
+ catch (error) {
351
+ if (error.name === "AccessDeniedException") {
352
+ const errorType = error.error;
353
+ let message;
354
+ switch (errorType) {
355
+ case "TOKEN_EXPIRED":
356
+ message = "Your session has expired. Please reauthenticate.";
357
+ break;
358
+ case "USER_CREDENTIALS_CHANGED":
359
+ message =
360
+ "Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";
361
+ break;
362
+ case "INSUFFICIENT_PERMISSIONS":
363
+ message =
364
+ "Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";
365
+ break;
366
+ default:
367
+ message = `Failed to refresh token: ${String(error)}. Please re-authenticate using \`aws login\``;
368
+ }
369
+ throw new propertyProvider.CredentialsProviderError(message, { logger: this.logger, tryNextLink: false });
370
+ }
371
+ throw new propertyProvider.CredentialsProviderError(`Failed to refresh token: ${String(error)}. Please re-authenticate using aws login`, { logger: this.logger });
372
+ }
373
+ }
374
+ async loadToken() {
375
+ const tokenFilePath = this.getTokenFilePath();
376
+ try {
377
+ let tokenData;
378
+ try {
379
+ tokenData = await sharedIniFileLoader.readFile(tokenFilePath, { ignoreCache: this.init?.ignoreCache });
380
+ }
381
+ catch {
382
+ tokenData = await node_fs.promises.readFile(tokenFilePath, "utf8");
383
+ }
384
+ const token = JSON.parse(tokenData);
385
+ const missingFields = ["accessToken", "clientId", "refreshToken", "dpopKey"].filter((k) => !token[k]);
386
+ if (!token.accessToken?.accountId) {
387
+ missingFields.push("accountId");
388
+ }
389
+ if (missingFields.length > 0) {
390
+ throw new propertyProvider.CredentialsProviderError(`Token validation failed, missing fields: ${missingFields.join(", ")}`, {
391
+ logger: this.logger,
392
+ tryNextLink: false,
393
+ });
394
+ }
395
+ return token;
396
+ }
397
+ catch (error) {
398
+ throw new propertyProvider.CredentialsProviderError(`Failed to load token from ${tokenFilePath}: ${String(error)}`, {
399
+ logger: this.logger,
400
+ tryNextLink: false,
401
+ });
402
+ }
403
+ }
404
+ async saveToken(token) {
405
+ const tokenFilePath = this.getTokenFilePath();
406
+ const directory = node_path.dirname(tokenFilePath);
407
+ try {
408
+ await node_fs.promises.mkdir(directory, { recursive: true });
409
+ }
410
+ catch (error) {
411
+ }
412
+ await node_fs.promises.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8");
413
+ }
414
+ getTokenFilePath() {
415
+ const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? node_path.join(node_os.homedir(), ".aws", "login", "cache");
416
+ const loginSessionBytes = Buffer.from(this.loginSession, "utf8");
417
+ const loginSessionSha256 = node_crypto.createHash("sha256").update(loginSessionBytes).digest("hex");
418
+ return node_path.join(directory, `${loginSessionSha256}.json`);
419
+ }
420
+ derToRawSignature(derSignature) {
421
+ let offset = 2;
422
+ if (derSignature[offset] !== 0x02) {
423
+ throw new Error("Invalid DER signature");
424
+ }
425
+ offset++;
426
+ const rLength = derSignature[offset++];
427
+ let r = derSignature.subarray(offset, offset + rLength);
428
+ offset += rLength;
429
+ if (derSignature[offset] !== 0x02) {
430
+ throw new Error("Invalid DER signature");
431
+ }
432
+ offset++;
433
+ const sLength = derSignature[offset++];
434
+ let s = derSignature.subarray(offset, offset + sLength);
435
+ r = r[0] === 0x00 ? r.subarray(1) : r;
436
+ s = s[0] === 0x00 ? s.subarray(1) : s;
437
+ const rPadded = Buffer.concat([Buffer.alloc(32 - r.length), r]);
438
+ const sPadded = Buffer.concat([Buffer.alloc(32 - s.length), s]);
439
+ return Buffer.concat([rPadded, sPadded]);
440
+ }
441
+ createDPoPInterceptor(middlewareStack) {
442
+ middlewareStack.add((next) => async (args) => {
443
+ if (protocolHttp.HttpRequest.isInstance(args.request)) {
444
+ const request = args.request;
445
+ const actualEndpoint = `${request.protocol}//${request.hostname}${request.port ? `:${request.port}` : ""}${request.path}`;
446
+ const dpop = await this.generateDpop(request.method, actualEndpoint);
447
+ request.headers = {
448
+ ...request.headers,
449
+ DPoP: dpop,
450
+ };
451
+ }
452
+ return next(args);
453
+ }, {
454
+ step: "finalizeRequest",
455
+ name: "dpopInterceptor",
456
+ override: true,
457
+ });
458
+ }
459
+ async generateDpop(method = "POST", endpoint) {
460
+ const token = await this.loadToken();
461
+ try {
462
+ const privateKey = node_crypto.createPrivateKey({
463
+ key: token.dpopKey,
464
+ format: "pem",
465
+ type: "sec1",
466
+ });
467
+ const publicKey = node_crypto.createPublicKey(privateKey);
468
+ const publicDer = publicKey.export({ format: "der", type: "spki" });
469
+ let pointStart = -1;
470
+ for (let i = 0; i < publicDer.length; i++) {
471
+ if (publicDer[i] === 0x04) {
472
+ pointStart = i;
473
+ break;
474
+ }
475
+ }
476
+ const x = publicDer.slice(pointStart + 1, pointStart + 33);
477
+ const y = publicDer.slice(pointStart + 33, pointStart + 65);
478
+ const header = {
479
+ alg: "ES256",
480
+ typ: "dpop+jwt",
481
+ jwk: {
482
+ kty: "EC",
483
+ crv: "P-256",
484
+ x: x.toString("base64url"),
485
+ y: y.toString("base64url"),
486
+ },
487
+ };
488
+ const payload = {
489
+ jti: crypto.randomUUID(),
490
+ htm: method,
491
+ htu: endpoint,
492
+ iat: Math.floor(Date.now() / 1000),
493
+ };
494
+ const headerB64 = Buffer.from(JSON.stringify(header)).toString("base64url");
495
+ const payloadB64 = Buffer.from(JSON.stringify(payload)).toString("base64url");
496
+ const message = `${headerB64}.${payloadB64}`;
497
+ const asn1Signature = node_crypto.sign("sha256", Buffer.from(message), privateKey);
498
+ const rawSignature = this.derToRawSignature(asn1Signature);
499
+ const signatureB64 = rawSignature.toString("base64url");
500
+ return `${message}.${signatureB64}`;
501
+ }
502
+ catch (error) {
503
+ throw new propertyProvider.CredentialsProviderError(`Failed to generate Dpop proof: ${error instanceof Error ? error.message : String(error)}`, { logger: this.logger, tryNextLink: false });
504
+ }
505
+ }
506
+ }
507
+
508
+ const fromLoginCredentials = (init) => async ({ callerClientConfig } = {}) => {
509
+ init?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");
510
+ const profiles = await sharedIniFileLoader.parseKnownFiles(init || {});
511
+ const profileName = sharedIniFileLoader.getProfileName({
512
+ profile: init?.profile ?? callerClientConfig?.profile,
513
+ });
514
+ const profile = profiles[profileName];
515
+ if (!profile?.login_session) {
516
+ throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} does not contain login_session.`, {
517
+ tryNextLink: true,
518
+ logger: init?.logger,
519
+ });
520
+ }
521
+ const fetcher = new LoginCredentialsFetcher(profile, init, callerClientConfig);
522
+ const credentials = await fetcher.loadCredentials();
523
+ return client.setCredentialFeature(credentials, "CREDENTIALS_LOGIN", "AD");
524
+ };
525
+
526
+ exports.fromLoginCredentials = fromLoginCredentials;
527
+
528
+
529
+ /***/ })
530
+
531
+ };
532
+
533
+ //# sourceMappingURL=869.index.js.map