Repository navigation
feat: hide controls the API key cannot use - #358
Merged
4 commits merged intoNov 13, 2026
Merged
4 commits merged into
4 commits merged into
Conversation
nofuturekid
force-pushed
the
feat/hide-controls-the-key-cannot-use
branch
from
November 13, 2026 21:04
8d5eac6 to
dfa17c2
Compare
The Resume button on a paused container sent the start mutation, which
Docker refuses ("cannot start a paused container, try unpause instead"),
so the container stayed paused. A paused container now gets the existing
UnpauseContainer mutation (docker.unpause, available since API 4.29.0, so
on every supported server and without a capability floor); a stopped
container still gets start.
The choice is made once, in UnraidRepository.startContainer(client, id,
paused), the same seam as restartContainer. The Docker tab row and the
container sheet both go through MainViewModel.startContainer(Container).
The demo follows the repository surface: UnraidGateway.startContainer
takes the same flag, and the demo model refuses start on a paused
container like Docker does, so the demo no longer hides the bug.
Closes #345
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ain http
The foreground clients followed redirects, and OkHttp keeps the x-api-key
header when it does, so a 3xx answer moved the key to whatever Location
named: another host, or http after the user entered https. For the
WebSocket the handshake was followed and the key then went out in
connection_init to the new host.
No client that carries the key follows a redirect any more (ADR-0051).
A redirect is reported as the new reason Redirected, naming the target
origin ("The server redirects to https://... Edit the server and enter
that address."), in the tabs, in the Add server sheet's Test and in the
action message. It is no connection problem, so the pill does not say
Offline. Unraid answers http requests with 302 when SSL is Yes or Strict.
Closes #354
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A key without the permission for an action no longer gets the button for it. The Docker, VMs and Array tabs and the container, VM and notification sheets hide Start, Stop, Restart, Update, parity, Archive and Delete controls when the capability probe says the key lacks DOCKER, VMS, ARRAY or NOTIFICATIONS UPDATE_ANY / DELETE_ANY, and show one "View only" note that names the missing permission, with a link to the README table. Unknown access keeps every button as before, and a refused action now says which permission it needed instead of "Forbidden resource". The Add server Test button now uses the capability probe instead of Ping, which the server answers for any key: a rejected key fails the test, and an accepted one reports the Unraid and API version and what the key can do. The API Key field gets a hint and a "Which permissions?" link. The Overview shows the failure reason of a total failure like the tabs do, and only a connection problem (unreachable server, rejected key) marks it offline and hides the needs-attention card. Closes #315 Closes #316 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ion card with services off The Containers and Virtual machines cards turned an unknown list (not loaded, turned off, not allowed, offline) into "0 running", "all healthy" and "0 configured". They now show the same dash as the other Overview cards; a real empty list still reads 0. The figures moved into OverviewFigures.kt so they can be unit-tested. Regression tests for #356: the Needs attention card stays with VMs or Docker switched off or forbidden for the key, and the cards render dashes while their data is unknown. ErrorReasonTest now also classifies the Docker-off answer through the real Docker query. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
nofuturekid
force-pushed
the
feat/hide-controls-the-key-cannot-use
branch
from
November 13, 2026 21:43
cf43b99 to
9792740
Compare
nofuturekid
added a commit
that referenced
this pull request
Nov 13, 2026
#358 moved the Add server sheet's Test onto the capability probe, whose failure path never called redirectMessage(): a 3xx answer showed the generic "Http request failed with status code 302" instead of the sentence ADR-0051 documents. testOutcomeOf now prefers the redirect message when the probe's failure carries the HTTP exception. Tests: a 302 with a target and one without go through the real probe; the classifier test no longer claims to cover Test. ADR-0048's last sentence pointed at in-app clients that follow redirects; since ADR-0051 they do not. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
What changed
A key that lacks the permission for an action is no longer offered the button for it (#315).
Denied(from the capability probe of ADR-0047), the Docker, VMs and Array tabs and the container, VM and notification sheets hide Start, Stop, Restart, Resume, Update, Update all, Pause, Reboot, Reset, Force stop, Start/Stop array, the parity buttons, Archive, Unarchive, Archive all, Delete and Delete all archived, and show one "View only" note in their place that names the missing permission (for example "Needs DOCKER:UPDATE_ANY") with a "Which permissions?" link to the README table (#api-key-permissions). The texts are the ones of the design. Notifications are split: a key that may archive but not delete keeps exactly the archive buttons, and the note says "This API key can't delete notifications."Access.Deniedhides a control. While detection runs, when it failed, or for a role NOVA does not know, every screen looks as before. This is tested in pairs (Denied vs Unknown vs Allowed) on every surface.FORBIDDENthe snackbar now reads "Action failed: your API key isn't allowed to do this (it needs DOCKER:UPDATE_ANY)" (permission fromKeyAction.forOperation), forUNAUTHENTICATED"…the server didn't accept the API key". The server's own text stays onActionFailedException.detail.Ping(__typename) is answered for any key, so Test used to say "Connected" for a wrong key. Test now runs version +me: a rejected key fails ("The server didn't accept this API key"); an accepted key shows "Connected · Unraid 7.4.0 · API 4.37.11" and "View only key: NOVA will hide controls", "Full control" or "Can control: Docker, VMs"; a too-old API gets the design's sentence. A refusedmesays nothing about control. Certificate handling (untrusted/changed certificate dialog) still works through the probe (tested).query Pingis removed. The API Key field gets "A key with the VIEWER role is enough to see everything. Controls need more permissions." and a "Which permissions?" link (Document the minimal API key permissions for each feature #316).ErrorState(same texts as the tabs; a connection problem wins over other reasons). Its offline rule, and so the needs-attention card, is now decided byErrorReason.isConnectionProblem: Docker or VMs switched off no longer hides the card. The Containers and Virtual machines cards show "—" instead of "0 running · all healthy" / "0 configured" while their data is unknown (Needs attention card never appears when VMs or Docker are switched off #356).Accessfrom the demo's capabilities exactly asMainScreendoes and checks that no note shows and no button is missing.Closes #315
Closes #316
Closes #356
Shared files touched, and the region
MainScreen.kt: thecapabilitiescollection afterdisplayThresholds, plus onecontrol =/update =/delete =argument at each tab and sheet call site. Nothing else.UnraidRepository.kt: onlytestConnection(nowtestOutcomeOf(probeCapabilities(client))) and the removedPingQueryimport.ResponseClassifier.kt:ActionFailedException(newdetail),checkActionResponse/orThrow(refusal wording),TestOutcome.Ok, newTestControlandtestOutcomeOf.CapabilityProbe.kt:ProbeOutcomecarries the transportcauseand the server'sfailureTextof a failed detection (needed so Test can still show the certificate dialog and real errors).Error.code()is nowinternal.DockerTab.kt,ContainerDetailSheet.kt,VmsTab.kt,VmDetailSheet.kt,ArrayTab.kt,NotificationsSheet.kt: new parameters with the defaultAccess.Unknownand the button rows only. InContainerDetailSheet.ktthe actions block gets one extraelse if (control == Denied)branch; the Start/Resume lines are untouched.AddEditServerSheet.kt: the Test result state and panel, the key hint and link.OverviewTab.kt: the all-failed branch and the offline rule (two small internal functions).queries.graphql(removedPing),HANDOFF.md(one file-list entry),README.md(two sentences that said buttons are refused / "a later version will hide them"),CHANGELOG.md.ui/components/ViewOnlyNote.kt.Not touched: Settings screen and
data/alerts,ApolloClientFactoryand the response classifier's redirect handling,UnraidRepository.unpause/resume and the Docker container sheet's Resume line,DomainState.kt,SnapshotStates.kt,schema.graphqls, the top bar region,.github/, version, ADRs.Deliberately left out
Tests
New:
ViewOnlyControlsTest(Robolectric: Denied/Unknown/Allowed per surface, notification split, demo hides nothing),TestConnectionOutcomeTest(wrong key fails, view only, full, partial, unknown, too old, unreachable, certificate dialog, server text),ActionRefusalTest(live FORBIDDEN body names the permission; every operation names its ownKeyAction),OverviewFailureTest(reason shown, card kept with Docker/VMs off, hidden when unreachable or key rejected)../scripts/local-ci.sh: passed (636 unit tests, 0 failed, 0 skipped).Device acceptance (read-only key, then admin key)
🤖 Generated with Claude Code