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(rt): constrain RFC-3339 timestamps to microsecond precision #469

Merged
merged 2 commits into from
Aug 31, 2021

Conversation

aajtodd
Copy link
Contributor

@aajtodd aajtodd commented Aug 30, 2021

Issue #

fixes awslabs/aws-sdk-kotlin#304

Description of changes

Restrict RFC-3339 (ISO-8601) timestamps to microsecond precision

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.

@@ -40,7 +41,7 @@ actual class Instant(internal val value: jtInstant) : Comparable<Instant> {
* Encode the [Instant] as a string into the format specified by [TimestampFormat]
*/
actual fun format(fmt: TimestampFormat): String = when (fmt) {
TimestampFormat.ISO_8601 -> ISO_INSTANT.format(value)
TimestampFormat.ISO_8601 -> ISO_INSTANT.format(value.truncatedTo(ChronoUnit.MICROS))
Copy link
Contributor

Choose a reason for hiding this comment

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

is there any downside to always defaulting to microseconds? assuming not but just asking

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 downside is loss of resolution but there is going to be no way to tell which services support finer grained precision.

Copy link
Contributor

Choose a reason for hiding this comment

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

I figured there was no way to tell

Copy link
Contributor

@kneekey23 kneekey23 left a comment

Choose a reason for hiding this comment

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

LGTM

@aajtodd aajtodd merged commit 872390c into main Aug 31, 2021
@aajtodd aajtodd deleted the fix-iso8601-precision branch August 31, 2021 13:37
aajtodd added a commit that referenced this pull request Mar 11, 2024
…ible (#469)

Refactor credential providers to remove CRT dependency and make them KMP compatible. Added SSO provider to default chain. Lots of misc cleanup and improvements.


* feat(rt): standalone sso credentials provider (#462)
* refactor(rt)!: generated sts and sts web identity credential providers (#470)
* refactor(rt)!: implement kmp ecs provider (#475)
* feat(rt)!: implement kmp profile credentials provider (#478)
* feat(rt)!: kmp default credentials provider chain (#491)
* fix: work around machine-specific Gradle bug with aws-config variants (#496)
* fix: credentials provider ownership (#498)

Co-authored-by: Ian Botsford <[email protected]>
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.

cloudwatch getMetricsStatistics fails when timestamp uses nanos
3 participants