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

Auth refresh check admin #1349

Merged
merged 2 commits into from
Nov 19, 2024
Merged

Auth refresh check admin #1349

merged 2 commits into from
Nov 19, 2024

Conversation

ewan-escience
Copy link
Collaborator

Check admin status on JWT refresh

Changes proposed in this pull request

  • Check the database for admin status when refreshing JWT
  • Upgrade some auth dependencies

How to test

  • To be able to test this, you need your cookies to expire in just slightly longer than 5 minutes (instead of an hour), so edit JwtCreator.java and set ONE_HOUR_IN_MILLISECONDS to 310_000L
  • Make sure to have RSD_ENVIRONMENT=dev in your .env
  • docker compose down --volumes && docker compose build --parallel && docker compose up --scale data-generation=0
  • Sign in, you should be admin
  • Run in the database DELETE FROM admin_account;; within 10 seconds, you should not be admin anymore
  • Run in the database INSERT INTO admin_account VALUES ('some-uuid');, where you can find your UUID in your settings; within 10 seconds, you should be admin again
  • Don't forget to git restore . afterwards

PR Checklist:

  • Increase version numbers in docker-compose.yml
  • Link to a GitHub issue
  • Update documentation
  • Tests

@ewan-escience ewan-escience self-assigned this Nov 18, 2024
Copy link

Copy link
Contributor

@dmijatovic dmijatovic left a comment

Choose a reason for hiding this comment

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

Nice work!

@ewan-escience ewan-escience merged commit 2317c36 into main Nov 19, 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.

2 participants