DynamicSyncContext: skip warning for everyone group
@@ -33,6 +33,7 @@ import org.apache.jackrabbit.oak.spi.security.authentication.external.basic.Defa
import org.apache.jackrabbit.oak.spi.security.authentication.external.basic.DefaultSyncContext;
import org.apache.jackrabbit.oak.spi.security.authentication.external.basic.DefaultSyncResultImpl;
import org.apache.jackrabbit.oak.spi.security.authentication.external.basic.DefaultSyncedIdentity;
+import org.apache.jackrabbit.oak.spi.security.principal.EveryonePrincipal;
import org.apache.jackrabbit.oak.spi.security.principal.PrincipalImpl;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -351,8 +352,8 @@ public class DynamicSyncContext extends DefaultSyncContext {
// clear auto-membership
grp.removeMember(authorizable);
clearGroupMembership(grp, groupPrincipalNames, toRemove);
- } else {
- // some other membership that has not been added by the sync process
+ } else if (!isEveryone(grp)){
+ // some other membership that has not been added by the sync process (but skip for dynamic 'everyone' group)
log.warn("Ignoring unexpected membership of '{}' in group '{}' crossing IDP boundary.", authorizable.getID(), grp.getID());
}
}
@@ -378,6 +379,14 @@ public class DynamicSyncContext extends DefaultSyncContext {
return authorizable.hasProperty(REP_LAST_SYNCED) && !authorizable.hasProperty(ExternalIdentityConstants.REP_EXTERNAL_PRINCIPAL_NAMES);
}
+ private static boolean isEveryone(@NotNull Group group) {
+ try {
+ return EveryonePrincipal.NAME.equals(group.getPrincipal().getName());
+ } catch (RepositoryException e) {
+ return false;
+ }
+ }
+
/**
* Helper object to avoid repeated lookup of principalName, {@link ExternalGroup} and synchronized {@link Group} for
* a given {@link ExternalIdentityRef} during {@link #syncMembership(ExternalIdentity, Authorizable, long)}.
