validate oauth client_id/secret

This commit is contained in:
Min RK
2017-04-04 15:38:31 +02:00
parent bef121dbe3
commit 5a5fdc2565

View File

@@ -428,6 +428,12 @@ class HubOAuth(HubAuth):
def _client_secret(self): def _client_secret(self):
return os.getenv('JUPYTERHUB_CLIENT_SECRET', '') return os.getenv('JUPYTERHUB_CLIENT_SECRET', '')
@validate('oauth_client_id', 'oauth_client_secret')
def _ensure_not_empty(self, proposal):
if not proposal.value:
raise ValueError("%s cannot be empty." % proposal.trait.name)
return proposal.value
oauth_redirect_uri = Unicode( oauth_redirect_uri = Unicode(
help="""OAuth redirect URI help="""OAuth redirect URI