fix(AUD-008): SSO/OIDC con verificación de firma real - #104
Conversation
Implement SSO authentication using OIDC with real RS256/ES256 JWKS signature verification, auto-provisioning users linked to organizations by email domain rules, issuing Cognito sessions, and logging SIEM audit events. Includes a documented SAML 2.0 provider stub. Co-authored-by: Axlfc <14998495+Axlfc@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR implements SSO authentication for Cognito (AUD-008):
app/core/sso/oidc.py): Real RS256/ES256 JWKS signature verification using PyJWT and cryptography, Authorization Code flow, and strict token claim validation.app/core/sso/service.py): Auto-provisions new users or updates existing users in DB upon first login, maps users to organizations via email domain rules (COGNITO_SSO_DOMAIN_MAP), binds sessions viaSessionManager(auth_type="authenticated_sso"), and logs structured SIEM audit events (auth.sso_login,auth.sso_logout).app/api/routes/auth.py): Exposes/api/auth/sso/login,/api/auth/sso/callback, and/api/auth/sso/logout.app/core/sso/saml.py): Typed SAMLProvider stub following the AUD-003 VaultSecretsProvider pattern.tests/test_sso_oidc.py): Complete test suite covering E2E flow with mock IdP, explicit rejection of tampered token signatures, user auto-provisioning, session binding, audit logs, and SAML stub behavior.AUDIT_MASTER.md): Updated AUD-008 status to "Corregido".PR created automatically by Jules for task 125475925907716905 started by @Axlfc