@Override public boolean isInteractive() { return (delegate != null) && delegate.isInteractive(); }
/** {@inheritDoc} */ @Override public boolean isInteractive() { for (CredentialsProvider p : credentialProviders) if (p.isInteractive()) return true; return false; }
/** * {@inheritDoc} * <p> * Populates the credential items with the credentials provided by the first * credential provider in the list which populates them with non-null values * * @see org.eclipse.jgit.transport.CredentialsProvider#supports(org.eclipse.jgit.transport.CredentialItem[]) */ @Override public boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem { for (CredentialsProvider p : credentialProviders) { if (p.supports(items)) { if (!p.get(uri, items)) { if (p.isInteractive()) { return false; // user cancelled the request } continue; } if (isAnyNull(items)) { continue; } return true; } } return false; } }
/** {@inheritDoc} */ @Override public boolean isInteractive() { for (CredentialsProvider p : credentialProviders) if (p.isInteractive()) return true; return false; }
@Override public boolean isInteractionAllowed(ClientSession session) { return provider != null && provider.isInteractive(); }
/** * @return {@code true} if any of the credential providers in the list is * interactive, otherwise {@code false} * @see org.eclipse.jgit.transport.CredentialsProvider#isInteractive() */ @Override public boolean isInteractive() { for (CredentialsProvider p : credentialProviders) if (p.isInteractive()) return true; return false; }
session.setConfig("PreferredAuthentications", pauth); //$NON-NLS-1$ if (credentialsProvider != null && (!hc.isBatchMode() || !credentialsProvider.isInteractive())) { session.setUserInfo(new CredentialsProviderUserInfo(session, credentialsProvider));
/** * Populates the credential items with the credentials provided by the first * credential provider in the list which populates them with non-null values * * @return {@code true} if any of the credential providers in the list * supports the requested items, otherwise {@code false} * @see org.eclipse.jgit.transport.CredentialsProvider#supports(org.eclipse.jgit.transport.CredentialItem[]) */ @Override public boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem { for (CredentialsProvider p : credentialProviders) { if (p.supports(items)) { if (!p.get(uri, items)) { if (p.isInteractive()) { return false; // user cancelled the request } continue; } if (isAnyNull(items)) { continue; } return true; } } return false; } }
/** * {@inheritDoc} * <p> * Populates the credential items with the credentials provided by the first * credential provider in the list which populates them with non-null values * * @see org.eclipse.jgit.transport.CredentialsProvider#supports(org.eclipse.jgit.transport.CredentialItem[]) */ @Override public boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem { for (CredentialsProvider p : credentialProviders) { if (p.supports(items)) { if (!p.get(uri, items)) { if (p.isInteractive()) { return false; // user cancelled the request } continue; } if (isAnyNull(items)) { continue; } return true; } } return false; } }
private Session createSession(CredentialsProvider credentialsProvider, FS fs, String user, final String pass, String host, int port, final OpenSshConfig.Host hc) throws JSchException { final Session session = createSession(hc, user, host, port, fs); // We retry already in getSession() method. JSch must not retry // on its own. session.setConfig("MaxAuthTries", "1"); //$NON-NLS-1$ //$NON-NLS-2$ if (pass != null) session.setPassword(pass); final String strictHostKeyCheckingPolicy = hc .getStrictHostKeyChecking(); if (strictHostKeyCheckingPolicy != null) session.setConfig("StrictHostKeyChecking", //$NON-NLS-1$ strictHostKeyCheckingPolicy); final String pauth = hc.getPreferredAuthentications(); if (pauth != null) session.setConfig("PreferredAuthentications", pauth); //$NON-NLS-1$ if (credentialsProvider != null && (!hc.isBatchMode() || !credentialsProvider.isInteractive())) { session.setUserInfo(new CredentialsProviderUserInfo(session, credentialsProvider)); } configure(hc, session); return session; }
session.setConfig("PreferredAuthentications", pauth); //$NON-NLS-1$ if (credentialsProvider != null && (!hc.isBatchMode() || !credentialsProvider.isInteractive())) { session.setUserInfo(new CredentialsProviderUserInfo(session, credentialsProvider));