Skip to content

Commit

Permalink
feat(client-s3): codegen S3 with endpointRuleSet `HttpAuthSchemePro…
Browse files Browse the repository at this point in the history
…vider`
  • Loading branch information
Steven Yuan committed Sep 25, 2023
1 parent 7c9f189 commit 5cffb01
Show file tree
Hide file tree
Showing 97 changed files with 349 additions and 3 deletions.
45 changes: 44 additions & 1 deletion clients/client-s3/src/auth/httpAuthSchemeProvider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// smithy-typescript generated code
import {
createEndpointRuleSetHttpAuthSchemeParametersProvider,
createEndpointRuleSetHttpAuthSchemeProvider,
DefaultIdentityProviderConfig,
doesIdentityRequireRefresh,
HttpAuthOption,
Expand All @@ -13,6 +15,8 @@ import {
import { AwsCredentialIdentity, AwsCredentialIdentityProvider, Provider as __Provider } from "@smithy/types";
import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";

import { EndpointParameters } from "../endpoint/EndpointParameters";
import { defaultEndpointResolver } from "../endpoint/endpointResolver";
import { S3ClientResolvedConfig } from "../S3Client";

/**
Expand Down Expand Up @@ -56,6 +60,16 @@ function createAwsAuthSigv4HttpAuthOption(authParameters: S3HttpAuthSchemeParame
};
}

function createAwsAuthSigv4aHttpAuthOption(authParameters: S3HttpAuthSchemeParameters): HttpAuthOption {
return {
schemeId: "aws.auth#sigv4a",
signingProperties: {
name: "s3",
region: authParameters.region,
},
};
}

/**
* @internal
*/
Expand Down Expand Up @@ -122,9 +136,38 @@ export const resolveHttpAuthSchemeConfig = (config: HttpAuthSchemeInputConfig):
...config,
credentials,
region,
httpAuthSchemeParametersProvider: defaultS3HttpAuthSchemeParametersProvider,
httpAuthSchemeParametersProvider: defaultEndpointRuleSetHttpAuthSchemeParametersProvider,
identityProviderConfig: new DefaultIdentityProviderConfig({
"aws.auth#sigv4": credentials,
}),
};
};

/**
* @internal
*/
export interface S3EndpointRuleSetHttpAuthSchemeParameters extends EndpointParameters, S3HttpAuthSchemeParameters {}

/**
* @internal
*/
export interface S3EndpointRuleSetHttpAuthSchemeParametersProvider
extends HttpAuthSchemeParametersProvider<S3ClientResolvedConfig, S3EndpointRuleSetHttpAuthSchemeParameters> {}

/**
* @internal
*/
export const defaultEndpointRuleSetHttpAuthSchemeParametersProvider: S3EndpointRuleSetHttpAuthSchemeParametersProvider =
createEndpointRuleSetHttpAuthSchemeParametersProvider(defaultS3HttpAuthSchemeParametersProvider);

/**
* @internal
*/
export interface S3EndpointRuleSetHttpAuthSchemeProvider
extends HttpAuthSchemeProvider<S3EndpointRuleSetHttpAuthSchemeParameters> {}

