CRemoteAuthentication remoteAuthentication = new CRemoteAuthentication(); remoteAuthentication.setUsername( up.getUsername() ); remoteAuthentication.setPassword( up.getPassword() ); remoteAuthentication.setNtlmDomain( up.getNtlmDomain() ); remoteAuthentication.setNtlmHost( up.getNtlmHost() ); (UsernamePasswordRemoteAuthenticationSettings) settings; remoteAuthentication.setUsername( up.getUsername() ); remoteAuthentication.setPassword( up.getPassword() ); remoteAuthentication.setKeyStore( cs.getKeyStore().getAbsolutePath() ); remoteAuthentication.setKeyStorePassword( cs.getKeyStorePassword() ); remoteAuthentication.setTrustStore( cs.getTrustStore().getAbsolutePath() ); remoteAuthentication.setTrustStorePassword( cs.getTrustStorePassword() );
public RemoteAuthenticationSettings convertAndValidateFromModel( CRemoteAuthentication model ) throws ConfigurationException { if ( model != null ) { doValidate( model ); if ( StringUtils.isNotBlank( model.getKeyStore() ) || StringUtils.isNotBlank( model.getTrustStore() ) ) { return new ClientSSLRemoteAuthenticationSettings( new File( model.getTrustStore() ), model .getTrustStorePassword(), new File( model.getKeyStore() ), model.getKeyStorePassword() ); } else if ( StringUtils.isNotBlank( model.getNtlmDomain() ) ) { return new NtlmRemoteAuthenticationSettings( model.getUsername(), model.getPassword(), model .getNtlmDomain(), model.getNtlmHost() ); } else { return new UsernamePasswordRemoteAuthenticationSettings( model.getUsername(), model.getPassword() ); } } else { return null; } }
protected CRemoteAuthentication convertAuthentication(AuthenticationSettings authentication, String oldPassword) { if (authentication == null) { return null; } CRemoteAuthentication appModelSettings = new CRemoteAuthentication(); appModelSettings.setUsername(authentication.getUsername()); appModelSettings.setPassword(this.getActualPassword(authentication.getPassword(), oldPassword)); appModelSettings.setNtlmDomain(authentication.getNtlmDomain()); appModelSettings.setNtlmHost(authentication.getNtlmHost()); return appModelSettings; }
value.setUsername( cRemoteAuthentication.getUsername() ); value.setPassword( cRemoteAuthentication.getPassword() ); value.setNtlmHost( cRemoteAuthentication.getNtlmHost() ); value.setNtlmDomain( cRemoteAuthentication.getNtlmDomain() ); value.setTrustStore( cRemoteAuthentication.getTrustStore() ); value.setTrustStorePassword( cRemoteAuthentication.getTrustStorePassword() ); value.setKeyStore( cRemoteAuthentication.getKeyStore() ); value.setKeyStorePassword( cRemoteAuthentication.getKeyStorePassword() );
/** * Externalized Nexus object to DTO's conversion. */ public static AuthenticationSettings convert(CRemoteAuthentication settings) { if (settings == null) { return null; } AuthenticationSettings auth = new AuthenticationSettings(); auth.setUsername(settings.getUsername()); auth.setPassword(PASSWORD_PLACE_HOLDER); auth.setNtlmHost(settings.getNtlmHost()); auth.setNtlmDomain(settings.getNtlmDomain()); // auth.setPrivateKey( settings.getPrivateKey() ); // auth.setPassphrase( settings.getPassphrase() ); return auth; }
&& StringUtils.isNotEmpty( config.getGlobalHttpProxySettings().getAuthentication().getPassword() ) ) auth.setPassword( encryptDecryptPassword( auth.getPassword(), encrypt, mask ) ); && StringUtils.isNotEmpty( repo.getRemoteStorage().getAuthentication().getPassword() ) ) auth.setPassword( encryptDecryptPassword( auth.getPassword(), encrypt, mask ) ); && repo.getRemoteStorage().getHttpProxySettings() != null && repo.getRemoteStorage().getHttpProxySettings().getAuthentication() != null && StringUtils.isNotEmpty( repo.getRemoteStorage().getHttpProxySettings().getAuthentication().getPassword() ) ) auth.setPassword( encryptDecryptPassword( auth.getPassword(), encrypt, mask ) );
/** * Method upgradeCRemoteAuthentication. * * @param cRemoteAuthentication * @return CRemoteAuthentication */ public org.sonatype.nexus.configuration.model.CRemoteAuthentication upgradeCRemoteAuthentication( org.sonatype.nexus.configuration.model.v2_7_0.CRemoteAuthentication cRemoteAuthentication ) { return upgradeCRemoteAuthentication( cRemoteAuthentication, new org.sonatype.nexus.configuration.model.CRemoteAuthentication() ); } //-- org.sonatype.nexus.configuration.model.CRemoteAuthentication upgradeCRemoteAuthentication( org.sonatype.nexus.configuration.model.v2_7_0.CRemoteAuthentication )
protected CRemoteAuthentication convertAuthentication( AuthenticationSettings authentication, String oldPassword ) { if ( authentication == null ) { return null; } CRemoteAuthentication appModelSettings = new CRemoteAuthentication(); appModelSettings.setUsername( authentication.getUsername() ); appModelSettings.setPassword( this.getActualPassword( authentication.getPassword(), oldPassword ) ); appModelSettings.setNtlmDomain( authentication.getNtlmDomain() ); appModelSettings.setNtlmHost( authentication.getNtlmHost() ); return appModelSettings; }
/** * Externalized Nexus object to DTO's conversion. * * @param resource */ public static AuthenticationSettings convert( CRemoteAuthentication settings ) { if ( settings == null ) { return null; } AuthenticationSettings auth = new AuthenticationSettings(); auth.setUsername( settings.getUsername() ); auth.setPassword( PASSWORD_PLACE_HOLDER ); auth.setNtlmHost( settings.getNtlmHost() ); auth.setNtlmDomain( settings.getNtlmDomain() ); // auth.setPrivateKey( settings.getPrivateKey() ); // auth.setPassphrase( settings.getPassphrase() ); return auth; }
public RemoteHttpProxySettings convert(final RemoteHttpProxySettingsDTO settings, final String oldPassword) throws ConfigurationException { if (settings == null || StringUtils.isEmpty(settings.getProxyHostname())) { return null; } final RemoteHttpProxySettings result = new DefaultRemoteHttpProxySettings(); result.setHostname(settings.getProxyHostname()); result.setPort(settings.getProxyPort()); if (settings.getAuthentication() != null) { CRemoteAuthentication auth = new CRemoteAuthentication(); auth.setUsername(settings.getAuthentication().getUsername()); auth.setPassword(getActualPassword(settings.getAuthentication().getPassword(), oldPassword)); auth.setNtlmDomain(settings.getAuthentication().getNtlmDomain()); auth.setNtlmHost(settings.getAuthentication().getNtlmHost()); result.setProxyAuthentication( getAuthenticationInfoConverter().convertAndValidateFromModel(auth)); } else { result.setProxyAuthentication(null); } return result; }
if ( cRemoteAuthentication.getUsername() != null ) serializer.startTag( NAMESPACE, "username" ).text( cRemoteAuthentication.getUsername() ).endTag( NAMESPACE, "username" ); if ( cRemoteAuthentication.getPassword() != null ) serializer.startTag( NAMESPACE, "password" ).text( cRemoteAuthentication.getPassword() ).endTag( NAMESPACE, "password" ); if ( cRemoteAuthentication.getNtlmHost() != null ) serializer.startTag( NAMESPACE, "ntlmHost" ).text( cRemoteAuthentication.getNtlmHost() ).endTag( NAMESPACE, "ntlmHost" ); if ( cRemoteAuthentication.getNtlmDomain() != null ) serializer.startTag( NAMESPACE, "ntlmDomain" ).text( cRemoteAuthentication.getNtlmDomain() ).endTag( NAMESPACE, "ntlmDomain" ); if ( cRemoteAuthentication.getTrustStore() != null ) serializer.startTag( NAMESPACE, "trustStore" ).text( cRemoteAuthentication.getTrustStore() ).endTag( NAMESPACE, "trustStore" ); if ( cRemoteAuthentication.getTrustStorePassword() != null ) serializer.startTag( NAMESPACE, "trustStorePassword" ).text( cRemoteAuthentication.getTrustStorePassword() ).endTag( NAMESPACE, "trustStorePassword" ); if ( cRemoteAuthentication.getKeyStore() != null ) serializer.startTag( NAMESPACE, "keyStore" ).text( cRemoteAuthentication.getKeyStore() ).endTag( NAMESPACE, "keyStore" ); if ( cRemoteAuthentication.getKeyStorePassword() != null )
CRemoteAuthentication cRemoteAuthentication = new CRemoteAuthentication(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) cRemoteAuthentication.setUsername( getTrimmedValue( parser.nextText() ) ); cRemoteAuthentication.setPassword( getTrimmedValue( parser.nextText() ) ); cRemoteAuthentication.setNtlmHost( getTrimmedValue( parser.nextText() ) ); cRemoteAuthentication.setNtlmDomain( getTrimmedValue( parser.nextText() ) ); cRemoteAuthentication.setTrustStore( getTrimmedValue( parser.nextText() ) ); cRemoteAuthentication.setTrustStorePassword( getTrimmedValue( parser.nextText() ) ); cRemoteAuthentication.setKeyStore( getTrimmedValue( parser.nextText() ) ); cRemoteAuthentication.setKeyStorePassword( getTrimmedValue( parser.nextText() ) );
CRemoteAuthentication auth = new CRemoteAuthentication(); auth.setUsername( s.getAuthentication().getUsername() ); auth.setPassword( this.getActualPassword( s.getAuthentication().getPassword(), oldPassword ) ); auth.setNtlmDomain( s.getAuthentication().getNtlmDomain() ); auth.setNtlmHost( s.getAuthentication().getNtlmHost() );