Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7B00D11CDA for ; Sun, 24 Aug 2014 14:04:25 +0000 (UTC) Received: (qmail 99779 invoked by uid 500); 24 Aug 2014 14:04:23 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 99750 invoked by uid 500); 24 Aug 2014 14:04:23 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 99316 invoked by uid 99); 24 Aug 2014 14:04:23 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Aug 2014 14:04:23 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 80D77955D09; Sun, 24 Aug 2014 14:04:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bhaisaab@apache.org To: commits@cloudstack.apache.org Date: Sun, 24 Aug 2014 14:05:08 -0000 Message-Id: <81fe0b17c13e40fc93b419809ad57aba@git.apache.org> In-Reply-To: <585a1505e501427b9b78fa468ab4ac2c@git.apache.org> References: <585a1505e501427b9b78fa468ab4ac2c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [48/50] [abbrv] git commit: updated refs/heads/saml2 to ba68616 server: fix server package after auth plugin refactor - Have opensaml dependency to get version from root pom - add com.cloud.api.auth.APIAuthenticationManagerImpl to spring ctx manager - Fix getCommands() in APIAuthenticationManagerImpl - Fix imports in resources, test and src classes Signed-off-by: Rohit Yadav Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3141ea1c Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3141ea1c Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3141ea1c Branch: refs/heads/saml2 Commit: 3141ea1ce7c10cbeab8b015ddcd2ec2703f6cd2b Parents: cc14843 Author: Rohit Yadav Authored: Sun Aug 24 15:59:10 2014 +0200 Committer: Rohit Yadav Committed: Sun Aug 24 15:59:10 2014 +0200 ---------------------------------------------------------------------- server/pom.xml | 2 +- .../spring-server-core-managers-context.xml | 5 +++- server/src/com/cloud/api/ApiServlet.java | 7 ++--- .../api/auth/APIAuthenticationManagerImpl.java | 27 ++++++++++++++------ .../auth/DefaultLoginAPIAuthenticatorCmd.java | 4 ++- .../auth/DefaultLogoutAPIAuthenticatorCmd.java | 2 ++ server/test/com/cloud/api/ApiServletTest.java | 6 ++--- 7 files changed, 36 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3141ea1c/server/pom.xml ---------------------------------------------------------------------- diff --git a/server/pom.xml b/server/pom.xml index 04c25af..0e517f7 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -136,7 +136,7 @@ org.opensaml opensaml - 2.6.1 + ${cs.opensaml.version} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3141ea1c/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml ---------------------------------------------------------------------- diff --git a/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml b/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml index 17681f7..e2d4d27 100644 --- a/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml +++ b/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml @@ -32,7 +32,10 @@ http://www.springframework.org/schema/util/spring-util-3.0.xsd" > - + + + _apiAuthenticators; + private static Map> s_authenticators = null; - private static List> s_commandList = null; public APIAuthenticationManagerImpl() { } + public List getApiAuthenticators() { + return _apiAuthenticators; + } + + public void setApiAuthenticators(List authenticators) { + _apiAuthenticators = authenticators; + } + @Override public boolean start() { s_authenticators = new HashMap>(); @@ -53,14 +65,13 @@ public class APIAuthenticationManagerImpl extends ManagerBase implements APIAuth @Override public List> getCommands() { - if (s_commandList == null) { - s_commandList = new ArrayList>(); - s_commandList.add(DefaultLoginAPIAuthenticatorCmd.class); - s_commandList.add(DefaultLogoutAPIAuthenticatorCmd.class); - s_commandList.add(SAML2LoginAPIAuthenticatorCmd.class); - s_commandList.add(SAML2LogoutAPIAuthenticatorCmd.class); + List> cmdList = new ArrayList>(); + cmdList.add(DefaultLoginAPIAuthenticatorCmd.class); + cmdList.add(DefaultLogoutAPIAuthenticatorCmd.class); + for (PluggableAPIAuthenticator apiAuthenticator: _apiAuthenticators) { + cmdList.addAll(apiAuthenticator.getAuthCommands()); } - return s_commandList; + return cmdList; } @Override http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3141ea1c/server/src/com/cloud/api/auth/DefaultLoginAPIAuthenticatorCmd.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/api/auth/DefaultLoginAPIAuthenticatorCmd.java b/server/src/com/cloud/api/auth/DefaultLoginAPIAuthenticatorCmd.java index 243ad9b..2fb3f56 100644 --- a/server/src/com/cloud/api/auth/DefaultLoginAPIAuthenticatorCmd.java +++ b/server/src/com/cloud/api/auth/DefaultLoginAPIAuthenticatorCmd.java @@ -16,7 +16,7 @@ // under the License. package com.cloud.api.auth; -import com.cloud.api.ApiServerService; +import org.apache.cloudstack.api.ApiServerService; import com.cloud.api.response.ApiResponseSerializer; import com.cloud.exception.CloudAuthenticationException; import com.cloud.user.Account; @@ -26,6 +26,8 @@ import org.apache.cloudstack.api.ApiErrorCode; import org.apache.cloudstack.api.BaseCmd; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.auth.APIAuthenticationType; +import org.apache.cloudstack.api.auth.APIAuthenticator; import org.apache.cloudstack.api.response.LoginCmdResponse; import org.apache.log4j.Logger; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3141ea1c/server/src/com/cloud/api/auth/DefaultLogoutAPIAuthenticatorCmd.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/api/auth/DefaultLogoutAPIAuthenticatorCmd.java b/server/src/com/cloud/api/auth/DefaultLogoutAPIAuthenticatorCmd.java index a5802bf..999cefd 100644 --- a/server/src/com/cloud/api/auth/DefaultLogoutAPIAuthenticatorCmd.java +++ b/server/src/com/cloud/api/auth/DefaultLogoutAPIAuthenticatorCmd.java @@ -22,6 +22,8 @@ import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiErrorCode; import org.apache.cloudstack.api.BaseCmd; import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.auth.APIAuthenticationType; +import org.apache.cloudstack.api.auth.APIAuthenticator; import org.apache.cloudstack.api.response.LogoutCmdResponse; import org.apache.log4j.Logger; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3141ea1c/server/test/com/cloud/api/ApiServletTest.java ---------------------------------------------------------------------- diff --git a/server/test/com/cloud/api/ApiServletTest.java b/server/test/com/cloud/api/ApiServletTest.java index 0a90296..1a9c13d 100644 --- a/server/test/com/cloud/api/ApiServletTest.java +++ b/server/test/com/cloud/api/ApiServletTest.java @@ -16,9 +16,9 @@ // under the License. package com.cloud.api; -import com.cloud.api.auth.APIAuthenticationManager; -import com.cloud.api.auth.APIAuthenticationType; -import com.cloud.api.auth.APIAuthenticator; +import org.apache.cloudstack.api.auth.APIAuthenticationManager; +import org.apache.cloudstack.api.auth.APIAuthenticationType; +import org.apache.cloudstack.api.auth.APIAuthenticator; import com.cloud.server.ManagementServer; import com.cloud.user.Account; import com.cloud.user.AccountService;