/**
* @internal
*/
export const defaultEndpointRuleSetHttpAuthSchemeProvider: S3EndpointRuleSetHttpAuthSchemeProvider =
createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, defaultS3HttpAuthSchemeProvider);
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/AbortMultipartUploadCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ export class AbortMultipartUploadCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "AbortMultipartUpload",
endpointRuleSet: {
getEndpointParameterInstructions: AbortMultipartUploadCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ export class CompleteMultipartUploadCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "CompleteMultipartUpload",
endpointRuleSet: {
getEndpointParameterInstructions: CompleteMultipartUploadCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/CopyObjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,9 @@ export class CopyObjectCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "CopyObject",
endpointRuleSet: {
getEndpointParameterInstructions: CopyObjectCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/CreateBucketCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ export class CreateBucketCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "CreateBucket",
endpointRuleSet: {
getEndpointParameterInstructions: CreateBucketCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@ export class CreateMultipartUploadCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "CreateMultipartUpload",
endpointRuleSet: {
getEndpointParameterInstructions: CreateMultipartUploadCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ export class DeleteBucketAnalyticsConfigurationCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteBucketAnalyticsConfiguration",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteBucketAnalyticsConfigurationCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/DeleteBucketCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ export class DeleteBucketCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteBucket",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteBucketCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/DeleteBucketCorsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ export class DeleteBucketCorsCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteBucketCors",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteBucketCorsCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ export class DeleteBucketEncryptionCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteBucketEncryption",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteBucketEncryptionCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ export class DeleteBucketIntelligentTieringConfigurationCommand extends $Command
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteBucketIntelligentTieringConfiguration",
endpointRuleSet: {
getEndpointParameterInstructions:
DeleteBucketIntelligentTieringConfigurationCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ export class DeleteBucketInventoryConfigurationCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteBucketInventoryConfiguration",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteBucketInventoryConfigurationCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ export class DeleteBucketLifecycleCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteBucketLifecycle",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteBucketLifecycleCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ export class DeleteBucketMetricsConfigurationCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteBucketMetricsConfiguration",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteBucketMetricsConfigurationCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ export class DeleteBucketOwnershipControlsCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteBucketOwnershipControls",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteBucketOwnershipControlsCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/DeleteBucketPolicyCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ export class DeleteBucketPolicyCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteBucketPolicy",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteBucketPolicyCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ export class DeleteBucketReplicationCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteBucketReplication",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteBucketReplicationCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/DeleteBucketTaggingCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ export class DeleteBucketTaggingCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteBucketTagging",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteBucketTaggingCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/DeleteBucketWebsiteCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ export class DeleteBucketWebsiteCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteBucketWebsite",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteBucketWebsiteCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/DeleteObjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ export class DeleteObjectCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteObject",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteObjectCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/DeleteObjectTaggingCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ export class DeleteObjectTaggingCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteObjectTagging",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteObjectTaggingCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/DeleteObjectsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ export class DeleteObjectsCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeleteObjects",
endpointRuleSet: {
getEndpointParameterInstructions: DeleteObjectsCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ export class DeletePublicAccessBlockCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "DeletePublicAccessBlock",
endpointRuleSet: {
getEndpointParameterInstructions: DeletePublicAccessBlockCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ export class GetBucketAccelerateConfigurationCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "GetBucketAccelerateConfiguration",
endpointRuleSet: {
getEndpointParameterInstructions: GetBucketAccelerateConfigurationCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/GetBucketAclCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ export class GetBucketAclCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "GetBucketAcl",
endpointRuleSet: {
getEndpointParameterInstructions: GetBucketAclCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ export class GetBucketAnalyticsConfigurationCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "GetBucketAnalyticsConfiguration",
endpointRuleSet: {
getEndpointParameterInstructions: GetBucketAnalyticsConfigurationCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/GetBucketCorsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ export class GetBucketCorsCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "GetBucketCors",
endpointRuleSet: {
getEndpointParameterInstructions: GetBucketCorsCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/GetBucketEncryptionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ export class GetBucketEncryptionCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "GetBucketEncryption",
endpointRuleSet: {
getEndpointParameterInstructions: GetBucketEncryptionCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ export class GetBucketIntelligentTieringConfigurationCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "GetBucketIntelligentTieringConfiguration",
endpointRuleSet: {
getEndpointParameterInstructions:
GetBucketIntelligentTieringConfigurationCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ export class GetBucketInventoryConfigurationCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "GetBucketInventoryConfiguration",
endpointRuleSet: {
getEndpointParameterInstructions: GetBucketInventoryConfigurationCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ export class GetBucketLifecycleConfigurationCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "GetBucketLifecycleConfiguration",
endpointRuleSet: {
getEndpointParameterInstructions: GetBucketLifecycleConfigurationCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/GetBucketLocationCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ export class GetBucketLocationCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "GetBucketLocation",
endpointRuleSet: {
getEndpointParameterInstructions: GetBucketLocationCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-s3/src/commands/GetBucketLoggingCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ export class GetBucketLoggingCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "GetBucketLogging",
endpointRuleSet: {
getEndpointParameterInstructions: GetBucketLoggingCommand.getEndpointParameterInstructions,
},
},
};
const { requestHandler } = configuration;
Expand Down
Loading

0 comments on commit 5cffb01

Please sign in to comment.