-
Notifications
You must be signed in to change notification settings - Fork 49
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
misc: Customize S3's Expires
field
#1287
Conversation
Expires
fieldExpires
field
A new generated diff is ready to view. |
A new generated diff is ready to view. |
A new generated diff is ready to view. |
note: e2e tests expected to fail until smithy-kotlin is merged and released, they pass locally. |
A new generated diff is ready to view. |
A new generated diff is ready to view. |
.asSequence() | ||
.mapNotNull { shape -> | ||
shape.members() | ||
.singleOrNull { member -> member.memberName.lowercase() == "expires" } |
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.
Nit: Prefer .equals("expires", ignoreCase = true)
here and elsewhere
Instant.fromRfc5322(response.headers["Expires"]!!) | ||
} catch (e: Exception) { | ||
coroutineContext.logger<ExpiresFieldInterceptor>().warn { | ||
"Failed to parse `expires`=${response.headers["Expires"]} as a timestamp, setting it to `null`. The unparsed value is available in `expiresString`." |
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.
Nit: Include quotes around the value which failed to parse. This makes values which are empty or contain multiple spaces easier to understand.
A new generated diff is ready to view. |
A new generated diff is ready to view. |
Quality Gate failedFailed conditions |
A new generated diff is ready to view. |
This PR customizes S3's
Expires
field to improve the user experience in preparation for upstream model changes.Expires
fields are always timestamps, even if the model changes in the futureExpires
tonull
if parsing failsFor output shapes only:
ExpiresString
member which contains the raw string value ofExpires
Expires
in favor ofExpiresString
Issue #
Description of changes
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.