auth
Module for encapsulating Geo Engine authentication
BearerAuth Objects
Section titled “BearerAuth Objects”class BearerAuth(AuthBase)A bearer token authentication for requests
Session Objects
Section titled “Session Objects”class Session()A Geo Engine session
__init__
Section titled “__init__”def __init__(server_url: str, credentials: tuple[str, str] | None = None, token: str | None = None) -> NoneInitialize communication between this library and a Geo Engine instance
If credentials or a token are provided, the session will be authenticated. Credentials and token must not be provided at the same time.
optional arguments:
(email, password)as tupletokenas a string
optional environment variables:
GEOENGINE_EMAILGEOENGINE_PASSWORDGEOENGINE_TOKEN
__repr__
Section titled “__repr__”def __repr__() -> strDisplay representation of a session
auth_header
Section titled “auth_header”@propertydef auth_header() -> dict[str, str]Create an authentication header for the current session
server_url
Section titled “server_url”@propertydef server_url() -> strReturn the server url of the current session
configuration
Section titled “configuration”@propertydef configuration() -> geoengine_api_client.ConfigurationReturn the current http configuration
user_id
Section titled “user_id”@propertydef user_id() -> UUIDReturn the user id. Only works in Geo Engine Pro.
requests_bearer_auth
Section titled “requests_bearer_auth”def requests_bearer_auth() -> BearerAuthReturn a Bearer authentication object for the current session
logout
Section titled “logout”def logout()Logout the current session
get_session
Section titled “get_session”def get_session() -> SessionReturn the global session if it exists
Raises an exception otherwise.
initialize
Section titled “initialize”def initialize(server_url: str, credentials: tuple[str, str] | None = None, token: str | None = None) -> NoneInitialize communication between this library and a Geo Engine instance
If credentials or a token are provided, the session will be authenticated. Credentials and token must not be provided at the same time.
optional arugments: (email, password) as tuple or token as a string optional environment variables: GEOENGINE_EMAIL, GEOENGINE_PASSWORD, GEOENGINE_TOKEN optional .env file defining: GEOENGINE_EMAIL, GEOENGINE_PASSWORD, GEOENGINE_TOKEN
def reset(logout: bool = True) -> NoneResets the current session