refactor: unify ApiKeyManager to use AgentApiKey model #49

Merged
Snider merged 1 commit from refactor/api-key-manager-model into main 2026-02-23 06:10:45 +00:00
Member

Summary

Closes #19

  • Switch View/Modal/Admin/ApiKeyManager.php from Core\Api\Models\ApiKey to Core\Mod\Agentic\Models\AgentApiKey and AgentApiKeyService
  • Update blade template to use permissions field, getMaskedKey(), and dynamic permission checkboxes from AgentApiKey::availablePermissions()
  • Rename newKeyScopes/toggleScope to newKeyPermissions/togglePermission
  • Add tests/Feature/ApiKeyManagerTest.php with integration coverage

Test plan

  • All existing tests pass
  • New ApiKeyManagerTest covers model consistency, key creation, workspace scoping, revocation, and permission listing
  • Admin UI creates/revokes keys using AgentApiKey consistently with services

🤖 Generated with Claude Code

## Summary Closes #19 - Switch `View/Modal/Admin/ApiKeyManager.php` from `Core\Api\Models\ApiKey` to `Core\Mod\Agentic\Models\AgentApiKey` and `AgentApiKeyService` - Update blade template to use `permissions` field, `getMaskedKey()`, and dynamic permission checkboxes from `AgentApiKey::availablePermissions()` - Rename `newKeyScopes`/`toggleScope` to `newKeyPermissions`/`togglePermission` - Add `tests/Feature/ApiKeyManagerTest.php` with integration coverage ## Test plan - [ ] All existing tests pass - [ ] New `ApiKeyManagerTest` covers model consistency, key creation, workspace scoping, revocation, and permission listing - [ ] Admin UI creates/revokes keys using `AgentApiKey` consistently with services 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Clotho added 1 commit 2026-02-23 06:10:11 +00:00
refactor: unify ApiKeyManager to use AgentApiKey model (#19)
Some checks failed
CI / PHP 8.4 (pull_request) Failing after 1m35s
CI / PHP 8.3 (pull_request) Failing after 1m46s
6ebd527204
Switch View/Modal/Admin/ApiKeyManager.php from Core\Api\Models\ApiKey
to Core\Mod\Agentic\Models\AgentApiKey and AgentApiKeyService, bringing
the workspace-owner admin UI into consistency with all other services.

Changes:
- Replace Core\Api\Models\ApiKey import with AgentApiKey + AgentApiKeyService
- Use AgentApiKeyService::create() for key generation
- Use AgentApiKey::forWorkspace() scoping in revokeKey() and render()
- Rename newKeyScopes → newKeyPermissions, toggleScope → togglePermission
- Expose availablePermissions() from AgentApiKey for the create form
- Update blade template: permissions field, getMaskedKey(), togglePermission,
  dynamic permission checkboxes from AgentApiKey::availablePermissions()
- Add tests/Feature/ApiKeyManagerTest.php with integration coverage
- Mark CQ-002 resolved in TODO.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Snider merged commit b75b1b8191 into main 2026-02-23 06:10:45 +00:00
Snider deleted branch refactor/api-key-manager-model 2026-02-23 06:10:45 +00:00
Sign in to join this conversation.
No description provided.