Skip to content

test(sso): add test coverage for encrypted credential storage #9685

Closed

Description

@mrveiss

Context

PR #9676 implements encrypted storage for SSO credentials but has zero test coverage for a security-critical change.

Required Test Coverage

  1. Integration tests for SSOSecretsManager:

    • Creating SSO provider stores secrets in SystemSecret table
    • Updating provider updates encrypted secrets
    • Deleting provider removes all associated secrets
    • Plaintext migration to encrypted storage
    • Decryption failures are handled gracefully
  2. End-to-end OAuth flow tests:

    • OAuth authorization with encrypted client_secret
    • Token exchange with encrypted credentials
    • Userinfo retrieval
  3. End-to-end LDAP tests:

    • LDAP connection with encrypted bind_password
    • Authentication flow
  4. Migration script tests:

    • Migrate sample SSO providers from plaintext to encrypted
    • Verify all secrets are properly encrypted
    • Verify config references are correct
    • Handle providers with missing/empty secrets

Acceptance Criteria

  • All critical paths have integration test coverage
  • Tests verify secrets are actually encrypted in database
  • Tests verify secrets can be decrypted and used
  • Migration script has test coverage
  • All tests pass

Related

Activity

  1. self-assigned this
    on Jun 5, 2026
  2. mrveiss commented on Jun 17, 2026

    @mrveiss
    OwnerAuthor

    Verify-and-close (umbrella #9930 sweep): Encrypted-credential storage already has test coverage: autobot-slm-backend/tests/services/test_sso_security.py (TestClientSecretHandling — encryption, no-logging, not-in-exception-messages) and migrations/migrate_sso_secrets_test.py (plaintext→encrypted migration). The deeper vault round-trip/rotation tests are folded into sub-umbrella #8994 Phase C1 (#10153). Recommend closing as already-covered; vault-era tests tracked in #10153.

  3. mrveiss commented on Jun 22, 2026

    @mrveiss
    OwnerAuthor

    Verified in current Dev_new_gui: encrypted-credential test coverage exists in tests/services/test_sso_security.py and migrations/migrate_sso_secrets_test.py. Closing as covered (vault-era tests tracked at #10153).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions