feat(auth): add Microsoft Azure Service Principal and Entra ID SSO credential templates - #207
feat(auth): add Microsoft Azure Service Principal and Entra ID SSO credential templates#207JLCode-tech wants to merge 10 commits into
Conversation
…edential templates
…gn alembic docstring
…O routes, doc SSO/terraform split F1: normalize naive azure_sso_token_expiry to UTC before comparing in _test_azure_template — matches get_sso_status / credential_refresh_service guards; fixes TypeError on SQLite/dev naive round-trip. Adds SQLite regression test (mutation-verified: fails with the exact TypeError without the guard). F2: remove the unwired standalone Azure SSO routes (/azure/sso/initiate, /azure/sso/poll, /azure/subscriptions), their request models, and the unused client methods (initiateAzureSSO/pollAzureSSO/listAzureSubscriptions). The frontend uses the server-side template flow (authenticate-sso/poll-sso, returns only has_credentials); these paths leaked long-lived access/refresh tokens in the response body. Regenerated openapi.json + api-generated.ts. F4: document at the terraform credential-injection site that SSO Azure templates deliberately inject no credential (SSO is validation/console; terraform provisioning uses the service-principal secret). Claude-Session: https://claude.ai/code/session_01UCsZXDxBsWV2s4kT47DwDW
Self-review (cold, adversarial) + fixes appliedIndependent cold audit, executed. No blockers — secret-at-rest is correct ( F1 (MEDIUM — tz-naive datetime crash) — FIXED. F2 (LOW — token-leaking unused routes) — FIXED (removed). F3 (description) — FIXED: corrected the "MSAL" claim (it's raw OAuth2 Verified: 74 passed, ruff clean, contract fresh. Note for merge coordination: #206/#208 also touch |
Summary
Adds support for Microsoft Azure Service Principal credentials and Entra ID SSO credential templates, including OAuth token refresh lifecycle management and region auto-discovery.
Key Changes
v2_156_add_azure_credential_template_fields.py) and updatedSystemCredentialTemplatemodels.AzureAuthService, which performs token acquisition and validation via raw OAuth2 requests tologin.microsoftonline.com(using therequestslibrary — nomsaldependency).CredentialTemplateServiceandCredentialRefreshServiceto handle Azure Service Principal and Entra ID secrets/certificates.test_azure_auth_service.pyandtest_credential_template_service.py.CredentialTemplates.tsx,SSOAuthDialog.tsx, andresolveCredStatus.ts.CloudRegionSelector.tsx.https://claude.ai/code/session_01UCsZXDxBsWV2s4kT47DwDW