fmn.core.config module

class fmn.core.config.AlembicModel(*, migrations_path: Annotated[Path, PathType(path_type=dir)] = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/fmn/checkouts/develop/fmn/database/migrations'))[source]

Bases: BaseModel

migrations_path: Annotated[Path, PathType(path_type=dir)]
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class fmn.core.config.CacheArgsModel(*, ttl: int | float | str | timedelta | None = None, lock_ttl: int | float | str | timedelta | None = None, early_ttl: int | float | str | timedelta | None = None)[source]

Bases: BaseModel

early_ttl: int | float | str | timedelta | None
lock_ttl: int | float | str | timedelta | None
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

ttl: int | float | str | timedelta | None
class fmn.core.config.CacheModel(*, url: str = 'mem://', setup_args: dict[str, Any] | None = None, backoff_max_tries: int = 5, default_args: CacheArgsModel = CacheArgsModel(ttl='1h', lock_ttl=None, early_ttl=None), scoped_args: CacheScopedArgsModel = CacheScopedArgsModel(tracked=CacheArgsModel(ttl='1d', lock_ttl='1h', early_ttl='20h'), rules=CacheArgsModel(ttl='1d', lock_ttl='5m', early_ttl='20h'), pagure=None, fasjson=None))[source]

Bases: BaseModel

backoff_max_tries: int
default_args: CacheArgsModel
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

scoped_args: CacheScopedArgsModel
setup_args: dict[str, Any] | None
url: str
class fmn.core.config.CacheScopedArgsModel(*, tracked: CacheArgsModel = CacheArgsModel(ttl='1d', lock_ttl='1h', early_ttl='20h'), rules: CacheArgsModel = CacheArgsModel(ttl='1d', lock_ttl='5m', early_ttl='20h'), pagure: CacheArgsModel | None = None, fasjson: CacheArgsModel | None = None)[source]

Bases: BaseModel

fasjson: CacheArgsModel | None
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pagure: CacheArgsModel | None
rules: CacheArgsModel
tracked: CacheArgsModel
class fmn.core.config.DBModel(*, sqlalchemy: SQLAlchemyModel = SQLAlchemyModel(url='sqlite:///:memory:', echo=False, isolation_level='SERIALIZABLE'), alembic: AlembicModel = AlembicModel(migrations_path=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/fmn/checkouts/develop/fmn/database/migrations')))[source]

Bases: BaseModel

alembic: AlembicModel
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

sqlalchemy: SQLAlchemyModel
class fmn.core.config.SQLAlchemyModel(*, url: str = 'sqlite:///:memory:', echo: bool = False, isolation_level: str = 'SERIALIZABLE', **extra_data: Any)[source]

Bases: BaseModel

echo: bool
isolation_level: str
model_config = {'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

url: str
class fmn.core.config.ServicesModel(*, fasjson_url: str = 'https://fasjson.fedoraproject.org', distgit_url: str = 'https://src.fedoraproject.org', distgit_db_url: str | None = None, datagrepper_url: str = 'https://apps.fedoraproject.org/datagrepper')[source]

Bases: BaseModel

datagrepper_url: str
distgit_db_url: str | None
distgit_url: str
fasjson_url: str
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class fmn.core.config.Settings(_case_sensitive: bool | None = None, _nested_model_default_partial_update: bool | None = None, _env_prefix: str | None = None, _env_prefix_target: EnvPrefixTarget | None = None, _env_file: DotenvType | None = PosixPath('.'), _env_file_encoding: str | None = None, _env_ignore_empty: bool | None = None, _env_nested_delimiter: str | None = None, _env_nested_max_split: int | None = None, _env_parse_none_str: str | None = None, _env_parse_enums: bool | None = None, _cli_prog_name: str | None = None, _cli_parse_args: bool | list[str] | tuple[str, ...] | None = None, _cli_settings_source: CliSettingsSource[Any] | None = None, _cli_parse_none_str: str | None = None, _cli_hide_none_type: bool | None = None, _cli_avoid_json: bool | None = None, _cli_enforce_required: bool | None = None, _cli_use_class_docs_for_groups: bool | None = None, _cli_exit_on_error: bool | None = None, _cli_prefix: str | None = None, _cli_flag_prefix_char: str | None = None, _cli_implicit_flags: bool | Literal['dual', 'toggle'] | None = None, _cli_ignore_unknown_args: bool | None = None, _cli_kebab_case: bool | Literal['all', 'no_enums'] | None = None, _cli_shortcuts: Mapping[str, str | list[str]] | None = None, _secrets_dir: PathType | None = None, _build_sources: tuple[tuple[PydanticBaseSettingsSource, ...], dict[str, Any]] | None = None, *, public_url: str = 'https://notifications.fedoraproject.org', cors_origins: str = 'https://notifications.fedoraproject.org', oidc_provider_url: str = 'https://id.fedoraproject.org/openidc', oidc_conf_endpoint: str = '/.well-known/openid-configuration', oidc_token_info_endpoint: str = '/TokenInfo', oidc_user_info_endpoint: str = '/UserInfo', oidc_client_id: str = '0123456789abcdef0123456789abcdef', oidc_client_secret: str = '0123456789abcdef0123456789abcdef', admin_groups: list[str] = ['sysadmin-main'], oidc_conf_url: str | None = None, oidc_token_info_url: str | None = None, oidc_user_info_url: str | None = None, id_cache_gc_interval: int = 300, database: DBModel = DBModel(sqlalchemy=SQLAlchemyModel(url='sqlite:///:memory:', echo=False, isolation_level='SERIALIZABLE'), alembic=AlembicModel(migrations_path=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/fmn/checkouts/develop/fmn/database/migrations'))), cache: CacheModel = CacheModel(url='mem://', setup_args=None, backoff_max_tries=5, default_args=CacheArgsModel(ttl='1h', lock_ttl=None, early_ttl=None), scoped_args=CacheScopedArgsModel(tracked=CacheArgsModel(ttl='1d', lock_ttl='1h', early_ttl='20h'), rules=CacheArgsModel(ttl='1d', lock_ttl='5m', early_ttl='20h'), pagure=None, fasjson=None)), services: ServicesModel = ServicesModel(fasjson_url='https://fasjson.fedoraproject.org', distgit_url='https://src.fedoraproject.org', distgit_db_url=None, datagrepper_url='https://apps.fedoraproject.org/datagrepper'))[source]

Bases: BaseSettings

admin_groups: list[str]
cache: CacheModel
compute_compound_fields() dict[source]
cors_origins: str
database: DBModel
id_cache_gc_interval: int
model_config = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_exit_on_error': True, 'cli_flag_prefix_char': '-', 'cli_hide_none_type': False, 'cli_ignore_unknown_args': False, 'cli_implicit_flags': False, 'cli_kebab_case': False, 'cli_parse_args': None, 'cli_parse_none_str': None, 'cli_prefix': '', 'cli_prog_name': None, 'cli_shortcuts': None, 'cli_use_class_docs_for_groups': False, 'enable_decoding': True, 'env_file': 'fmn.cfg', 'env_file_encoding': None, 'env_ignore_empty': False, 'env_nested_delimiter': '__', 'env_nested_max_split': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': '', 'env_prefix_target': 'variable', 'extra': 'forbid', 'json_file': None, 'json_file_encoding': None, 'nested_model_default_partial_update': False, 'protected_namespaces': ('model_validate', 'model_dump', 'settings_customise_sources'), 'secrets_dir': None, 'toml_file': None, 'validate_default': True, 'yaml_config_section': None, 'yaml_file': None, 'yaml_file_encoding': None}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

oidc_client_id: str
oidc_client_secret: str
oidc_conf_endpoint: str
oidc_conf_url: str | None
oidc_provider_url: str
oidc_token_info_endpoint: str
oidc_token_info_url: str | None
oidc_user_info_endpoint: str
oidc_user_info_url: str | None
public_url: str
services: ServicesModel
fmn.core.config.get_settings() Settings[source]
fmn.core.config.set_settings_file(path: str) None[source]