fix(team): stop reading a role restriction as a revoked team vault (#187) - #191
Merged
Conversation
) A connect-only member holds no VIEW_SECRETS, so GET /vault-key 403s for them. On an empty team vault — the one a joiner meets right after the owner converts a private vault — fetchTeamData falls through to that route and rendered the 403 as "Access revoked". They were never revoked. The route cannot separate "removed from the team" from "your role lacks VIEW_SECRETS", but the client can: a revoked member no longer has the team in their own team list. A 403 while the team is still listed is a role restriction, and such a member reads the vault through the object routes only — so the empty list they just got IS their view of it. Answers the "what a connect-only invitee should see first" half of #70: the vault, empty, like any other empty vault.
Open
4 tasks
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.
Closes #187. Also answers the "what a connect-only invitee should see first" half of #70.
The bug
A member holding only the built-in
connect-onlyrole opens the team vault they were just invited to and sees "Access revoked — You no longer have access to this team vault." They were never revoked.connect-onlyis28676=CONNECT | START_TERMINAL_SESSION | JOIN_TERMINAL_SESSION | VIEW_TERMINAL_SESSIONS. NoVIEW_SECRETS, soGET /v1/teams/:team_id/vault-keyreturns 403 andgetTeamVaultKeymaps 403 to"forbidden"— the revocation state.It bites at exactly one moment.
fetchTeamDatatrieslistTeamObjectsfirst; that route is membership-gated and returns plaintext metadata, so once the vault holds anything it opens for a connect-only member without the key ever being needed. It is the empty vault — the one a joiner meets right after the owner converts a private vault — that falls through to the key route and 403s.The fix
The route cannot separate "removed from the team" from "your role lacks
VIEW_SECRETS" — both are 403. The client can: the server drops revoked teams from the caller's team list, andonTeamRemovedclears the store. So a 403 while the team is still listed is a role restriction.Such a member reads this vault through the object routes only, which means the empty list they just got is their view of the vault. Show it, rather than a false revocation.
Genuine revocation is unaffected — it arrives through
onTeamRemovedand through a 403 onlist_objectsitself (membership-gated), both of which still land onforbidden.What this deliberately does not do
It does not widen
get_my_vault_keytoPERM_CONNECT || PERM_VIEW_SECRETS, the "Yes" option in #187. That buys nothing for hosts — they never needed the key — and it is unsafe until VoltiusApp/server#11 lands, becauseGET /sync-blobis membership-only today and the pair would hand a connect-only member the whole vault in plaintext.It also does not fix the deeper problem the investigation turned up: a connect-only member can never fetch any credential ciphertext (
list_secretsrequiresVIEW_SECRETS) nor the key to decrypt it, so the role cannot connect to any host with a stored password or key passphrase. Filed as #190 — it needs a design decision about whatPERM_CONNECTmeans.Tests
Two new tests in
teamVaultSync.data.test.ts: a 403 on the key route resolves to an empty loaded vault when the team is still listed, and still resolves toforbiddenwhen it is not. Verified against a negative baseline — the first test fails ondev.Server side: VoltiusApp/server#11