@aws-sdk/client-eventbridge 3.622.0 → 3.624.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/dist-cjs/auth/httpAuthSchemeProvider.js +126 -0
- package/dist-cjs/index.js +109 -56
- package/dist-cjs/runtimeConfig.shared.js +15 -0
- package/dist-es/EventBridgeClient.js +11 -3
- package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/auth/httpAuthSchemeProvider.js +122 -0
- package/dist-es/runtimeConfig.shared.js +15 -0
- package/dist-es/runtimeExtensions.js +3 -0
- package/dist-types/EventBridgeClient.d.ts +6 -6
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +69 -0
- package/dist-types/extensionConfiguration.d.ts +2 -1
- package/dist-types/runtimeConfig.browser.d.ts +4 -2
- package/dist-types/runtimeConfig.d.ts +3 -1
- package/dist-types/runtimeConfig.native.d.ts +4 -2
- package/dist-types/runtimeConfig.shared.d.ts +2 -0
- package/dist-types/ts3.4/EventBridgeClient.d.ts +8 -8
- 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/extensionConfiguration.d.ts +3 -1
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -4
- package/dist-types/ts3.4/runtimeConfig.d.ts +3 -3
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -4
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +2 -0
- package/package.json +8 -8
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const core_1 = require("@aws-sdk/core");
|
|
4
5
|
const signature_v4_multi_region_1 = require("@aws-sdk/signature-v4-multi-region");
|
|
5
6
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
7
|
const url_parser_1 = require("@smithy/url-parser");
|
|
7
8
|
const util_base64_1 = require("@smithy/util-base64");
|
|
8
9
|
const util_utf8_1 = require("@smithy/util-utf8");
|
|
10
|
+
const httpAuthSchemeProvider_1 = require("./auth/httpAuthSchemeProvider");
|
|
9
11
|
const endpointResolver_1 = require("./endpoint/endpointResolver");
|
|
10
12
|
const getRuntimeConfig = (config) => {
|
|
11
13
|
return {
|
|
@@ -15,6 +17,19 @@ const getRuntimeConfig = (config) => {
|
|
|
15
17
|
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
16
18
|
endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
|
|
17
19
|
extensions: config?.extensions ?? [],
|
|
20
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultEventBridgeHttpAuthSchemeProvider,
|
|
21
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
22
|
+
{
|
|
23
|
+
schemeId: "aws.auth#sigv4",
|
|
24
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
25
|
+
signer: new core_1.AwsSdkSigV4Signer(),
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
schemeId: "aws.auth#sigv4a",
|
|
29
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
|
|
30
|
+
signer: new core_1.AwsSdkSigV4ASigner(),
|
|
31
|
+
},
|
|
32
|
+
],
|
|
18
33
|
logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
|
|
19
34
|
serviceId: config?.serviceId ?? "EventBridge",
|
|
20
35
|
signerConstructor: config?.signerConstructor ?? signature_v4_multi_region_1.SignatureV4MultiRegion,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
|
|
2
2
|
import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
|
|
3
3
|
import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
|
|
4
|
-
import { getAwsAuthPlugin, resolveAwsAuthConfig, } from "@aws-sdk/middleware-signing";
|
|
5
4
|
import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
|
|
6
5
|
import { resolveRegionConfig } from "@smithy/config-resolver";
|
|
6
|
+
import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
|
|
7
7
|
import { getContentLengthPlugin } from "@smithy/middleware-content-length";
|
|
8
8
|
import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
|
|
9
9
|
import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
|
|
10
10
|
import { Client as __Client, } from "@smithy/smithy-client";
|
|
11
|
+
import { defaultEventBridgeHttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
|
|
11
12
|
import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
|
|
12
13
|
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
|
|
13
14
|
import { resolveRuntimeExtensions } from "./runtimeExtensions";
|
|
@@ -21,7 +22,7 @@ export class EventBridgeClient extends __Client {
|
|
|
21
22
|
const _config_4 = resolveRegionConfig(_config_3);
|
|
22
23
|
const _config_5 = resolveHostHeaderConfig(_config_4);
|
|
23
24
|
const _config_6 = resolveEndpointConfig(_config_5);
|
|
24
|
-
const _config_7 =
|
|
25
|
+
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
|
|
25
26
|
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
26
27
|
super(_config_8);
|
|
27
28
|
this.config = _config_8;
|
|
@@ -31,7 +32,14 @@ export class EventBridgeClient extends __Client {
|
|
|
31
32
|
this.middlewareStack.use(getHostHeaderPlugin(this.config));
|
|
32
33
|
this.middlewareStack.use(getLoggerPlugin(this.config));
|
|
33
34
|
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
|
|
34
|
-
this.middlewareStack.use(
|
|
35
|
+
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
36
|
+
httpAuthSchemeParametersProvider: defaultEventBridgeHttpAuthSchemeParametersProvider,
|
|
37
|
+
identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
|
|
38
|
+
"aws.auth#sigv4": config.credentials,
|
|
39
|
+
"aws.auth#sigv4a": config.credentials,
|
|
40
|
+
}),
|
|
41
|
+
}));
|
|
42
|
+
this.middlewareStack.use(getHttpSigningPlugin(this.config));
|
|
35
43
|
}
|
|
36
44
|
destroy() {
|
|
37
45
|
super.destroy();
|
|
@@ -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,122 @@
|
|
|
1
|
+
import { resolveAwsSdkSigV4Config, } from "@aws-sdk/core";
|
|
2
|
+
import { signatureV4CrtContainer } from "@aws-sdk/signature-v4-multi-region";
|
|
3
|
+
import { resolveParams } from "@smithy/middleware-endpoint";
|
|
4
|
+
import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";
|
|
5
|
+
import { defaultEndpointResolver } from "../endpoint/endpointResolver";
|
|
6
|
+
const createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
|
|
7
|
+
if (!input) {
|
|
8
|
+
throw new Error(`Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\``);
|
|
9
|
+
}
|
|
10
|
+
const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
|
|
11
|
+
const instructionsFn = getSmithyContext(context)?.commandInstance?.constructor
|
|
12
|
+
?.getEndpointParameterInstructions;
|
|
13
|
+
if (!instructionsFn) {
|
|
14
|
+
throw new Error(`getEndpointParameterInstructions() is not defined on \`${context.commandName}\``);
|
|
15
|
+
}
|
|
16
|
+
const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config);
|
|
17
|
+
return Object.assign(defaultParameters, endpointParameters);
|
|
18
|
+
};
|
|
19
|
+
const _defaultEventBridgeHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
20
|
+
return {
|
|
21
|
+
operation: getSmithyContext(context).operation,
|
|
22
|
+
region: (await normalizeProvider(config.region)()) ||
|
|
23
|
+
(() => {
|
|
24
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
25
|
+
})(),
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export const defaultEventBridgeHttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultEventBridgeHttpAuthSchemeParametersProvider);
|
|
29
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
30
|
+
return {
|
|
31
|
+
schemeId: "aws.auth#sigv4",
|
|
32
|
+
signingProperties: {
|
|
33
|
+
name: "events",
|
|
34
|
+
region: authParameters.region,
|
|
35
|
+
},
|
|
36
|
+
propertiesExtractor: (config, context) => ({
|
|
37
|
+
signingProperties: {
|
|
38
|
+
config,
|
|
39
|
+
context,
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function createAwsAuthSigv4aHttpAuthOption(authParameters) {
|
|
45
|
+
return {
|
|
46
|
+
schemeId: "aws.auth#sigv4a",
|
|
47
|
+
signingProperties: {
|
|
48
|
+
name: "events",
|
|
49
|
+
region: authParameters.region,
|
|
50
|
+
},
|
|
51
|
+
propertiesExtractor: (config, context) => ({
|
|
52
|
+
signingProperties: {
|
|
53
|
+
config,
|
|
54
|
+
context,
|
|
55
|
+
},
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
|
|
60
|
+
const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
|
|
61
|
+
const endpoint = defaultEndpointResolver(authParameters);
|
|
62
|
+
const authSchemes = endpoint.properties?.authSchemes;
|
|
63
|
+
if (!authSchemes) {
|
|
64
|
+
return defaultHttpAuthSchemeResolver(authParameters);
|
|
65
|
+
}
|
|
66
|
+
const options = [];
|
|
67
|
+
for (const scheme of authSchemes) {
|
|
68
|
+
const { name: resolvedName, properties = {}, ...rest } = scheme;
|
|
69
|
+
const name = resolvedName.toLowerCase();
|
|
70
|
+
if (resolvedName !== name) {
|
|
71
|
+
console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${resolvedName}\` to \`${name}\``);
|
|
72
|
+
}
|
|
73
|
+
let schemeId;
|
|
74
|
+
if (name === "sigv4a") {
|
|
75
|
+
schemeId = "aws.auth#sigv4a";
|
|
76
|
+
const sigv4Present = authSchemes.find((s) => {
|
|
77
|
+
const name = s.name.toLowerCase();
|
|
78
|
+
return name !== "sigv4a" && name.startsWith("sigv4");
|
|
79
|
+
});
|
|
80
|
+
if (!signatureV4CrtContainer.CrtSignerV4 && sigv4Present) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else if (name.startsWith("sigv4")) {
|
|
85
|
+
schemeId = "aws.auth#sigv4";
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${name}\``);
|
|
89
|
+
}
|
|
90
|
+
const createOption = createHttpAuthOptionFunctions[schemeId];
|
|
91
|
+
if (!createOption) {
|
|
92
|
+
throw new Error(`Could not find HttpAuthOption create function for \`${schemeId}\``);
|
|
93
|
+
}
|
|
94
|
+
const option = createOption(authParameters);
|
|
95
|
+
option.schemeId = schemeId;
|
|
96
|
+
option.signingProperties = { ...(option.signingProperties || {}), ...rest, ...properties };
|
|
97
|
+
options.push(option);
|
|
98
|
+
}
|
|
99
|
+
return options;
|
|
100
|
+
};
|
|
101
|
+
return endpointRuleSetHttpAuthSchemeProvider;
|
|
102
|
+
};
|
|
103
|
+
const _defaultEventBridgeHttpAuthSchemeProvider = (authParameters) => {
|
|
104
|
+
const options = [];
|
|
105
|
+
switch (authParameters.operation) {
|
|
106
|
+
default: {
|
|
107
|
+
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
108
|
+
options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return options;
|
|
112
|
+
};
|
|
113
|
+
export const defaultEventBridgeHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultEventBridgeHttpAuthSchemeProvider, {
|
|
114
|
+
"aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
|
|
115
|
+
"aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
|
|
116
|
+
});
|
|
117
|
+
export const resolveHttpAuthSchemeConfig = (config) => {
|
|
118
|
+
const config_0 = resolveAwsSdkSigV4Config(config);
|
|
119
|
+
return {
|
|
120
|
+
...config_0,
|
|
121
|
+
};
|
|
122
|
+
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { AwsSdkSigV4ASigner, AwsSdkSigV4Signer } from "@aws-sdk/core";
|
|
1
2
|
import { SignatureV4MultiRegion } from "@aws-sdk/signature-v4-multi-region";
|
|
2
3
|
import { NoOpLogger } from "@smithy/smithy-client";
|
|
3
4
|
import { parseUrl } from "@smithy/url-parser";
|
|
4
5
|
import { fromBase64, toBase64 } from "@smithy/util-base64";
|
|
5
6
|
import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
|
|
7
|
+
import { defaultEventBridgeHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider";
|
|
6
8
|
import { defaultEndpointResolver } from "./endpoint/endpointResolver";
|
|
7
9
|
export const getRuntimeConfig = (config) => {
|
|
8
10
|
return {
|
|
@@ -12,6 +14,19 @@ export const getRuntimeConfig = (config) => {
|
|
|
12
14
|
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
13
15
|
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
14
16
|
extensions: config?.extensions ?? [],
|
|
17
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultEventBridgeHttpAuthSchemeProvider,
|
|
18
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
19
|
+
{
|
|
20
|
+
schemeId: "aws.auth#sigv4",
|
|
21
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
22
|
+
signer: new AwsSdkSigV4Signer(),
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
schemeId: "aws.auth#sigv4a",
|
|
26
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
|
|
27
|
+
signer: new AwsSdkSigV4ASigner(),
|
|
28
|
+
},
|
|
29
|
+
],
|
|
15
30
|
logger: config?.logger ?? new NoOpLogger(),
|
|
16
31
|
serviceId: config?.serviceId ?? "EventBridge",
|
|
17
32
|
signerConstructor: config?.signerConstructor ?? SignatureV4MultiRegion,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
|
|
2
2
|
import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
|
|
3
3
|
import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
|
|
4
|
+
import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration";
|
|
4
5
|
const asPartial = (t) => t;
|
|
5
6
|
export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
6
7
|
const extensionConfiguration = {
|
|
7
8
|
...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
|
|
8
9
|
...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
|
|
9
10
|
...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
|
|
11
|
+
...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
|
|
10
12
|
};
|
|
11
13
|
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
12
14
|
return {
|
|
@@ -14,5 +16,6 @@ export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
|
14
16
|
...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
|
|
15
17
|
...resolveDefaultRuntimeConfig(extensionConfiguration),
|
|
16
18
|
...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
|
|
19
|
+
...resolveHttpAuthRuntimeConfig(extensionConfiguration),
|
|
17
20
|
};
|
|
18
21
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header";
|
|
2
|
-
import { AwsAuthInputConfig, AwsAuthResolvedConfig } from "@aws-sdk/middleware-signing";
|
|
3
2
|
import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
|
|
4
|
-
import { Credentials as __Credentials } from "@aws-sdk/types";
|
|
5
3
|
import { RegionInputConfig, RegionResolvedConfig } from "@smithy/config-resolver";
|
|
6
4
|
import { EndpointInputConfig, EndpointResolvedConfig } from "@smithy/middleware-endpoint";
|
|
7
5
|
import { RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
|
|
8
6
|
import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http";
|
|
9
7
|
import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
|
|
10
|
-
import { BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
|
|
8
|
+
import { AwsCredentialIdentityProvider, BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
|
|
9
|
+
import { HttpAuthSchemeInputConfig, HttpAuthSchemeResolvedConfig } from "./auth/httpAuthSchemeProvider";
|
|
11
10
|
import { ActivateEventSourceCommandInput, ActivateEventSourceCommandOutput } from "./commands/ActivateEventSourceCommand";
|
|
12
11
|
import { CancelReplayCommandInput, CancelReplayCommandOutput } from "./commands/CancelReplayCommand";
|
|
13
12
|
import { CreateApiDestinationCommandInput, CreateApiDestinationCommandOutput } from "./commands/CreateApiDestinationCommand";
|
|
@@ -159,9 +158,10 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
|
|
|
159
158
|
defaultUserAgentProvider?: Provider<__UserAgent>;
|
|
160
159
|
/**
|
|
161
160
|
* Default credentials provider; Not available in browser runtime.
|
|
161
|
+
* @deprecated
|
|
162
162
|
* @internal
|
|
163
163
|
*/
|
|
164
|
-
credentialDefaultProvider?: (input: any) =>
|
|
164
|
+
credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider;
|
|
165
165
|
/**
|
|
166
166
|
* Value for how many times a request will be made at most in case of retry.
|
|
167
167
|
*/
|
|
@@ -188,7 +188,7 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
|
|
|
188
188
|
/**
|
|
189
189
|
* @public
|
|
190
190
|
*/
|
|
191
|
-
export type EventBridgeClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & UserAgentInputConfig & RetryInputConfig & RegionInputConfig & HostHeaderInputConfig & EndpointInputConfig<EndpointParameters> &
|
|
191
|
+
export type EventBridgeClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & UserAgentInputConfig & RetryInputConfig & RegionInputConfig & HostHeaderInputConfig & EndpointInputConfig<EndpointParameters> & HttpAuthSchemeInputConfig & ClientInputEndpointParameters;
|
|
192
192
|
/**
|
|
193
193
|
* @public
|
|
194
194
|
*
|
|
@@ -199,7 +199,7 @@ export interface EventBridgeClientConfig extends EventBridgeClientConfigType {
|
|
|
199
199
|
/**
|
|
200
200
|
* @public
|
|
201
201
|
*/
|
|
202
|
-
export type EventBridgeClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & UserAgentResolvedConfig & RetryResolvedConfig & RegionResolvedConfig & HostHeaderResolvedConfig & EndpointResolvedConfig<EndpointParameters> &
|
|
202
|
+
export type EventBridgeClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & UserAgentResolvedConfig & RetryResolvedConfig & RegionResolvedConfig & HostHeaderResolvedConfig & EndpointResolvedConfig<EndpointParameters> & HttpAuthSchemeResolvedConfig & ClientResolvedEndpointParameters;
|
|
203
203
|
/**
|
|
204
204
|
* @public
|
|
205
205
|
*
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types";
|
|
2
|
+
import { EventBridgeHttpAuthSchemeProvider } from "./httpAuthSchemeProvider";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export interface HttpAuthExtensionConfiguration {
|
|
7
|
+
setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void;
|
|
8
|
+
httpAuthSchemes(): HttpAuthScheme[];
|
|
9
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider: EventBridgeHttpAuthSchemeProvider): void;
|
|
10
|
+
httpAuthSchemeProvider(): EventBridgeHttpAuthSchemeProvider;
|
|
11
|
+
setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void;
|
|
12
|
+
credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export type HttpAuthRuntimeConfig = Partial<{
|
|
18
|
+
httpAuthSchemes: HttpAuthScheme[];
|
|
19
|
+
httpAuthSchemeProvider: EventBridgeHttpAuthSchemeProvider;
|
|
20
|
+
credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare const getHttpAuthExtensionConfiguration: (runtimeConfig: HttpAuthRuntimeConfig) => HttpAuthExtensionConfiguration;
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare const resolveHttpAuthRuntimeConfig: (config: HttpAuthExtensionConfiguration) => HttpAuthRuntimeConfig;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { AwsSdkSigV4AuthInputConfig, AwsSdkSigV4AuthResolvedConfig, AwsSdkSigV4PreviouslyResolved } from "@aws-sdk/core";
|
|
2
|
+
import { HandlerExecutionContext, HttpAuthScheme, HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider, HttpAuthSchemeProvider } from "@smithy/types";
|
|
3
|
+
import { EndpointParameters } from "../endpoint/EndpointParameters";
|
|
4
|
+
import { EventBridgeClientResolvedConfig } from "../EventBridgeClient";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
interface _EventBridgeHttpAuthSchemeParameters extends HttpAuthSchemeParameters {
|
|
9
|
+
region?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export interface EventBridgeHttpAuthSchemeParameters extends _EventBridgeHttpAuthSchemeParameters, EndpointParameters {
|
|
15
|
+
region?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export interface EventBridgeHttpAuthSchemeParametersProvider extends HttpAuthSchemeParametersProvider<EventBridgeClientResolvedConfig, HandlerExecutionContext, EventBridgeHttpAuthSchemeParameters, object> {
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare const defaultEventBridgeHttpAuthSchemeParametersProvider: EventBridgeHttpAuthSchemeParametersProvider;
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export interface EventBridgeHttpAuthSchemeProvider extends HttpAuthSchemeProvider<EventBridgeHttpAuthSchemeParameters> {
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
export declare const defaultEventBridgeHttpAuthSchemeProvider: EventBridgeHttpAuthSchemeProvider;
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig {
|
|
39
|
+
/**
|
|
40
|
+
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
httpAuthSchemes?: HttpAuthScheme[];
|
|
44
|
+
/**
|
|
45
|
+
* Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
httpAuthSchemeProvider?: EventBridgeHttpAuthSchemeProvider;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig {
|
|
54
|
+
/**
|
|
55
|
+
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
readonly httpAuthSchemes: HttpAuthScheme[];
|
|
59
|
+
/**
|
|
60
|
+
* Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
readonly httpAuthSchemeProvider: EventBridgeHttpAuthSchemeProvider;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export declare const resolveHttpAuthSchemeConfig: <T>(config: T & HttpAuthSchemeInputConfig & AwsSdkSigV4PreviouslyResolved) => T & HttpAuthSchemeResolvedConfig;
|
|
69
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AwsRegionExtensionConfiguration } from "@aws-sdk/types";
|
|
2
2
|
import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http";
|
|
3
3
|
import { DefaultExtensionConfiguration } from "@smithy/types";
|
|
4
|
+
import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration";
|
|
4
5
|
/**
|
|
5
6
|
* @internal
|
|
6
7
|
*/
|
|
7
|
-
export interface EventBridgeExtensionConfiguration extends HttpHandlerExtensionConfiguration, DefaultExtensionConfiguration, AwsRegionExtensionConfiguration {
|
|
8
|
+
export interface EventBridgeExtensionConfiguration extends HttpHandlerExtensionConfiguration, DefaultExtensionConfiguration, AwsRegionExtensionConfiguration, HttpAuthExtensionConfiguration {
|
|
8
9
|
}
|
|
@@ -7,7 +7,7 @@ export declare const getRuntimeConfig: (config: EventBridgeClientConfig) => {
|
|
|
7
7
|
runtime: string;
|
|
8
8
|
defaultsMode: import("@smithy/types").Provider<import("@smithy/smithy-client").ResolvedDefaultsMode>;
|
|
9
9
|
bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
|
|
10
|
-
credentialDefaultProvider: (input: any) => import("@smithy/types").
|
|
10
|
+
credentialDefaultProvider: (input: any) => import("@smithy/types").AwsCredentialIdentityProvider;
|
|
11
11
|
defaultUserAgentProvider: import("@smithy/types").Provider<import("@smithy/types").UserAgent>;
|
|
12
12
|
maxAttempts: number | import("@smithy/types").Provider<number>;
|
|
13
13
|
region: string | import("@smithy/types").Provider<any>;
|
|
@@ -34,7 +34,9 @@ export declare const getRuntimeConfig: (config: EventBridgeClientConfig) => {
|
|
|
34
34
|
logger?: import("@smithy/types").Logger | undefined;
|
|
35
35
|
}) => import("@smithy/types").EndpointV2;
|
|
36
36
|
tls?: boolean | undefined;
|
|
37
|
-
|
|
37
|
+
httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
|
|
38
|
+
httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").EventBridgeHttpAuthSchemeProvider;
|
|
39
|
+
credentials?: import("@smithy/types").AwsCredentialIdentity | import("@smithy/types").AwsCredentialIdentityProvider | undefined;
|
|
38
40
|
signer?: import("@smithy/types").RequestSigner | ((authScheme?: import("@smithy/types").AuthScheme | undefined) => Promise<import("@smithy/types").RequestSigner>) | undefined;
|
|
39
41
|
signingEscapePath?: boolean | undefined;
|
|
40
42
|
systemClockOffset?: number | undefined;
|
|
@@ -34,7 +34,9 @@ export declare const getRuntimeConfig: (config: EventBridgeClientConfig) => {
|
|
|
34
34
|
logger?: import("@smithy/types").Logger | undefined;
|
|
35
35
|
}) => import("@smithy/types").EndpointV2;
|
|
36
36
|
tls?: boolean | undefined;
|
|
37
|
-
|
|
37
|
+
httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
|
|
38
|
+
httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").EventBridgeHttpAuthSchemeProvider;
|
|
39
|
+
credentials?: import("@smithy/types").AwsCredentialIdentity | import("@smithy/types").AwsCredentialIdentityProvider | undefined;
|
|
38
40
|
signer?: import("@smithy/types").RequestSigner | ((authScheme?: import("@smithy/types").AuthScheme | undefined) => Promise<import("@smithy/types").RequestSigner>) | undefined;
|
|
39
41
|
signingEscapePath?: boolean | undefined;
|
|
40
42
|
systemClockOffset?: number | undefined;
|
|
@@ -20,7 +20,7 @@ export declare const getRuntimeConfig: (config: EventBridgeClientConfig) => {
|
|
|
20
20
|
useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
|
|
21
21
|
region: string | import("@smithy/types").Provider<any>;
|
|
22
22
|
defaultUserAgentProvider: import("@smithy/types").Provider<import("@smithy/types").UserAgent>;
|
|
23
|
-
credentialDefaultProvider: (input: any) => import("@smithy/types").
|
|
23
|
+
credentialDefaultProvider: (input: any) => import("@smithy/types").AwsCredentialIdentityProvider;
|
|
24
24
|
maxAttempts: number | import("@smithy/types").Provider<number>;
|
|
25
25
|
retryMode: string | import("@smithy/types").Provider<string>;
|
|
26
26
|
logger: import("@smithy/types").Logger;
|
|
@@ -33,7 +33,9 @@ export declare const getRuntimeConfig: (config: EventBridgeClientConfig) => {
|
|
|
33
33
|
logger?: import("@smithy/types").Logger | undefined;
|
|
34
34
|
}) => import("@smithy/types").EndpointV2;
|
|
35
35
|
tls?: boolean | undefined;
|
|
36
|
-
|
|
36
|
+
httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
|
|
37
|
+
httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").EventBridgeHttpAuthSchemeProvider;
|
|
38
|
+
credentials?: import("@smithy/types").AwsCredentialIdentity | import("@smithy/types").AwsCredentialIdentityProvider | undefined;
|
|
37
39
|
signer?: import("@smithy/types").RequestSigner | ((authScheme?: import("@smithy/types").AuthScheme | undefined) => Promise<import("@smithy/types").RequestSigner>) | undefined;
|
|
38
40
|
signingEscapePath?: boolean | undefined;
|
|
39
41
|
systemClockOffset?: number | undefined;
|
|
@@ -12,6 +12,8 @@ export declare const getRuntimeConfig: (config: EventBridgeClientConfig) => {
|
|
|
12
12
|
logger?: import("@smithy/types").Logger | undefined;
|
|
13
13
|
}) => import("@smithy/types").EndpointV2;
|
|
14
14
|
extensions: import("./runtimeExtensions").RuntimeExtension[];
|
|
15
|
+
httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").EventBridgeHttpAuthSchemeProvider;
|
|
16
|
+
httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
|
|
15
17
|
logger: import("@smithy/types").Logger;
|
|
16
18
|
serviceId: string;
|
|
17
19
|
signerConstructor: (new (options: import("@smithy/signature-v4").SignatureV4Init & import("@smithy/signature-v4").SignatureV4CryptoInit) => import("@smithy/types").RequestSigner) | typeof SignatureV4MultiRegion;
|
|
@@ -2,15 +2,10 @@ import {
|
|
|
2
2
|
HostHeaderInputConfig,
|
|
3
3
|
HostHeaderResolvedConfig,
|
|
4
4
|
} from "@aws-sdk/middleware-host-header";
|
|
5
|
-
import {
|
|
6
|
-
AwsAuthInputConfig,
|
|
7
|
-
AwsAuthResolvedConfig,
|
|
8
|
-
} from "@aws-sdk/middleware-signing";
|
|
9
5
|
import {
|
|
10
6
|
UserAgentInputConfig,
|
|
11
7
|
UserAgentResolvedConfig,
|
|
12
8
|
} from "@aws-sdk/middleware-user-agent";
|
|
13
|
-
import { Credentials as __Credentials } from "@aws-sdk/types";
|
|
14
9
|
import {
|
|
15
10
|
RegionInputConfig,
|
|
16
11
|
RegionResolvedConfig,
|
|
@@ -31,6 +26,7 @@ import {
|
|
|
31
26
|
SmithyResolvedConfiguration as __SmithyResolvedConfiguration,
|
|
32
27
|
} from "@smithy/smithy-client";
|
|
33
28
|
import {
|
|
29
|
+
AwsCredentialIdentityProvider,
|
|
34
30
|
BodyLengthCalculator as __BodyLengthCalculator,
|
|
35
31
|
CheckOptionalClientConfig as __CheckOptionalClientConfig,
|
|
36
32
|
ChecksumConstructor as __ChecksumConstructor,
|
|
@@ -45,6 +41,10 @@ import {
|
|
|
45
41
|
UrlParser as __UrlParser,
|
|
46
42
|
UserAgent as __UserAgent,
|
|
47
43
|
} from "@smithy/types";
|
|
44
|
+
import {
|
|
45
|
+
HttpAuthSchemeInputConfig,
|
|
46
|
+
HttpAuthSchemeResolvedConfig,
|
|
47
|
+
} from "./auth/httpAuthSchemeProvider";
|
|
48
48
|
import {
|
|
49
49
|
ActivateEventSourceCommandInput,
|
|
50
50
|
ActivateEventSourceCommandOutput,
|
|
@@ -414,7 +414,7 @@ export interface ClientDefaults
|
|
|
414
414
|
useFipsEndpoint?: boolean | __Provider<boolean>;
|
|
415
415
|
region?: string | __Provider<string>;
|
|
416
416
|
defaultUserAgentProvider?: Provider<__UserAgent>;
|
|
417
|
-
credentialDefaultProvider?: (input: any) =>
|
|
417
|
+
credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider;
|
|
418
418
|
maxAttempts?: number | __Provider<number>;
|
|
419
419
|
retryMode?: string | __Provider<string>;
|
|
420
420
|
logger?: __Logger;
|
|
@@ -430,7 +430,7 @@ export type EventBridgeClientConfigType = Partial<
|
|
|
430
430
|
RegionInputConfig &
|
|
431
431
|
HostHeaderInputConfig &
|
|
432
432
|
EndpointInputConfig<EndpointParameters> &
|
|
433
|
-
|
|
433
|
+
HttpAuthSchemeInputConfig &
|
|
434
434
|
ClientInputEndpointParameters;
|
|
435
435
|
export interface EventBridgeClientConfig extends EventBridgeClientConfigType {}
|
|
436
436
|
export type EventBridgeClientResolvedConfigType =
|
|
@@ -442,7 +442,7 @@ export type EventBridgeClientResolvedConfigType =
|
|
|
442
442
|
RegionResolvedConfig &
|
|
443
443
|
HostHeaderResolvedConfig &
|
|
444
444
|
EndpointResolvedConfig<EndpointParameters> &
|
|
445
|
-
|
|
445
|
+
HttpAuthSchemeResolvedConfig &
|
|
446
446
|
ClientResolvedEndpointParameters;
|
|
447
447
|
export interface EventBridgeClientResolvedConfig
|
|
448
448
|
extends EventBridgeClientResolvedConfigType {}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AwsCredentialIdentity,
|
|
3
|
+
AwsCredentialIdentityProvider,
|
|
4
|
+
HttpAuthScheme,
|
|
5
|
+
} from "@smithy/types";
|
|
6
|
+
import { EventBridgeHttpAuthSchemeProvider } from "./httpAuthSchemeProvider";
|
|
7
|
+
export interface HttpAuthExtensionConfiguration {
|
|
8
|
+
setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void;
|
|
9
|
+
httpAuthSchemes(): HttpAuthScheme[];
|
|
10
|
+
setHttpAuthSchemeProvider(
|
|
11
|
+
httpAuthSchemeProvider: EventBridgeHttpAuthSchemeProvider
|
|
12
|
+
): void;
|
|
13
|
+
httpAuthSchemeProvider(): EventBridgeHttpAuthSchemeProvider;
|
|
14
|
+
setCredentials(
|
|
15
|
+
credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider
|
|
16
|
+
): void;
|
|
17
|
+
credentials():
|
|
18
|
+
| AwsCredentialIdentity
|
|
19
|
+
| AwsCredentialIdentityProvider
|
|
20
|
+
| undefined;
|
|
21
|
+
}
|
|
22
|
+
export type HttpAuthRuntimeConfig = Partial<{
|
|
23
|
+
httpAuthSchemes: HttpAuthScheme[];
|
|
24
|
+
httpAuthSchemeProvider: EventBridgeHttpAuthSchemeProvider;
|
|
25
|
+
credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const getHttpAuthExtensionConfiguration: (
|
|
28
|
+
runtimeConfig: HttpAuthRuntimeConfig
|
|
29
|
+
) => HttpAuthExtensionConfiguration;
|
|
30
|
+
export declare const resolveHttpAuthRuntimeConfig: (
|
|
31
|
+
config: HttpAuthExtensionConfiguration
|
|
32
|
+
) => HttpAuthRuntimeConfig;
|