Commit ae941b7d authored by Tanner Prestegard's avatar Tanner Prestegard

Use a single service URL for all auth types

GraceDB servers can now handle all auth types at the
default service URL (/api/), so we don't need to specify
any special URL for basic auth.
parent 4ea4efad
......@@ -21,7 +21,7 @@ import os, sys, shutil
import json
import six
from ligo.gracedb.rest import GraceDb, GraceDbBasic
from ligo.gracedb.rest import DEFAULT_SERVICE_URL, DEFAULT_BASIC_SERVICE_URL
from ligo.gracedb.rest import DEFAULT_SERVICE_URL
DEFAULT_COLUMNS = "graceid,labels,group,pipeline,search,far,gpstime,created,dataurl"
......@@ -285,18 +285,6 @@ Longer strings will be truncated.""" % {
os.environ.get('GRACEDB_SERVICE_URL', None) or \
DEFAULT_SERVICE_URL
# If the user requested a specific service, but also wants basic auth,
# then the service had better be a basic auth endpoint. Otherwise die.
# On the other hand, if the user did not specify a service url, then we
# will use the default basic URL if basic auth was requested.
if options.use_basic_auth:
if options.service or os.environ.get('GRACEDB_SERVICE_URL', None):
if 'basic' not in service:
error("To use the basic auth client, specify a basic auth service URL or use the default.")
exit(1)
else:
service = DEFAULT_BASIC_SERVICE_URL
# Client subclass according to preferred auth method.
global Client
if options.use_basic_auth:
......
......@@ -35,7 +35,6 @@ from .utils import event_or_superevent, handle_str_or_list_arg, safe_netrc, \
cleanListInput, get_dt_from_openssl_output, is_expired
DEFAULT_SERVICE_URL = "https://gracedb.ligo.org/api/"
DEFAULT_BASIC_SERVICE_URL = "https://gracedb.ligo.org/apibasic/"
KNOWN_TEST_HOSTS = ['moe.phys.uwm.edu', 'embb-dev.ligo.caltech.edu', 'simdb.phys.uwm.edu',]
#---------------------------------------------------------------------
......@@ -2003,7 +2002,7 @@ class GraceDbBasic(GraceDb):
GraceDB behind a proxy. For other kwargs accepted by the constructor,
consult the source code.
"""
def __init__(self, service_url=DEFAULT_BASIC_SERVICE_URL, proxy_host=None,
def __init__(self, service_url=DEFAULT_SERVICE_URL, proxy_host=None,
proxy_port=3128, username=None, password=None, api_version=None,
*args, **kwargs):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment