Skip to content
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

Refactor signing config and set a default signing config for s3 client #545

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

monthonk
Copy link
Contributor

@monthonk monthonk commented Oct 6, 2023

Description of change

This PR refactors the signing config and also set a default signing config for s3 client to prepare for upcoming changes.

Does this change impact existing behavior?

No.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).

@monthonk monthonk had a problem deploying to PR integration tests October 6, 2023 10:13 — with GitHub Actions Failure
@monthonk monthonk had a problem deploying to PR integration tests October 6, 2023 10:13 — with GitHub Actions Failure
@monthonk monthonk had a problem deploying to PR integration tests October 6, 2023 10:13 — with GitHub Actions Failure
@monthonk monthonk had a problem deploying to PR integration tests October 6, 2023 10:13 — with GitHub Actions Failure
Signed-off-by: Monthon Klongklaew <[email protected]>
@monthonk monthonk temporarily deployed to PR integration tests October 6, 2023 10:21 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests October 6, 2023 10:21 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests October 6, 2023 10:21 — with GitHub Actions Inactive
@monthonk monthonk temporarily deployed to PR integration tests October 6, 2023 10:21 — with GitHub Actions Inactive
@monthonk monthonk changed the title Refactor signing configuration Refactor signing config and set a default signing config for s3 client Oct 6, 2023
auth_scheme.signing_region(),
auth_scheme.scheme_name(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Reason we were not keeping it optional is because when we were resolving endpoint, we were explicitly failing when we were not getting any value for any of the fields of AuthScheme. So, all these options should have some value set.

Copy link
Contributor Author

@monthonk monthonk Oct 9, 2023

Choose a reason for hiding this comment

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

That's fine if we want to fail, we can do that at resolve_for_bucket(..). But can't we create a signing config without resolving endpoint? Looking at the CRT function, I think what we really need are region and credentials_provider, the others are optional.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we dont need other arguments in the CRT function. But, the signing config is only created after resolving the endpoint ( in s3_crt_client ). I am not sure if we need to set signing config other than making request where endpoint should be resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that is a signing config at request level. We can also set it at client level which I added in this change (see s3_crt_client.rs line 272-279), and I don't think we want to resolve the endpoint there.

@@ -32,6 +33,49 @@ impl Debug for SigningConfigInner {
}
}

impl SigningConfigInner {
/// Create a new [SigningConfig] with default options.
pub fn new(region: &str, credentials_provider: CredentialsProvider) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did we create this constructor for SigningConfigInner when we were doing the same with default_init_siginig_config()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, some of the configs are now optional. I think this might be easier to read.

@sauraank sauraank added this pull request to the merge queue Oct 10, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 10, 2023
@jamesbornholt jamesbornholt added this pull request to the merge queue Oct 16, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 16, 2023
@jamesbornholt jamesbornholt added this pull request to the merge queue Oct 16, 2023
Merged via the queue into awslabs:main with commit 7e94711 Oct 16, 2023
18 checks passed
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.

3 participants