Skip to content

Automation for SCIM endpoints#570

Open
dasarinaidu wants to merge 1 commit intorancher:mainfrom
dasarinaidu:scim-card-validations-with-openldap
Open

Automation for SCIM endpoints#570
dasarinaidu wants to merge 1 commit intorancher:mainfrom
dasarinaidu:scim-card-validations-with-openldap

Conversation

@dasarinaidu
Copy link
Copy Markdown
Contributor

  1. Automated SCIM endpoints
  2. Started with OpenLdap AuthProvider
  3. Will add more provider tests in upcoming PRs

@dasarinaidu dasarinaidu requested review from Priyashetty17, Copilot and joesims22 and removed request for Copilot March 20, 2026 17:40
@dasarinaidu dasarinaidu force-pushed the scim-card-validations-with-openldap branch 3 times, most recently from 572b5f5 to 5356596 Compare March 20, 2026 19:44
@rancher rancher deleted a comment from github-actions bot Mar 23, 2026
@rancher rancher deleted a comment from github-actions bot Mar 23, 2026
@rancher rancher deleted a comment from github-actions bot Mar 23, 2026
@rancher rancher deleted a comment from github-actions bot Mar 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an initial end-to-end SCIM 2.0 automation suite targeting the OpenLDAP auth provider, along with a new SCIM actions client to exercise SCIM endpoints and validate expected Rancher behavior.

Changes:

  • Introduces a new SCIM OpenLDAP validation suite covering discovery, CRUD (users/groups), patch semantics, pagination, and RBAC bindings.
  • Adds a reusable SCIM actions client/helper utilities for feature-flag handling and SCIM token secret management.
  • Documents SCIM test prerequisites and required cattle-config.yaml inputs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 11 comments.

File Description
validation/auth/scim/scim_openldap_test.go New OpenLDAP-focused SCIM validation suite with extensive endpoint and RBAC coverage.
validation/auth/scim/README.md New documentation for configuring and running the SCIM OpenLDAP test suite.
actions/scim/scim.go New SCIM HTTP client and setup helpers (feature flag + auth provider enablement + token secret handling).

Comment on lines +702 to +721
func (s *SCIMOpenLDAPTestSuite) TestSCIMCannotDeleteDefaultAdmin() {
subSession := s.session.NewSession()
defer subSession.Cleanup()

logrus.Info("Verifying default admin user is not visible via SCIM (local users are not SCIM-provisioned)")

params := url.Values{}
params.Set("filter", `userName eq "admin"`)

resp, err := s.scim.Users().List(params)
require.NoError(s.T(), err)
require.Equal(s.T(), http.StatusOK, resp.StatusCode, "Filter request should return 200, body: %s", string(resp.Body))

var body map[string]interface{}
err = resp.DecodeJSON(&body)
require.NoError(s.T(), err)

resources, _ := body["Resources"].([]interface{})
require.Empty(s.T(), resources, "Local admin should not appear in SCIM — only SCIM-provisioned users are returned")
}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The test name suggests a delete is attempted, but the test only asserts the local "admin" user does not appear in SCIM list results. Rename the test to reflect the actual assertion (e.g., that local users are not returned by SCIM), or add a delete attempt if that's the intended behavior to verify.

Copilot uses AI. Check for mistakes.
@dasarinaidu dasarinaidu force-pushed the scim-card-validations-with-openldap branch from 5356596 to af1cd19 Compare March 24, 2026 06:11
@dasarinaidu dasarinaidu requested a review from a team as a code owner March 24, 2026 06:11
actions/go.mod Outdated
sigs.k8s.io/yaml v1.6.0 // indirect
)

replace github.com/rancher/shepherd => github.com/dasarinaidu/shepherd v0.0.0-20260324045604-66c21b128aaf
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.

Waiting for shepherd merge to approve

actions/go.sum Outdated
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/creasty/defaults v1.5.2 h1:/VfB6uxpyp6h0fr7SPp7n8WJBoV8jfxQXPCnkVSjyls=
github.com/creasty/defaults v1.5.2/go.mod h1:FPZ+Y0WNrbqOVw+c6av63eyHUAl6pMHZwqLPvXUZGfY=
github.com/dasarinaidu/shepherd v0.0.0-20260324045604-66c21b128aaf/go.mod h1:SJtW8Jqv0rphZzsGnvB965YdyR2FqFtB+TbbzVLt8F4=
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.

Waiting for shepherd merge to approve

@dasarinaidu dasarinaidu force-pushed the scim-card-validations-with-openldap branch 4 times, most recently from f779c8c to e8a2ced Compare April 1, 2026 17:54
@rancher rancher deleted a comment from Copilot AI Apr 1, 2026
@rancher rancher deleted a comment from Copilot AI Apr 1, 2026
@dasarinaidu dasarinaidu force-pushed the scim-card-validations-with-openldap branch 2 times, most recently from d4ae9cd to 17a55b4 Compare April 1, 2026 19:40
lscalabrini01
lscalabrini01 previously approved these changes Apr 1, 2026
@dasarinaidu dasarinaidu force-pushed the scim-card-validations-with-openldap branch from 17a55b4 to 659ab43 Compare April 1, 2026 21:06
@rancher rancher deleted a comment from Copilot AI Apr 1, 2026
@rancher rancher deleted a comment from Copilot AI Apr 1, 2026
@rancher rancher deleted a comment from Copilot AI Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants