-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Remove AWS SDK V1 references #52990
base: master
Are you sure you want to change the base?
Remove AWS SDK V1 references #52990
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some ideas for the region list, maybe use go:generate or through make to fetch this:
https://raw.githubusercontent.com/boto/botocore/refs/heads/develop/botocore/data/partitions.json
e.g:
$ curl -s https://raw.githubusercontent.com/boto/botocore/refs/heads/develop/botocore/data/partitions.json | jq -r '.partitions[].regions | keys | flatten[] ' | grep -v "\-global$" | sort
af-south-1
ap-east-1
ap-northeast-1
...
` <Test>test</Test>`, | ||
` <Encoding>2009-02-13T23:31:30Z</Encoding>`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happened here? could we keep the original test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but that would require us to duplicate the definition of the struct or make the test rely on it. I've kept the test in a simpler format, given that it seems to be a generic function in the end (that marshals XML) and is not specifically attached to any AWS structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we want to move away from sts types, i would test a more complicated example than a string, and not using AssumeRoleResponse
as the xml name. I would still prefer to test some aws sdk struct though as this is part of aws utils.
alternatively we can move these helpers to the caller since your new implementation is a lot easier and there is only one caller i believe. Then we make sure proper UT cover there with the real type.
} | ||
|
||
// MarshalXML marshals the provided root name and a map of children in XML with | ||
// default indent (prefix "", indent " "). | ||
func MarshalXML(rootName xml.Name, children map[string]any) ([]byte, error) { | ||
func MarshalXML(root string, namespace string, v any) ([]byte, error) { | ||
var buf bytes.Buffer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should move MarshalXML
and its unit test into aws_local_proxy_test.go since that's the only place we use it
This PR migrates most of the AWS SDK V1 references. Although this is a large PR, most changes are on tests. For reviewers, the most significant change is in Sign V4 migration (including the signer's tests and usage).
After this is merged, only a few references will be remaining:
lib/aws/region.go
is used for discovery and configuration validation. This was left outside this PR as there is no direct conversion, so it could lead to more discussion on how to solve it.