feat(mgmt): add PatchTenant endpoint for partial tenant updates - #841
Conversation
Update() is a full overwrite of TenantRequest, so callers preserving only the fields they know about silently clear newer fields (SSO enforcement exclusions, role inheritance) added since they last upgraded. Patch() uses pointer fields so only explicitly-set values are sent, and the Update() doc comment now correctly describes its full-overwrite scope instead of "name and domains". Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
🐕 Review complete — View session on Shuni Portal 🐾 |
🐕 Suggested ReviewersThis PR adds a new
Suggested by Shuni based on git history and PR context. Names are not @-mentioned to avoid notifying anyone — request a review from whoever fits best. |
There was a problem hiding this comment.
🐕 Shuni Review
Adds a Tenant().Patch() endpoint with a pointer-field PatchTenantRequest so partial tenant updates no longer reset unrelated fields, mirroring the existing User().Patch() pattern.
Actionable comments posted: 1
- 1 🟡 Minor:
FederatedAppIDsfield onPatchTenantRequesthas no corresponding field onTenant/TenantRequestand no other reference in the codebase
Merge risk: 🟢 Low: the core patch logic mirrors the well-tested User().Patch() pattern and is covered by new unit tests; the one flagged field is an isolated, easily-verifiable addition.
See inline comments for details.
Review scope: Full review
Reviewed files (7)
README.mddescope/api/client.godescope/internal/mgmt/tenant.godescope/internal/mgmt/tenant_test.godescope/sdk/mgmt.godescope/tests/mocks/mgmt/managementmock.godescope/types.go
# Conflicts: # descope/api/client.go
|
🐕 Review complete — View session on Shuni Portal 🐾 |
There was a problem hiding this comment.
🐕 Shuni Review
No new issues found.
1 unresolved prior finding
⚠️ Review follow-up issue: Unresolved prior review threads: PRRT_kwDOHT4RP86dtvjm.
Review scope: Incremental re-review
Reviewed new changes (5)
README.mddescope/api/client.godescope/sdk/mgmt.godescope/tests/mocks/mgmt/managementmock.godescope/types.go
FederatedAppIDs was only reachable through PatchTenantRequest, so it had no counterpart in the read model or Create/Update, and couldn't be verified via Load(). Wire it into Tenant and TenantRequest too so it's symmetric with every other patchable field. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
🐕 Review complete — View session on Shuni Portal 🐾 |
Related Issues
related to https://github.com/descope/etc/issues/17551
Description
Wraps the management endpoint
PATCH /v1/mgmt/tenant/patchto support partial tenant structure updates.Must