diff --git a/bento_lib/config/pydantic.py b/bento_lib/config/pydantic.py index bbf8988..6db56d6 100644 --- a/bento_lib/config/pydantic.py +++ b/bento_lib/config/pydantic.py @@ -4,7 +4,7 @@ from bento_lib.service_info.constants import SERVICE_ORGANIZATION_C3G from bento_lib.service_info.types import GA4GHServiceOrganizationModel from pydantic.fields import FieldInfo -from pydantic_settings import BaseSettings, EnvSettingsSource, PydanticBaseSettingsSource +from pydantic_settings import BaseSettings, EnvSettingsSource, PydanticBaseSettingsSource, SettingsConfigDict from typing import Any __all__ = [ @@ -41,6 +41,9 @@ class BentoBaseConfig(BaseSettings): cors_origins: tuple[str, ...] = CORS_ORIGINS_DEFAULT + # Make Config instances hashable + immutable + model_config = SettingsConfigDict(frozen=True) + @classmethod def settings_customise_sources( cls,