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

[ENH] - Add User object to database #930

Open
peytondmurray opened this issue Oct 28, 2024 · 0 comments · May be fixed by #975
Open

[ENH] - Add User object to database #930

peytondmurray opened this issue Oct 28, 2024 · 0 comments · May be fixed by #975
Assignees
Labels
area: workflow-improvements Issue is affected by upcoming workflow improvements needs: discussion 💬 This item needs team-level discussion before scoping needs: testing ✅ roadmap: UX Experience type: enhancement 💅🏼

Comments

@peytondmurray
Copy link
Contributor

peytondmurray commented Oct 28, 2024

Feature description

Currently, conda-store doesn't have the concept of a User. This leads to much confusion among
conda-store users and devs because:

  1. When you run docker compose up --build to bring up conda-store locally and then navigate to
    https://localhost:8080, you are presented with a login screen, suggesting that you need user
    credentials
  2. When you use nebari, you have to login with keycloak
  3. conda-store has a robust permissioning system

In actuality, conda-store doesn't store user credentials at all. Nebari users login with keycloak,
which then mints a token that contains a user's role bindings for conda-store; then every request
sent to conda-store-server includes this token, which conda-store processes and uses to know
what environments/namespaces are available to the person who made the web request.

The effect of this choice is that we don't have to manage user credentials or keep track of users,
but at the cost of a lot of internal code complexity and developer confusion.

This issue is to start the discussion about adding a User table to the database. Potential issues:

  • Coordination with Nebari team to prevent breaking active deployments
  • Ensuring conda-store authentication works with Keycloak authentication

Other notes

Currently, we are managing Roles using just python strings; i.e. there's no Role enum defined anywhere. In any context where we need to enforce a certain level of access, we do string comparison to figure out whether someone has the required role bindings to do the action.

Additionally we have an Enum class for Permissions, which are used for restricting access for certain conda-store actions, e.g. environment::create.

Value and/or benefit

  • Reduction in developer confusion
  • More straightforward code paths any time we need to get role mappings for a user

Key Workflows

A working implementation must

  • Define User, Role, and Permission tables
  • Allow each User to have admin, viewer, or editor Role for various namespace/environment rules.
  • Map each Role to Permission entries; e.g. a User with the editor Role for namespace/environment */foo, should be able to create or edit environments named foo in any namespace.
@peytondmurray peytondmurray self-assigned this Oct 28, 2024
@peytondmurray peytondmurray moved this from New 🚦 to Ready 🛎️ in conda-store 🐍 Oct 28, 2024
@peytondmurray peytondmurray added type: enhancement 💅🏼 needs: discussion 💬 This item needs team-level discussion before scoping needs: testing ✅ area: workflow-improvements Issue is affected by upcoming workflow improvements labels Oct 28, 2024
@peytondmurray peytondmurray linked a pull request Nov 11, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: workflow-improvements Issue is affected by upcoming workflow improvements needs: discussion 💬 This item needs team-level discussion before scoping needs: testing ✅ roadmap: UX Experience type: enhancement 💅🏼
Projects
Status: Ready 🛎️
Development

Successfully merging a pull request may close this issue.

2 participants