Skip to content

feat: S3 Express support #916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

feat: S3 Express support #916

wants to merge 21 commits into from

Conversation

jbelkins
Copy link
Contributor

Description of changes

Provides support for customizations needed to utilize the S3 Express feature.

Scope

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

import class Smithy.ContextBuilder
import struct Smithy.AttributeKey

public extension Context {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allow the client config object to be placed into the context. This allows the client config to be passed to the S3 Express identity resolver, so that it can use the S3 client to obtain S3 Express credentials.

}

private let clientConfigKey = AttributeKey<ClientConfigurationWrapper>(name: "SmithySwiftClientConfigWrapper")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client config is wrapped in a @unchecked Sendable wrapper before adding it to the context, since Context requires that anything added to its storage be Sendable.

See comment on code immediately below for more details.


import struct Smithy.AttributeKey

public enum IdentityPropertyKeys {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Client config is also wrapped before storing it as an identity property. The wrapper defined immediately above is used.

@@ -73,7 +73,14 @@ extension AuthSchemeMiddleware: SelectAuthScheme {
context: attributes
)
// Resolve identity using the resolver from auth scheme
let identity = try await identityResolver.getIdentity(identityProperties: option.identityProperties)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client config is wrapped, then added to identity properties (if any client config was stored to the context when the operation was started.)

The modified identity properties are then passed into the identity resolver. This is used by the S3 Express identity resolver to call S3.

// Set signing name and signing region flags
updatedSigningProperties.set(key: SigningPropertyKeys.signingName, value: context.signingName)
// Set resolved signing name and signing region flags
let signingName = updatedSigningProperties.get(key: SigningPropertyKeys.signingName) ?? context.signingName
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If signing properties include a signing name, use it, else fall back to the default signing name defined in the model's sigv4 trait.

@jbelkins jbelkins marked this pull request as ready for review June 16, 2025 15:51
@jbelkins jbelkins requested review from sichanyoo and dayaffe June 16, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants