Repository navigation
Conversation
The gateway now accepts a group as the grantee of a vault share or of a vault space membership. The gateway does not check the VaultMode permission for a group, because role assignments belong to single accounts and group membership can change. The ocis notification services filter the group members by VaultMode instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t storage Add the auth interceptor option vault_mode_required. When the option is on, the interceptor denies each request from a user who does not hold the VaultMode permission. Service accounts are not checked. The interceptor caches definitive answers for each user for 30 seconds. An error during the check denies the request. The vault storage provider uses this option. A group member without the VaultMode permission then cannot open a vault resource that is shared with the group. NewStream now resolves the gateway address in the same way as NewUnary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… event The events middleware read the granteegroupid value of a removed share into the user ID field. Thus the ShareRemoved event of a group share contained the group ID as a user ID, and GranteeGroupID was empty. The notification services then sent the "Resource unshared" notification to no member of the group. Read the value into the group ID field. Add a test for a group grantee and for a user grantee. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Roman Perekhod <2403905@gmail.com>
… interceptor The auth interceptor checked MFA and the VaultMode permission. The interceptor kept the VaultMode cache and the gateway client in package globals. In one process, all auth interceptors used the cache settings of the first interceptor. Add the package pkg/vault. It holds the VaultMode check and a Checker type. Each Checker has its own cache. The gateway and the new interceptor use this package. Other services, for example oCIS, can use it too. Add the interceptor vault. It runs after the auth interceptor and denies users without MFA or without the VaultMode permission. The option mfa_required replaces the option mfa_enabled of the auth interceptor. The auth interceptor now only authenticates. Add a test that fails when the loader does not register the vault interceptor. rgrpc ignores a configured interceptor that is not registered, so a missing import would leave the vault unprotected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Roman Perekhod <2403905@gmail.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Description
This pull request answers the review comments of jvillafanez on #787.
Dependency: this branch starts from the branch of #787. Until #787 is merged, this pull request also shows the 3 commits of #787. Review only the last commit,
refactor(vault): move the vault checks into a separate interceptor. Merge #787 first.Changes
pkg/vaultIsVaultStorage,IsVaultSpace,PermissionGranted, andHasVaultModehold the one VaultMode check. Before this change, the auth interceptor, the gateway, and oCIS had their own copies.Checkertype can cache the definitive answers. EachCheckerhas its own cache.FilterUserschecks a list of users in parallel, with a limit.sync.Onceare removed. Before this change, all auth interceptors in one process used the cache settings of the first interceptor.vault(internal/grpc/interceptors/vault)mfa_required,vault_mode_required,vault_mode_cache_size,vault_mode_cache_seconds,priority.mfa_requiredreplaces the optionmfa_enabledof the auth interceptor. No release containsmfa_enabled.granteeMayAccessVaultusespkg/vault.vaultinterceptor.Not in this pull request
userGroupsCacheandscopeExpansionCacheof the auth interceptor have the same pattern. They affect all services, so they need a separate ticket.Related
interceptors.vaultfor the vault storage-users instance and usespkg/vaultin the userlog and notifications services.Tests
go test -race ./pkg/vault/go test ./internal/grpc/interceptors/... ./internal/grpc/services/gateway/ ./pkg/rgrpc/...golangci-lint runfor the changed packages: no findings.🤖 Generated with Claude Code