Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E835F11290 for ; Wed, 27 Aug 2014 09:29:52 +0000 (UTC) Received: (qmail 97000 invoked by uid 500); 27 Aug 2014 09:29:49 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 96962 invoked by uid 500); 27 Aug 2014 09:29:49 -0000 Mailing-List: contact dev-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 dev@cloudstack.apache.org Received: (qmail 96950 invoked by uid 99); 27 Aug 2014 09:29:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Aug 2014 09:29:49 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of silvano@corp.globo.com designates 74.125.149.73 as permitted sender) Received: from [74.125.149.73] (HELO na3sys009aog104.obsmtp.com) (74.125.149.73) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 27 Aug 2014 09:29:44 +0000 Received: from mail-yk0-f171.google.com ([209.85.160.171]) (using TLSv1) by na3sys009aob104.postini.com ([74.125.148.12]) with SMTP ID DSNKU/2k8yiQ101jpM6bpgYfmytLWJYlUQQT@postini.com; Wed, 27 Aug 2014 02:29:23 PDT Received: by mail-yk0-f171.google.com with SMTP id 19so12594793ykq.16 for ; Wed, 27 Aug 2014 02:29:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=3j48LGcnRz910vrCK3YrgUpHNrYBTuEF+rv7tAoN/kk=; b=khcylK306WsiZVF6wjsB2+Oc2KxqSCv1s2BJS9RzCUB6L+7p8jZr1tSHBT26KsyvZj nAoN+apU/QXgJW7OCesCq201R/AWqarC7aaBMPgRTDKo/ivpsMUZJa8Jra4dv36QvtVj ss5MT8lHwE+5JNE8nExMLuG8OiVjznvLsLMeCfh7mkzFzhAN1yuqNomY8Xxk0sec+6IM kjdOLN8c5qW4KSvCrZ8lLBZkRpepPBIsfqUq33IFNjGBNaiGD1ZoDCd7TmESCUZASnau S8ZFB4WBfuji6T41wgnvHMHLtQxgV7KujT5MLLSHFye9iSfEmKLyhU/lgGxAXJNEi8kF 3Bew== X-Gm-Message-State: ALoCoQkVLTxet65zfyaIYvOrGgCXC8tYrXgOxDBOSxCKCKdEFGI8UT8qGCNfCWR34LX0yK44PAliSnLyNYUs7Y/mqU8P2JOHO4yeGrSTEutKY1ebQGseQRRSvtCRMKuRZj8ShUgB4uSt X-Received: by 10.52.228.67 with SMTP id sg3mr19391082vdc.6.1409131762716; Wed, 27 Aug 2014 02:29:22 -0700 (PDT) X-Received: by 10.52.228.67 with SMTP id sg3mr19391058vdc.6.1409131762191; Wed, 27 Aug 2014 02:29:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.197.199 with HTTP; Wed, 27 Aug 2014 02:29:01 -0700 (PDT) In-Reply-To: <1F3F4B7B-534D-400A-BED8-95EAF1E7DE8D@shapeblue.com> References: <75A38343-2A53-4B98-8745-AE1E9F5AE5C2@shapeblue.com> <4CFC8347-8946-4F95-95A1-0450212BF221@gmail.com> <1F3F4B7B-534D-400A-BED8-95EAF1E7DE8D@shapeblue.com> From: Silvano Nogueira Buback Date: Wed, 27 Aug 2014 06:29:01 -0300 Message-ID: Subject: Re: [MERGE] Merge saml2 branch to master To: dev@cloudstack.apache.org Content-Type: multipart/alternative; boundary=089e01183d4e20a7e50501990e07 X-Virus-Checked: Checked by ClamAV on apache.org --089e01183d4e20a7e50501990e07 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I'm trying use your implementation to implement OAuth2. It's almost working, but I think is necessary a little change: Class APIAuthenticationManagerImpl is calling command without correct spring context. I'm working in 4.3 branch, so, I will show what I changed: - org.apache.cloudstack.api.auth.PluggableAPIAuthenticator needs to implements PluggableService and have no more method getAuthCommands. - Little patch in APIAuthenticationManagerImpl +++ b/server/src/com/cloud/api/auth/APIAuthenticationManagerImpl.java @@ -55,24 +55,31 @@ public class APIAuthenticationManagerImpl extends ManagerBase implements APIAuth @Override public boolean start() { s_authenticators =3D new HashMap>(); - for (Class authenticator: getCommands()) { - APICommand command =3D authenticator.getAnnotation(APICommand.class); - if (command !=3D null && !command.name().isEmpty() - && APIAuthenticator.class.isAssignableFrom(authenticator)) { - s_authenticators.put(command.name(), authenticator); + for (Class authenticatorCommand: getCommands()) { + registerCommandsInAPIAuthenticator(authenticatorCommand); + } + // Register all external APIAuthenticator(s) + for (PluggableAPIAuthenticator apiAuthenticator: _apiAuthenticators) { + for (Class authenticatorCommand: apiAuthenticator.getCommands()) { + registerCommandsInAPIAuthenticator(authenticatorCommand); } } return true; } + private void registerCommandsInAPIAuthenticator(Class authenticator) { + APICommand command =3D authenticator.getAnnotation(APICommand.clas= s); + if (command !=3D null && !command.name().isEmpty() + && APIAuthenticator.class.isAssignableFrom(authenticator)) { + s_authenticators.put(command.name(), authenticator); + } + } + @Override public List> getCommands() { List> cmdList =3D new ArrayList>(); cmdList.add(DefaultLoginAPIAuthenticatorCmd.class); cmdList.add(DefaultLogoutAPIAuthenticatorCmd.class); - for (PluggableAPIAuthenticator apiAuthenticator: _apiAuthenticators) { - cmdList.addAll(apiAuthenticator.getAuthCommands()); - } return cmdList; } Now, authentication commands work inside plugin context. PluggableAPIAuthenticator needs to implement tradicional getCommands to work. Best regards, Silvano Buback On Tue, Aug 26, 2014 at 6:59 AM, Rohit Yadav wrote: > > On 26-Aug-2014, at 11:47 am, Sebastien Goasguen wrote: > > we do have some selenium tests in /test/selenium but I don't think they > are being run. > > > > +1 from me (satisfied with your answers) > > Thanks! Few more classes; > > Class, %Method, %Line, % > GetServiceProviderMetaDataCmd100% (1/ 1)62.5% (5/ 8)77.9% (53/ 68) > SAMLMetaDataResponse100% (1/ 1)66.7% (2/ 3)80% (4/ 5) > > From IntelliJ: http://people.apache.org/~bhaisaab/samlcoverage.png > > Regards, > Rohit Yadav > Software Architect, ShapeBlue > M. +41 779015219 | rohit.yadav@shapeblue.com > Blog: bhaisaab.org | Twitter: @_bhaisaab > > > > Find out more about ShapeBlue and our range of CloudStack related service= s > > IaaS Cloud Design & Build< > http://shapeblue.com/iaas-cloud-design-and-build//> > CSForge =E2=80=93 rapid IaaS deployment framework > CloudStack Consulting > CloudStack Infrastructure Support< > http://shapeblue.com/cloudstack-infrastructure-support/> > CloudStack Bootcamp Training Courses< > http://shapeblue.com/cloudstack-training/> > > This email and any attachments to it may be confidential and are intended > solely for the use of the individual to whom it is addressed. Any views o= r > opinions expressed are solely those of the author and do not necessarily > represent those of Shape Blue Ltd or related companies. If you are not th= e > intended recipient of this email, you must neither take any action based > upon its contents, nor copy or show it to anyone. Please contact the send= er > if you believe you have received this email in error. Shape Blue Ltd is a > company incorporated in England & Wales. ShapeBlue Services India LLP is = a > company incorporated in India and is operated under license from Shape Bl= ue > Ltd. Shape Blue Brasil Consultoria Ltda is a company incorporated in Bras= il > and is operated under license from Shape Blue Ltd. ShapeBlue SA Pty Ltd i= s > a company registered by The Republic of South Africa and is traded under > license from Shape Blue Ltd. ShapeBlue is a registered trademark. > --089e01183d4e20a7e50501990e07--