Gets the Proxy user password.

@param repoProperties the Repository Properties
@return the user password
768681
public static String getProxyPwd(Properties repoProperties) {
        if (repoProperties.getProperty(InstallConstants.REPO_PROPERTIES_PROXY_USERPWD) != null)
            return repoProperties.getProperty(InstallConstants.REPO_PROPERTIES_PROXY_USERPWD);
        else if (repoProperties.getProperty(InstallConstants.REPO_PROPERTIES_PROXY_PWD) != null)
            return repoProperties.getProperty(InstallConstants.REPO_PROPERTIES_PROXY_PWD);
        else
            return null;
    }
267211
public String getRepository()
    {
        if( !m_allowReleases && !m_allowSnapshots )
        {
            throw new IllegalStateException( "Does not make sense to disallow both releases and snapshots." );
        }
        final StringBuilder repositoryUrl = new StringBuilder();
        repositoryUrl.append( m_repositoryUrl );
        if( m_allowSnapshots )
        {
            repositoryUrl.append( "@snapshots" );
        }
        if( !m_allowReleases )
        {
            repositoryUrl.append( "@noreleases" );
        }
        return repositoryUrl.toString();
    }
1221581
@Override
	public char[] getPropertyPassword(Class<?> aClass, String key,
			char[] defaultPassword)
	{
		return getPropertyPassword(new StringBuilder(aClass.getName()).append(".").append(key).toString(),
				defaultPassword);
	}
43216
@Override
	public char[] getPropertyPassword(String key)
	{
		char[] bVal = null;
		String sVal = getSecureProperty(key);

		if(sVal == null)
			throw new MissingConfigPropertiesException(key);
		
		bVal = sVal.toCharArray();

		return bVal;
	}
