Package org.sonatype.plexus.components.sec.dispatcher

Examples of org.sonatype.plexus.components.sec.dispatcher.SecDispatcher


            // ignore
        }

        WagonManager wagonManager = (WagonManager) container.lookup( WagonManager.ROLE );

        SecDispatcher sd = null;
       
        try
        {
            Proxy proxy = settings.getActiveProxy();
           
            try
            {
                sd = (SecDispatcher) container.lookup( SecDispatcher.ROLE, "maven" );
            }
            catch (Exception e)
            {
                getLogger().warn( "Security features are disabled. Cannot find plexus component "+SecDispatcher.ROLE + ":maven" );
               
                line();
            }

            if ( proxy != null )
            {
                if ( proxy.getHost() == null )
                {
                    throw new SettingsConfigurationException( "Proxy in settings.xml has no host" );
                }
               
                String pass = proxy.getPassword();
               
                if ( sd != null )
                {
                    try
                    {
                        pass = sd.decrypt( pass );
                    }
                    catch ( SecDispatcherException e )
                    {
                        reportSecurityConfigurationError( "password for proxy '" + proxy.getId() + "'", e );
                    }
                }

                wagonManager.addProxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), proxy.getUsername(),
                                       pass, proxy.getNonProxyHosts() );
            }
           
            for ( Iterator i = settings.getServers().iterator(); i.hasNext(); )
            {
                Server server = (Server) i.next();
               
                String passWord = server.getPassword();

                if ( sd != null )
                {
                    try
                    {
                        passWord = sd.decrypt( passWord );
                    }
                    catch ( SecDispatcherException e )
                    {
                        reportSecurityConfigurationError( "password for server '" + server.getId() + "'", e );
                    }
                }
               
                String passPhrase = server.getPassphrase();

                if ( sd != null )
                {
                    try
                    {
                        passPhrase = sd.decrypt( passPhrase );
                    }
                    catch ( SecDispatcherException e )
                    {
                        reportSecurityConfigurationError( "passphrase for server '" + server.getId() + "'", e );
                    }
View Full Code Here


            catch ( ClassCastException e )
            {
                // ignore
            }

            SecDispatcher sd = null;
       
            try
            {
                Proxy proxy = settings.getActiveProxy();
           
                try
                {
                    sd = (SecDispatcher) container.lookup( SecDispatcher.ROLE, "maven" );
                }
                catch (Exception e)
                {
                    getLogger().warn( "Security features are disabled. Cannot find plexus component "+SecDispatcher.ROLE + ":maven" );
                   
                    line();
                }
   
                if ( proxy != null )
                {
                    if ( proxy.getHost() == null )
                    {
                        throw new SettingsConfigurationException( "Proxy in settings.xml has no host" );
                    }
                   
                    String pass = proxy.getPassword();
                   
                    if ( sd != null )
                    {
                        try
                        {
                            pass = sd.decrypt( pass );
                        }
                        catch ( SecDispatcherException e )
                        {
                            reportSecurityConfigurationError( "password for proxy '" + proxy.getId() + "'", e );
                        }
                    }
   
                    wagonManager.addProxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), proxy.getUsername(),
                                           pass, proxy.getNonProxyHosts() );
                }
               
                for ( Iterator i = settings.getServers().iterator(); i.hasNext(); )
                {
                    Server server = (Server) i.next();
                   
                    String passWord = server.getPassword();
   
                    if ( sd != null )
                    {
                        try
                        {
                            passWord = sd.decrypt( passWord );
                        }
                        catch ( SecDispatcherException e )
                        {
                            reportSecurityConfigurationError( "password for server '" + server.getId() + "'", e );
                        }
                    }
                   
                    String passPhrase = server.getPassphrase();
   
                    if ( sd != null )
                    {
                        try
                        {
                            passPhrase = sd.decrypt( passPhrase );
                        }
                        catch ( SecDispatcherException e )
                        {
                            reportSecurityConfigurationError( "passphrase for server '" + server.getId() + "'", e );
                        }
View Full Code Here

    @Mocked
    PlexusContainer container;

    @Before
    public void containerSetup() throws ComponentLookupException {
        final SecDispatcher secDispatcher = new MockSecDispatcher().getMockInstance();
        new NonStrictExpectations() {{
            container.lookup(SecDispatcher.ROLE, "maven"); result = secDispatcher;

        }};
        factory = new AuthConfigFactory(container);
View Full Code Here

TOP

Related Classes of org.sonatype.plexus.components.sec.dispatcher.SecDispatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.