feat(namespace): add device auto-accept setting#6264
feat(namespace): add device auto-accept setting#6264danielgatis wants to merge 3 commits intoshellhub-io:masterfrom
Conversation
New devices connecting to a namespace are automatically accepted when the setting is enabled, instead of going to pending queue.
|
/review |
|
Claude finished @otavio's task in 4m 37s —— View job Code Review CompleteReviewed 22 files across code quality, security, testing, Go/TypeScript patterns, and architecture. 2 inline issues posted (2 high). Additional notesCross-repo impact — cloud admin // cloud/internal/admin/services/namespace.go, after line 70:
ns.Settings.DeviceAutoAccept = namespace.Settings.DeviceAutoAcceptIf you've addressed the feedback and want a new review, tag |
- Fix TS build: add device_auto_accept to BannerEdit settings body - Fix TS build: use Namespace type instead of NamespaceRoot in drawer - Fix TS build: add device_auto_accept to test mock settings object - Fix ESLint: correct import type resolves unsafe-member-access errors - Fix auth: sync in-memory device status after auto-accept on re-registered devices to avoid DeviceUpdate clobbering the DB - Fix UI: use neutral style for Off toggle button (not primary blue)
|
@otavio could i get another /review round? 👋 |
|
@danielgatis You are not authorized to request an explicit review. If you believe this PR needs a new automated review round, please tag the |
|
/review |
|
Claude finished @otavio's task in 51s —— View job Code Review CompleteReviewed 24 files across code quality, security, testing, Go/TypeScript patterns, and architecture. 1 inline issue posted (1 high). Additional notesPrevious review issues addressed: Both issues from the first review round (the Cross-repo impact (unchanged from previous review): The cloud admin ns.Settings.DeviceAutoAccept = namespace.Settings.DeviceAutoAcceptIf you've addressed the feedback and want a new review, tag |
omitempty on bool causes BSON to omit the field when false, making it impossible to disable auto-accept on MongoDB deployments.
|
/review |
|
Claude finished @otavio's task in 7s —— View job Code Review CompleteReviewed 24 files across code quality, security, testing, Go/TypeScript patterns, and architecture — no issues found. Previous review issues addressed: All three issues from prior rounds have been fixed in this revision:
Cross-repo impact (unchanged from previous reviews): The cloud admin ns.Settings.DeviceAutoAccept = namespace.Settings.DeviceAutoAcceptIf you've addressed the feedback and want a new review, tag |
Motivation
In controlled environments, operators may want every device that attempts
to connect to be automatically accepted without manual intervention.
This removes the need to periodically visit the pending devices list,
making the workflow less bureaucratic and improving the day-to-day
experience for operators who trust their network.
Summary
device_auto_acceptboolean to namespace settingsPUT /api/namespaces/device-auto-accept/:tenantroute withNamespaceDeviceAutoAcceptpermission (owner + administrator)device_auto_acceptcolumn tonamespacesAuthDeviceon first device registrationCloses #4091
Test plan
go test ./api/services/... ./api/routes/... ./pkg/api/authorizer/...