You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added a new Contains All operator to the secret tags condition on the secrets permission subject. The existing Contains operator functions as an OR operator, meaning that if a secret contains one of the tags in the Contains array, it will allow access.
The Contains All operator is exactly the same as the Contains operator, except it requires the secrets to have ALL the tags defined in the condition.
It's built on the $all mongo2js operator which is natively supported in CASL, so no extra work for us!
Type
Fix
Feature
Improvement
Breaking
Docs
Chore
Checklist
Title follows the conventional commit format: type(scope): short description (scope is optional, e.g., fix: prevent crash on sync or fix(api): handle null response).
varonix0
changed the title
feat(permissions): $all (Contains All) operator support
feat(permissions): Contains All ($all) operator support
Mar 17, 2026
This PR adds a $all ("Contains All") operator to the secretTags condition on the secrets permission subject, complementing the existing $in ("Contains") operator which acts as an OR match. The new operator requires a secret to have all specified tags before the permission condition is satisfied, enabling more precise tag-based access control.
The implementation is minimal and correct:
Adds $ALL = "$all" to the PermissionConditionOperators enum in both backend and frontend
Extends the SecretConditionV2SchemasecretTags field to accept $all alongside $in
Registers the same array-of-strings Zod validation for $all as exists for $in
Adds the "Contains All" option to the frontend operator dropdown and its helper description text
Leverages the natively supported $all operator in @ucast/mongo2js (via buildMongoQueryMatcher) — no custom interpreter needed
Issues found:
The documentation at docs/internals/permissions/overview.mdx still states that secretTags "only supports $in operator". This needs to be updated to mention $all support, and the operators table on the same page should include an entry for $all.
Confidence Score: 4/5
This PR is safe to merge; the change is additive, backwards-compatible, and relies on a natively supported CASL/mongo2js operator with no custom logic required.
The implementation is clean, consistent with existing patterns, and uses a well-supported native operator. The only gap is an outdated documentation line that still describes secretTags as supporting only $in — not a runtime issue, but could mislead API users relying on the docs.
docs/internals/permissions/overview.mdx — documentation for secretTags operators needs updating.
Important Files Changed
Filename
Overview
backend/src/lib/casl/index.ts
Adds $ALL = "$all" to PermissionConditionOperators enum. The $all operator is natively supported by @ucast/mongo2js used in buildMongoQueryMatcher, so no additional interpreter registration is needed.
Adds "Contains All" SelectItem for the secretTags condition type in the operator dropdown, and adds a helper description for the $ALL operator. Changes are clean and consistent with the existing UI pattern.
Comments Outside Diff (1)
docs/internals/permissions/overview.mdx, line 77 (link)
Outdated secretTags documentation
The description for secretTags still says it "only supports $in operator", but this PR adds support for $all as well. This should be updated to reflect the new operator, and the operators table below should include a $all row.
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
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.
Context
Added a new
Contains Alloperator to the secret tags condition on the secrets permission subject. The existingContainsoperator functions as an OR operator, meaning that if a secret contains one of the tags in the Contains array, it will allow access.The
Contains Alloperator is exactly the same as theContainsoperator, except it requires the secrets to have ALL the tags defined in the condition.It's built on the
$allmongo2js operator which is natively supported in CASL, so no extra work for us!Type
Checklist
type(scope): short description(scope is optional, e.g.,fix: prevent crash on syncorfix(api): handle null response).