feat(monitoring): add API key aliases and filtering#84
Merged
Conversation
Create the api_key_aliases SQLite table for CPAM-owned API key display metadata. The table stores only SHA-256 API key hashes, aliases, and update timestamps, keeping CPA api-keys unchanged. Refs #21
Add management endpoints to load, save, and delete API key alias mappings backed by SQLite. Validate hashes and enforce case-insensitive alias uniqueness so monitoring labels remain unambiguous. Also carries api_key_hash through usage payload details for historical request lookup. Refs #21
Add API key alias editing in the config editor, including SHA-256 hashing, duplicate validation, and Usage Service persistence. Expose API key filters and full-key search in request monitoring, with aliases preferred over masked key labels. Update localized copy, frontend tests, and generated key length to sk- plus 64 random characters. Closes #21
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.
Summary
Add API key alias management and API key filtering for request monitoring.
Changes
api_key_hashthrough usage payload details without storing plaintext API keys.sk-plus 64 random characters.Testing
go test ./...inusage-servicenpm test -- src/utils/apiKeyHash.test.ts src/features/monitoring/hooks/useMonitoringData.test.ts src/features/monitoring/accountOverviewState.test.tsgit diff --checknpx vite buildNotes
npm run type-checkstill fails on existing auth paste tests due missingreact-test-renderertypes and implicitanyparameters.Closes #21