Skip to content

feat: secure key storage with AES-256-GCM encryption#2

Merged
santthosh merged 2 commits intomainfrom
feature/secure-key-storage
Feb 14, 2026
Merged

feat: secure key storage with AES-256-GCM encryption#2
santthosh merged 2 commits intomainfrom
feature/secure-key-storage

Conversation

@santthosh
Copy link
Owner

Summary

  • Add AES-256-GCM encrypted credential storage in per-user Firestore subcollections (users/{uid}/credentials)
  • API keys are encrypted before writing to Firestore; only masked suffixes (e.g. sk-...7f3a) are returned on read
  • CRUD endpoints: POST/GET/PUT/DELETE /api/keys with auth-scoped access
  • Desktop API client functions (createKey, listKeys, getKey, updateKey, deleteKey)
  • Terraform secrets + Cloud Run injection for CREDENTIAL_ENCRYPTION_KEY

Test plan

  • 7 unit tests: encrypt/decrypt round-trip, unique ciphertexts, mask format, wrong key fails, corrupted blob fails
  • 10 integration tests: full CRUD, masked output, empty/short key rejection, 404 handling
  • All 19 tests pass, ruff check clean, pyright 0 errors

🤖 Generated with Claude Code

santthosh and others added 2 commits February 13, 2026 22:24
API keys are encrypted before writing to Firestore and only masked
suffixes (e.g. sk-...7f3a) are returned on read. Credentials are
stored in per-user subcollections (users/{uid}/credentials) for
isolation. Includes CRUD endpoints, desktop API client, Terraform
secrets, and 17 tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@santthosh santthosh merged commit 3e02e28 into main Feb 14, 2026
7 checks passed
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