-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor, globus: fix help string indentation and misc whitespace
- Loading branch information
1 parent
0bd5809
commit 2ade700
Showing
1 changed file
with
34 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,20 +91,24 @@ def _token_url_default(self): | |
) | ||
|
||
identity_provider = Unicode( | ||
help="""Restrict which institution a user | ||
can use to login (GlobusID, University of Hogwarts, etc.). This should | ||
be set in the app at developers.globus.org, but this acts as an additional | ||
check to prevent unnecessary account creation.""" | ||
help=""" | ||
Restrict which institution (domain) a user can use to login (GlobusID, | ||
University of Hogwarts, etc.). This should be set in the app at | ||
developers.globus.org, but this acts as an additional check to prevent | ||
unnecessary account creation. | ||
""" | ||
).tag(config=True) | ||
|
||
def _identity_provider_default(self): | ||
return os.getenv('IDENTITY_PROVIDER', '') | ||
|
||
username_from_email = Bool( | ||
False, | ||
help="""Create username from email address, not preferred username. If | ||
an identity provider is specified, email address must be from the same | ||
domain. Email scope will be set automatically.""", | ||
help=""" | ||
Create username from email address, not preferred username. If an | ||
identity provider is specified, email address must be from the same | ||
domain. Email scope will be set automatically. | ||
""", | ||
config=True, | ||
) | ||
|
||
|
@@ -115,8 +119,10 @@ def _username_claim_default(self): | |
return "preferred_username" | ||
|
||
exclude_tokens = List( | ||
help="""Exclude tokens from being passed into user environments | ||
when they start notebooks, Terminals, etc.""" | ||
help=""" | ||
Exclude tokens from being passed into user environments when they start | ||
notebooks, Terminals, etc. | ||
""" | ||
).tag(config=True) | ||
|
||
def _exclude_tokens_default(self): | ||
|
@@ -137,32 +143,40 @@ def _scope_default(self): | |
return scopes | ||
|
||
globus_local_endpoint = Unicode( | ||
help="""If Jupyterhub is also a Globus | ||
endpoint, its endpoint id can be specified here.""" | ||
help=""" | ||
If JupyterHub is also a Globus endpoint, its endpoint id can be | ||
specified here. | ||
""" | ||
).tag(config=True) | ||
|
||
def _globus_local_endpoint_default(self): | ||
return os.getenv('GLOBUS_LOCAL_ENDPOINT', '') | ||
|
||
revoke_tokens_on_logout = Bool( | ||
help="""Revoke tokens so they cannot be used again. Single-user servers | ||
MUST be restarted after logout in order to get a fresh working set of | ||
tokens.""" | ||
help=""" | ||
Revoke tokens so they cannot be used again. Single-user servers MUST be | ||
restarted after logout in order to get a fresh working set of tokens. | ||
""" | ||
).tag(config=True) | ||
|
||
def _revoke_tokens_on_logout_default(self): | ||
return False | ||
|
||
allowed_globus_groups = Set( | ||
help="""Allow members of defined Globus Groups to access JupyterHub. Users in an | ||
admin Globus Group are also automatically allowed. Groups are specified with their UUIDs. Setting this will | ||
add the Globus Groups scope.""" | ||
help=""" | ||
Allow members of defined Globus Groups to access JupyterHub. Users in an | ||
admin Globus Group are also automatically allowed. Groups are specified | ||
with their UUIDs. Setting this will add the Globus Groups scope. | ||
""" | ||
).tag(config=True) | ||
|
||
admin_globus_groups = Set( | ||
help="""Set members of defined Globus Groups as JupyterHub admin users. | ||
These users are automatically allowed to login to JupyterHub. Groups are specified with | ||
their UUIDs. Setting this will add the Globus Groups scope.""" | ||
help=""" | ||
Set members of defined Globus Groups as JupyterHub admin users. These | ||
users are automatically allowed to login to JupyterHub. Groups are | ||
specified with their UUIDs. Setting this will add the Globus Groups | ||
scope. | ||
""" | ||
).tag(config=True) | ||
|
||
async def pre_spawn_start(self, user, spawner): | ||
|
@@ -208,7 +222,6 @@ def build_auth_state_dict(self, token_info, user_info): | |
accounts) will correspond to a Globus User ID, so [email protected] | ||
will have the 'foouser' account in Jupyterhub. | ||
""" | ||
|
||
tokens = self.get_globus_tokens(token_info) | ||
# historically, tokens have been organized by resource server for convenience. | ||
# If multiple scopes are requested from the same resource server, they will be | ||
|
@@ -324,7 +337,6 @@ def user_info_to_username(self, user_info): | |
accounts) will correspond to a Globus User ID, so [email protected] | ||
will have the 'foouser' account in Jupyterhub. | ||
""" | ||
|
||
return user_info.get(self.username_claim).split('@')[0] | ||
|
||
def get_default_headers(self): | ||
|
@@ -352,7 +364,6 @@ async def revoke_service_tokens(self, services): | |
<Additional services>... | ||
} | ||
""" | ||
|
||
access_tokens = [ | ||
token_dict.get('access_token') for token_dict in services.values() | ||
] | ||
|