test_class.declarator: r
test_class.modifier: private
test_class.original_string: private Root r;
test_class.type: Root
test_class.var_name: r
test_class.declarator: userManager
test_class.modifier: private
test_class.original_string: private UserManager userManager;
test_class.type: UserManager
test_class.var_name: userManager
test_class.declarator: valueFactory
test_class.modifier: private
test_class.original_string: private ValueFactory valueFactory;
test_class.type: ValueFactory
test_class.var_name: valueFactory
test_class.declarator: syncContext
test_class.modifier: private
test_class.original_string: private DynamicSyncContext syncContext;
test_class.type: DynamicSyncContext
test_class.var_name: syncContext
test_class.file: oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/DynamicSyncContextTest.java
test_class.identifier: DynamicSyncContextTest
test_class.superclass: extends AbstractExternalAuthTest
test_case.body: @Test
      public void testSyncExternalUserDepthInfinite() throws Exception {
          syncConfig.user().setMembershipNestingDepth(Long.MAX_VALUE);
  
          ExternalUser externalUser = idp.getUser(USER_ID);
          sync(externalUser, SyncResult.Status.ADD);
  
          Tree tree = r.getTree(userManager.getAuthorizable(USER_ID).getPath());
          PropertyState extPrincipalNames = tree.getProperty(REP_EXTERNAL_PRINCIPAL_NAMES);
          assertNotNull(extPrincipalNames);
  
          Set<String> pNames = Sets.newHashSet(extPrincipalNames.getValue(Type.STRINGS));
          Set<String> expected = Sets.newHashSet();
          collectGroupPrincipals(expected, externalUser.getDeclaredGroups(), Long.MAX_VALUE);
  
          assertEquals(expected, pNames);
      }
