Repository navigation
Conversation
The checkTransitiveMembership query is a CEL expression, so the member key must be a quoted string literal: member_key_id == 'member_key_id_value'. The unquoted email was rejected by the API (400), the error was swallowed, and the group-allowlist login path could never succeed. Quote the value, escaping backslashes and single quotes.
Capture the URL sent to RestTemplate and assert it contains member_key_id == 'user@example.com', plus a case with a single quote in the email asserting the escaping. Both fail without the fix.
Xyloslabs
requested review from
anantbhargava-lgtm,
prashantgarg-coder,
thebarnaby and
xinyij-goo
as code owners
November 29, 2026 03:45
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.
The group-allowlist login path could never succeed: checkGroupMembership sends the member key to the Cloud Identity checkTransitiveMembership endpoint as an unquoted CEL expression (member_key_id == user@example.com). The API expects a quoted string literal (member_key_id == 'user@example.com'), rejects the unquoted form with a 400, and the error is swallowed, so the check always returns false. The domain allowlist and the * wildcard still work, so this only breaks group-based allowlisting.
This change adds a toCelStringLiteral helper that quotes the value, escaping backslashes and single quotes, and uses it when building the query. Two tests capture the URL sent to RestTemplate and assert the quoted expression, including a single-quote escaping case.
How it was checked: MembershipServiceImplTest run locally, 10/10 pass with the fix; the two new tests fail without it (8 pass / 2 fail). Note the repo has no Java CI workflow, so these were run locally: the test classpath was assembled from Maven Central with curl and run with the JUnit platform console, because mvn test cannot reach the network from this machine. Formatting was checked against google-java-format 1.22.0 (the repo's fmt-maven-plugin version).
Google CLA: signed.