Examples of AuthenticationInfo


Examples of org.apache.maven.wagon.authentication.AuthenticationInfo

        return TestData.getTestRepositoryUrl( getTestRepositoryPort() );
    }

    protected AuthenticationInfo getAuthInfo()
    {
        AuthenticationInfo authInfo = new AuthenticationInfo();

        String userName = TestData.getUserName();

        authInfo.setUserName( userName );

        File privateKey = TestData.getPrivateKey();

        if ( privateKey.exists() )
        {
            authInfo.setPrivateKey( privateKey.getAbsolutePath() );

            authInfo.setPassphrase( "" );
        }

        return authInfo;
    }
View Full Code Here

Examples of org.apache.maven.wagon.authentication.AuthenticationInfo

        assertNull( wagon.getProxyInfo( "dav", "www.example.com" ) );
        assertNull( wagon.getProxyInfo( "scp", "www.example.com" ) );
        assertNull( wagon.getProxyInfo( "ftp", "www.example.com" ) );
        assertNull( wagon.getProxyInfo( "http", "localhost" ) );

        wagon.connect( repository, new AuthenticationInfo() );
        assertNull( wagon.getProxyInfo() );
        assertNull( wagon.getProxyInfo( "http", "www.example.com" ) );
        assertNull( wagon.getProxyInfo( "dav", "www.example.com" ) );
        assertNull( wagon.getProxyInfo( "scp", "www.example.com" ) );
        assertNull( wagon.getProxyInfo( "ftp", "www.example.com" ) );
View Full Code Here

Examples of org.apache.maven.wagon.authentication.AuthenticationInfo

    public void testRepositoryUserName()
        throws ConnectionException, AuthenticationException
    {
        Repository repository = new Repository( "id", "http://bporter:password@www.example.com/path/to/resource" );

        AuthenticationInfo authenticationInfo = new AuthenticationInfo();
        authenticationInfo.setUserName( "brett" );
        authenticationInfo.setPassword( "pass" );
        wagon.connect( repository, authenticationInfo );

        assertEquals( authenticationInfo, wagon.getAuthenticationInfo() );
        assertEquals( "brett", authenticationInfo.getUserName() );
        assertEquals( "pass", authenticationInfo.getPassword() );
    }
View Full Code Here

Examples of org.apache.maven.wagon.authentication.AuthenticationInfo

    public void testRepositoryUserNameNotGivenInCredentials()
        throws ConnectionException, AuthenticationException
    {
        Repository repository = new Repository( "id", "http://bporter:password@www.example.com/path/to/resource" );

        AuthenticationInfo authenticationInfo = new AuthenticationInfo();
        wagon.connect( repository, authenticationInfo );

        assertEquals( authenticationInfo, wagon.getAuthenticationInfo() );
        assertEquals( "bporter", authenticationInfo.getUserName() );
        assertEquals( "password", authenticationInfo.getPassword() );
    }
View Full Code Here

Examples of org.apache.maven.wagon.authentication.AuthenticationInfo

    protected AuthenticationInfo getAuthInfo()
    {
        try
        {
            AuthenticationInfo authInfo = super.getAuthInfo();
            // user : guest/guest123 -  passphrase : toto01
            authInfo.setUserName( "guest" );
            File sshKeysTarget = new File( "target/ssh-keys" );
            FileUtils.copyDirectory( new File( "src/test/ssh-keys" ), sshKeysTarget );
            // ssh keys need to 700 permissions
            // to prevent WARNING: UNPROTECTED PRIVATE KEY FILE!
            Commandline commandline = new Commandline( "chmod" );
            commandline.createArg().setValue( "-R" );
            commandline.createArg().setValue( "700" );
            commandline.createArg().setValue( sshKeysTarget.getCanonicalPath() );
            CommandLineUtils.StringStreamConsumer out = new CommandLineUtils.StringStreamConsumer();
            CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer();
            int exitCode = CommandLineUtils.executeCommandLine( commandline, out, err );
            Streams streams = new Streams();
            streams.setOut( out.getOutput() );
            streams.setErr( err.getOutput() );
            if ( exitCode != 0 )
            {
                throw new RuntimeException(
                    "fail to chmod exit code " + exitCode + ", error" + streams.getErr() + ", out "
                        + streams.getOut() );
            }

            authInfo.setPrivateKey( new File( sshKeysTarget, "id_rsa" ).getCanonicalPath() );

            return authInfo;
        }
        catch ( Exception e )
        {
View Full Code Here

Examples of org.apache.maven.wagon.authentication.AuthenticationInfo

    }


    protected AuthenticationInfo getAuthInfo()
    {
        AuthenticationInfo authInfo = super.getAuthInfo();

        authInfo.setUserName( TestData.getUserName() );

        authInfo.setPassphrase( "" );

        return authInfo;
    }
View Full Code Here

Examples of org.apache.maven.wagon.authentication.AuthenticationInfo

        return TestData.getTestRepositoryUrl( sshServerEmbedded.getPort() );
    }

    protected AuthenticationInfo getAuthInfo()
    {
        AuthenticationInfo authInfo = super.getAuthInfo();
        // user : guest/guest123 -  passphrase : toto01
        authInfo.setUserName( "guest" );
        //authInfo.setPassword( TestData.getUserPassword() );
        authInfo.setPrivateKey( new File( "src/test/ssh-keys/id_rsa" ).getPath() );

        return authInfo;
    }
View Full Code Here

Examples of org.apache.maven.wagon.authentication.AuthenticationInfo

    //
    // ----------------------------------------------------------------------

    protected AuthenticationInfo getAuthInfo()
    {
        return new AuthenticationInfo();
    }
View Full Code Here

Examples of org.apache.maven.wagon.authentication.AuthenticationInfo

    }

    protected void openConnectionInternal()
        throws ConnectionException, AuthenticationException
    {
        AuthenticationInfo authInfo = getAuthenticationInfo();

        if ( authInfo == null )
        {
            throw new IllegalArgumentException( "Authentication Credentials cannot be null for FTP protocol" );
        }

        if ( authInfo.getUserName() == null )
        {
            authInfo.setUserName( System.getProperty( "user.name" ) );
        }

        String username = authInfo.getUserName();

        String password = authInfo.getPassword();

        if ( username == null )
        {
            throw new AuthenticationException( "Username not specified for repository " + getRepository().getId() );
        }
View Full Code Here

Examples of org.apache.shiro.authc.AuthenticationInfo

        super(name);
    }

    @Override
    protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
        final AuthenticationInfo authenticationInfo = super.doGetAuthenticationInfo(token);

        // if we could authenticate the user with this realm, it is the local admin user.
        // set the request's current user to be the shared instance, so we don't blow everything up trying to retrieve it from the server.

        if (authenticationInfo != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.