feat(server): add admin endpoint to delete 7-day inactive hosts - #153
Merged
rodriguecyber merged 1 commit intoAug 28, 2026
Merged
Conversation
Contributor
Author
|
I have Added the feature according to the issue with no frontend changes |
rodriguecyber
approved these changes
Aug 28, 2026
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
This PR addresses the issue of old, disconnected host records persisting in the database by introducing a secure deletion endpoint.
Scope: Backend only (UI confirmation modal will be implemented in a separate frontend PR).
We added a
DELETE /hosts/:idendpoint that strictly enforces:ONLINE(returns 409 Conflict otherwise).lastSeen(orcreatedAtas a fallback for legacy records).It is protected by the
@Roles('ADMIN')guard.Type of change
Areas touched
apps/server(NestJS)apps/web(React / Vite)apps/agent(Go)packages/protocol(shared WebSocket contracts)infrastructure/.github/workflowsdocsRelated issues
Closes #125
How to test
npm run db:migrate).npm run test --workspace=@docksight/serverand verify that all host deletion tests pass.npm run dev:server), open the Swagger UI athttp://localhost:3000/api/docs, and verify theDELETE /hosts/:idendpoint is documented with the correct responses and requires an Admin Bearer token.Checklist
docs/if module boundaries or the protocol changed.docs/decisions/if this is a larger architectural change.Local checks