Table of Contents

openeo_fastapi.client.auth

Class and model to define the framework and partial application logic for interacting with Jobs.

Classes: - User: Framework for defining and extending the logic for working with BatchJobs. - Authenticator: Class holding the abstract validation method used for authentication for API endpoints. - AuthMethod: Enum defining the available auth methods. - AuthToken: Pydantic model for breaking and validating an OpenEO Token into it's consituent parts. - IssuerHandler: Class for handling the AuthToken and validating against the revelant token Issuer and AuthMethod.

User Objects

class User(BaseModel)

Pydantic model manipulating users.

Config Objects

class Config()

Pydantic model class config.

get_orm

@classmethod
def get_orm(cls)

Get the ORM model for this pydantic model.

Authenticator Objects

class Authenticator(ABC)

Basic class to hold the validation call to be used by the api endpoints requiring authentication.

validate

@abstractmethod
def validate(authorization: str = Header())

Validate the authorisation header and create a new user. This method can be overwritten as needed.

Arguments:

  • authorization str - The authorisation header content from the request headers.

Returns:

  • User - The authenticated user.

AuthMethod Objects

class AuthMethod(Enum)

Enum defining known auth methods.

AuthToken Objects

class AuthToken(BaseModel)

The AuthToken breaks down the OpenEO token into its consituent parts to be used for validation.

from_token

@classmethod
def from_token(cls, token: str)

Takes the openeo format token, splits it into the component parts, and returns an Auth token.

IssuerHandler Objects

class IssuerHandler(BaseModel)

General token handler for querying provided tokens against issuers.

validate_token

def validate_token(token: str)

Try to validate the token against the give OIDC provider.

Arguments:

  • token str - The OpenEO token to be parsed and validated against the oidc provider.

Raises:

  • HTTPException - Raises an exception with relevant status code and descriptive message of failure.

Returns:

The JSON as dictionary from _validate_oidc_token.