Skip to content

feat(monitoring): add API key aliases and filtering#84

Merged
seakee merged 3 commits into
mainfrom
feature/api-key-alias-filter
May 14, 2026
Merged

feat(monitoring): add API key aliases and filtering#84
seakee merged 3 commits into
mainfrom
feature/api-key-alias-filter

Conversation

@seakee
Copy link
Copy Markdown
Owner

@seakee seakee commented May 14, 2026

Summary

Add API key alias management and API key filtering for request monitoring.

Changes

  • Add SQLite-backed API key alias storage and Usage Service management endpoints.
  • Carry api_key_hash through usage payload details without storing plaintext API keys.
  • Add API key alias editing in the config editor with duplicate validation.
  • Add request monitoring API key dropdown filtering and full-key search by SHA-256 hash.
  • Update localized copy and generated API key format to sk- plus 64 random characters.

Testing

  • go test ./... in usage-service
  • npm test -- src/utils/apiKeyHash.test.ts src/features/monitoring/hooks/useMonitoringData.test.ts src/features/monitoring/accountOverviewState.test.ts
  • git diff --check
  • npx vite build

Notes

  • npm run type-check still fails on existing auth paste tests due missing react-test-renderer types and implicit any parameters.

Closes #21

seakee added 3 commits May 14, 2026 08:45
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
@seakee seakee merged commit 45641fc into main May 14, 2026
3 checks passed
@seakee seakee deleted the feature/api-key-alias-filter branch May 14, 2026 01:03
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.

是否可以增加按api-key筛选用量

1 participant