Add Preset backend client with SCIM API support - #337
Open
ruagrawa wants to merge 2 commits into
Open
Conversation
Enables group membership reconciliation and user offboarding via Preset SCIM v2. Signed-off-by: Ruchi Agrawal <ruagrawa@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Ruchi Agrawal <ruagrawa@redhat.com>
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.
Enables group membership reconciliation and user offboarding via Preset SCIM v2.
Changes
📝 Description
What changed?
Added a Preset backend client (pkg/clients/preset/) implementing the shared clients.Client interface via Preset’s SCIM v2 API:
Users: list, create (idempotent by email), fetch, delete
Teams (SCIM Groups): list, create (idempotent by displayName), fetch, delete
Membership: add/remove users via SCIM PATCH on groups
Auth: SCIM bearer token (preferred) or optional JWT exchange via api_token + api_secret
Group params: ReconcileGroupParams is a no-op (no Preset-specific CR params)
Wiring:
pkg/clients/client.go — case "preset" in factory New()
appconfig/default.yaml — sample Preset backend block
config/samples/v1alpha1_group.yaml — example Group CR with preset backend
Uses existing controller reconcile and offboarding flows; no controller changes.
Why is this change needed?
To centralize Preset access management in usernaut alongside Fivetran, GitLab, Snowflake, and Rover. LDAP group membership can drive Preset SCIM group membership, and users removed from LDAP can be offboarded from Preset automatically (Preset is not in the GitLab/Rover offboarding skip list).
Dependencies
N/A (no new go.mod dependencies)
🧪 Testing
Test Coverage
go build ./... — passes
make lint — passes (golangci-lint)
Pre-commit hook — security scan, lint, unit tests
go test ./pkg/clients/ldap/ — passes (existing LDAP tests)
No Preset-specific unit tests in this PR (aligned with Fivetran/GitLab, which also have no client-level tests)
Manual validation against Platformtest Preset team:
FetchAllUsers (~126 users)
User reconcile: create/find by email, add/remove group membership via SCIM PATCH
No changes to controller mocks or offboarding test fixtures; Preset uses the generic Client interface.
Performance Impact
🚀 Deployment
Deploy Steps
Prerequisites
Post-Deployment Monitoring
Rollback Plan
NA
Details:
⚙️ Configuration Changes
backends:
type: preset
✅ Developer Checklist