Skip to content

Commit

Permalink
fix(config): make base config instances immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Nov 24, 2023
1 parent f356356 commit d2e451e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bento_lib/config/pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ = [
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d2e451e

Please sign in to comment.