Skip to content

feat(group): expose the source of a group and its members - #375

Open
dorsha wants to merge 4 commits into
mainfrom
feat/group-member-source
Open

dorsha wants to merge 4 commits into
mainfrom
feat/group-member-source

Conversation

@dorsha

@dorsha dorsha commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Description

Group membership now records which side added each member. GroupMember.source is "scim" when SCIM pushed the member, "jit" when an SSO assertion added it at login, and empty for memberships recorded before provenance was tracked (those belong to the group's own source).

A SCIM group can legitimately hold JIT members: SSO assertions keep their own membership so a user's idpGroups claim survives a token refresh, rather than only being present at login. The field lets callers tell the two apart.

Group.source is included because a member with an empty source inherits the group's, so the member field cannot be interpreted on its own. The other SDKs already expose Group.source; this SDK had not picked it up yet.

Both fields are read-only: populated by the server, ignored on writes.

Issue: descope/etc#18722
Backend: descope/backend#2745

Testing

mvn compile and mvn checkstyle:check pass. GroupServiceImplTest reports the same 3 pre-existing apiProxy is null errors on this branch as on a clean origin/main (verified side by side); the suite mocks Group, so model fields are not exercised by it.

🤖 Generated with Claude Code

Group membership now records which side added each member: "scim" when
SCIM pushed it, "jit" when an SSO assertion added it at login. A SCIM
group can hold JIT members, because SSO assertions keep their own
membership so the user's idpGroups claim survives a token refresh.

Group.source comes along because a member whose own source is empty
(recorded before provenance was tracked) belongs to the group's source,
so the member field cannot be interpreted without it.

Both are read-only, populated by the server and ignored on writes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@shuni-bot

shuni-bot Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🐕 Shuni Review

No new issues found.

🤖 Model: claude-opus-5.5 · Effort: high


Review scope: Partial incremental re-review

Reviewed new changes (1)
  • src/test/java/com/descope/sdk/mgmt/impl/GroupServiceImplTest.java
Previously reviewed and unchanged: 3 files.

🐕 Review complete — View session on Shuni Portal 🐾

🤖 Model: claude-opus-5.5 · Effort: high

@shuni-bot shuni-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐕 Shuni review: no new findings. Every changed file in this pull request was reviewed.

The full review summary is in Shuni's sticky review comment on this pull request.

The group endpoints deserialized into a raw List, so every element came
back as a LinkedHashMap. Iterating the result as Group, or calling any
getter on an element, threw ClassCastException, which made the model's
fields unreachable. Use a TypeReference, as the user service already
does.

With that fixed the member fields still would not bind: the mapper is
case sensitive and the server sends loginId and userId, so name them
explicitly while keeping the Java accessors.

Group and GroupMember each gained a field, which widens the generated
all-args constructor. Add explicit three-field constructors so existing
callers keep compiling.

Callers that currently cast elements of these responses to Map will
need to change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@shuni-bot shuni-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐕 Shuni review: 2 inline findings. Every changed file in this pull request was reviewed.

The full review summary is in Shuni's sticky review comment on this pull request.

List.of is Java 9+, and this project targets Java 8, so the test broke
the oldest build in the matrix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@shuni-bot shuni-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐕 Shuni review: no new findings. Every changed file in this pull request was reviewed.

The full review summary is in Shuni's sticky review comment on this pull request.

The group endpoints deserialize through postAndGetArray, so the three
tests still stubbing post received null and their assertions failed.
These are the same tests that previously failed with a null proxy, which
masked the stub being wrong.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@shuni-bot shuni-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐕 Shuni review: no new findings. Every changed file in this pull request was reviewed.

The full review summary is in Shuni's sticky review comment on this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant