@smithy/experimental-identity-and-auth 0.0.23 → 0.0.24
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/memoizeIdentityProvider.js +4 -3
- package/dist-cjs/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js +5 -2
- package/dist-cjs/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js +5 -2
- package/dist-cjs/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +8 -5
- package/dist-es/memoizeIdentityProvider.js +2 -1
- package/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js +5 -2
- package/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js +5 -2
- package/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +7 -5
- package/dist-types/HttpAuthScheme.d.ts +5 -1
- package/dist-types/memoizeIdentityProvider.d.ts +4 -0
- package/dist-types/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.d.ts +11 -2
- package/dist-types/middleware-http-auth-scheme/getHttpAuthSchemePlugin.d.ts +11 -2
- package/dist-types/middleware-http-auth-scheme/httpAuthSchemeMiddleware.d.ts +8 -3
- package/dist-types/ts3.4/HttpAuthScheme.d.ts +5 -1
- package/dist-types/ts3.4/memoizeIdentityProvider.d.ts +4 -0
- package/dist-types/ts3.4/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.d.ts +11 -2
- package/dist-types/ts3.4/middleware-http-auth-scheme/getHttpAuthSchemePlugin.d.ts +11 -2
- package/dist-types/ts3.4/middleware-http-auth-scheme/httpAuthSchemeMiddleware.d.ts +8 -3
- package/package.json +8 -8
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.memoizeIdentityProvider = exports.doesIdentityRequireRefresh = exports.isIdentityExpired = exports.EXPIRATION_MS = void 0;
|
|
3
|
+
exports.memoizeIdentityProvider = exports.doesIdentityRequireRefresh = exports.isIdentityExpired = exports.EXPIRATION_MS = exports.createIsIdentityExpiredFunction = void 0;
|
|
4
|
+
const createIsIdentityExpiredFunction = (expirationMs) => (identity) => (0, exports.doesIdentityRequireRefresh)(identity) && identity.expiration.getTime() - Date.now() < expirationMs;
|
|
5
|
+
exports.createIsIdentityExpiredFunction = createIsIdentityExpiredFunction;
|
|
4
6
|
exports.EXPIRATION_MS = 300000;
|
|
5
|
-
|
|
6
|
-
exports.isIdentityExpired = isIdentityExpired;
|
|
7
|
+
exports.isIdentityExpired = (0, exports.createIsIdentityExpiredFunction)(exports.EXPIRATION_MS);
|
|
7
8
|
const doesIdentityRequireRefresh = (identity) => identity.expiration !== undefined;
|
|
8
9
|
exports.doesIdentityRequireRefresh = doesIdentityRequireRefresh;
|
|
9
10
|
const memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
|
|
@@ -11,9 +11,12 @@ exports.httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
|
|
|
11
11
|
relation: "before",
|
|
12
12
|
toMiddleware: middleware_endpoint_1.endpointMiddlewareOptions.name,
|
|
13
13
|
};
|
|
14
|
-
const getHttpAuthSchemeEndpointRuleSetPlugin = (config) => ({
|
|
14
|
+
const getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({
|
|
15
15
|
applyToStack: (clientStack) => {
|
|
16
|
-
clientStack.addRelativeTo((0, httpAuthSchemeMiddleware_1.httpAuthSchemeMiddleware)(config
|
|
16
|
+
clientStack.addRelativeTo((0, httpAuthSchemeMiddleware_1.httpAuthSchemeMiddleware)(config, {
|
|
17
|
+
httpAuthSchemeParametersProvider,
|
|
18
|
+
identityProviderConfigProvider,
|
|
19
|
+
}), exports.httpAuthSchemeEndpointRuleSetMiddlewareOptions);
|
|
17
20
|
},
|
|
18
21
|
});
|
|
19
22
|
exports.getHttpAuthSchemeEndpointRuleSetPlugin = getHttpAuthSchemeEndpointRuleSetPlugin;
|
|
@@ -11,9 +11,12 @@ exports.httpAuthSchemeMiddlewareOptions = {
|
|
|
11
11
|
relation: "before",
|
|
12
12
|
toMiddleware: middleware_serde_1.serializerMiddlewareOption.name,
|
|
13
13
|
};
|
|
14
|
-
const getHttpAuthSchemePlugin = (config) => ({
|
|
14
|
+
const getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({
|
|
15
15
|
applyToStack: (clientStack) => {
|
|
16
|
-
clientStack.addRelativeTo((0, httpAuthSchemeMiddleware_1.httpAuthSchemeMiddleware)(config
|
|
16
|
+
clientStack.addRelativeTo((0, httpAuthSchemeMiddleware_1.httpAuthSchemeMiddleware)(config, {
|
|
17
|
+
httpAuthSchemeParametersProvider,
|
|
18
|
+
identityProviderConfigProvider,
|
|
19
|
+
}), exports.httpAuthSchemeMiddlewareOptions);
|
|
17
20
|
},
|
|
18
21
|
});
|
|
19
22
|
exports.getHttpAuthSchemePlugin = getHttpAuthSchemePlugin;
|
|
@@ -10,8 +10,9 @@ function convertHttpAuthSchemesToMap(httpAuthSchemes) {
|
|
|
10
10
|
}
|
|
11
11
|
return map;
|
|
12
12
|
}
|
|
13
|
-
const httpAuthSchemeMiddleware = (config) => (next, context) => async (args) => {
|
|
14
|
-
|
|
13
|
+
const httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => {
|
|
14
|
+
var _a;
|
|
15
|
+
const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));
|
|
15
16
|
const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
|
|
16
17
|
const smithyContext = (0, util_middleware_1.getSmithyContext)(context);
|
|
17
18
|
const failureReasons = [];
|
|
@@ -21,15 +22,17 @@ const httpAuthSchemeMiddleware = (config) => (next, context) => async (args) =>
|
|
|
21
22
|
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);
|
|
22
23
|
continue;
|
|
23
24
|
}
|
|
24
|
-
const identityProvider = scheme.identityProvider(config
|
|
25
|
+
const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));
|
|
25
26
|
if (!identityProvider) {
|
|
26
27
|
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
|
|
27
28
|
continue;
|
|
28
29
|
}
|
|
29
|
-
const
|
|
30
|
+
const { identityProperties = {}, signingProperties = {} } = ((_a = option.propertiesExtractor) === null || _a === void 0 ? void 0 : _a.call(option, config, context)) || {};
|
|
31
|
+
option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
|
|
32
|
+
option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
|
|
30
33
|
smithyContext.selectedHttpAuthScheme = {
|
|
31
34
|
httpAuthOption: option,
|
|
32
|
-
identity,
|
|
35
|
+
identity: await identityProvider(option.identityProperties),
|
|
33
36
|
signer: scheme.signer,
|
|
34
37
|
};
|
|
35
38
|
break;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
export const createIsIdentityExpiredFunction = (expirationMs) => (identity) => doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs;
|
|
1
2
|
export const EXPIRATION_MS = 300000;
|
|
2
|
-
export const isIdentityExpired = (
|
|
3
|
+
export const isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);
|
|
3
4
|
export const doesIdentityRequireRefresh = (identity) => identity.expiration !== undefined;
|
|
4
5
|
export const memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
|
|
5
6
|
if (provider === undefined) {
|
|
@@ -8,8 +8,11 @@ export const httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
|
|
|
8
8
|
relation: "before",
|
|
9
9
|
toMiddleware: endpointMiddlewareOptions.name,
|
|
10
10
|
};
|
|
11
|
-
export const getHttpAuthSchemeEndpointRuleSetPlugin = (config) => ({
|
|
11
|
+
export const getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({
|
|
12
12
|
applyToStack: (clientStack) => {
|
|
13
|
-
clientStack.addRelativeTo(httpAuthSchemeMiddleware(config
|
|
13
|
+
clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
|
|
14
|
+
httpAuthSchemeParametersProvider,
|
|
15
|
+
identityProviderConfigProvider,
|
|
16
|
+
}), httpAuthSchemeEndpointRuleSetMiddlewareOptions);
|
|
14
17
|
},
|
|
15
18
|
});
|
|
@@ -8,8 +8,11 @@ export const httpAuthSchemeMiddlewareOptions = {
|
|
|
8
8
|
relation: "before",
|
|
9
9
|
toMiddleware: serializerMiddlewareOption.name,
|
|
10
10
|
};
|
|
11
|
-
export const getHttpAuthSchemePlugin = (config) => ({
|
|
11
|
+
export const getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({
|
|
12
12
|
applyToStack: (clientStack) => {
|
|
13
|
-
clientStack.addRelativeTo(httpAuthSchemeMiddleware(config
|
|
13
|
+
clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
|
|
14
|
+
httpAuthSchemeParametersProvider,
|
|
15
|
+
identityProviderConfigProvider,
|
|
16
|
+
}), httpAuthSchemeMiddlewareOptions);
|
|
14
17
|
},
|
|
15
18
|
});
|
|
@@ -7,8 +7,8 @@ function convertHttpAuthSchemesToMap(httpAuthSchemes) {
|
|
|
7
7
|
}
|
|
8
8
|
return map;
|
|
9
9
|
}
|
|
10
|
-
export const httpAuthSchemeMiddleware = (config) => (next, context) => async (args) => {
|
|
11
|
-
const options = config.httpAuthSchemeProvider(await
|
|
10
|
+
export const httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => {
|
|
11
|
+
const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));
|
|
12
12
|
const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
|
|
13
13
|
const smithyContext = getSmithyContext(context);
|
|
14
14
|
const failureReasons = [];
|
|
@@ -18,15 +18,17 @@ export const httpAuthSchemeMiddleware = (config) => (next, context) => async (ar
|
|
|
18
18
|
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);
|
|
19
19
|
continue;
|
|
20
20
|
}
|
|
21
|
-
const identityProvider = scheme.identityProvider(config
|
|
21
|
+
const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));
|
|
22
22
|
if (!identityProvider) {
|
|
23
23
|
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
|
|
24
24
|
continue;
|
|
25
25
|
}
|
|
26
|
-
const
|
|
26
|
+
const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};
|
|
27
|
+
option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
|
|
28
|
+
option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
|
|
27
29
|
smithyContext.selectedHttpAuthScheme = {
|
|
28
30
|
httpAuthOption: option,
|
|
29
|
-
identity,
|
|
31
|
+
identity: await identityProvider(option.identityProperties),
|
|
30
32
|
signer: scheme.signer,
|
|
31
33
|
};
|
|
32
34
|
break;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Identity, IdentityProvider } from "@smithy/types";
|
|
1
|
+
import { HandlerExecutionContext, Identity, IdentityProvider } from "@smithy/types";
|
|
2
2
|
import { HttpSigner } from "./HttpSigner";
|
|
3
3
|
import { IdentityProviderConfig } from "./IdentityProviderConfig";
|
|
4
4
|
/**
|
|
@@ -33,6 +33,10 @@ export interface HttpAuthOption {
|
|
|
33
33
|
schemeId: HttpAuthSchemeId;
|
|
34
34
|
identityProperties?: Record<string, unknown>;
|
|
35
35
|
signingProperties?: Record<string, unknown>;
|
|
36
|
+
propertiesExtractor?: <TConfig extends object, TContext extends HandlerExecutionContext>(config: TConfig, context: TContext) => {
|
|
37
|
+
identityProperties?: Record<string, unknown>;
|
|
38
|
+
signingProperties?: Record<string, unknown>;
|
|
39
|
+
};
|
|
36
40
|
}
|
|
37
41
|
/**
|
|
38
42
|
* @internal
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Identity, IdentityProvider } from "@smithy/types";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare const createIsIdentityExpiredFunction: (expirationMs: number) => (identity: Identity) => boolean;
|
|
2
6
|
/**
|
|
3
7
|
* @internal
|
|
4
8
|
* This may need to be configurable in the future, but for now it is defaulted to 5min.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HandlerExecutionContext, Pluggable, RelativeMiddlewareOptions, SerializeHandlerOptions } from "@smithy/types";
|
|
2
|
-
import { HttpAuthSchemeParameters } from "../HttpAuthSchemeProvider";
|
|
2
|
+
import { HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider } from "../HttpAuthSchemeProvider";
|
|
3
|
+
import { IdentityProviderConfig } from "../IdentityProviderConfig";
|
|
3
4
|
import { PreviouslyResolved } from "./httpAuthSchemeMiddleware";
|
|
4
5
|
/**
|
|
5
6
|
* @internal
|
|
@@ -8,4 +9,12 @@ export declare const httpAuthSchemeEndpointRuleSetMiddlewareOptions: SerializeHa
|
|
|
8
9
|
/**
|
|
9
10
|
* @internal
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
interface HttpAuthSchemeEndpointRuleSetPluginOptions<TConfig extends object, TContext extends HandlerExecutionContext, TParameters extends HttpAuthSchemeParameters, TInput extends object> {
|
|
13
|
+
httpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput>;
|
|
14
|
+
identityProviderConfigProvider: (config: TConfig) => Promise<IdentityProviderConfig>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare const getHttpAuthSchemeEndpointRuleSetPlugin: <TConfig extends object, TContext extends HandlerExecutionContext, TParameters extends HttpAuthSchemeParameters, TInput extends object>(config: TConfig & PreviouslyResolved<TParameters>, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }: HttpAuthSchemeEndpointRuleSetPluginOptions<TConfig, TContext, TParameters, TInput>) => Pluggable<any, any>;
|
|
20
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HandlerExecutionContext, Pluggable, RelativeMiddlewareOptions, SerializeHandlerOptions } from "@smithy/types";
|
|
2
|
-
import { HttpAuthSchemeParameters } from "../HttpAuthSchemeProvider";
|
|
2
|
+
import { HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider } from "../HttpAuthSchemeProvider";
|
|
3
|
+
import { IdentityProviderConfig } from "../IdentityProviderConfig";
|
|
3
4
|
import { PreviouslyResolved } from "./httpAuthSchemeMiddleware";
|
|
4
5
|
/**
|
|
5
6
|
* @internal
|
|
@@ -8,4 +9,12 @@ export declare const httpAuthSchemeMiddlewareOptions: SerializeHandlerOptions &
|
|
|
8
9
|
/**
|
|
9
10
|
* @internal
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
interface HttpAuthSchemePluginOptions<TConfig extends object, TContext extends HandlerExecutionContext, TParameters extends HttpAuthSchemeParameters, TInput extends object> {
|
|
13
|
+
httpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput>;
|
|
14
|
+
identityProviderConfigProvider: (config: TConfig) => Promise<IdentityProviderConfig>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare const getHttpAuthSchemePlugin: <TConfig extends object, TContext extends HandlerExecutionContext, TParameters extends HttpAuthSchemeParameters, TInput extends object>(config: TConfig & PreviouslyResolved<TParameters>, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }: HttpAuthSchemePluginOptions<TConfig, TContext, TParameters, TInput>) => Pluggable<any, any>;
|
|
20
|
+
export {};
|
|
@@ -5,11 +5,16 @@ import { IdentityProviderConfig } from "../IdentityProviderConfig";
|
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
|
-
export interface PreviouslyResolved<
|
|
8
|
+
export interface PreviouslyResolved<TParameters extends HttpAuthSchemeParameters> {
|
|
9
9
|
httpAuthSchemes: HttpAuthScheme[];
|
|
10
10
|
httpAuthSchemeProvider: HttpAuthSchemeProvider<TParameters>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
interface HttpAuthSchemeMiddlewareOptions<TConfig extends object, TContext extends HandlerExecutionContext, TParameters extends HttpAuthSchemeParameters, TInput extends object> {
|
|
11
16
|
httpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput>;
|
|
12
|
-
|
|
17
|
+
identityProviderConfigProvider: (config: TConfig) => Promise<IdentityProviderConfig>;
|
|
13
18
|
}
|
|
14
19
|
/**
|
|
15
20
|
* @internal
|
|
@@ -26,5 +31,5 @@ interface HttpAuthSchemeMiddlewareHandlerExecutionContext extends HandlerExecuti
|
|
|
26
31
|
/**
|
|
27
32
|
* @internal
|
|
28
33
|
*/
|
|
29
|
-
export declare const httpAuthSchemeMiddleware: <TInput extends object, Output extends object, TConfig extends object, TContext extends HttpAuthSchemeMiddlewareHandlerExecutionContext, TParameters extends HttpAuthSchemeParameters>(config: TConfig & PreviouslyResolved<TConfig, TContext, TParameters, TInput>) => SerializeMiddleware<TInput, Output>;
|
|
34
|
+
export declare const httpAuthSchemeMiddleware: <TInput extends object, Output extends object, TConfig extends object, TContext extends HttpAuthSchemeMiddlewareHandlerExecutionContext, TParameters extends HttpAuthSchemeParameters>(config: TConfig & PreviouslyResolved<TParameters>, mwOptions: HttpAuthSchemeMiddlewareOptions<TConfig, TContext, TParameters, TInput>) => SerializeMiddleware<TInput, Output>;
|
|
30
35
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Identity, IdentityProvider } from "@smithy/types";
|
|
1
|
+
import { HandlerExecutionContext, Identity, IdentityProvider } from "@smithy/types";
|
|
2
2
|
import { HttpSigner } from "./HttpSigner";
|
|
3
3
|
import { IdentityProviderConfig } from "./IdentityProviderConfig";
|
|
4
4
|
/**
|
|
@@ -33,6 +33,10 @@ export interface HttpAuthOption {
|
|
|
33
33
|
schemeId: HttpAuthSchemeId;
|
|
34
34
|
identityProperties?: Record<string, unknown>;
|
|
35
35
|
signingProperties?: Record<string, unknown>;
|
|
36
|
+
propertiesExtractor?: <TConfig extends object, TContext extends HandlerExecutionContext>(config: TConfig, context: TContext) => {
|
|
37
|
+
identityProperties?: Record<string, unknown>;
|
|
38
|
+
signingProperties?: Record<string, unknown>;
|
|
39
|
+
};
|
|
36
40
|
}
|
|
37
41
|
/**
|
|
38
42
|
* @internal
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Identity, IdentityProvider } from "@smithy/types";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare const createIsIdentityExpiredFunction: (expirationMs: number) => (identity: Identity) => boolean;
|
|
2
6
|
/**
|
|
3
7
|
* @internal
|
|
4
8
|
* This may need to be configurable in the future, but for now it is defaulted to 5min.
|
package/dist-types/ts3.4/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HandlerExecutionContext, Pluggable, RelativeMiddlewareOptions, SerializeHandlerOptions } from "@smithy/types";
|
|
2
|
-
import { HttpAuthSchemeParameters } from "../HttpAuthSchemeProvider";
|
|
2
|
+
import { HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider } from "../HttpAuthSchemeProvider";
|
|
3
|
+
import { IdentityProviderConfig } from "../IdentityProviderConfig";
|
|
3
4
|
import { PreviouslyResolved } from "./httpAuthSchemeMiddleware";
|
|
4
5
|
/**
|
|
5
6
|
* @internal
|
|
@@ -8,4 +9,12 @@ export declare const httpAuthSchemeEndpointRuleSetMiddlewareOptions: SerializeHa
|
|
|
8
9
|
/**
|
|
9
10
|
* @internal
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
interface HttpAuthSchemeEndpointRuleSetPluginOptions<TConfig extends object, TContext extends HandlerExecutionContext, TParameters extends HttpAuthSchemeParameters, TInput extends object> {
|
|
13
|
+
httpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput>;
|
|
14
|
+
identityProviderConfigProvider: (config: TConfig) => Promise<IdentityProviderConfig>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare const getHttpAuthSchemeEndpointRuleSetPlugin: <TConfig extends object, TContext extends HandlerExecutionContext, TParameters extends HttpAuthSchemeParameters, TInput extends object>(config: TConfig & PreviouslyResolved<TParameters>, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }: HttpAuthSchemeEndpointRuleSetPluginOptions<TConfig, TContext, TParameters, TInput>) => Pluggable<any, any>;
|
|
20
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HandlerExecutionContext, Pluggable, RelativeMiddlewareOptions, SerializeHandlerOptions } from "@smithy/types";
|
|
2
|
-
import { HttpAuthSchemeParameters } from "../HttpAuthSchemeProvider";
|
|
2
|
+
import { HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider } from "../HttpAuthSchemeProvider";
|
|
3
|
+
import { IdentityProviderConfig } from "../IdentityProviderConfig";
|
|
3
4
|
import { PreviouslyResolved } from "./httpAuthSchemeMiddleware";
|
|
4
5
|
/**
|
|
5
6
|
* @internal
|
|
@@ -8,4 +9,12 @@ export declare const httpAuthSchemeMiddlewareOptions: SerializeHandlerOptions &
|
|
|
8
9
|
/**
|
|
9
10
|
* @internal
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
interface HttpAuthSchemePluginOptions<TConfig extends object, TContext extends HandlerExecutionContext, TParameters extends HttpAuthSchemeParameters, TInput extends object> {
|
|
13
|
+
httpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput>;
|
|
14
|
+
identityProviderConfigProvider: (config: TConfig) => Promise<IdentityProviderConfig>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare const getHttpAuthSchemePlugin: <TConfig extends object, TContext extends HandlerExecutionContext, TParameters extends HttpAuthSchemeParameters, TInput extends object>(config: TConfig & PreviouslyResolved<TParameters>, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }: HttpAuthSchemePluginOptions<TConfig, TContext, TParameters, TInput>) => Pluggable<any, any>;
|
|
20
|
+
export {};
|
|
@@ -5,11 +5,16 @@ import { IdentityProviderConfig } from "../IdentityProviderConfig";
|
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
|
-
export interface PreviouslyResolved<
|
|
8
|
+
export interface PreviouslyResolved<TParameters extends HttpAuthSchemeParameters> {
|
|
9
9
|
httpAuthSchemes: HttpAuthScheme[];
|
|
10
10
|
httpAuthSchemeProvider: HttpAuthSchemeProvider<TParameters>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
interface HttpAuthSchemeMiddlewareOptions<TConfig extends object, TContext extends HandlerExecutionContext, TParameters extends HttpAuthSchemeParameters, TInput extends object> {
|
|
11
16
|
httpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput>;
|
|
12
|
-
|
|
17
|
+
identityProviderConfigProvider: (config: TConfig) => Promise<IdentityProviderConfig>;
|
|
13
18
|
}
|
|
14
19
|
/**
|
|
15
20
|
* @internal
|
|
@@ -26,5 +31,5 @@ interface HttpAuthSchemeMiddlewareHandlerExecutionContext extends HandlerExecuti
|
|
|
26
31
|
/**
|
|
27
32
|
* @internal
|
|
28
33
|
*/
|
|
29
|
-
export declare const httpAuthSchemeMiddleware: <TInput extends object, Output extends object, TConfig extends object, TContext extends HttpAuthSchemeMiddlewareHandlerExecutionContext, TParameters extends HttpAuthSchemeParameters>(config: TConfig & PreviouslyResolved<TConfig, TContext, TParameters, TInput>) => SerializeMiddleware<TInput, Output>;
|
|
34
|
+
export declare const httpAuthSchemeMiddleware: <TInput extends object, Output extends object, TConfig extends object, TContext extends HttpAuthSchemeMiddlewareHandlerExecutionContext, TParameters extends HttpAuthSchemeParameters>(config: TConfig & PreviouslyResolved<TParameters>, mwOptions: HttpAuthSchemeMiddlewareOptions<TConfig, TContext, TParameters, TInput>) => SerializeMiddleware<TInput, Output>;
|
|
30
35
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/experimental-identity-and-auth",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
|
6
6
|
"build:cjs": "yarn g:tsc -p tsconfig.cjs.json",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@smithy/middleware-endpoint": "^2.
|
|
28
|
-
"@smithy/middleware-retry": "^2.0.
|
|
29
|
-
"@smithy/middleware-serde": "^2.0.
|
|
30
|
-
"@smithy/protocol-http": "^3.0.
|
|
31
|
-
"@smithy/signature-v4": "^2.0.
|
|
32
|
-
"@smithy/types": "^2.
|
|
27
|
+
"@smithy/middleware-endpoint": "^2.2.0",
|
|
28
|
+
"@smithy/middleware-retry": "^2.0.20",
|
|
29
|
+
"@smithy/middleware-serde": "^2.0.13",
|
|
30
|
+
"@smithy/protocol-http": "^3.0.9",
|
|
31
|
+
"@smithy/signature-v4": "^2.0.15",
|
|
32
|
+
"@smithy/types": "^2.5.0",
|
|
33
33
|
"tslib": "^2.5.0"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"directory": "packages/experimental-identity-and-auth"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@smithy/util-test": "^0.1.
|
|
55
|
+
"@smithy/util-test": "^0.1.9",
|
|
56
56
|
"@tsconfig/recommended": "1.0.1",
|
|
57
57
|
"concurrently": "7.0.0",
|
|
58
58
|
"downlevel-dts": "0.10.1",
|