Class GrouperDuoProvisioningTargetNativeSync

java.lang.Object
edu.internet2.middleware.grouper.app.provisioning.GrouperProvisioningTargetNativeSync
edu.internet2.middleware.grouper.app.duo.GrouperDuoProvisioningTargetNativeSync

public class GrouperDuoProvisioningTargetNativeSync extends GrouperProvisioningTargetNativeSync
Duo-specific GrouperProvisioningTargetNativeSync: builds native target reporting beans for sync-back to the generic grouper_prov_group / grouper_prov_user tables.

Both groups and users are captured from the raw Duo JSON (JSON Pointer paths, like SCIM and Adobe), hooked at the API-commands seam (GrouperDuoApiCommands read methods such as retrieveDuoGroups / retrieveDuoUsers / retrieveDuoUser) where the per-element JSON node is in scope. This avoids losing any Duo field that the GrouperDuoGroup / GrouperDuoUser typed beans do not model; operators can capture any JSON field via nativeAttributesGroups / nativeAttributesEntities with a name and optional JSON-Pointer path.

The default keys are chosen so each default's captured value matches what the OLD typed-bean getter returned: the Duo user JSON field is username (stored under the friendlier key userName, matching GrouperDuoUser.getUserName()), and the target ids come from /user_id (user) and /group_id (group) -- the same JSON fields the old typed-bean build methods read via getId() / getGroup_id().

Memberships are still derived from the GrouperDuoUser typed bean's inline groups set (captureMembershipsFromUser(edu.internet2.middleware.grouper.app.duo.GrouperDuoUser)); each GrouperDuoGroup in that set carries its own group_id, so no name->id index resolution is needed. Only the group/user object capture is JSON-based.

  • Constructor Details

    • GrouperDuoProvisioningTargetNativeSync

      public GrouperDuoProvisioningTargetNativeSync()
  • Method Details

    • getDefaultNativeAttributeConfigsEntities

      protected List<GrouperProvisioningNativeAttributeConfig> getDefaultNativeAttributeConfigsEntities()
      Description copied from class: GrouperProvisioningTargetNativeSync
      Per-protocol sensible-default attribute list for entities (users) when the operator hasn't configured nativeAttributesEntities. Override in protocol subclasses to return a curated list (e.g. SCIM core schema fields). Default is empty — for LDAP this means "no extra capture beyond what the regular target query returned," which is the historical behavior.
      Overrides:
      getDefaultNativeAttributeConfigsEntities in class GrouperProvisioningTargetNativeSync
    • getDefaultNativeAttributeConfigsGroups

      protected List<GrouperProvisioningNativeAttributeConfig> getDefaultNativeAttributeConfigsGroups()
      Description copied from class: GrouperProvisioningTargetNativeSync
      Per-protocol sensible-default attribute list for groups. See GrouperProvisioningTargetNativeSync.getDefaultNativeAttributeConfigsEntities().
      Overrides:
      getDefaultNativeAttributeConfigsGroups in class GrouperProvisioningTargetNativeSync
    • buildNativeGroupFromJson

      public GrouperProvisioningTargetNativeGroup buildNativeGroupFromJson(com.fasterxml.jackson.databind.JsonNode groupNode)
      Build a native group bean from the raw Duo group JSON. targetId is read from /group_id (the same field the old typed-bean build read via getGroup_id()); the attributes map is populated for each entry in GrouperProvisioningTargetNativeSync.effectiveNativeAttributeConfigsGroups() (operator-configured or default) by JSON Pointer. Returns null when the JSON is missing or has no group_id.
    • buildNativeUserFromJson

      public GrouperProvisioningTargetNativeUser buildNativeUserFromJson(com.fasterxml.jackson.databind.JsonNode userNode)
      Build a native user bean from the raw Duo user JSON. targetId is read from /user_id (the same field the old typed-bean build read via getId()); the attributes map is populated for each entry in GrouperProvisioningTargetNativeSync.effectiveNativeAttributeConfigsEntities() (operator-configured or default) by JSON Pointer. Returns null when the JSON is missing or has no user_id.
    • captureGroupJson

      public void captureGroupJson(com.fasterxml.jackson.databind.JsonNode groupNode)
      Build + record a Duo group from its raw JSON. No-op when sync-back is off or id-less.
    • captureUserJson

      public void captureUserJson(com.fasterxml.jackson.databind.JsonNode userNode)
      Build + record a Duo user from its raw JSON. No-op when sync-back is off or id-less.
    • captureMembershipsFromUser

      public void captureMembershipsFromUser(GrouperDuoUser grouperDuoUser)
      Translate a Duo user's inline groups set (GrouperDuoGroup beans with their own group_id) into native membership beans and record them. No-op if reporting is off or the user has no groups.
    • captureGroupJsonFromCurrentProvisioner

      public static void captureGroupJsonFromCurrentProvisioner(com.fasterxml.jackson.databind.JsonNode groupNode)
      Capture a Duo group (from its raw JSON) against the current provisioner's sync. No-op if there's no current provisioner or the active provisioner isn't a Duo one. Called from the commands seam (GrouperDuoApiCommands read methods) for every group parsed from a read.
    • captureUserJsonFromCurrentProvisioner

      public static void captureUserJsonFromCurrentProvisioner(com.fasterxml.jackson.databind.JsonNode userNode)
      Capture a Duo user (from its raw JSON) against the current provisioner's sync. No-op if there's no current provisioner or the active provisioner isn't a Duo one. Called from the commands seam (GrouperDuoApiCommands read methods) for every user parsed from a read.
    • captureMembershipsFromUserForCurrentProvisioner

      public static void captureMembershipsFromUserForCurrentProvisioner(GrouperDuoUser grouperDuoUser)
      Translate a Duo user's inline groups set into native membership records and record them on the current provisioner.
    • captureMembershipInsertFromCurrentProvisioner

      public static void captureMembershipInsertFromCurrentProvisioner(String groupTargetId, String userTargetId)
      Write-track a successful Duo membership add (associateUserToGroup) against the current provisioner: record (groupTargetId, userTargetId) in the native membership mirror. Unlike groups/users (re-read via the drain), memberships are tracked purely from our own successful writes -- never re-read -- so grouper_prov_mship stays current for GRP-7048 (full sync serving memberships from the sync-back cache). No-op out of cycle or for a non-Duo provisioner; the record call itself is a no-op when membership sync-back is off.
    • captureMembershipDeleteFromCurrentProvisioner

      public static void captureMembershipDeleteFromCurrentProvisioner(String groupTargetId, String userTargetId)
      Write-track a successful Duo membership remove (disassociateUserFromGroup) against the current provisioner: drop (groupTargetId, userTargetId) from the native membership mirror so the end-of-run flush deletes its grouper_prov_mship row. No-op out of cycle or for a non-Duo provisioner; the record call itself is a no-op when membership sync-back is off.