test_case.class_method_signature: DynamicSyncContextTest.testSyncExternalUserDepthInfinite()
test_case.full_signature: @Test public void testSyncExternalUserDepthInfinite()
test_case.identifier: testSyncExternalUserDepthInfinite
test_case.invocations: setMembershipNestingDepth user getUser sync getTree getPath getAuthorizable getProperty assertNotNull newHashSet getValue newHashSet collectGroupPrincipals getDeclaredGroups assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSyncExternalUserDepthInfinite()
focal_class.declarator: log = LoggerFactory.getLogger(DynamicSyncContext.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(DynamicSyncContext.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.file: oak-auth-external/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/DynamicSyncContext.java
focal_class.identifier: DynamicSyncContext
focal_class.class_method_signature: DynamicSyncContext.DynamicSyncContext(@NotNull DefaultSyncConfig config,
                                @NotNull ExternalIdentityProvider idp,
                                @NotNull UserManager userManager,
                                @NotNull ValueFactory valueFactory)
focal_class.full_signature: public  DynamicSyncContext(@NotNull DefaultSyncConfig config,
                                @NotNull ExternalIdentityProvider idp,
                                @NotNull UserManager userManager,
                                @NotNull ValueFactory valueFactory)
focal_class.identifier: DynamicSyncContext
focal_class.modifiers: public
focal_class.parameters: (@NotNull DefaultSyncConfig config,
                                @NotNull ExternalIdentityProvider idp,
                                @NotNull UserManager userManager,
                                @NotNull ValueFactory valueFactory)
focal_class.signature:  DynamicSyncContext(@NotNull DefaultSyncConfig config,
                                @NotNull ExternalIdentityProvider idp,
                                @NotNull UserManager userManager,
                                @NotNull ValueFactory valueFactory)
focal_class.class_method_signature: DynamicSyncContext.sync(@NotNull ExternalIdentity identity)
focal_class.full_signature: @NotNull @Override public SyncResult sync(@NotNull ExternalIdentity identity)
focal_class.identifier: sync
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@NotNull ExternalIdentity identity)
focal_class.return: SyncResult
focal_class.signature: SyncResult sync(@NotNull ExternalIdentity identity)
focal_class.class_method_signature: DynamicSyncContext.syncMembership(@NotNull ExternalIdentity external, @NotNull Authorizable auth, long depth)
focal_class.full_signature: @Override protected void syncMembership(@NotNull ExternalIdentity external, @NotNull Authorizable auth, long depth)
focal_class.identifier: syncMembership
focal_class.modifiers: @Override protected
focal_class.parameters: (@NotNull ExternalIdentity external, @NotNull Authorizable auth, long depth)
focal_class.return: void
focal_class.signature: void syncMembership(@NotNull ExternalIdentity external, @NotNull Authorizable auth, long depth)
focal_class.class_method_signature: DynamicSyncContext.applyMembership(@NotNull Authorizable member, @NotNull Set<String> groups)
focal_class.full_signature: @Override protected void applyMembership(@NotNull Authorizable member, @NotNull Set<String> groups)
focal_class.identifier: applyMembership
focal_class.modifiers: @Override protected
focal_class.parameters: (@NotNull Authorizable member, @NotNull Set<String> groups)
focal_class.return: void
focal_class.signature: void applyMembership(@NotNull Authorizable member, @NotNull Set<String> groups)
focal_class.class_method_signature: DynamicSyncContext.collectPrincipalNames(@NotNull Set<String> principalNames, @NotNull Iterable<ExternalIdentityRef> declaredGroupIdRefs, long depth)
focal_class.full_signature: private void collectPrincipalNames(@NotNull Set<String> principalNames, @NotNull Iterable<ExternalIdentityRef> declaredGroupIdRefs, long depth)
focal_class.identifier: collectPrincipalNames
focal_class.modifiers: private
focal_class.parameters: (@NotNull Set<String> principalNames, @NotNull Iterable<ExternalIdentityRef> declaredGroupIdRefs, long depth)
focal_class.return: void
focal_class.signature: void collectPrincipalNames(@NotNull Set<String> principalNames, @NotNull Iterable<ExternalIdentityRef> declaredGroupIdRefs, long depth)
focal_class.superclass: extends DefaultSyncContext
focal_method.body: @NotNull
      @Override
      public SyncResult sync(@NotNull ExternalIdentity identity) throws SyncException {
          if (identity instanceof ExternalUser) {
              return super.sync(identity);
          } else if (identity instanceof ExternalGroup) {
              try {
                  Group group = getAuthorizable(identity, Group.class);
                  if (group != null) {
                      // group has been synchronized before -> continue updating for consistency.
                      return syncGroup((ExternalGroup) identity, group);
                  } else {
                      // external group has never been synchronized before:
                      // don't sync external groups into the repository internal user management
                      // but limit synchronized information to group-principals stored
                      // separately with each external user such that the subject gets
                      // properly populated upon login
                      ExternalIdentityRef ref = identity.getExternalId();
  
                      log.debug("ExternalGroup {}: Not synchronized as authorizable Group into the repository.", ref.getString());
  
                      SyncResult.Status status = (isSameIDP(ref)) ? SyncResult.Status.NOP : SyncResult.Status.FOREIGN;
                      return new DefaultSyncResultImpl(new DefaultSyncedIdentity(identity.getId(), ref, true, -1), status);
                  }
              } catch (RepositoryException e) {
                  throw new SyncException(e);
              }
          } else {
              throw new IllegalArgumentException("identity must be user or group but was: " + identity);
          }
      }
focal_method.class_method_signature: DynamicSyncContext.sync(@NotNull ExternalIdentity identity)
focal_method.full_signature: @NotNull @Override public SyncResult sync(@NotNull ExternalIdentity identity)
focal_method.identifier: sync
focal_method.invocations: sync getAuthorizable syncGroup getExternalId debug getString isSameIDP getId
focal_method.modifiers: @NotNull @Override public
focal_method.parameters: (@NotNull ExternalIdentity identity)
focal_method.return: SyncResult
focal_method.signature: SyncResult sync(@NotNull ExternalIdentity identity)