Conversation
- Create provisioning_keys table with SHA-256 key hashing and status lifecycle - Create agents table where id IS the agent identifier (no separate agent_id) - Create agent_connection_logs table for audit trail - Add SQLC queries for provisioning keys, agents, and connection logs - Generate type-safe database access layer via SQLC - Add provisioning system documentation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
- Add provisioning service with key generation (crypto/rand) and SHA-256 hashing - Add agent service for lifecycle management and connection logging - Integrate provisioning handshake into gRPC stream handler - Support legacy agent auto-migration with default user - Add database persistence for agent last_seen updates - Update connection manager to accept agent service for DB persistence - Wire up services in server initialization - Update tests to reflect new ConnectionManager signature - Update documentation with Phase 2 completion status
- Add provisioning key management endpoints (POST/GET/DELETE) - Add agent management endpoints (GET/DELETE) - Implement JWT-based authentication for all provisioning endpoints - Add agent client provisioning handshake logic - Implement automatic config file persistence after provisioning - Agent removes provisioning_key and saves agent_id to config - Add comprehensive manual testing guide in documentation - Update router to expose new endpoints with authentication - Wire services into HTTP layer API Endpoints: - POST /provisioning-keys - Create provisioning key - GET /provisioning-keys - List user's keys - DELETE /provisioning-keys/:id - Revoke key - GET /agents - List user's agents with connection status - GET /agents/:id - Get agent details - DELETE /agents/:id - Deregister agent (soft delete) Agent Client: - Accepts provisioning_key in config - Sends provisioning_key on first connection - Receives agent_id from server - Persists agent_id to YAML config - Removes provisioning_key from config - Subsequent connections use agent_id
Make IncrementKeyUsage atomic with WHERE used_count < max_uses guard so concurrent requests cannot exceed max_uses. Reorder ProvisionAgent to claim a key use before creating the agent. Remove legacy agent auto-migration since the service has not been deployed to production — unknown agent_id now returns an error instead of silently creating agents under the admin user.
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.