Initial
This commit is contained in:
43
resources/app/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthExtensionConfiguration.js
generated
vendored
Normal file
43
resources/app/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthExtensionConfiguration.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.resolveHttpAuthRuntimeConfig = exports.getHttpAuthExtensionConfiguration = void 0;
|
||||
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
||||
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
||||
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
||||
let _credentials = runtimeConfig.credentials;
|
||||
return {
|
||||
setHttpAuthScheme(httpAuthScheme) {
|
||||
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
||||
if (index === -1) {
|
||||
_httpAuthSchemes.push(httpAuthScheme);
|
||||
}
|
||||
else {
|
||||
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
||||
}
|
||||
},
|
||||
httpAuthSchemes() {
|
||||
return _httpAuthSchemes;
|
||||
},
|
||||
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
||||
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
||||
},
|
||||
httpAuthSchemeProvider() {
|
||||
return _httpAuthSchemeProvider;
|
||||
},
|
||||
setCredentials(credentials) {
|
||||
_credentials = credentials;
|
||||
},
|
||||
credentials() {
|
||||
return _credentials;
|
||||
},
|
||||
};
|
||||
};
|
||||
exports.getHttpAuthExtensionConfiguration = getHttpAuthExtensionConfiguration;
|
||||
const resolveHttpAuthRuntimeConfig = (config) => {
|
||||
return {
|
||||
httpAuthSchemes: config.httpAuthSchemes(),
|
||||
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
||||
credentials: config.credentials(),
|
||||
};
|
||||
};
|
||||
exports.resolveHttpAuthRuntimeConfig = resolveHttpAuthRuntimeConfig;
|
||||
67
resources/app/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js
generated
vendored
Normal file
67
resources/app/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.resolveHttpAuthSchemeConfig = exports.resolveStsAuthConfig = exports.defaultSTSHttpAuthSchemeProvider = exports.defaultSTSHttpAuthSchemeParametersProvider = void 0;
|
||||
const core_1 = require("@aws-sdk/core");
|
||||
const util_middleware_1 = require("@smithy/util-middleware");
|
||||
const STSClient_1 = require("../STSClient");
|
||||
const defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
||||
return {
|
||||
operation: (0, util_middleware_1.getSmithyContext)(context).operation,
|
||||
region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
|
||||
(() => {
|
||||
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
||||
})(),
|
||||
};
|
||||
};
|
||||
exports.defaultSTSHttpAuthSchemeParametersProvider = defaultSTSHttpAuthSchemeParametersProvider;
|
||||
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
||||
return {
|
||||
schemeId: "aws.auth#sigv4",
|
||||
signingProperties: {
|
||||
name: "sts",
|
||||
region: authParameters.region,
|
||||
},
|
||||
propertiesExtractor: (config, context) => ({
|
||||
signingProperties: {
|
||||
config,
|
||||
context,
|
||||
},
|
||||
}),
|
||||
};
|
||||
}
|
||||
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
|
||||
return {
|
||||
schemeId: "smithy.api#noAuth",
|
||||
};
|
||||
}
|
||||
const defaultSTSHttpAuthSchemeProvider = (authParameters) => {
|
||||
const options = [];
|
||||
switch (authParameters.operation) {
|
||||
case "AssumeRoleWithSAML": {
|
||||
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
||||
break;
|
||||
}
|
||||
case "AssumeRoleWithWebIdentity": {
|
||||
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
||||
}
|
||||
}
|
||||
return options;
|
||||
};
|
||||
exports.defaultSTSHttpAuthSchemeProvider = defaultSTSHttpAuthSchemeProvider;
|
||||
const resolveStsAuthConfig = (input) => ({
|
||||
...input,
|
||||
stsClientCtor: STSClient_1.STSClient,
|
||||
});
|
||||
exports.resolveStsAuthConfig = resolveStsAuthConfig;
|
||||
const resolveHttpAuthSchemeConfig = (config) => {
|
||||
const config_0 = (0, exports.resolveStsAuthConfig)(config);
|
||||
const config_1 = (0, core_1.resolveAwsSdkSigV4Config)(config_0);
|
||||
return {
|
||||
...config_1,
|
||||
};
|
||||
};
|
||||
exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
|
||||
Reference in New Issue
Block a user