Skip to content

Auth Proxy is a proxy system that manages your API authentication for you so that your local scripts don't need shitty environment variables

Notifications You must be signed in to change notification settings

Shuffle/auth-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Auth Proxy

Auth Proxy is an HTTP proxy that automatically adds the Authorization header to the request. It is useful for testing APIs that require authentication.

PS: If you want to try this, please reach out to support@shuffler.io. It is Open Source, but currently in Beta in the Nightly release of Shuffle

image

TODO

Auth proxy is in internal tests by the Shuffle team and is currently not useful. We will eventually release it as a part of shuffle with the /api/v1/proxy endpoint

Authentication Storage

Authentication in Shuffle is handled in many ways, including OAuth2, JWT, and API keys. Auth Proxy supports OAuth2, API keys and every other authentication method Shuffle itself supports.

Shuffle encrypts and stores your authentication data securely. The proxy will automatically add the correct headers to the request, so you don't have to worry about it.

Usage

  1. Set up auth for your product: shuffler.io/search
  2. Get your API-key: shuffler.io/settings
  3. Configure HTTP/HTTPS proxy:
export HTTP_PROXY=http://:APIKEY@shuffler.io/api/v1/proxy
export HTTPS_PROXY=https://:APIKEY@shuffler.io/api/v1/proxy
  1. Run your python script (example): The proxy will automatically add the Authorization header to the request for Github Oauth2 in the case below, as long as your Github authentication in Shuffle is configured.
import requests

# Manual control of proxies without HTTP/HTTPS_PROXY env variables:
proxies = {"http": "http://:APIKEY@shuffler.io/api/v1/proxy"}

# Send the request
response = requests.get('https://api.github.com/user', proxies=proxies)
print(response.json())

Accessing Local Services

Since the proxy is in the Shuffle backend, you will need a local version of the Shuffle backend running to access local services.

You can redirect requests to the proxy with the HTTP_PROXY and HTTPS_PROXY environment variables as per usual - just change the shuffler.io in the original example to localhost:5001 or whatever your local Shuffle backend is running on.

About

Auth Proxy is a proxy system that manages your API authentication for you so that your local scripts don't need shitty environment variables

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published