mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-12 20:43:02 +00:00
Placeholder for roles in spawner
This commit is contained in:
@@ -587,7 +587,7 @@ class JupyterHubOAuthServer(WebApplicationServer):
|
|||||||
super().__init__(validator, *args, **kwargs)
|
super().__init__(validator, *args, **kwargs)
|
||||||
|
|
||||||
def add_client(
|
def add_client(
|
||||||
self, client_id, client_secret, redirect_uri, allowed_roles, description=''
|
self, client_id, client_secret, redirect_uri, allowed_roles=None, description=''
|
||||||
):
|
):
|
||||||
"""Add a client
|
"""Add a client
|
||||||
|
|
||||||
@@ -609,6 +609,8 @@ class JupyterHubOAuthServer(WebApplicationServer):
|
|||||||
app_log.info(f'Creating oauth client {client_id}')
|
app_log.info(f'Creating oauth client {client_id}')
|
||||||
else:
|
else:
|
||||||
app_log.info(f'Updating oauth client {client_id}')
|
app_log.info(f'Updating oauth client {client_id}')
|
||||||
|
if allowed_roles == None:
|
||||||
|
allowed_roles = []
|
||||||
orm_client.secret = hash_token(client_secret) if client_secret else ""
|
orm_client.secret = hash_token(client_secret) if client_secret else ""
|
||||||
orm_client.redirect_uri = redirect_uri
|
orm_client.redirect_uri = redirect_uri
|
||||||
orm_client.description = description
|
orm_client.description = description
|
||||||
|
@@ -568,7 +568,7 @@ class User:
|
|||||||
client_id,
|
client_id,
|
||||||
api_token,
|
api_token,
|
||||||
url_path_join(self.url, server_name, 'oauth_callback'),
|
url_path_join(self.url, server_name, 'oauth_callback'),
|
||||||
description="Server at %s"
|
description="Server at %s" # todo: own server: 'users:servers!user={username} as allowed role?
|
||||||
% (url_path_join(self.base_url, server_name) + '/'),
|
% (url_path_join(self.base_url, server_name) + '/'),
|
||||||
)
|
)
|
||||||
db.commit()
|
db.commit()
|
||||||
|
Reference in New Issue
Block a user