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

Onboarding event when a user logs in #518

Open
Yuwei0021 opened this issue Nov 19, 2024 · 2 comments
Open

Onboarding event when a user logs in #518

Yuwei0021 opened this issue Nov 19, 2024 · 2 comments

Comments

@Yuwei0021
Copy link

Hello,

with Onyxia, I would like to ensure that when a user logs in, it triggers some code to create the namespace for the user, specifically to avoid granting the onyxia service account the right to create/modify namespaces.

Currently, the InitNamespaceEvent is only triggered when a user launches a service and if their namespace does not already exist.

It would be ideal to emit an onboarding event whenever a user logs in, independent of service instantiation.

Best regards,
Yuwei

@olevitt olevitt transferred this issue from InseeFrLab/onyxia Nov 19, 2024
@Yuwei0021
Copy link
Author

Hello,
Based on my observations, the onboarding endpoint is triggered every time a user logs in. The onyxia-api either creates a namespace if it doesn’t already exist or updates the lastlogin annotation for the namespace.

If the onboarding process only performs those actions, would it make sense to make it optional?
We could either let Onyxia handle the onboarding or allow it to be managed externally. The second option could help bypass security restrictions in organizations that don't want to grant cluster-wide permissions to the Onyxia API.

yuwei

@olevitt
Copy link
Contributor

olevitt commented Nov 22, 2024

Hi !

Yes, I agree with you.
Mid / long term answer : we are planning to separate the onboarding process from the rest of the API (possibly creating a new optional module onyxia-onboarding with elevated privileges so that Onyxia-api can be run with lower privileges.
Short term answer : there is a configuration key in region (services.allowNamespaceCreation, see https://github.com/InseeFrLab/onyxia-api/blob/main/docs/region-configuration.md#services-properties) that let you disable the namespace creation, assuming it has been done externally from Onyxia. But yeah, if you have allowNamespaceCreation disabled then you have to create the namespace by yourself and you (currently at least, this issue may want to change that) don't get any event. So this is probably only suitable if your onboarding process is completly external from Onyxia (e.g you are watching Keycloak events)

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

No branches or pull requests

2 participants