1313443
protected Session login(String repositoryId) {
        LOGGER.debug("--- login: " + repositoryId);

        if (context == null) {
            throw new CmisRuntimeException("No user context!");
        }

        Session session = sessions.get(repositoryId);
        if (session == null) {
            HttpServletRequest request = (HttpServletRequest) context.get(CallContext.HTTP_SERVLET_REQUEST);
            if (request != null) {
                //try via http authentication
                try {
                    session = jcrRepository(repositoryId).login(new ServletCredentials(request), workspace(repositoryId));
                    sessions.put(repositoryId, session);
                    return session;
                } catch (CmisPermissionDeniedException e) {
                    LOGGER.debug(e, "Cannot authenticate using http authentication");
                }
            }
            //http authentication didn't work, try std authentication
            String userName = context.getUsername();
            String password = context.getPassword();
            Credentials credentials = (userName == null)
                    ? null : new SimpleCredentials(userName, password == null ? "".toCharArray() : password.toCharArray());

            try {
                session = jcrRepository(repositoryId).login(credentials, workspace(repositoryId));
                sessions.put(repositoryId, session);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
        return session;
    }
158841
@Deprecated
  public static FileSystem getProxiedFileSystemUsingKeytab(@NonNull final String userNameToProxyAs,
      final String superUserName, final Path superUserKeytabLocation, final URI fsURI, final Configuration conf)
      throws ExecutionException {
    try {
      return getProxiedFileSystemUsingKeytab(userNameToProxyAs, superUserName, superUserKeytabLocation, fsURI, conf,
          null);
    } catch (IOException ioe) {
      throw new ExecutionException(ioe);
    }
  }
421416
@Provides @Singleton
    public List<RemoteRepository> getRemoteRepositories(
            SettingsDecrypter decrypter,
            ExtensionList<RemoteRepositoryDecorator> decorators) {

        List<RemoteRepository> repositories = new ArrayList<RemoteRepository>();
        MavenDependencyResolverSettings resolverSettings = new MavenDependencyResolverSettings();
        resolverSettings.setUseMavenCentral(true);
        List<RemoteRepository> repos = resolverSettings.getRemoteRepositories();
        for (RemoteRepository remoteRepository : repos) {
            Server server = resolverSettings.getSettings().getServer(remoteRepository.getId());
            if (server != null) {
                server = decrypter.decrypt(new DefaultSettingsDecryptionRequest(server)).getServer();
                remoteRepository.setAuthentication(new Authentication(server.getUsername(), server.getPassword(), server.getPrivateKey(), server.getPassphrase()));
            }
            repositories.add(decorate(remoteRepository, decorators));
        }
        RemoteRepository r = new RemoteRepository("cloudbees-public-release", "default", "https://repository-cloudbees.forge.cloudbees.com/public-release/");
        repositories.add(decorate(r,decorators));
        return repositories;
    }
1023198
@Override
    public String getProxyURL() {
        try {
            if (hasProperty(PROXY_FOR)) {
                return getProperty(PROXY_FOR).getString();
            }
            return null;
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }
329678
@Builder(builderClassName = "ProxiedFileSystemFromToken", builderMethodName = "fromToken")
  private static FileSystem getProxiedFileSystemUsingToken(@NonNull String userNameToProxyAs, Token<?> userNameToken,
      URI fsURI, Configuration conf, FileSystem referenceFS) throws IOException, ExecutionException {
    Preconditions.checkNotNull(userNameToProxyAs, "Must provide a user name to proxy as.");
    Preconditions.checkNotNull(userNameToken, "Must provide token for user to proxy.");
    URI actualURI = resolveUri(fsURI, conf, referenceFS);
    Configuration actualConfiguration = resolveConfiguration(conf, referenceFS);

    return USER_NAME_TO_FILESYSTEM_CACHE.get(getFileSystemKey(actualURI, userNameToProxyAs, referenceFS),
        new CreateProxiedFileSystemFromToken(userNameToProxyAs, userNameToken, actualURI, actualConfiguration,
            referenceFS));
  }
189822
def get_login_password(site_name="github.com",
                       netrc_file="~/.netrc",
                       git_credential_file="~/.git-credentials"):
    """"""
    try:
        n = netrc.netrc(os.path.expanduser(netrc_file))
    except OSError:
        pass
    else:
        if site_name in n.hosts:
            return n.hosts[site_name][0], n.hosts[site_name][2]

    try:
        with open(os.path.expanduser(git_credential_file)) as f:
            for line in f:
                parsed = parse.urlparse(line.strip())
                if parsed.hostname == site_name:
                    return (parse.unquote(parsed.username),
                            parse.unquote(parsed.password))
    except OSError:
        pass

    return None, None
488066
public static UserGroupInformation getProxiedUser(final Properties prop,
      final Logger log, final Configuration conf) throws IOException {
    final String toProxy = verifySecureProperty(prop, JobProperties.USER_TO_PROXY, log);
    final UserGroupInformation user = getProxiedUser(toProxy, prop, log, conf);
    if (user == null) {
      throw new IOException(
          "Proxy as any user in unsecured grid is not supported!"
              + prop.toString());
    }
    log.info("created proxy user for " + user.getUserName() + user.toString());
    return user;
  }
95518
public static String getRepoName(Properties repoProperties, RepositoryConnection repoConn) throws InstallException {
        String repoName = null;
        List<RepositoryConfig> configRepos = RepositoryConfigUtils.getRepositoryConfigs(repoProperties);

        if (!(repoConn instanceof DirectoryRepositoryConnection || repoConn instanceof ZipRepositoryConnection)) {
            if (RepositoryConfigUtils.isLibertyRepository((RestRepositoryConnection) repoConn, repoProperties))
                return WLP_REPO;
        }
        for (RepositoryConfig rc : configRepos) {
            if (rc.getUrl() != null) {
                if (rc.getUrl().toLowerCase().startsWith("file:") && (repoConn instanceof DirectoryRepositoryConnection || repoConn instanceof ZipRepositoryConnection)) {
                    String repoDir = rc.getUrl();
                    try {
                        URL fileURL = new URL(repoDir);
                        File repoFile = new File(fileURL.getPath());
                        if (repoFile.getAbsolutePath().equalsIgnoreCase(repoConn.getRepositoryLocation())) {
                            repoName = rc.getId();
                            break;
                        }
                    } catch (Exception e) {
                        throw new InstallException(RepositoryUtils.getMessage("ERROR_DIRECTORY_NOT_EXISTS", repoDir));
                    }
                } else {
                    if (rc.getUrl().equalsIgnoreCase(repoConn.getRepositoryLocation())) {
                        repoName = rc.getId();
                        break;
                    }
                }
            }
        }
        return repoName;
    }
1042227
public Properties toProperties()
  {
    Properties props = new Properties();
    if(passwordHash != null)
    {
      props.put("password", passwordHash);
    }
    if(groups != null && !groups.isEmpty())
    {
      props.put("groups", Joiner.on(',').join(groups));
    }
    if(permissions != null && !permissions.isEmpty())
    {
      props.put("permissions", Joiner.on(',').join(permissions));
    }
    if(expires != null)
    {
      props.put("expires", ISODateTimeFormat.date().print(expires));
    }
    return props;
  }
512854
private void loadInfosFromSettings( ScmProviderRepositoryWithHost repo )
    {
        if ( username == null || password == null )
        {
            String host = repo.getHost();

            int port = repo.getPort();

            if ( port > 0 )
            {
                host += ":" + port;
            }

            Server server = this.settings.getServer( host );

            if ( server != null )
            {
                setPasswordIfNotEmpty( repo, decrypt( server.getPassword(), host ) );

                setUserIfNotEmpty( repo, server.getUsername() );
            }
        }
    }
615744
private JPanel getPanelProxyAuth() {
		if (panelProxyAuth == null) {
			java.awt.GridBagConstraints gridBagConstraints82 = new GridBagConstraints();

			java.awt.GridBagConstraints gridBagConstraints72 = new GridBagConstraints();

			java.awt.GridBagConstraints gridBagConstraints62 = new GridBagConstraints();

			java.awt.GridBagConstraints gridBagConstraints52 = new GridBagConstraints();

			java.awt.GridBagConstraints gridBagConstraints42 = new GridBagConstraints();

			java.awt.GridBagConstraints gridBagConstraints31 = new GridBagConstraints();

			java.awt.GridBagConstraints gridBagConstraints21 = new GridBagConstraints();

			java.awt.GridBagConstraints gridBagConstraints16 = new GridBagConstraints();

			java.awt.GridBagConstraints gridBagConstraints17 = new GridBagConstraints();

			javax.swing.JLabel jLabel11 = new JLabel();

			javax.swing.JLabel jLabel10 = new JLabel();

			javax.swing.JLabel jLabel9 = new JLabel();

			panelProxyAuth = new JPanel();
			panelProxyAuth.setLayout(new GridBagLayout());
			jLabel9.setText(Constant.messages.getString("conn.options.proxy.auth.realm"));
			jLabel10.setText(Constant.messages.getString("conn.options.proxy.auth.username"));
			jLabel11.setText(Constant.messages.getString("conn.options.proxy.auth.password"));
			panelProxyAuth.setBorder(javax.swing.BorderFactory.createTitledBorder(null, 
					Constant.messages.getString("conn.options.proxy.auth.auth"), 
					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, 
					javax.swing.border.TitledBorder.DEFAULT_POSITION, 
					FontUtils.getFont(FontUtils.Size.standard), java.awt.Color.black));
			gridBagConstraints16.gridx = 0;
			gridBagConstraints16.gridy = 0;
			gridBagConstraints16.insets = new java.awt.Insets(2,2,2,2);
			gridBagConstraints16.anchor = java.awt.GridBagConstraints.NORTHWEST;
			gridBagConstraints16.fill = java.awt.GridBagConstraints.HORIZONTAL;
			gridBagConstraints16.gridwidth = 2;
			gridBagConstraints16.weightx = 1.0D;
			gridBagConstraints17.gridx = 0;
			gridBagConstraints17.gridy = 1;
			gridBagConstraints17.insets = new java.awt.Insets(2,2,2,2);
			gridBagConstraints17.anchor = java.awt.GridBagConstraints.WEST;
			gridBagConstraints17.fill = java.awt.GridBagConstraints.HORIZONTAL;
			gridBagConstraints17.gridwidth = 2;
			gridBagConstraints17.weightx = 1.0D;
			gridBagConstraints21.gridx = 0;
			gridBagConstraints21.gridy = 2;
			gridBagConstraints21.insets = new java.awt.Insets(2,2,2,2);
			gridBagConstraints21.anchor = java.awt.GridBagConstraints.WEST;
			gridBagConstraints21.fill = java.awt.GridBagConstraints.HORIZONTAL;
			gridBagConstraints21.weightx = 0.5D;
			gridBagConstraints31.gridx = 1;
			gridBagConstraints31.gridy = 2;
			gridBagConstraints31.weightx = 0.5D;
			gridBagConstraints31.fill = java.awt.GridBagConstraints.HORIZONTAL;
			gridBagConstraints31.insets = new java.awt.Insets(2,2,2,2);
			gridBagConstraints31.anchor = java.awt.GridBagConstraints.WEST;
			gridBagConstraints31.ipadx = 50;
			gridBagConstraints42.gridx = 0;
			gridBagConstraints42.gridy = 3;
			gridBagConstraints42.insets = new java.awt.Insets(2,2,2,2);
			gridBagConstraints42.fill = java.awt.GridBagConstraints.HORIZONTAL;
			gridBagConstraints42.weightx = 0.5D;
			gridBagConstraints42.anchor = java.awt.GridBagConstraints.WEST;
			gridBagConstraints52.gridx = 1;
			gridBagConstraints52.gridy = 3;
			gridBagConstraints52.weightx = 0.5D;
			gridBagConstraints52.fill = java.awt.GridBagConstraints.HORIZONTAL;
			gridBagConstraints52.insets = new java.awt.Insets(2,2,2,2);
			gridBagConstraints52.anchor = java.awt.GridBagConstraints.WEST;
			gridBagConstraints52.ipadx = 50;
			gridBagConstraints62.gridx = 0;
			gridBagConstraints62.gridy = 4;
			gridBagConstraints62.insets = new java.awt.Insets(2,2,2,2);
			gridBagConstraints62.anchor = java.awt.GridBagConstraints.WEST;
			gridBagConstraints62.fill = java.awt.GridBagConstraints.HORIZONTAL;
			gridBagConstraints62.weightx = 0.5D;
			gridBagConstraints72.gridx = 1;
			gridBagConstraints72.gridy = 4;
			gridBagConstraints72.weightx = 0.5D;
			gridBagConstraints72.fill = java.awt.GridBagConstraints.HORIZONTAL;
			gridBagConstraints72.insets = new java.awt.Insets(2,2,2,2);
			gridBagConstraints72.anchor = java.awt.GridBagConstraints.WEST;
			gridBagConstraints72.ipadx = 50;
			gridBagConstraints82.gridx = 1;
			gridBagConstraints82.gridy = 5;
			gridBagConstraints82.weightx = 0.5D;
			gridBagConstraints82.fill = java.awt.GridBagConstraints.HORIZONTAL;
			gridBagConstraints82.insets = new java.awt.Insets(2,2,2,2);
			gridBagConstraints82.anchor = java.awt.GridBagConstraints.WEST;
			gridBagConstraints82.ipadx = 50;
			panelProxyAuth.add(getChkProxyChainAuth(), gridBagConstraints16);
			panelProxyAuth.add(getChkProxyChainPrompt(), gridBagConstraints17);
			panelProxyAuth.add(jLabel9, gridBagConstraints21);
			panelProxyAuth.add(getTxtProxyChainRealm(), gridBagConstraints31);
			panelProxyAuth.add(jLabel10, gridBagConstraints42);
			panelProxyAuth.add(getTxtProxyChainUserName(), gridBagConstraints52);
			panelProxyAuth.add(jLabel11, gridBagConstraints62);
			panelProxyAuth.add(getTxtProxyChainPassword(), gridBagConstraints72);
			panelProxyAuth.add(getChkShowPassword(), gridBagConstraints82);
		}
		return panelProxyAuth;
	}
52155
public Credentials toGrgit() {
        if (username != null && password != null) {
            return new Credentials(username, password);
        } else {
            return null;
        }
    }
411828
public PullResult pullFromRepository(final Git git, final String remote, String remoteBranch, final String passphrase,
        final Path privateKey) {
        SshSessionFactory sshSessionFactory = new JschConfigSessionFactory() {
            @Override
            protected void configure(OpenSshConfig.Host host, Session session) {
                session.setUserInfo(new PassphraseUserInfo(passphrase));
            }

            @Override
            protected JSch createDefaultJSch(FS fs) throws JSchException {
                if (privateKey != null) {
                    JSch defaultJSch = super.createDefaultJSch(fs);
                    defaultJSch.addIdentity(privateKey.toFile().getAbsolutePath());
                    return defaultJSch;
                } else {
                    return super.createDefaultJSch(fs);
                }
            }
        };

        try {
            return git.pull()
                .setRemote(remote)
                .setRemoteBranchName(remoteBranch)
                .setTransportConfigCallback(transport -> {
                    SshTransport sshTransport = (SshTransport) transport;
                    sshTransport.setSshSessionFactory(sshSessionFactory);
                })
                .call();
        } catch (GitAPIException e) {
            throw new IllegalStateException(e);
        }
    }