Skip to content

Commit

Permalink
allow specifying the REST API url via an env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dsschult committed May 30, 2024
1 parent 5b1da7f commit 25f2be3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions iceprod/client_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
def add_auth_to_argparse(parser):
"""Add auth args to argparse."""
config = from_environment({
'API_URL': 'https://iceprod2-api.icecube.wisc.edu',
'OAUTH_URL': 'https://keycloak.icecube.wisc.edu/auth/realms/IceCube',
'OAUTH_CLIENT_ID': 'iceprod',
'OAUTH_CLIENT_SECRET': '',
})
description = '''
Use either user credentials or client credentials to authenticate.
Can also be specified via env variables: OAUTH_URL, OAUTH_CLIENT_ID,
and OAUTH_CLIENT_SECRET.
Can also be specified via env variables: API_URL, OAUTH_URL,
OAUTH_CLIENT_ID, and OAUTH_CLIENT_SECRET.
'''
parser.add_argument('--rest-url', default='https://iceprod2-api.icecube.wisc.edu',
parser.add_argument('--rest-url', default=config['API_URL'],
help='URL for REST API (default: IceProd API)')
group = parser.add_argument_group('OAuth', description)
group.add_argument('--oauth-url', default=config['OAUTH_URL'],
Expand Down

0 comments on commit 25f2be3

Please sign in to comment.