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

Multi coupon #24

Merged
merged 11 commits into from
Oct 28, 2024
Merged

Multi coupon #24

merged 11 commits into from
Oct 28, 2024

Conversation

kenafoster
Copy link
Contributor

This PR replaces #21 with a local branch

Description

This PR adds support for multiple coupons, so each can have independent configuration options. For example, having different coupons to add users to different keycloak groups.

Related Issue

Closes #14

Motivation and Context

We've been using this extension in training and tutorials where there's a clear benefit of having different coupons map to different groups to manage access. For example, you might have one coupon granting access to GPUs, while other coupon just grants access to regular instances. Or you might have yet another coupon which grants admin rights.

Having support for multiple coupons make it easy to handle these cases by assigning them to different keycloak groups and managing separate permissions for them.

How Has This Been Tested?

This has been tested by:

  1. Installing the extension from the multi-coupon branch:
pip install git+https://github.com/marcelovilla/nebari-self-registration@multi-coupon
  1. Set the following extension configuration in nebari-config.yaml and create the required groups in keycloak if they do not exist already:
self_registration:
  coupons:
    METROSTAR:
      account_expiration_days: 365
      approved_domains: ["*.mil"]
      registration_groups: ["metrostar"]
    QUANSIGHT:
      account_expiration_days: 31
      approved_domains: ["quansight.com"]
      registration_groups: ["quansight"]
    METROSTARADMIN:
      account_expiration_days: 365
      approved_domains: ["*.mil"]
      registration_groups: ["metrostar", "admin"]
  values:
    image:
      repository: ghcr.io/marcelovilla/nebari-self-registration
      tag: "20240701-1553"
  1. Re-deploy Nebari:
nebari deploy -c nebari-config.yaml
  1. Go to /registration and use the different coupons to create new accounts. If everything works as expected, you'll see the new users in keycloak and depending what coupon you used, you'll see they've been assigned to the corresponding groups.

Screenshots (if appropriate):

@kenafoster kenafoster mentioned this pull request Oct 25, 2024
Copy link
Member

@marcelovilla marcelovilla 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 to me @kenafoster ! Thanks for taking the time to get this over the finish line 🚀

@kenafoster kenafoster merged commit 68f3dfd into main Oct 28, 2024
1 check passed
@kenafoster kenafoster deleted the multi-coupon branch October 28, 2024 17:22
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.

Support for multiple coupons with specifc Keycloak group assignation
2 participants