Skip to content

refactor!: Add ProvisionAndInviteSCIMUserRequest and pass it by value to ProvisionAndInviteSCIMUser - #4697

Merged
gmlewis merged 2 commits into
google:masterfrom
JamBalaya56562:refactor/3644-scim-provision-request-type
Oct 31, 2026
Merged

gmlewis merged 2 commits into
google:masterfrom
JamBalaya56562:refactor/3644-scim-provision-request-type

Conversation

@JamBalaya56562

Copy link
Copy Markdown
Contributor

Updates #3644.

BREAKING CHANGE: SCIMService.ProvisionAndInviteSCIMUser now takes a new ProvisionAndInviteSCIMUserRequest by value instead of *SCIMUserAttributes.

ProvisionAndInviteSCIMUser (POST /scim/v2/organizations/{org}/Users) used the response type SCIMUserAttributes as its request body. That type has response-only fields (ID, Meta) and Roles, none of which are in the request schema. This PR adds a request type with exactly the properties of the request schema, the same way as the existing UpdateProvisionedOrgMembershipRequest for PUT /scim/v2/organizations/{org}/Users/{scim_user_id}.

Two commits:

  1. feat - Add the properties of the scim-user response schema that SCIMUserAttributes was missing: organization_id (OrganizationID), profileUrl (ProfileURL), and operations (Operations, which reuses UpdateAttributeForSCIMUserOperations because the item schema is the same op/path/value). The GetSCIMProvisioningInfoForUser test now decodes them.
  2. refactor! - Add ProvisionAndInviteSCIMUserRequest and pass it by value. userName, name, and emails are required in the schema, so they are not pointers and have no omit option. The optional slices Schemas and Groups use omitzero. SCIMUserAttributes is removed from body-allowed-pointer-types, and the test checks the request body with testJSONBody.

The method name already matches the GitHub docs operation name ("Provision and invite a SCIM user"), so it is not renamed.

Verified locally: go build ./..., go vet -tags integration ./test/integration/, example module build, go test ./github/, generated files idempotent, custom-gcl 0 issues, and script/check-schema-fields.sh reports nothing for the SCIM types. (It reports 4 new warnings for EnterpriseUpdateBudget, but master reports the same 4 since the openapi_commit update in #4693, so they are not from this PR.)

@gmlewis gmlewis added NeedsReview PR is awaiting a review before merging. Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). labels Oct 31, 2026
@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.64%. Comparing base (1306473) to head (6f7ada7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4697   +/-   ##
=======================================
  Coverage   98.64%   98.64%           
=======================================
  Files         203      203           
  Lines       19027    19027           
=======================================
  Hits        18769    18769           
  Misses        258      258           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Not-Dhananjay-Mishra Not-Dhananjay-Mishra 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.

LGTM

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you, @JamBalaya56562 and @Not-Dhananjay-Mishra!
LGTM.
Merging.

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Oct 31, 2026
@gmlewis
gmlewis merged commit eeb77ef into google:master Oct 31, 2026
15 checks passed
@JamBalaya56562
JamBalaya56562 deleted the refactor/3644-scim-provision-request-type branch October 31, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants