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

Update last used timestamp on ssh keys when used #457

Merged
merged 2 commits into from
Jul 2, 2024
Merged

Update last used timestamp on ssh keys when used #457

merged 2 commits into from
Jul 2, 2024

Conversation

smlx
Copy link
Member

@smlx smlx commented Jul 1, 2024

Update the last_used attribute of ssh keys using the same technique as uselagoon/lagoon#3675:

  • Convert time to a string to be parsed by MySQL to DATETIME column type.
  • Use UTC timezone.

Avoid redundant whitespace.
@smlx smlx changed the title last used Update last used timestamp on ssh keys when they are used Jul 1, 2024
@smlx smlx changed the title Update last used timestamp on ssh keys when they are used Update last used timestamp on ssh keys when used Jul 1, 2024
@smlx smlx force-pushed the last-used branch 2 times, most recently from 3edfcad to b83eeae Compare July 2, 2024 01:53
Update the last_used timestamp to the current time whenever an SSH key
is used to either generate a token or query exec permissions on a Lagoon
environment.

The timestamp is updated every time the key is used, regardless of
whether or not the permission check or token generation succeeds.

Timestamps are converted and stored in UTC.
@smlx smlx marked this pull request as ready for review July 2, 2024 03:34
@smlx smlx requested a review from shreddedbacon July 2, 2024 03:34
Copy link
Member

@shreddedbacon shreddedbacon left a comment

Choose a reason for hiding this comment

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

Yeah, still unsure how the portal is fully pieced together but 👀 over the changes related to the sshkey last used look ✔️

@smlx smlx merged commit a79c370 into main Jul 2, 2024
12 checks passed
@smlx smlx deleted the last-used branch July 2, 2024 04:27
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.

2 participants