diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-03 20:45:29 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-03 20:45:29 -0800 |
commit | 422a8cc47489aa44b852ff0add1ef6ea63cfc1ff (patch) | |
tree | 6640c13f10271cffe8e442e1fc75202d032121ca /python/fatcat_web/__init__.py | |
parent | 1cb3b1afa8df555d890cc556751222cf22c22696 (diff) | |
download | fatcat-422a8cc47489aa44b852ff0add1ef6ea63cfc1ff.tar.gz fatcat-422a8cc47489aa44b852ff0add1ef6ea63cfc1ff.zip |
several auth improvements
Diffstat (limited to 'python/fatcat_web/__init__.py')
-rw-r--r-- | python/fatcat_web/__init__.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/python/fatcat_web/__init__.py b/python/fatcat_web/__init__.py index f8b72fd0..9cd5f812 100644 --- a/python/fatcat_web/__init__.py +++ b/python/fatcat_web/__init__.py @@ -26,6 +26,17 @@ conf = fatcat_client.Configuration() conf.host = "http://localhost:9411/v0" api = fatcat_client.DefaultApi(fatcat_client.ApiClient(conf)) +if Config.FATCAT_API_AUTH_TOKEN: + print("Found and using privileged token (eg, for account signup)") + priv_conf = fatcat_client.Configuration() + priv_conf.api_key["Authorization"] = Config.FATCAT_API_AUTH_TOKEN + priv_conf.api_key_prefix["Authorization"] = "Bearer" + priv_conf.host = 'http://localhost:9411/v0' + priv_api = fatcat_client.DefaultApi(fatcat_client.ApiClient(local_conf)) +else: + print("No privileged token found") + priv_api = None + from fatcat_web import routes, auth gitlab_bp = create_flask_blueprint(Gitlab, oauth, auth.handle_oauth) |