Merged
Conversation
Contributor
Greptile SummaryAll previous security and correctness issues have been properly addressed:
One documented trade-off remains by design: service account IDs are passed to The implementation is production-ready for the REST API and service account features described in the PR. Confidence Score: 5/5
Last reviewed commit: bd94f87 |
58b91a9 to
39ad0b9
Compare
Add database migration for service accounts with hashed API key storage, environment scoping, JSON permissions, and expiration support.
Implements list, create, revoke, and delete procedures for service accounts with ADMIN-only access, audit logging, and SHA-256 key hashing. Registers the router in the app router and updates audit/team-access middleware to resolve ServiceAccount entities.
Implements API key authentication middleware and 12 REST endpoints: - Pipelines: list, get, deploy, undeploy, versions, rollback - Nodes: list (with label filtering), get, toggle maintenance - Secrets: CRUD operations - Alert rules: list and create - Audit: cursor-based polling with action filtering All endpoints authenticate via Bearer token (service account API keys) and enforce per-permission authorization.
Frontend page for managing service accounts with: - Table listing with status, permissions badges, and last-used time - Create dialog with permission toggles grouped by category - One-time API key display modal with copy-to-clipboard - Revoke and delete confirmation dialogs - Link from main settings page
- New operations/service-accounts.md with creation, management, permissions, rotation, and security best practices - Updated reference/api.md with complete REST API documentation including curl examples for all 12 endpoints - Updated SUMMARY.md with service accounts page under Operations
- Add audit logging to all mutating REST API endpoints (secrets CRUD, node maintenance toggle, alert rule creation) using writeAuditLog with fire-and-forget pattern - Fix teamId bypass in POST /api/v1/alerts/rules: derive teamId server-side from the authenticated environment instead of accepting it from the request body
- Replace `include` with explicit `select` on node endpoints to omit nodeTokenHash and pendingAction from REST responses - Add writeAuditLog calls to deploy, undeploy, and rollback endpoints - Add cursor validation in audit log pagination - Add identifier validation (id or name required) for secrets PUT/DELETE
f01a1de to
bd94f87
Compare
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
/api/v1/for pipelines, nodes, secrets, alerts, and audit logTest plan
GET /api/v1/pipelinesand verify authentication workspipelines.readkey cannot call deploy endpoint)