Conversation
There was a problem hiding this comment.
Pull request overview
Adds account-scoped API key management (CRUD + enable/suspend) backed by MongoDB, wired into the Echo API, with repository tests and integration coverage for the new endpoints.
Changes:
- Introduces
ApiKeyService+ MongoDB repository with a unique index on (tenantId, accountId, name) - Adds
/accounts/:id/apikeysroutes + handlers and wires them intocmd/bulwarkauthadmin/main.go - Adds integration tests for API key lifecycle and repository-level tests for Mongo behavior/isolation
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/integration/accounts/account_apikey_integration_test.go | Integration tests for API key endpoints (create/list/get/enable/suspend/revoke). |
| internal/utils/encryption.go | Adds bcrypt-based hashing/verification helper used by API key generation. |
| internal/accounts/error.go | Adds a domain error type for duplicate API key names. |
| internal/accounts/apikey/mongodb_apikey_repository_test.go | Unit tests for MongoDB API key repository CRUD and tenant/account isolation. |
| internal/accounts/apikey/mongodb_apikey_repository.go | MongoDB repository implementation + unique index for API keys. |
| internal/accounts/apikey/apikey.go | API key domain model + service implementation for generating and managing keys. |
| cmd/bulwarkauthadmin/main.go | Wires API key repository/service/handler into the tenant API group. |
| api/accounts/apikey/accounts_routes.go | Registers account API key routes. |
| api/accounts/apikey/accounts_handler.go | Implements HTTP handlers for API key management. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.