Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(config): migrate Pydantic v1 class Config → v2 ConfigDict / SettingsConfigDict (H-6)#124

Merged
beenuar merged 1 commit into
mainfrom
fix/pydantic-v2-config
May 14, 2026
Merged

fix(config): migrate Pydantic v1 class Config → v2 ConfigDict / SettingsConfigDict (H-6)#124
beenuar merged 1 commit into
mainfrom
fix/pydantic-v2-config

Conversation

@beenuar
Copy link
Copy Markdown
Owner

@beenuar beenuar commented May 14, 2026

Summary

Eliminates 63+ PydanticDeprecatedSince20 warnings that were emitted on every API/service boot and during every test run, by migrating from Pydantic v1 class Config: to the v2 ConfigDict / SettingsConfigDict API.

Scope: pure API-surface migration. No schema or wire-format changes.

Changes

BaseSettingsSettingsConfigDict

  • services/fusion/app/core/config.py
  • services/threatintel/app/config.py

BaseModelConfigDict (every endpoint with from_attributes=True)

  • services/api/app/api/v1/endpoints/sla.py
  • services/api/app/api/v1/endpoints/threat_intel.py
  • services/api/app/api/v1/endpoints/reports.py
  • services/api/app/api/v1/endpoints/mssp.py
  • services/api/app/api/v1/endpoints/remediation.py
  • services/api/app/api/v1/endpoints/identity_graph.py
  • services/api/app/api/v1/endpoints/insider_threat.py
  • services/api/app/api/v1/endpoints/assets.py
  • services/api/app/api/v1/endpoints/posture.py
  • services/ueba/app/api/routes.py

Verification

$ cd services/api && python -W error::DeprecationWarning -c "
from app.api.v1.endpoints import sla, threat_intel, reports, mssp, remediation, identity_graph, insider_threat, assets, posture
"
# No Pydantic deprecation warnings on import

Repo-wide grep for the deprecated patterns now returns no matches:

  • class Config: → 0 hits
  • orm_mode = True → 0 hits
  • @validator( → 0 hits

Test plan

  • All endpoint modules import cleanly
  • SettingsConfigDict resolves to a dict (Pydantic v2 contract)
  • No deprecation warnings under -W error::DeprecationWarning
  • Existing API tests pass (CI)

Refs: H-6

Made with Cursor

…ngsConfigDict (H-6)

Eliminates 63+ `PydanticDeprecatedSince20: Support for class-based
`config` is deprecated, use ConfigDict instead` warnings emitted on
every API/service boot and during every test run.

BaseSettings → SettingsConfigDict:
- services/fusion/app/core/config.py
- services/threatintel/app/config.py

BaseModel → ConfigDict (from_attributes=True on response models):
- services/api/app/api/v1/endpoints/sla.py
- services/api/app/api/v1/endpoints/threat_intel.py
- services/api/app/api/v1/endpoints/reports.py
- services/api/app/api/v1/endpoints/mssp.py
- services/api/app/api/v1/endpoints/remediation.py
- services/api/app/api/v1/endpoints/identity_graph.py
- services/api/app/api/v1/endpoints/insider_threat.py
- services/api/app/api/v1/endpoints/assets.py
- services/api/app/api/v1/endpoints/posture.py
- services/ueba/app/api/routes.py

No schema or wire-format changes. Verified with
`python -W error::DeprecationWarning` — full API surface imports clean.

Refs: H-6
@beenuar beenuar marked this pull request as ready for review May 14, 2026 10:44
@beenuar beenuar merged commit 68c84b2 into main May 14, 2026
25 checks passed
@beenuar beenuar deleted the fix/pydantic-v2-config branch May 14, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant