Authentication

class Auth(domain='https://accounts.descarteslabs.com', scope=None, leeway=500, token_info_path='/root/.descarteslabs/token_info.json', client_id=None, client_secret=None, jwt_token=None, refresh_token=None)[source]

Helps retrieve JWT from a client id and refresh token for cli usage.

Parameters:
  • domain – endpoint for auth0
  • scope – the JWT fields to be included
  • leeway – JWT expiration leeway
  • token_info_path – path to a JSON file optionally holding auth information
  • client_id – JWT client id
  • client_secret – JWT client secret
  • jwt_token – the JWT token, if we already have one
  • refresh_token – the refresh token
build_session()[source]
classmethod from_environment_or_token_json(**kwargs)[source]

Creates an Auth object from environment variables CLIENT_ID, CLIENT_SECRET, JWT_TOKEN if they are set, or else from a JSON file at the given path.

Parameters:
  • domain – endpoint for auth0
  • scope – the JWT fields to be included
  • leeway – JWT expiration leeway
  • token_info_path – path to a JSON file optionally holding auth information
ADAPTER = <descarteslabs.common.threading.local.ThreadLocalWrapper object>
RETRY_CONFIG = Retry(total=5, connect=None, read=None, redirect=None, status=None)
namespace
payload
session
token