Skip to content

feat(user-management): add DirectoryManaged to OrganizationMembership#508

Merged
wzahedi merged 1 commit intomainfrom
wzahedi/add-directory-managed-to-org-membership
Mar 5, 2026
Merged

feat(user-management): add DirectoryManaged to OrganizationMembership#508
wzahedi merged 1 commit intomainfrom
wzahedi/add-directory-managed-to-org-membership

Conversation

@wzahedi
Copy link
Contributor

@wzahedi wzahedi commented Mar 5, 2026

Summary

  • Add DirectoryManaged bool field with json:"directory_managed" tag to OrganizationMembership struct
  • This field indicates whether an organization membership is managed by a directory sync connection

Test plan

  • New field uses zero value (false) which is consistent with existing test fixtures
  • No test changes needed as bool defaults to false in Go
    🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wzahedi wzahedi requested a review from a team as a code owner March 5, 2026 16:12
@wzahedi wzahedi requested a review from mattgd March 5, 2026 16:12
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 5, 2026

Greptile Summary

This PR adds a single DirectoryManaged bool field to the OrganizationMembership struct in pkg/usermanagement/client.go, indicating whether a membership is managed by a directory sync connection.

  • The new field follows established conventions in the struct (JSON snake_case tag, Go bool zero value of false).
  • No test changes are required because all existing test fixtures omit the field, which correctly defaults to false and matches the mock responses.
  • The change is non-breaking: existing callers that do not inspect DirectoryManaged are unaffected, and the JSON decoder silently ignores the field if the API does not return it.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, additive, backward-compatible struct field addition.
  • The change is a single boolean field added to a Go struct with a correct JSON tag. It introduces no new logic, no API surface changes beyond the new field, and no test coverage gaps because Go's zero value for bool (false) is consistent with existing fixtures.
  • No files require special attention.

Important Files Changed

Filename Overview
pkg/usermanagement/client.go Adds DirectoryManaged bool field with json:"directory_managed" tag to OrganizationMembership struct. Follows existing struct conventions; no issues found.

Sequence Diagram

sequenceDiagram
    participant Caller
    participant WorkOS SDK (Client)
    participant WorkOS API

    Caller->>WorkOS SDK (Client): GetOrganizationMembership / ListOrganizationMemberships
    WorkOS SDK (Client)->>WorkOS API: GET /user_management/organization_memberships/{id}
    WorkOS API-->>WorkOS SDK (Client): JSON { ..., "directory_managed": true/false, ... }
    WorkOS SDK (Client)-->>Caller: OrganizationMembership{ ..., DirectoryManaged: true/false, ... }
Loading

Last reviewed commit: 6fe9644

@wzahedi wzahedi merged commit e9206b1 into main Mar 5, 2026
5 checks passed
@wzahedi wzahedi deleted the wzahedi/add-directory-managed-to-org-membership branch March 5, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants