Skip to content

Commit

Permalink
Template the GitHub OAuth configuration.
Browse files Browse the repository at this point in the history
To make it configurable via the copier questionaire.
  • Loading branch information
csadorf committed Jun 10, 2022
1 parent 176c402 commit 5256870
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
24 changes: 24 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,27 @@ gh_oauth_client_secret:
default:
secret: true
help: The GitHub OAuth app client secret.

gh_oauth_admin_users:
type: str
default:
placeholder: jdoe jsmith
help: |
Users listed here are granted admin access to the JupyterHub. Specify
multiple users through white space delimitation.
gh_oauth_allowed_organizations:
type: str
placeholder: contoso myorg
help: |
Restrict the login to users who are members of any of the specified
organizations. Specify multiple organizations through white space
delimitation.
gh_oauth_allowed_users:
type: str
default:
placeholder: jdoe jsmith
help: |
Restrict the login to users who are listed here. Specify multiple users
through white space delimitation.
20 changes: 18 additions & 2 deletions template/{{hostname}}/modules/aiidalab/values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,29 @@ hub:
client_id: "{{ gh_oauth_client_id }}"
client_secret: "{{ gh_oauth_client_secret }}"
oauth_callback_url: "https://{{ hostname }}/hub/oauth_callback"
{%- if gh_oauth_allowed_organizations %}
allowed_organizations:
- aiidalab
{%- for org in gh_oauth_allowed_organizations.split() %}
- {{ org }}
{%- endfor %}
{%- endif %}
{%- if gh_oauth_allowed_users %}
allowed_users:
{%- for user in gh_oauth_allowed_users.split() %}
- {{ user }}
{%- endfor %}
{%- endif %}
{%- if gh_oauth_admin_users %}
admin_users:
- csadorf
{%- for user in gh_oauth_admin_users.split() %}
- {{ user }}
{%- endfor %}
{%- endif %}
scope:
- read:user
{%- if gh_oauth_allowed_organizations %}
- read:org
{%- endif %}

db:
pvc:
Expand Down

0 comments on commit 5256870

Please sign in to comment.