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

Parse and insert keycloak roles scopes into JupyterHub #2471

Merged
merged 22 commits into from
May 28, 2024

Conversation

aktech
Copy link
Member

@aktech aktech commented May 17, 2024

Reference Issues or PRs

Fixes #2432

What does this implement/fix?

Put a x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds a feature)
  • Breaking change (fix or feature that would cause existing features not to work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • Other (please describe):

Testing

  • Did you test the pull request locally?
  • Did you add new tests?

Any other comments?

@aktech aktech force-pushed the parse-keycloak-roles-scopes branch from 7d2b7d7 to 2b1a857 Compare May 24, 2024 20:36
@aktech aktech marked this pull request as ready for review May 26, 2024 16:38
@aktech aktech requested a review from krassowski May 26, 2024 20:38
Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

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

I have not run it yet, but it looks good.

Do you know how long the login sequence with the REST API call takes? Should we add a log message printing out delta in milliseconds to be able to monitor this in logs?

- improve comments
- improve error logging

Co-authored-by: Michał Krassowski <[email protected]>
@aktech
Copy link
Member Author

aktech commented May 27, 2024

Do you know how long the login sequence with the REST API call takes? Should we add a log message printing out delta in milliseconds to be able to monitor this in logs?

I have not measured it but I didn't notice any observable latency. Sure, worth adding the time delta in logs.

Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

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

Tested locally by:

  • adding a new client role keycloak: Configure → Clients → jupyterhub → Roles → Add role → Role name = testrole → Save → Attributes → scopes = test → component = jupyterhub
  • assigning the role to user: Manage → Users → username → Role mappings → Available Roles → testrole → Add Selected
  • log out and log in as username
  • open k9s, enter shell on jupyterhub pod, open sqlite database, view the roles table

Co-authored-by: Michał Krassowski <[email protected]>
Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

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

Looks good - thank you!

Last time some pytest tests failed in local deployment run, let's see if those pass this time before merging.

@aktech
Copy link
Member Author

aktech commented May 28, 2024

Last time some pytest tests failed in local deployment run, let's see if those pass this time before merging.

Yes, I noticed tests/tests_deployment/test_jupyterhub_ssh.py::test_simple_jupyterhub_ssh failed, I am guessing it's a bit flaky, lets see though. 🤞

@aktech
Copy link
Member Author

aktech commented May 28, 2024

All green now, merging.

@aktech aktech merged commit 363cb0d into develop May 28, 2024
26 checks passed
@aktech aktech deleted the parse-keycloak-roles-scopes branch May 28, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done 💪🏾
Development

Successfully merging this pull request may close these issues.

[ENH] - Parse and load keycloak roles into JupyterHub
2 participants