rasenmaeher_api.rmsettings

Application settings.

Module Contents

Classes

LogLevel

Possible log levels.

RMSettings

Application settings.

Attributes

LOGGER

switchme_to_singleton_call

LOGGER[source]
class LogLevel[source]

Bases: str, enum.Enum

Possible log levels.

NOTSET = 'NOTSET'[source]
DEBUG = 'DEBUG'[source]
INFO = 'INFO'[source]
WARNING = 'WARNING'[source]
ERROR = 'ERROR'[source]
FATAL = 'FATAL'[source]
class RMSettings(*args, **kwargs)[source]

Bases: pydantic.BaseSettings

Application settings.

These parameters can be configured with environment variables.

Parameters:
  • args (List[Any])

  • kwargs (Dict[str, Any])

class Config[source]

Configuration of settings.

env_file = '.env'[source]
env_prefix = 'RM_'[source]
env_file_encoding = 'utf-8'[source]
property valid_product_cns: List[str][source]

Get valid CNs for productapi certs

Return type:

List[str]

host: str = '127.0.0.1'[source]
port: int = 8000[source]
workers_count: int = 1[source]
reload: bool = True[source]
environment: str = 'dev'[source]
log_level: LogLevel[source]
log_level_int: int[source]
integration_api_port: int = 4625[source]
kraftwerk_manifest_path: str = '/pvarki/kraftwerk-rasenmaeher-init.json'[source]
kraftwerk_manifest_bool: bool = False[source]
kraftwerk_manifest_dict: Dict[Any, Any][source]
integration_api_timeout: float = 3.0[source]
api_client_cert_header: str = 'X-ClientCert-DN'[source]
test_api_client_cert_header_value: str = 'CN=fake.localmaeher.pvarki.fi,O=N/A'[source]
api_healthcheck_proto: str = 'http://'[source]
api_healthcheck_url: str = '/api/v1/healthcheck'[source]
api_healthcheck_headers: str = '{"propably":"not_needed"}'[source]
sentry_dsn: str | None[source]
sentry_sample_rate: float = 1.0[source]
cfssl_host: str = 'http://127.0.0.1'[source]
cfssl_port: str = '8888'[source]
ocsprest_host: str = 'http://127.0.0.1'[source]
ocsprest_port: str = '8887'[source]
cfssl_timeout: float = 2.5[source]
persistent_data_dir = '/data/persistent'[source]
mtls_client_cert_path: str | None[source]
mtls_client_key_path: str | None[source]
mtls_client_cert_cn = 'rasenmaeher'[source]
keycloak_server_url: str | None[source]
keycloak_client_id: str | None[source]
keycloak_realm_name: str | None[source]
keycloak_client_secret: str | None[source]
ldap_conn_string: str | None[source]
ldap_username: str | None[source]
ldap_client_secret: str | None[source]
tilauspalvelu_jwt: str = 'https://tilaa.pvarki.fi/api/v1/config/jwtPublicKey.pem'[source]
kraftwerk_announce: str | None[source]
kraftwerk_timeout: float = 2.0[source]
_singleton: ClassVar[RMSettings | None][source]
classmethod singleton()[source]

Return singleton

Return type:

RMSettings

load_manifest()[source]

Load the kraftwerk manifest file

Return type:

None

switchme_to_singleton_call[source]