mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 05:53:00 +00:00
add description to oauth clients for services and user servers
This commit is contained in:
@@ -1222,6 +1222,7 @@ class JupyterHub(Application):
|
||||
client_id=service.oauth_client_id,
|
||||
client_secret=service.api_token,
|
||||
redirect_uri=service.oauth_redirect_uri,
|
||||
description="JupyterHub service %s" % service.name,
|
||||
)
|
||||
|
||||
self._service_map[name] = service
|
||||
|
@@ -196,7 +196,7 @@ class ClientStore(HubDBMixin, oauth2.store.ClientStore):
|
||||
secret=HashComparable(orm_client.secret),
|
||||
)
|
||||
|
||||
def add_client(self, client_id, client_secret, redirect_uri):
|
||||
def add_client(self, client_id, client_secret, redirect_uri, description=''):
|
||||
"""Add a client
|
||||
|
||||
hash its client_secret before putting it in the database.
|
||||
@@ -212,6 +212,7 @@ class ClientStore(HubDBMixin, oauth2.store.ClientStore):
|
||||
identifier=client_id,
|
||||
secret=hash_token(client_secret),
|
||||
redirect_uri=redirect_uri,
|
||||
description=description,
|
||||
)
|
||||
self.db.add(orm_client)
|
||||
self.db.commit()
|
||||
|
@@ -381,6 +381,7 @@ class User:
|
||||
# containers that resume will be updated below
|
||||
client_store.add_client(client_id, api_token,
|
||||
url_path_join(self.url, server_name, 'oauth_callback'),
|
||||
description="Server at %s" % url_path_join(self.url, server_name),
|
||||
)
|
||||
db.commit()
|
||||
|
||||
|
Reference in New Issue
Block a user