Repository: syncope Updated Branches: refs/heads/SYNCOPE-652 f03ffb300 -> a82d98880
Removing unused interface Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/a404f51c Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/a404f51c Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/a404f51c Branch: refs/heads/SYNCOPE-652 Commit: a404f51ca51f3f0aa321796d89e62167a0152bff Parents: f03ffb3 Author: Francesco Chicchiriccò <[email protected]> Authored: Thu Aug 13 12:59:07 2015 +0200 Committer: Francesco Chicchiriccò <[email protected]> Committed: Thu Aug 13 12:59:07 2015 +0200 ---------------------------------------------------------------------- .../core/misc/policy/AccountPolicyEnforcer.java | 3 +- .../misc/policy/PasswordPolicyEnforcer.java | 3 +- .../core/misc/policy/PolicyEnforcer.java | 35 -------------------- 3 files changed, 2 insertions(+), 39 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/a404f51c/core/misc/src/main/java/org/apache/syncope/core/misc/policy/AccountPolicyEnforcer.java ---------------------------------------------------------------------- diff --git a/core/misc/src/main/java/org/apache/syncope/core/misc/policy/AccountPolicyEnforcer.java b/core/misc/src/main/java/org/apache/syncope/core/misc/policy/AccountPolicyEnforcer.java index 13ddc84..23740d6 100644 --- a/core/misc/src/main/java/org/apache/syncope/core/misc/policy/AccountPolicyEnforcer.java +++ b/core/misc/src/main/java/org/apache/syncope/core/misc/policy/AccountPolicyEnforcer.java @@ -25,11 +25,10 @@ import org.apache.syncope.core.persistence.api.entity.user.User; import org.springframework.stereotype.Component; @Component -public class AccountPolicyEnforcer implements PolicyEnforcer<AccountPolicySpec, User> { +public class AccountPolicyEnforcer { private static final Pattern DEFAULT_PATTERN = Pattern.compile("[a-zA-Z0-9-_@. ]+"); - @Override public boolean enforce(final AccountPolicySpec policy, final PolicyType type, final User user) { if (user.getUsername() == null) { throw new PolicyEnforceException("Invalid account"); http://git-wip-us.apache.org/repos/asf/syncope/blob/a404f51c/core/misc/src/main/java/org/apache/syncope/core/misc/policy/PasswordPolicyEnforcer.java ---------------------------------------------------------------------- diff --git a/core/misc/src/main/java/org/apache/syncope/core/misc/policy/PasswordPolicyEnforcer.java b/core/misc/src/main/java/org/apache/syncope/core/misc/policy/PasswordPolicyEnforcer.java index 1313d2e..1458bf3 100644 --- a/core/misc/src/main/java/org/apache/syncope/core/misc/policy/PasswordPolicyEnforcer.java +++ b/core/misc/src/main/java/org/apache/syncope/core/misc/policy/PasswordPolicyEnforcer.java @@ -24,9 +24,8 @@ import org.apache.syncope.core.persistence.api.entity.user.User; import org.springframework.stereotype.Component; @Component -public class PasswordPolicyEnforcer implements PolicyEnforcer<PasswordPolicySpec, User> { +public class PasswordPolicyEnforcer { - @Override public boolean enforce(final PasswordPolicySpec policy, final PolicyType type, final User user) { final String clearPassword = user.getClearPassword(); final String password = user.getPassword(); http://git-wip-us.apache.org/repos/asf/syncope/blob/a404f51c/core/misc/src/main/java/org/apache/syncope/core/misc/policy/PolicyEnforcer.java ---------------------------------------------------------------------- diff --git a/core/misc/src/main/java/org/apache/syncope/core/misc/policy/PolicyEnforcer.java b/core/misc/src/main/java/org/apache/syncope/core/misc/policy/PolicyEnforcer.java deleted file mode 100644 index 86e6583..0000000 --- a/core/misc/src/main/java/org/apache/syncope/core/misc/policy/PolicyEnforcer.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.core.misc.policy; - -import org.apache.syncope.common.lib.types.PolicySpec; -import org.apache.syncope.common.lib.types.PolicyType; - -public interface PolicyEnforcer<T extends PolicySpec, E> { - - /** - * Check the given entity to see if it conforms with the indicated policy. - * - * @param policy - * @param type - * @param entity - * @return whether user is to be suspended - */ - boolean enforce(final T policy, final PolicyType type, final E entity); -}
