Skip to content

Add Preset backend client with SCIM API support - #337

Open
ruagrawa wants to merge 2 commits into
redhat-data-and-ai:mainfrom
ruagrawa:preset-backend
Open

Add Preset backend client with SCIM API support#337
ruagrawa wants to merge 2 commits into
redhat-data-and-ai:mainfrom
ruagrawa:preset-backend

Conversation

@ruagrawa

Copy link
Copy Markdown

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

  • N/A

🚀 Deployment

Deploy Steps

  1. N/A

Prerequisites

  • N/A

Post-Deployment Monitoring

  • N/A

Rollback Plan

  • N/A

⚠️ Breaking Changes

NA

Details:

  • N/A

⚙️ Configuration Changes

backends:

  • name: preset
    type: preset

✅ Developer Checklist

  • [Y ] My code follows the style guidelines of this project
  • [ Y] I have performed a self-review of my own code
  • [ Y] I have commented my code, particularly in hard-to-understand areas
  • I have added positive and negative tests that prove my fix is effective or that my feature works
  • Relevant documentation (README, tech specs, etc.) has been added or updated
  • All CI/CD checks are passing

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>
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 45de47c1-ab07-44c1-a806-2e25e26d2d7f


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: Ruchi Agrawal <ruagrawa@redhat.com>
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