feat(BRE2-763): adding revoke command. Fixes to register.#309
Merged
patelspratik merged 5 commits intomainfrom Mar 4, 2026
Merged
feat(BRE2-763): adding revoke command. Fixes to register.#309patelspratik merged 5 commits intomainfrom
patelspratik merged 5 commits intomainfrom
Conversation
Contributor
patelspratik
commented
Mar 4, 2026
- Added revoke-ssh (inverse of grant)
- device_registration is now in etc so all linux users will see a registration
drewmalin
reviewed
Mar 4, 2026
pkg/cmd/register/sshkeys.go
Outdated
Comment on lines
+25
to
+27
| // BrevKeyComment is kept as an alias for backward compatibility with tests | ||
| // and callers that reference the old constant name. | ||
| const BrevKeyComment = BrevKeyPrefix |
pkg/cmd/register/sshkeys.go
Outdated
| // RevokeSSHAccessFromNode removes the user's public key from authorized_keys | ||
| // and calls RevokeNodeSSHAccess to record the revocation server-side. | ||
| // No rollback is performed if the RPC fails — the key stays removed for safety. | ||
| func RevokeSSHAccessFromNode( |
pkg/cmd/grantssh/grantssh.go
Outdated
Contributor
There was a problem hiding this comment.
Old but: typo here curren
pkg/cmd/revokessh/revokessh.go
Outdated
Comment on lines
+155
to
+169
| func getRegistration(deps revokeSSHDeps) (*register.DeviceRegistration, error) { | ||
| registered, err := deps.registrationStore.Exists() | ||
| if err != nil { | ||
| return nil, breverrors.WrapAndTrace(err) | ||
| } | ||
| if !registered { | ||
| return nil, fmt.Errorf("no registration found; this machine does not appear to be registered\nRun 'brev register' to register your device first") | ||
| } | ||
|
|
||
| reg, err := deps.registrationStore.Load() | ||
| if err != nil { | ||
| return nil, fmt.Errorf("failed to read registration file: %w", err) | ||
| } | ||
| return reg, nil | ||
| } |
Contributor
There was a problem hiding this comment.
This looks duplicated (also exists in grantssh.go)
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #309 +/- ##
==========================================
+ Coverage 14.77% 15.46% +0.69%
==========================================
Files 127 128 +1
Lines 16977 17155 +178
==========================================
+ Hits 2508 2653 +145
- Misses 14182 14203 +21
- Partials 287 299 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
drewmalin
approved these changes
Mar 4, 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.