-
Notifications
You must be signed in to change notification settings - Fork 151
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
feat: store user last accessed, and sshkey last used timestamps #3675
Conversation
064d9f9
to
7791232
Compare
e7a22f3
to
8798018
Compare
8798018
to
1edc28d
Compare
ssh-portal-api will either need to use the API, or be updated to include the function to update the last used timestamp when an ssh key is used |
Should the SSH key last used also include the last time it was used to generate a token? From what I can tell this PR doesn't do that but I could be wrong. |
In the legacy SSH service, it is called whenever the authorize.sh script is called and hits the /keys endpoint in the API. So whenever a key is used and matches, it will get updated. Token, SSH, whatever. |
8ece7e8
to
38f28d8
Compare
38f28d8
to
828c247
Compare
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.
This looks good - tested ok - picked up and closed any minor nits already :-)
General Checklist
Database Migrations
Whenever a user accesses the API update the last_accessed attribute on the user.
Alternative approach could be to store this in the API DB to reduce calls to keycloak though.
Also when the
api/keys
endpoint is hit, and a valid sshkey is detected, a newlast_used
field is updated to indicate when the key was last used.