Table of Contents

openeo_fastapi.client.settings

Defining the settings to be used at the application layer of the API.

AppSettings Objects

class AppSettings(BaseSettings)

The application settings that need to be defined when the app is initialised.

API_DNS

The domain name hosting the API.

API_TLS

Whether the API http scheme should be http or https.

API_TITLE

The API title to be provided to FastAPI.

API_DESCRIPTION

The API description to be provided to FastAPI.

OPENEO_VERSION

The OpenEO Api specification version supported in this deployment of the API.

OPENEO_PREFIX

The OpenEO prefix to be used when creating the endpoint urls.

OIDC_URL

The policies to be used for authenticated users with the backend, if not set, any usser with a valid token from the issuer is accepted.

OIDC_ORGANISATION

The abbreviation of the OIDC provider's organisation name, e.g. egi.

OIDC_POLICIES

The OIDC policies to check against when authorizing a user. If not provided, all users with a valid token from the issuer will be admitted.

"&&" Is used to denote the addition of another policy. Policies in the list should be structures as "key, value". The key referers to some value that is expected to be found in the OIDC userinfo request. The value referes to some value that is then checked for presence in the values found at the key location.

Example:

{
    "email": user@test.org,
    "groups" : [ "/staff" ]
}

A valid policy to allow members from the group staff would be, "groups, /staff". This would be the value provided to OIDC_POLICIES.

If you wanted to include users from another group called "/trial", the updated value to OIDC_POLICIES would be, "groups, /staff && groups, /trial"

STAC_VERSION

The STAC Version that is being supported by this deployments data discovery endpoints.

STAC_API_URL

The STAC URL of the catalogue that the application deployment will proxy to.

STAC_COLLECTIONS_WHITELIST

The collection ids to filter by when proxying to the Stac catalogue.

ensure_endswith_slash

@validator("STAC_API_URL")
def ensure_endswith_slash(cls, v: str) -> str

Ensure the STAC_API_URL ends with a trailing slash.

split_oidc_policies_str_to_list

@validator("OIDC_POLICIES", pre=True)
def split_oidc_policies_str_to_list(cls, v: str) -> str

Ensure the OIDC_POLICIES are split and formatted correctly.

Config Objects

class Config()

Pydantic model class config.

parse_env_var

@classmethod
def parse_env_var(cls, field_name: str, raw_val: str) -> Any

Parse any variables and handle and csv lists into python list type.