Class DropboxProvisioningTargetNativeSync

java.lang.Object
edu.internet2.middleware.grouper.app.provisioning.GrouperProvisioningTargetNativeSync
edu.internet2.middleware.grouper.app.dropbox.DropboxProvisioningTargetNativeSync

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

This mirrors TrueFoundryProvisioningTargetNativeSync. Both groups and users are captured from the raw Dropbox JSON (via JSON-Pointer paths, like SCIM / Adobe / Duo / TrueFoundry), hooked at the API-commands seam (DropboxApiCommands read methods such as retrieveDropboxGroups / retrieveDropboxGroup for groups and retrieveDropboxUsers / retrieveDropboxUser for users) where the per-object JSON node is in scope. Capturing the raw JSON -- rather than the lossy DropboxGroup / DropboxUser typed beans -- means an operator can capture any Dropbox field via nativeAttributesGroups / nativeAttributesEntities with a name and optional JSON-Pointer path, including fields the typed beans never model.

Dropbox JSON is uniform across endpoints (unlike TrueFoundry's team-vs-role nodes), so the commands seam performs only an identity normalization (a defensive deep copy) before handing the node here -- there is no field to alias and no groupType to synthesize. Every default / pointer below is therefore relative to the raw Dropbox node:

  • groups: target id from /group_id; default attributes name (from /group_name) and externalId (from /group_external_id, the Grouper match key).
  • users: target id from /profile/team_member_id (members/list_v2 and get_info_v2 both wrap the profile); default attributes email (from /profile/email) and status (from /profile/status/.tag, a Dropbox union tag).

Memberships are mirrored to grouper_prov_mship via a single native membership map kept current from two sources: every membership READ records "this membership exists" (via captureMembershipInsertFromCurrentProvisioner(java.lang.String, java.lang.String), called from the membership-read seam in DropboxApiCommands.retrieveDropboxGroupMemberships) so a full sync re-populates the map each pass and the end-of-run global reconcile keeps the rows; and every successful WRITE adjusts it -- DropboxTargetDao calls the same insert dispatcher after a groups/members/add and captureMembershipDeleteFromCurrentProvisioner(java.lang.String, java.lang.String) after a groups/members/remove -- so an incremental add/remove adjusts grouper_prov_mship precisely with no read-lag.

  • Constructor Details

    • DropboxProvisioningTargetNativeSync

      public DropboxProvisioningTargetNativeSync()
  • 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 Dropbox group JSON. targetId is read from /group_id (the same field DropboxGroup.fromJson reads); 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.
      Parameters:
      groupNode - a raw Dropbox group object
      Returns:
      the native group bean, or null
    • buildNativeUserFromJson

      public GrouperProvisioningTargetNativeUser buildNativeUserFromJson(com.fasterxml.jackson.databind.JsonNode memberNode)
      Build a native user bean from the raw Dropbox member JSON. targetId is read from /profile/team_member_id (the profile wrapper present on members/list_v2 and get_info_v2); 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 team_member_id.
      Parameters:
      memberNode - a raw Dropbox member object (with a profile child)
      Returns:
      the native user bean, or null
    • captureGroupJson

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

      public void captureUserJson(com.fasterxml.jackson.databind.JsonNode memberNode)
      Build + record a Dropbox user from its raw JSON. No-op when sync-back is off or the node is null / id-less.
      Parameters:
      memberNode - the raw Dropbox member node
    • captureGroupJsonFromCurrentProvisioner

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

      public static void captureUserJsonFromCurrentProvisioner(com.fasterxml.jackson.databind.JsonNode memberNode)
      Capture a Dropbox user (from its raw JSON) against the current provisioner's sync. No-op if there is no current provisioner or the active provisioner is not a Dropbox one. Called from the commands seam for every member parsed from a read.
      Parameters:
      memberNode - the raw Dropbox member node
    • captureMembershipInsertFromCurrentProvisioner

      public static void captureMembershipInsertFromCurrentProvisioner(String targetGroupId, String targetUserId)
      Record that a Dropbox group membership EXISTS: put (targetGroupId, targetUserId) in the native membership map so the end-of-run flush writes its grouper_prov_mship row. No-op out of cycle, for a non-Dropbox provisioner, or when membership sync-back is off. Called both from the membership-read seam (DropboxApiCommands.retrieveDropboxGroupMemberships, to re-populate the map on a full sync) and from DropboxTargetDao.insertMemberships after a successful add (so an incremental add adjusts sync-back immediately).
      Parameters:
      targetGroupId - the native group_id
      targetUserId - the native team_member_id
    • captureMembershipDeleteFromCurrentProvisioner

      public static void captureMembershipDeleteFromCurrentProvisioner(String targetGroupId, String targetUserId)
      Write-track a successful Dropbox group-member REMOVE (groups/members/remove) against the current provisioner: drop (targetGroupId, targetUserId) from the native membership map so the end-of-run flush deletes its grouper_prov_mship row. No-op out of cycle, for a non-Dropbox provisioner, or when membership sync-back is off. Called from DropboxTargetDao.deleteMemberships after the remove succeeds.
      Parameters:
      targetGroupId - the native group_id
      targetUserId - the native team_member_id