fmn.core.config module

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

Bases: BaseModel

migrations_path: Path
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'migrations_path': FieldInfo(annotation=Path, required=False, default=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/fmn/checkouts/develop/fmn/database/migrations'), metadata=[PathType(path_type='dir')])}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

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_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'early_ttl': FieldInfo(annotation=Union[int, float, str, timedelta, NoneType], required=False, default=None), 'lock_ttl': FieldInfo(annotation=Union[int, float, str, timedelta, NoneType], required=False, default=None), 'ttl': FieldInfo(annotation=Union[int, float, str, timedelta, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

ttl: int | float | str | timedelta | None
class fmn.core.config.CacheModel(*, url: str = 'mem://', setup_args: dict[str, Any] | None = None, 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

default_args: CacheArgsModel
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'default_args': FieldInfo(annotation=CacheArgsModel, required=False, default=CacheArgsModel(ttl='1h', lock_ttl=None, early_ttl=None)), 'scoped_args': FieldInfo(annotation=CacheScopedArgsModel, required=False, default=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)), 'setup_args': FieldInfo(annotation=Union[dict[str, Any], NoneType], required=False, default=None), 'url': FieldInfo(annotation=str, required=False, default='mem://')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

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_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'fasjson': FieldInfo(annotation=Union[CacheArgsModel, NoneType], required=False, default=None), 'pagure': FieldInfo(annotation=Union[CacheArgsModel, NoneType], required=False, default=None), 'rules': FieldInfo(annotation=CacheArgsModel, required=False, default=CacheArgsModel(ttl='1d', lock_ttl='5m', early_ttl='20h')), 'tracked': FieldInfo(annotation=CacheArgsModel, required=False, default=CacheArgsModel(ttl='1d', lock_ttl='1h', early_ttl='20h'))}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

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_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'alembic': FieldInfo(annotation=AlembicModel, required=False, default=AlembicModel(migrations_path=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/fmn/checkouts/develop/fmn/database/migrations'))), 'sqlalchemy': FieldInfo(annotation=SQLAlchemyModel, required=False, default=SQLAlchemyModel(url='sqlite:///:memory:', echo=False, isolation_level='SERIALIZABLE'))}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

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_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'allow'}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'echo': FieldInfo(annotation=bool, required=False, default=False), 'isolation_level': FieldInfo(annotation=str, required=False, default='SERIALIZABLE'), 'url': FieldInfo(annotation=str, required=False, default='sqlite:///:memory:')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

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

Bases: BaseModel

distgit_url: str
fasjson_url: str
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'distgit_url': FieldInfo(annotation=str, required=False, default='https://src.fedoraproject.org'), 'fasjson_url': FieldInfo(annotation=str, required=False, default='https://fasjson.fedoraproject.org')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class fmn.core.config.Settings(_case_sensitive: bool | None = None, _env_prefix: str | 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_parse_none_str: str | None = None, _secrets_dir: str | Path | 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, 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'))[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_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'env_file': 'fmn.cfg', 'env_file_encoding': None, 'env_ignore_empty': False, 'env_nested_delimiter': '__', 'env_parse_none_str': None, 'env_prefix': '', 'extra': 'forbid', 'json_file': None, 'json_file_encoding': None, 'protected_namespaces': ('model_', 'settings_'), 'secrets_dir': None, 'toml_file': None, 'validate_default': True, 'yaml_file': None, 'yaml_file_encoding': None}

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'admin_groups': FieldInfo(annotation=list[str], required=False, default=['sysadmin-main']), 'cache': FieldInfo(annotation=CacheModel, required=False, default=CacheModel(url='mem://', setup_args=None, 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))), 'cors_origins': FieldInfo(annotation=str, required=False, default='https://notifications.fedoraproject.org'), 'database': FieldInfo(annotation=DBModel, required=False, default=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')))), 'id_cache_gc_interval': FieldInfo(annotation=int, required=False, default=300), 'oidc_client_id': FieldInfo(annotation=str, required=False, default='0123456789abcdef0123456789abcdef'), 'oidc_client_secret': FieldInfo(annotation=str, required=False, default='0123456789abcdef0123456789abcdef'), 'oidc_conf_endpoint': FieldInfo(annotation=str, required=False, default='/.well-known/openid-configuration'), 'oidc_conf_url': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'oidc_provider_url': FieldInfo(annotation=str, required=False, default='https://id.fedoraproject.org/openidc'), 'oidc_token_info_endpoint': FieldInfo(annotation=str, required=False, default='/TokenInfo'), 'oidc_token_info_url': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'oidc_user_info_endpoint': FieldInfo(annotation=str, required=False, default='/UserInfo'), 'oidc_user_info_url': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'public_url': FieldInfo(annotation=str, required=False, default='https://notifications.fedoraproject.org'), 'services': FieldInfo(annotation=ServicesModel, required=False, default=ServicesModel(fasjson_url='https://fasjson.fedoraproject.org', distgit_url='https://src.fedoraproject.org'))}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

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]