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

Capture LastUsed time for ClusterAuthTokens #28

Merged

Conversation

andreas-kupries
Copy link
Contributor

@andreas-kupries andreas-kupries commented Aug 14, 2024

rancher/rancher#45732

Related changes:

If ACE was used to authenticate a request capture the last used time for the token in the corresponding ClusterAuthToken, which is then sync'ed back to the upstream Token object.

@andreas-kupries andreas-kupries self-assigned this Aug 14, 2024
@andreas-kupries andreas-kupries changed the title Support LastUsedAt for ClusterAuthToken Support for new field ClusterAuthToken.LastUsedAt Aug 16, 2024
Copy link
Contributor Author

@andreas-kupries andreas-kupries left a comment

Choose a reason for hiding this comment

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

Interesting trick with an anonymous nested function to get an early block abort without aborting the outer sequence.

Given that k-a-a is unversioned how does it work now distinguishing an old rancher not supporting last-used-at, versus one which supports it ?

@pmatseykanets
Copy link
Contributor

Given that k-a-a is unversioned how does it work now distinguishing an old rancher not supporting last-used-at, versus one which supports it?

It is versioned, it's just the same version can be (but doesn't have to be) used across multiple release lines. The version is pinned here. We can tag this change with v0.3.0 and use it only for v2.10+ leaving the room for potential updates/hotfixes for lower release lines. Now even without that, since the field is optional it may work just fine as is, needs to be tested well though.

@andreas-kupries
Copy link
Contributor Author

Given that k-a-a is unversioned how does it work now distinguishing an old rancher not supporting last-used-at, versus one which supports it?

It is versioned, it's just the same version can be (but doesn't have to be) used across multiple release lines. The version is pinned here. We can tag this change with v0.3.0 and use it only for v2.10+ leaving the room for potential updates/hotfixes for lower release lines. Now even without that, since the field is optional it may work just fine as is, needs to be tested well though.

💡

@pmatseykanets pmatseykanets changed the title Support for new field ClusterAuthToken.LastUsedAt Capture LastUsed time for ClusterAuthTokens Oct 1, 2024
andreas-kupries and others added 8 commits October 7, 2024 22:17
beware: figure out how to distinguish cat's supporting lua vs not
note: likely requires proper init of lua on cat creation
note: find the places creating cats
finalize: internal docs about code reasoning.
… support.

note: commit had to be in rancher reppo itself, not in a forked repo for go to pick it up.
@pmatseykanets pmatseykanets merged commit 5f7f885 into rancher:master Oct 8, 2024
4 checks passed
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