Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions private/smithy-rpcv2-cbor/src/auth/httpAuthSchemeProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import {
HttpAuthSchemeParameters,
HttpAuthSchemeParametersProvider,
HttpAuthSchemeProvider,
Provider,
} from "@smithy/types";
import { getSmithyContext } from "@smithy/util-middleware";
import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";

/**
* @internal
Expand Down Expand Up @@ -68,6 +69,14 @@ export const defaultRpcV2ProtocolHttpAuthSchemeProvider: RpcV2ProtocolHttpAuthSc
* @internal
*/
export interface HttpAuthSchemeInputConfig {
/**
* A comma-separated list of case-sensitive auth scheme names.
* An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.
* For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.
* @public
*/
authSchemePreference?: string[] | Provider<string[]>;

/**
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
* @internal
Expand All @@ -85,6 +94,14 @@ export interface HttpAuthSchemeInputConfig {
* @internal
*/
export interface HttpAuthSchemeResolvedConfig {
/**
* A comma-separated list of case-sensitive auth scheme names.
* An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.
* For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.
* @public
*/
readonly authSchemePreference: Provider<string[]>;

/**
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
* @internal
Expand All @@ -104,5 +121,7 @@ export interface HttpAuthSchemeResolvedConfig {
export const resolveHttpAuthSchemeConfig = <T>(
config: T & HttpAuthSchemeInputConfig
): T & HttpAuthSchemeResolvedConfig => {
return Object.assign(config, {}) as T & HttpAuthSchemeResolvedConfig;
return Object.assign(config, {
authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
}) as T & HttpAuthSchemeResolvedConfig;
};
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export interface EmptyInputOutputCommandOutput extends EmptyStructure, __Metadat
* @throws {@link RpcV2ProtocolServiceException}
* <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>
*
*
*/
export class EmptyInputOutputCommand extends $Command
.classBuilder<
Expand Down
1 change: 1 addition & 0 deletions private/smithy-rpcv2-cbor/src/commands/Float16Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface Float16CommandOutput extends Float16Output, __MetadataBearer {}
* @throws {@link RpcV2ProtocolServiceException}
* <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>
*
*
*/
export class Float16Command extends $Command
.classBuilder<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface FractionalSecondsCommandOutput extends FractionalSecondsOutput,
* @throws {@link RpcV2ProtocolServiceException}
* <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>
*
*
*/
export class FractionalSecondsCommand extends $Command
.classBuilder<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export interface GreetingWithErrorsCommandOutput extends GreetingWithErrorsOutpu
* @throws {@link RpcV2ProtocolServiceException}
* <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>
*
*
* @public
*/
export class GreetingWithErrorsCommand extends $Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export interface NoInputOutputCommandOutput extends __MetadataBearer {}
* @throws {@link RpcV2ProtocolServiceException}
* <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>
*
*
*/
export class NoInputOutputCommand extends $Command
.classBuilder<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export interface OperationWithDefaultsCommandOutput extends OperationWithDefault
* @throws {@link RpcV2ProtocolServiceException}
* <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>
*
*
*/
export class OperationWithDefaultsCommand extends $Command
.classBuilder<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export interface OptionalInputOutputCommandOutput extends SimpleStructure, __Met
* @throws {@link RpcV2ProtocolServiceException}
* <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>
*
*
*/
export class OptionalInputOutputCommand extends $Command
.classBuilder<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export interface RecursiveShapesCommandOutput extends RecursiveShapesInputOutput
* @throws {@link RpcV2ProtocolServiceException}
* <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>
*
*
*/
export class RecursiveShapesCommand extends $Command
.classBuilder<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export interface RpcV2CborDenseMapsCommandOutput extends RpcV2CborDenseMapsInput
* @throws {@link RpcV2ProtocolServiceException}
* <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>
*
*
* @public
*/
export class RpcV2CborDenseMapsCommand extends $Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export interface RpcV2CborListsCommandOutput extends RpcV2CborListInputOutput, _
* @throws {@link RpcV2ProtocolServiceException}
* <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>
*
*
* @public
*/
export class RpcV2CborListsCommand extends $Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export interface RpcV2CborSparseMapsCommandOutput extends RpcV2CborSparseMapsInp
* @throws {@link RpcV2ProtocolServiceException}
* <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>
*
*
*/
export class RpcV2CborSparseMapsCommand extends $Command
.classBuilder<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export interface SimpleScalarPropertiesCommandOutput extends SimpleScalarStructu
* @throws {@link RpcV2ProtocolServiceException}
* <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>
*
*
*/
export class SimpleScalarPropertiesCommand extends $Command
.classBuilder<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export interface SparseNullsOperationCommandOutput extends SparseNullsOperationI
* @throws {@link RpcV2ProtocolServiceException}
* <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>
*
*
*/
export class SparseNullsOperationCommand extends $Command
.classBuilder<
Expand Down