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

fix: prefer EndpointResolver Bucket for S3 in http label, AccountId for S3Control host label #660

Merged
merged 4 commits into from
Oct 31, 2022

Conversation

ganeshnj
Copy link
Contributor

@ganeshnj ganeshnj commented Oct 31, 2022

Issue #

Description of changes

S3 Bucket deduplication

Bucket in the HTTP URI is now a contextParam hence rules engine takes care of adding the bucket to the URI to either host name or path depending on the bucket location forceStylePath configuration. Therefore, SDK must not add the bucket to the URI outside of the rules engine.

"com.amazonaws.s3#GetObject": {
    "type": "operation",
    "input": {
        "target": "com.amazonaws.s3#GetObjectRequest"
    },
    "output": {
        "target": "com.amazonaws.s3#GetObjectOutput"
    },
    "traits": {
        "aws.protocols#httpChecksum": {
            "requestValidationModeMember": "ChecksumMode",
            "responseAlgorithms": [
                "CRC32",
                "CRC32C",
                "SHA256",
                "SHA1"
            ]
        },
        "smithy.api#http": {
            "method": "GET",
            "uri": "/{Bucket}/{Key+}?x-id=GetObject",
            "code": 200
        }
    }
},
"com.amazonaws.s3#GetObjectRequest": {
    "type": "structure",
    "members": {
        "Bucket": {
            "target": "com.amazonaws.s3#BucketName",
            "traits": {
                "smithy.api#httpLabel": {},
                "smithy.api#required": {},
                "smithy.rules#contextParam": {
                    "name": "Bucket"
                }
            }
        },

S3 Control AccountId deduplication

AccountId hostPrefix is now a staticContextParams hence rules engine takes care of adding AccountId to the host name. This is enabled by setting RequiresAccountId param in staticContextParams to true. Therefore, SDK must not add the AccountId to the host name outside of the rules engine.

"com.amazonaws.s3control#CreateAccessPoint": {
    "type": "operation",
    "input": {
        "target": "com.amazonaws.s3control#CreateAccessPointRequest"
    },
    "output": {
        "target": "com.amazonaws.s3control#CreateAccessPointResult"
    },
    "traits": {
        "smithy.api#endpoint": {
            "hostPrefix": "{AccountId}."
        },
        "smithy.api#http": {
            "method": "PUT",
            "uri": "/v20180820/accesspoint/{Name}",
            "code": 200
        },
        "smithy.rules#staticContextParams": {
            "RequiresAccountId": {
                "value": true
            }
        }
    }
}

New/existing dependencies impact assessment, if applicable

Conventional Commits

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

@ganeshnj ganeshnj marked this pull request as ready for review October 31, 2022 17:11
@ganeshnj ganeshnj changed the title fix: prefer EndpointResolver Bucket for S3 in http label, AccountId f… fix: prefer EndpointResolver Bucket for S3 in http label, AccountId for S3Control host label Oct 31, 2022
Copy link
Contributor

@jbelkins jbelkins left a comment

Choose a reason for hiding this comment

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

Approved, but with a question

@ganeshnj ganeshnj merged commit 31c8bb9 into main Oct 31, 2022
@ganeshnj ganeshnj deleted the jangirg/fix/s3-s3control-context-params branch October 31, 2022 21:44
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