Skip to content

James c iss2029 access token expiry#291

Open
James-Cocker wants to merge 14 commits intomainfrom
JamesC-iss2029-access-token-expiry
Open

James c iss2029 access token expiry#291
James-Cocker wants to merge 14 commits intomainfrom
JamesC-iss2029-access-token-expiry

Conversation

@James-Cocker
Copy link
Copy Markdown
Contributor

@James-Cocker James-Cocker commented Apr 30, 2026

Why?

Refer to galasa-dev/projectmanagement#2029.

This PR supports the upcoming expiry token changes in galasa-dev/galasa#570 for the issue above.

Screenshot(s) of changes

image image image image image

Changes

  • When you allocate an access token it asks for a number of days/months/years, or a certain date when it will expire. That expiry time is associated with the user.
  • Showing the token in the web UI also shows it's expiry time.
  • Any expiry time which is "getting close" will be marked on the UI with a warning.
  • Unit tests

Signed-off-by: James Cocker <james.s.earth@gmail.com>
Signed-off-by: James Cocker <james.s.earth@gmail.com>
Signed-off-by: James Cocker <james.s.earth@gmail.com>
Signed-off-by: James Cocker <james.s.earth@gmail.com>
Signed-off-by: James Cocker <james.s.earth@gmail.com>
Signed-off-by: James Cocker <james.s.earth@gmail.com>
Signed-off-by: James Cocker <james.s.earth@gmail.com>
Signed-off-by: James Cocker <james.s.earth@gmail.com>
Signed-off-by: James Cocker <james.s.earth@gmail.com>
Comment thread galasa-ui/messages/en.json Outdated
Comment thread galasa-ui/src/app/auth/tokens/route.ts Outdated
Comment thread galasa-ui/src/app/users/edit/page.tsx Outdated
Comment thread galasa-ui/src/app/users/edit/page.tsx Outdated
Comment thread galasa-ui/messages/en.json Outdated

// Check if token is expired
const isExpired = useMemo(() => {
if (!token.expiryTime) return false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For security purposes, if a token doesn't have an expiry time, then shouldn't we treat it as expired and force the user to create a new token?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe that this variable is just used for styling purposes so it shouldn't have any impact on security. I'm thinking if the migration somehow doesn't work, then the tokens probably don't need to all display as expired - but maybe they should as they wouldn't be usable if that were the case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, I agree that they should all be displayed. That at least gives users a chance to delete old tokens.

Comment thread galasa-ui/src/components/tokens/TokenRequestModal.tsx Outdated
Comment thread galasa-ui/src/components/tokens/TokenRequestModal.tsx Outdated
Signed-off-by: James Cocker <james.s.earth@gmail.com>
…ormat dates correctly

Signed-off-by: James Cocker <james.s.earth@gmail.com>
… corrected post request

Signed-off-by: James Cocker <james.s.earth@gmail.com>
Signed-off-by: James Cocker <james.s.earth@gmail.com>
Signed-off-by: James Cocker <james.s.earth@gmail.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.

2 participants