Claude Config API (v0.6): - Add CRUD endpoints for commands, skills, and agents - Commands/skills/agents stored in /workspace/.claude/ (per-project, in git) - Credentials shared via PVC at /root/.claude/ (shared across pods) - Use base64 encoding for file writes (prevents shell injection) - Add content size limits (1MB max) Security Hardening: - Add sanitize package for command/prompt validation - Add rate limiting middleware (token bucket algorithm) - Add concurrent command limiting - Add input sanitization to all command handlers - Gitignore secrets.yaml and credentials.yaml - Add *.example templates for secrets Testing Infrastructure: - Add testutil package with mocks and fixtures - Add unit tests for auth package (63% coverage) - Add unit tests for executor (47% coverage) - Add handler integration tests (40% coverage) - Add 100% coverage for sanitize, cmdlimit packages - Add 96% coverage for ratelimit package Infrastructure: - Shared Claude credentials PVC (ReadWriteMany) - Reduced workspace PVC size from 20Gi to 5Gi - Add init container cleanup before git clone - Document Longhorn RWX requirements Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
29 lines
837 B
Go
29 lines
837 B
Go
package port
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/orchard9/rdev/internal/domain"
|
|
)
|
|
|
|
// APIKeyRepository defines operations for managing API keys.
|
|
type APIKeyRepository interface {
|
|
// Create stores a new API key.
|
|
Create(ctx context.Context, key *domain.APIKey, keyHash string) error
|
|
|
|
// GetByHash retrieves an API key by its hash.
|
|
GetByHash(ctx context.Context, keyHash string) (*domain.APIKey, error)
|
|
|
|
// Get retrieves an API key by ID.
|
|
Get(ctx context.Context, id domain.APIKeyID) (*domain.APIKey, error)
|
|
|
|
// List returns all API keys (without secrets).
|
|
List(ctx context.Context) ([]*domain.APIKey, error)
|
|
|
|
// Revoke marks an API key as revoked.
|
|
Revoke(ctx context.Context, id domain.APIKeyID) error
|
|
|
|
// UpdateLastUsed updates the last used timestamp for a key.
|
|
UpdateLastUsed(ctx context.Context, id domain.APIKeyID) error
|
|
}
|