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

[get] Specify expiration of credentials #2

Merged
merged 3 commits into from
Feb 7, 2024
Merged

Conversation

Yannic
Copy link
Member

@Yannic Yannic commented Jan 18, 2024

No description provided.

@Yannic Yannic requested review from jayconrod and rogerhu January 18, 2024 20:22
@Yannic
Copy link
Member Author

Yannic commented Jan 18, 2024

@tjgq PTAL

"type": "object"
},
"expires": {
"description": "The time when the credentials expire and the tool should re-validate them, formatted as ISO 8601.\n\nIf set, tools **SHOULD** not invoke the `get` command of the Credential Helper for the URI before this time has passed or before the remote service indicates the credentials are expired, revoked, or invalid for any other reason. Otherwise, tools **MAY** assume that the credentials are valid indefinitely or for a tool-specified duration before re-validating them.",
Copy link
Member

Choose a reason for hiding this comment

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

What about the corner case where the credentials (are expected to) expire in the middle of an operation?

Choose a reason for hiding this comment

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

+1, recommend adding an "unless ..." clause in here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added something to indicate that revalidating if the server returns a permission error is always ok.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also added something to allow tools to refresh early if they expect the credentials to expire mid-operation. It's up to the server to decide what to do if they do expire mid-operation

schemas/get-credentials-response.schema.json Outdated Show resolved Hide resolved
"type": "object"
},
"expires": {
"description": "The time when the credentials expire and the tool should re-validate them, formatted as ISO 8601.\n\nIf set, tools **SHOULD** not invoke the `get` command of the Credential Helper for the URI before this time has passed or before the remote service indicates the credentials are expired, revoked, or invalid for any other reason. Otherwise, tools **MAY** assume that the credentials are valid indefinitely or for a tool-specified duration before re-validating them.",

Choose a reason for hiding this comment

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

+1, recommend adding an "unless ..." clause in here.

"type": "object"
},
"expires": {
"description": "The time when the credentials expire and the tool should re-validate them, formatted as ISO 8601.\n\nIf set, tools **SHOULD** not invoke the `get` command of the Credential Helper for the URI before this time has passed or before the remote service indicates the credentials are expired, revoked, or invalid for any other reason. Otherwise, tools **MAY** assume that the credentials are valid indefinitely or for a tool-specified duration before re-validating them.",
Copy link

Choose a reason for hiding this comment

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

The ISO 8601 spec allows for a (in my opinion) ridiculous number of variants, including ambiguous timestamps in the "local" timezone and esoteric formats such as week and ordinal dates. Should we require it to be in the much smaller subset defined by RFC 3339?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds reasonable, done

@Yannic
Copy link
Member Author

Yannic commented Jan 29, 2024

PTAL

@Yannic Yannic merged commit c9785e2 into main Feb 7, 2024
Yannic added a commit to EngFlow/bazel that referenced this pull request Feb 8, 2024
This was recently specified in EngFlow/credential-helper-spec#2.

RELNOTES[NEW]: Bazel now repects `expires` from Credential Helpers.
@Yannic Yannic deleted the yannic-get-resp-expires branch February 15, 2024 05:53
copybara-service bot pushed a commit to bazelbuild/bazel that referenced this pull request Feb 19, 2024
This was recently specified in EngFlow/credential-helper-spec#2.

RELNOTES[NEW]: Bazel now respects `expires` from Credential Helpers.

Closes #21249.

PiperOrigin-RevId: 608208538
Change-Id: Id168f654093c7491a40364e3988af66ad1767443
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Feb 19, 2024
This was recently specified in EngFlow/credential-helper-spec#2.

RELNOTES[NEW]: Bazel now respects `expires` from Credential Helpers.

Closes bazelbuild#21249.

PiperOrigin-RevId: 608208538
Change-Id: Id168f654093c7491a40364e3988af66ad1767443
tjgq pushed a commit to tjgq/bazel that referenced this pull request Feb 20, 2024
This was recently specified in EngFlow/credential-helper-spec#2.

RELNOTES[NEW]: Bazel now respects `expires` from Credential Helpers.

Closes bazelbuild#21249.

PiperOrigin-RevId: 608208538
Change-Id: Id168f654093c7491a40364e3988af66ad1767443
github-merge-queue bot pushed a commit to bazelbuild/bazel that referenced this pull request Feb 20, 2024
This was recently specified in
EngFlow/credential-helper-spec#2.

RELNOTES[NEW]: Bazel now respects `expires` from Credential Helpers.

Closes #21249.

PiperOrigin-RevId: 608208538
Change-Id: Id168f654093c7491a40364e3988af66ad1767443

Co-authored-by: Yannic Bonenberger <contact@yannic-bonenberger.com>
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.

4 participants