Package org.sonatype.nexus.configuration.model

Examples of org.sonatype.nexus.configuration.model.CRemoteAuthentication


    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 {
View Full Code Here


  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;
  }
View Full Code Here

    config.setRemoteProxySettings(new CRemoteProxySettings());

    final CRemoteHttpProxySettings httpProxySettings = new CRemoteHttpProxySettings();
    httpProxySettings.setProxyHostname("localhost");
    httpProxySettings.setProxyPort(1234);
    httpProxySettings.setAuthentication(new CRemoteAuthentication());
    httpProxySettings.getAuthentication().setPassword(password);

    final CRemoteHttpProxySettings httpsProxySettings = new CRemoteHttpProxySettings();
    httpsProxySettings.setProxyHostname("localhost");
    httpsProxySettings.setProxyPort(1234);
    httpsProxySettings.setAuthentication(new CRemoteAuthentication());
    httpsProxySettings.getAuthentication().setPassword(password);

    config.getRemoteProxySettings().setHttpProxySettings(httpProxySettings);
    config.getRemoteProxySettings().setHttpsProxySettings(httpsProxySettings);

    //        config.getSecurity().setAnonymousPassword( password );
    //
    //        // anon username
    //        config.getSecurity().setAnonymousPassword( password );

    // repo auth pass
    CRepository central = this.getCentralRepo(config);
    central.getRemoteStorage().setAuthentication(new CRemoteAuthentication());
    central.getRemoteStorage().getAuthentication().setPassword(password);

    // now we need to make the file valid....
    config.getRemoteProxySettings().getHttpProxySettings().setProxyPort(1234);
View Full Code Here

  public CRemoteAuthentication convertToModel(RemoteAuthenticationSettings settings) {
    if (settings == null) {
      return null;
    }
    else {
      CRemoteAuthentication remoteAuthentication = new CRemoteAuthentication();

      if (settings instanceof NtlmRemoteAuthenticationSettings) {
        NtlmRemoteAuthenticationSettings up = (NtlmRemoteAuthenticationSettings) settings;

        remoteAuthentication.setUsername(up.getUsername());

        remoteAuthentication.setPassword(up.getPassword());

        remoteAuthentication.setNtlmDomain(up.getNtlmDomain());

        remoteAuthentication.setNtlmHost(up.getNtlmHost());
      }
      else if (settings instanceof UsernamePasswordRemoteAuthenticationSettings) {
        UsernamePasswordRemoteAuthenticationSettings up =
            (UsernamePasswordRemoteAuthenticationSettings) settings;

        remoteAuthentication.setUsername(up.getUsername());

        remoteAuthentication.setPassword(up.getPassword());
      }
      else if (settings instanceof ClientSSLRemoteAuthenticationSettings) {
        ClientSSLRemoteAuthenticationSettings cs = (ClientSSLRemoteAuthenticationSettings) settings;

        remoteAuthentication.setKeyStore(cs.getKeyStore().getAbsolutePath());

        remoteAuthentication.setKeyStorePassword(cs.getKeyStorePassword());

        remoteAuthentication.setTrustStore(cs.getTrustStore().getAbsolutePath());

        remoteAuthentication.setTrustStorePassword(cs.getTrustStorePassword());
      }
      else {
        // ??
      }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.configuration.model.CRemoteAuthentication

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.