@depup/aws-sdk__client-sso-oidc 3.1010.0-depup.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.
- package/LICENSE +201 -0
- package/README.md +39 -0
- package/changes.json +42 -0
- package/dist-cjs/auth/httpAuthSchemeProvider.js +69 -0
- package/dist-cjs/endpoint/endpointResolver.js +18 -0
- package/dist-cjs/endpoint/ruleset.js +7 -0
- package/dist-cjs/index.js +214 -0
- package/dist-cjs/models/SSOOIDCServiceException.js +12 -0
- package/dist-cjs/models/errors.js +250 -0
- package/dist-cjs/runtimeConfig.browser.js +38 -0
- package/dist-cjs/runtimeConfig.js +53 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +49 -0
- package/dist-cjs/schemas/schemas_0.js +246 -0
- package/dist-es/SSOOIDC.js +15 -0
- package/dist-es/SSOOIDCClient.js +50 -0
- package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/auth/httpAuthSchemeProvider.js +63 -0
- package/dist-es/commands/CreateTokenCommand.js +16 -0
- package/dist-es/commands/CreateTokenWithIAMCommand.js +16 -0
- package/dist-es/commands/RegisterClientCommand.js +16 -0
- package/dist-es/commands/StartDeviceAuthorizationCommand.js +16 -0
- package/dist-es/commands/index.js +4 -0
- package/dist-es/endpoint/EndpointParameters.js +13 -0
- package/dist-es/endpoint/endpointResolver.js +14 -0
- package/dist-es/endpoint/ruleset.js +4 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +8 -0
- package/dist-es/models/SSOOIDCServiceException.js +8 -0
- package/dist-es/models/enums.js +9 -0
- package/dist-es/models/errors.js +233 -0
- package/dist-es/models/models_0.js +1 -0
- package/dist-es/runtimeConfig.browser.js +33 -0
- package/dist-es/runtimeConfig.js +48 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +45 -0
- package/dist-es/runtimeExtensions.js +9 -0
- package/dist-es/schemas/schemas_0.js +243 -0
- package/dist-types/SSOOIDC.d.ts +76 -0
- package/dist-types/SSOOIDCClient.d.ts +229 -0
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +75 -0
- package/dist-types/commands/CreateTokenCommand.d.ts +176 -0
- package/dist-types/commands/CreateTokenWithIAMCommand.d.ts +272 -0
- package/dist-types/commands/RegisterClientCommand.d.ts +151 -0
- package/dist-types/commands/StartDeviceAuthorizationCommand.d.ts +125 -0
- package/dist-types/commands/index.d.ts +4 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +50 -0
- package/dist-types/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/endpoint/ruleset.d.ts +2 -0
- package/dist-types/extensionConfiguration.d.ts +9 -0
- package/dist-types/index.d.ts +54 -0
- package/dist-types/models/SSOOIDCServiceException.d.ts +14 -0
- package/dist-types/models/enums.d.ts +25 -0
- package/dist-types/models/errors.d.ts +364 -0
- package/dist-types/models/models_0.d.ts +436 -0
- package/dist-types/runtimeConfig.browser.d.ts +63 -0
- package/dist-types/runtimeConfig.d.ts +63 -0
- package/dist-types/runtimeConfig.native.d.ts +62 -0
- package/dist-types/runtimeConfig.shared.d.ts +38 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/schemas/schemas_0.d.ts +36 -0
- package/dist-types/ts3.4/SSOOIDC.d.ts +73 -0
- package/dist-types/ts3.4/SSOOIDCClient.d.ts +143 -0
- package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +47 -0
- package/dist-types/ts3.4/commands/CreateTokenCommand.d.ts +47 -0
- package/dist-types/ts3.4/commands/CreateTokenWithIAMCommand.d.ts +51 -0
- package/dist-types/ts3.4/commands/RegisterClientCommand.d.ts +50 -0
- package/dist-types/ts3.4/commands/StartDeviceAuthorizationCommand.d.ts +51 -0
- package/dist-types/ts3.4/commands/index.d.ts +4 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +51 -0
- package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/extensionConfiguration.d.ts +9 -0
- package/dist-types/ts3.4/index.d.ts +11 -0
- package/dist-types/ts3.4/models/SSOOIDCServiceException.d.ts +9 -0
- package/dist-types/ts3.4/models/enums.d.ts +13 -0
- package/dist-types/ts3.4/models/errors.d.ts +134 -0
- package/dist-types/ts3.4/models/models_0.d.ts +74 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +125 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +120 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +129 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +58 -0
- package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
- package/dist-types/ts3.4/schemas/schemas_0.d.ts +35 -0
- package/package.json +159 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
|
|
2
|
+
import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
|
|
3
|
+
import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
|
|
4
|
+
import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
|
|
5
|
+
import { resolveRegionConfig } from "@smithy/config-resolver";
|
|
6
|
+
import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
|
|
7
|
+
import { getSchemaSerdePlugin } from "@smithy/core/schema";
|
|
8
|
+
import { getContentLengthPlugin } from "@smithy/middleware-content-length";
|
|
9
|
+
import { resolveEndpointConfig, } from "@smithy/middleware-endpoint";
|
|
10
|
+
import { getRetryPlugin, resolveRetryConfig, } from "@smithy/middleware-retry";
|
|
11
|
+
import { Client as __Client, } from "@smithy/smithy-client";
|
|
12
|
+
import { defaultSSOOIDCHttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
|
|
13
|
+
import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
|
|
14
|
+
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
|
|
15
|
+
import { resolveRuntimeExtensions } from "./runtimeExtensions";
|
|
16
|
+
export { __Client };
|
|
17
|
+
export class SSOOIDCClient extends __Client {
|
|
18
|
+
config;
|
|
19
|
+
constructor(...[configuration]) {
|
|
20
|
+
const _config_0 = __getRuntimeConfig(configuration || {});
|
|
21
|
+
super(_config_0);
|
|
22
|
+
this.initConfig = _config_0;
|
|
23
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
24
|
+
const _config_2 = resolveUserAgentConfig(_config_1);
|
|
25
|
+
const _config_3 = resolveRetryConfig(_config_2);
|
|
26
|
+
const _config_4 = resolveRegionConfig(_config_3);
|
|
27
|
+
const _config_5 = resolveHostHeaderConfig(_config_4);
|
|
28
|
+
const _config_6 = resolveEndpointConfig(_config_5);
|
|
29
|
+
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
|
|
30
|
+
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
31
|
+
this.config = _config_8;
|
|
32
|
+
this.middlewareStack.use(getSchemaSerdePlugin(this.config));
|
|
33
|
+
this.middlewareStack.use(getUserAgentPlugin(this.config));
|
|
34
|
+
this.middlewareStack.use(getRetryPlugin(this.config));
|
|
35
|
+
this.middlewareStack.use(getContentLengthPlugin(this.config));
|
|
36
|
+
this.middlewareStack.use(getHostHeaderPlugin(this.config));
|
|
37
|
+
this.middlewareStack.use(getLoggerPlugin(this.config));
|
|
38
|
+
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
|
|
39
|
+
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
40
|
+
httpAuthSchemeParametersProvider: defaultSSOOIDCHttpAuthSchemeParametersProvider,
|
|
41
|
+
identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
|
|
42
|
+
"aws.auth#sigv4": config.credentials,
|
|
43
|
+
}),
|
|
44
|
+
}));
|
|
45
|
+
this.middlewareStack.use(getHttpSigningPlugin(this.config));
|
|
46
|
+
}
|
|
47
|
+
destroy() {
|
|
48
|
+
super.destroy();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
2
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
3
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
4
|
+
let _credentials = runtimeConfig.credentials;
|
|
5
|
+
return {
|
|
6
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
7
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
8
|
+
if (index === -1) {
|
|
9
|
+
_httpAuthSchemes.push(httpAuthScheme);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
httpAuthSchemes() {
|
|
16
|
+
return _httpAuthSchemes;
|
|
17
|
+
},
|
|
18
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
19
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
20
|
+
},
|
|
21
|
+
httpAuthSchemeProvider() {
|
|
22
|
+
return _httpAuthSchemeProvider;
|
|
23
|
+
},
|
|
24
|
+
setCredentials(credentials) {
|
|
25
|
+
_credentials = credentials;
|
|
26
|
+
},
|
|
27
|
+
credentials() {
|
|
28
|
+
return _credentials;
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export const resolveHttpAuthRuntimeConfig = (config) => {
|
|
33
|
+
return {
|
|
34
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
35
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
36
|
+
credentials: config.credentials(),
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { resolveAwsSdkSigV4Config, } from "@aws-sdk/core";
|
|
2
|
+
import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";
|
|
3
|
+
export const defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
4
|
+
return {
|
|
5
|
+
operation: getSmithyContext(context).operation,
|
|
6
|
+
region: await normalizeProvider(config.region)() || (() => {
|
|
7
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
8
|
+
})(),
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
12
|
+
return {
|
|
13
|
+
schemeId: "aws.auth#sigv4",
|
|
14
|
+
signingProperties: {
|
|
15
|
+
name: "sso-oauth",
|
|
16
|
+
region: authParameters.region,
|
|
17
|
+
},
|
|
18
|
+
propertiesExtractor: (config, context) => ({
|
|
19
|
+
signingProperties: {
|
|
20
|
+
config,
|
|
21
|
+
context,
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
|
|
27
|
+
return {
|
|
28
|
+
schemeId: "smithy.api#noAuth",
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export const defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => {
|
|
32
|
+
const options = [];
|
|
33
|
+
switch (authParameters.operation) {
|
|
34
|
+
case "CreateToken":
|
|
35
|
+
{
|
|
36
|
+
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
;
|
|
40
|
+
case "RegisterClient":
|
|
41
|
+
{
|
|
42
|
+
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
;
|
|
46
|
+
case "StartDeviceAuthorization":
|
|
47
|
+
{
|
|
48
|
+
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
;
|
|
52
|
+
default: {
|
|
53
|
+
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return options;
|
|
57
|
+
};
|
|
58
|
+
export const resolveHttpAuthSchemeConfig = (config) => {
|
|
59
|
+
const config_0 = resolveAwsSdkSigV4Config(config);
|
|
60
|
+
return Object.assign(config_0, {
|
|
61
|
+
authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
|
|
62
|
+
});
|
|
63
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
|
+
import { commonParams } from "../endpoint/EndpointParameters";
|
|
4
|
+
import { CreateToken$ } from "../schemas/schemas_0";
|
|
5
|
+
export { $Command };
|
|
6
|
+
export class CreateTokenCommand extends $Command
|
|
7
|
+
.classBuilder()
|
|
8
|
+
.ep(commonParams)
|
|
9
|
+
.m(function (Command, cs, config, o) {
|
|
10
|
+
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
+
})
|
|
12
|
+
.s("AWSSSOOIDCService", "CreateToken", {})
|
|
13
|
+
.n("SSOOIDCClient", "CreateTokenCommand")
|
|
14
|
+
.sc(CreateToken$)
|
|
15
|
+
.build() {
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
|
+
import { commonParams } from "../endpoint/EndpointParameters";
|
|
4
|
+
import { CreateTokenWithIAM$ } from "../schemas/schemas_0";
|
|
5
|
+
export { $Command };
|
|
6
|
+
export class CreateTokenWithIAMCommand extends $Command
|
|
7
|
+
.classBuilder()
|
|
8
|
+
.ep(commonParams)
|
|
9
|
+
.m(function (Command, cs, config, o) {
|
|
10
|
+
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
+
})
|
|
12
|
+
.s("AWSSSOOIDCService", "CreateTokenWithIAM", {})
|
|
13
|
+
.n("SSOOIDCClient", "CreateTokenWithIAMCommand")
|
|
14
|
+
.sc(CreateTokenWithIAM$)
|
|
15
|
+
.build() {
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
|
+
import { commonParams } from "../endpoint/EndpointParameters";
|
|
4
|
+
import { RegisterClient$ } from "../schemas/schemas_0";
|
|
5
|
+
export { $Command };
|
|
6
|
+
export class RegisterClientCommand extends $Command
|
|
7
|
+
.classBuilder()
|
|
8
|
+
.ep(commonParams)
|
|
9
|
+
.m(function (Command, cs, config, o) {
|
|
10
|
+
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
+
})
|
|
12
|
+
.s("AWSSSOOIDCService", "RegisterClient", {})
|
|
13
|
+
.n("SSOOIDCClient", "RegisterClientCommand")
|
|
14
|
+
.sc(RegisterClient$)
|
|
15
|
+
.build() {
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
|
+
import { commonParams } from "../endpoint/EndpointParameters";
|
|
4
|
+
import { StartDeviceAuthorization$ } from "../schemas/schemas_0";
|
|
5
|
+
export { $Command };
|
|
6
|
+
export class StartDeviceAuthorizationCommand extends $Command
|
|
7
|
+
.classBuilder()
|
|
8
|
+
.ep(commonParams)
|
|
9
|
+
.m(function (Command, cs, config, o) {
|
|
10
|
+
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
+
})
|
|
12
|
+
.s("AWSSSOOIDCService", "StartDeviceAuthorization", {})
|
|
13
|
+
.n("SSOOIDCClient", "StartDeviceAuthorizationCommand")
|
|
14
|
+
.sc(StartDeviceAuthorization$)
|
|
15
|
+
.build() {
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const resolveClientEndpointParameters = (options) => {
|
|
2
|
+
return Object.assign(options, {
|
|
3
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
4
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
5
|
+
defaultSigningName: "sso-oauth",
|
|
6
|
+
});
|
|
7
|
+
};
|
|
8
|
+
export const commonParams = {
|
|
9
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
10
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
11
|
+
Region: { type: "builtInParams", name: "region" },
|
|
12
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
13
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { awsEndpointFunctions } from "@aws-sdk/util-endpoints";
|
|
2
|
+
import { customEndpointFunctions, EndpointCache, resolveEndpoint } from "@smithy/util-endpoints";
|
|
3
|
+
import { ruleSet } from "./ruleset";
|
|
4
|
+
const cache = new EndpointCache({
|
|
5
|
+
size: 50,
|
|
6
|
+
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
|
|
7
|
+
});
|
|
8
|
+
export const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
9
|
+
return cache.get(endpointParams, () => resolveEndpoint(ruleSet, {
|
|
10
|
+
endpointParams: endpointParams,
|
|
11
|
+
logger: context.logger,
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const u = "required", v = "fn", w = "argv", x = "ref";
|
|
2
|
+
const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "getAttr", i = { [u]: false, "type": "string" }, j = { [u]: true, "default": false, "type": "boolean" }, k = { [x]: "Endpoint" }, l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] }, m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] }, n = {}, o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] }, p = { [x]: g }, q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] }, r = [l], s = [m], t = [{ [x]: "Region" }];
|
|
3
|
+
const _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: "https://oidc-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: r, rules: [{ conditions: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://oidc.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://oidc-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: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://oidc.{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://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
|
|
4
|
+
export const ruleSet = _data;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist-es/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./SSOOIDCClient";
|
|
2
|
+
export * from "./SSOOIDC";
|
|
3
|
+
export * from "./commands";
|
|
4
|
+
export * from "./schemas/schemas_0";
|
|
5
|
+
export * from "./models/enums";
|
|
6
|
+
export * from "./models/errors";
|
|
7
|
+
export * from "./models/models_0";
|
|
8
|
+
export { SSOOIDCServiceException } from "./models/SSOOIDCServiceException";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ServiceException as __ServiceException, } from "@smithy/smithy-client";
|
|
2
|
+
export { __ServiceException };
|
|
3
|
+
export class SSOOIDCServiceException extends __ServiceException {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
Object.setPrototypeOf(this, SSOOIDCServiceException.prototype);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const AccessDeniedExceptionReason = {
|
|
2
|
+
KMS_ACCESS_DENIED: "KMS_AccessDeniedException",
|
|
3
|
+
};
|
|
4
|
+
export const InvalidRequestExceptionReason = {
|
|
5
|
+
KMS_DISABLED_KEY: "KMS_DisabledException",
|
|
6
|
+
KMS_INVALID_KEY_USAGE: "KMS_InvalidKeyUsageException",
|
|
7
|
+
KMS_INVALID_STATE: "KMS_InvalidStateException",
|
|
8
|
+
KMS_KEY_NOT_FOUND: "KMS_NotFoundException",
|
|
9
|
+
};
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { SSOOIDCServiceException as __BaseException } from "./SSOOIDCServiceException";
|
|
2
|
+
export class AccessDeniedException extends __BaseException {
|
|
3
|
+
name = "AccessDeniedException";
|
|
4
|
+
$fault = "client";
|
|
5
|
+
error;
|
|
6
|
+
reason;
|
|
7
|
+
error_description;
|
|
8
|
+
constructor(opts) {
|
|
9
|
+
super({
|
|
10
|
+
name: "AccessDeniedException",
|
|
11
|
+
$fault: "client",
|
|
12
|
+
...opts,
|
|
13
|
+
});
|
|
14
|
+
Object.setPrototypeOf(this, AccessDeniedException.prototype);
|
|
15
|
+
this.error = opts.error;
|
|
16
|
+
this.reason = opts.reason;
|
|
17
|
+
this.error_description = opts.error_description;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export class AuthorizationPendingException extends __BaseException {
|
|
21
|
+
name = "AuthorizationPendingException";
|
|
22
|
+
$fault = "client";
|
|
23
|
+
error;
|
|
24
|
+
error_description;
|
|
25
|
+
constructor(opts) {
|
|
26
|
+
super({
|
|
27
|
+
name: "AuthorizationPendingException",
|
|
28
|
+
$fault: "client",
|
|
29
|
+
...opts,
|
|
30
|
+
});
|
|
31
|
+
Object.setPrototypeOf(this, AuthorizationPendingException.prototype);
|
|
32
|
+
this.error = opts.error;
|
|
33
|
+
this.error_description = opts.error_description;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export class ExpiredTokenException extends __BaseException {
|
|
37
|
+
name = "ExpiredTokenException";
|
|
38
|
+
$fault = "client";
|
|
39
|
+
error;
|
|
40
|
+
error_description;
|
|
41
|
+
constructor(opts) {
|
|
42
|
+
super({
|
|
43
|
+
name: "ExpiredTokenException",
|
|
44
|
+
$fault: "client",
|
|
45
|
+
...opts,
|
|
46
|
+
});
|
|
47
|
+
Object.setPrototypeOf(this, ExpiredTokenException.prototype);
|
|
48
|
+
this.error = opts.error;
|
|
49
|
+
this.error_description = opts.error_description;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export class InternalServerException extends __BaseException {
|
|
53
|
+
name = "InternalServerException";
|
|
54
|
+
$fault = "server";
|
|
55
|
+
error;
|
|
56
|
+
error_description;
|
|
57
|
+
constructor(opts) {
|
|
58
|
+
super({
|
|
59
|
+
name: "InternalServerException",
|
|
60
|
+
$fault: "server",
|
|
61
|
+
...opts,
|
|
62
|
+
});
|
|
63
|
+
Object.setPrototypeOf(this, InternalServerException.prototype);
|
|
64
|
+
this.error = opts.error;
|
|
65
|
+
this.error_description = opts.error_description;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export class InvalidClientException extends __BaseException {
|
|
69
|
+
name = "InvalidClientException";
|
|
70
|
+
$fault = "client";
|
|
71
|
+
error;
|
|
72
|
+
error_description;
|
|
73
|
+
constructor(opts) {
|
|
74
|
+
super({
|
|
75
|
+
name: "InvalidClientException",
|
|
76
|
+
$fault: "client",
|
|
77
|
+
...opts,
|
|
78
|
+
});
|
|
79
|
+
Object.setPrototypeOf(this, InvalidClientException.prototype);
|
|
80
|
+
this.error = opts.error;
|
|
81
|
+
this.error_description = opts.error_description;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export class InvalidGrantException extends __BaseException {
|
|
85
|
+
name = "InvalidGrantException";
|
|
86
|
+
$fault = "client";
|
|
87
|
+
error;
|
|
88
|
+
error_description;
|
|
89
|
+
constructor(opts) {
|
|
90
|
+
super({
|
|
91
|
+
name: "InvalidGrantException",
|
|
92
|
+
$fault: "client",
|
|
93
|
+
...opts,
|
|
94
|
+
});
|
|
95
|
+
Object.setPrototypeOf(this, InvalidGrantException.prototype);
|
|
96
|
+
this.error = opts.error;
|
|
97
|
+
this.error_description = opts.error_description;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export class InvalidRequestException extends __BaseException {
|
|
101
|
+
name = "InvalidRequestException";
|
|
102
|
+
$fault = "client";
|
|
103
|
+
error;
|
|
104
|
+
reason;
|
|
105
|
+
error_description;
|
|
106
|
+
constructor(opts) {
|
|
107
|
+
super({
|
|
108
|
+
name: "InvalidRequestException",
|
|
109
|
+
$fault: "client",
|
|
110
|
+
...opts,
|
|
111
|
+
});
|
|
112
|
+
Object.setPrototypeOf(this, InvalidRequestException.prototype);
|
|
113
|
+
this.error = opts.error;
|
|
114
|
+
this.reason = opts.reason;
|
|
115
|
+
this.error_description = opts.error_description;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
export class InvalidScopeException extends __BaseException {
|
|
119
|
+
name = "InvalidScopeException";
|
|
120
|
+
$fault = "client";
|
|
121
|
+
error;
|
|
122
|
+
error_description;
|
|
123
|
+
constructor(opts) {
|
|
124
|
+
super({
|
|
125
|
+
name: "InvalidScopeException",
|
|
126
|
+
$fault: "client",
|
|
127
|
+
...opts,
|
|
128
|
+
});
|
|
129
|
+
Object.setPrototypeOf(this, InvalidScopeException.prototype);
|
|
130
|
+
this.error = opts.error;
|
|
131
|
+
this.error_description = opts.error_description;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
export class SlowDownException extends __BaseException {
|
|
135
|
+
name = "SlowDownException";
|
|
136
|
+
$fault = "client";
|
|
137
|
+
error;
|
|
138
|
+
error_description;
|
|
139
|
+
constructor(opts) {
|
|
140
|
+
super({
|
|
141
|
+
name: "SlowDownException",
|
|
142
|
+
$fault: "client",
|
|
143
|
+
...opts,
|
|
144
|
+
});
|
|
145
|
+
Object.setPrototypeOf(this, SlowDownException.prototype);
|
|
146
|
+
this.error = opts.error;
|
|
147
|
+
this.error_description = opts.error_description;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
export class UnauthorizedClientException extends __BaseException {
|
|
151
|
+
name = "UnauthorizedClientException";
|
|
152
|
+
$fault = "client";
|
|
153
|
+
error;
|
|
154
|
+
error_description;
|
|
155
|
+
constructor(opts) {
|
|
156
|
+
super({
|
|
157
|
+
name: "UnauthorizedClientException",
|
|
158
|
+
$fault: "client",
|
|
159
|
+
...opts,
|
|
160
|
+
});
|
|
161
|
+
Object.setPrototypeOf(this, UnauthorizedClientException.prototype);
|
|
162
|
+
this.error = opts.error;
|
|
163
|
+
this.error_description = opts.error_description;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
export class UnsupportedGrantTypeException extends __BaseException {
|
|
167
|
+
name = "UnsupportedGrantTypeException";
|
|
168
|
+
$fault = "client";
|
|
169
|
+
error;
|
|
170
|
+
error_description;
|
|
171
|
+
constructor(opts) {
|
|
172
|
+
super({
|
|
173
|
+
name: "UnsupportedGrantTypeException",
|
|
174
|
+
$fault: "client",
|
|
175
|
+
...opts,
|
|
176
|
+
});
|
|
177
|
+
Object.setPrototypeOf(this, UnsupportedGrantTypeException.prototype);
|
|
178
|
+
this.error = opts.error;
|
|
179
|
+
this.error_description = opts.error_description;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
export class InvalidRequestRegionException extends __BaseException {
|
|
183
|
+
name = "InvalidRequestRegionException";
|
|
184
|
+
$fault = "client";
|
|
185
|
+
error;
|
|
186
|
+
error_description;
|
|
187
|
+
endpoint;
|
|
188
|
+
region;
|
|
189
|
+
constructor(opts) {
|
|
190
|
+
super({
|
|
191
|
+
name: "InvalidRequestRegionException",
|
|
192
|
+
$fault: "client",
|
|
193
|
+
...opts,
|
|
194
|
+
});
|
|
195
|
+
Object.setPrototypeOf(this, InvalidRequestRegionException.prototype);
|
|
196
|
+
this.error = opts.error;
|
|
197
|
+
this.error_description = opts.error_description;
|
|
198
|
+
this.endpoint = opts.endpoint;
|
|
199
|
+
this.region = opts.region;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
export class InvalidClientMetadataException extends __BaseException {
|
|
203
|
+
name = "InvalidClientMetadataException";
|
|
204
|
+
$fault = "client";
|
|
205
|
+
error;
|
|
206
|
+
error_description;
|
|
207
|
+
constructor(opts) {
|
|
208
|
+
super({
|
|
209
|
+
name: "InvalidClientMetadataException",
|
|
210
|
+
$fault: "client",
|
|
211
|
+
...opts,
|
|
212
|
+
});
|
|
213
|
+
Object.setPrototypeOf(this, InvalidClientMetadataException.prototype);
|
|
214
|
+
this.error = opts.error;
|
|
215
|
+
this.error_description = opts.error_description;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
export class InvalidRedirectUriException extends __BaseException {
|
|
219
|
+
name = "InvalidRedirectUriException";
|
|
220
|
+
$fault = "client";
|
|
221
|
+
error;
|
|
222
|
+
error_description;
|
|
223
|
+
constructor(opts) {
|
|
224
|
+
super({
|
|
225
|
+
name: "InvalidRedirectUriException",
|
|
226
|
+
$fault: "client",
|
|
227
|
+
...opts,
|
|
228
|
+
});
|
|
229
|
+
Object.setPrototypeOf(this, InvalidRedirectUriException.prototype);
|
|
230
|
+
this.error = opts.error;
|
|
231
|
+
this.error_description = opts.error_description;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
3
|
+
import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser";
|
|
4
|
+
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
|
|
5
|
+
import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
|
|
6
|
+
import { invalidProvider } from "@smithy/invalid-dependency";
|
|
7
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
8
|
+
import { calculateBodyLength } from "@smithy/util-body-length-browser";
|
|
9
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
|
|
10
|
+
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
11
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
12
|
+
export const getRuntimeConfig = (config) => {
|
|
13
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
14
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
15
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
16
|
+
return {
|
|
17
|
+
...clientSharedValues,
|
|
18
|
+
...config,
|
|
19
|
+
runtime: "browser",
|
|
20
|
+
defaultsMode,
|
|
21
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
22
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
23
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
24
|
+
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
25
|
+
region: config?.region ?? invalidProvider("Region is missing"),
|
|
26
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
27
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
28
|
+
sha256: config?.sha256 ?? Sha256,
|
|
29
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
30
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
31
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { emitWarningIfUnsupportedVersion as awsCheckVersion, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS } from "@aws-sdk/core";
|
|
3
|
+
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
|
|
4
|
+
import { createDefaultUserAgentProvider, NODE_APP_ID_CONFIG_OPTIONS } from "@aws-sdk/util-user-agent-node";
|
|
5
|
+
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver";
|
|
6
|
+
import { Hash } from "@smithy/hash-node";
|
|
7
|
+
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
|
|
8
|
+
import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
|
|
9
|
+
import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
|
|
10
|
+
import { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
11
|
+
import { calculateBodyLength } from "@smithy/util-body-length-node";
|
|
12
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
|
|
13
|
+
import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
14
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
15
|
+
export const getRuntimeConfig = (config) => {
|
|
16
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
17
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
18
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
19
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
20
|
+
awsCheckVersion(process.version);
|
|
21
|
+
const loaderConfig = {
|
|
22
|
+
profile: config?.profile,
|
|
23
|
+
logger: clientSharedValues.logger,
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
...clientSharedValues,
|
|
27
|
+
...config,
|
|
28
|
+
runtime: "node",
|
|
29
|
+
defaultsMode,
|
|
30
|
+
authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
31
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
32
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
|
|
33
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
34
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
35
|
+
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
36
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
37
|
+
retryMode: config?.retryMode ??
|
|
38
|
+
loadNodeConfig({
|
|
39
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
40
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
41
|
+
}, config),
|
|
42
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
43
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
44
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
45
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
46
|
+
userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
2
|
+
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
3
|
+
export const getRuntimeConfig = (config) => {
|
|
4
|
+
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
5
|
+
return {
|
|
6
|
+
...browserDefaults,
|
|
7
|
+
...config,
|
|
8
|
+
runtime: "react-native",
|
|
9
|
+
sha256: config?.sha256 ?? Sha256,
|
|
10
|
+
};
|
|
11
|
+
};
|