Package org.tmatesoft.svn.cli
Class SVNConsoleAuthenticationProvider
java.lang.Object
org.tmatesoft.svn.cli.SVNConsoleAuthenticationProvider
- All Implemented Interfaces:
ISVNAuthenticationProvider,ISVNAuthStoreHandler,ISVNGnomeKeyringPasswordProvider,ISVNSSLPasspharsePromptSupport
public class SVNConsoleAuthenticationProvider
extends Object
implements ISVNAuthenticationProvider, ISVNSSLPasspharsePromptSupport, ISVNAuthStoreHandler, ISVNGnomeKeyringPasswordProvider
- Version:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final booleanprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate final EnumSet<SVNCertificateFailureKind>Fields inherited from interface org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider
ACCEPTED, ACCEPTED_TEMPORARY, REJECTED -
Constructor Summary
ConstructorsConstructorDescriptionSVNConsoleAuthenticationProvider(boolean trustServerCertificate) SVNConsoleAuthenticationProvider(EnumSet<SVNCertificateFailureKind> trustServerCertificateFailureKinds) -
Method Summary
Modifier and TypeMethodDescriptionintacceptServerAuthentication(SVNURL url, String realm, Object certificate, boolean resultMayBeStored) Checks a server authentication certificate and whether accepts it (if the client trusts it) or not.booleancanStorePlainTextPassphrases(String realm, SVNAuthentication auth) booleancanStorePlainTextPasswords(String realm, SVNAuthentication auth) char[]getKeyringPassword(String keyringName) private booleanisPlainTextAllowed(String realm, String promptText, String promptString) booleanprivate static voidprintRealm(String realm) private static Stringprivate static char[]promptPassword(String label) private static StringreadLine()requestClientAuthentication(String kind, SVNURL url, String realm, SVNErrorMessage errorMessage, SVNAuthentication previousAuth, boolean authMayBeStored) Returns a next user credential of the specified kind for the given authentication realm.
-
Field Details
-
OUR_PASSPHRASE_PROMPT_TEXT
- See Also:
-
OUR_PASSWORD_PROMPT_TEXT
- See Also:
-
OUR_HOST_KEY_PROMPT_TEXT
- See Also:
-
OUR_PASSWORD_PROMPT_STRING
- See Also:
-
OUR_PASSPHRASE_PROMPT_STRING
- See Also:
-
MAX_PROMPT_COUNT
private static final int MAX_PROMPT_COUNT- See Also:
-
myRequestsCount
-
myIsTrustServerCertificate
private final boolean myIsTrustServerCertificate -
trustServerCertificateFailureKinds
-
-
Constructor Details
-
SVNConsoleAuthenticationProvider
public SVNConsoleAuthenticationProvider(EnumSet<SVNCertificateFailureKind> trustServerCertificateFailureKinds) -
SVNConsoleAuthenticationProvider
public SVNConsoleAuthenticationProvider(boolean trustServerCertificate)
-
-
Method Details
-
acceptServerAuthentication
public int acceptServerAuthentication(SVNURL url, String realm, Object certificate, boolean resultMayBeStored) Description copied from interface:ISVNAuthenticationProviderChecks a server authentication certificate and whether accepts it (if the client trusts it) or not.This method is used by an SSL manager (see
DefaultSVNSSLTrustManager).- Specified by:
acceptServerAuthenticationin interfaceISVNAuthenticationProvider- Parameters:
url- a repository location that is accessedrealm- a repository authentication realm (host, port, realm string)certificate- a server certificate objectresultMayBeStored- if true then the server certificate can be cached, otherwise not- Returns:
- the result of the certificate check (
ISVNAuthenticationProvider.REJECTED,ISVNAuthenticationProvider.ACCEPTED_TEMPORARY, orISVNAuthenticationProvider.ACCEPTED)
-
requestClientAuthentication
public SVNAuthentication requestClientAuthentication(String kind, SVNURL url, String realm, SVNErrorMessage errorMessage, SVNAuthentication previousAuth, boolean authMayBeStored) Description copied from interface:ISVNAuthenticationProviderReturns a next user credential of the specified kind for the given authentication realm.If this provider has got more than one credentials (say, a list of credentials), to get the first one of them
previousAuthis set to null.- Specified by:
requestClientAuthenticationin interfaceISVNAuthenticationProvider- Parameters:
kind- a credential kind (for example, like those defined inISVNAuthenticationManager)url- a repository location that is to be accessedrealm- a repository authentication realm (host, port, realm string)errorMessage- the recent authentication failure error messagepreviousAuth- the credential that was previously retrieved (to tell if it's not accepted)authMayBeStored- if true then the returned credential can be cached, otherwise it won't be cached anyway- Returns:
- a next user credential
-
canStorePlainTextPasswords
- Specified by:
canStorePlainTextPasswordsin interfaceISVNAuthStoreHandler- Throws:
SVNException
-
canStorePlainTextPassphrases
public boolean canStorePlainTextPassphrases(String realm, SVNAuthentication auth) throws SVNException - Specified by:
canStorePlainTextPassphrasesin interfaceISVNAuthStoreHandler- Throws:
SVNException
-
isPlainTextAllowed
-
printRealm
-
prompt
-
promptPassword
-
readLine
-
isSSLPassphrasePromtSupported
public boolean isSSLPassphrasePromtSupported()- Specified by:
isSSLPassphrasePromtSupportedin interfaceISVNSSLPasspharsePromptSupport
-
getKeyringPassword
- Specified by:
getKeyringPasswordin interfaceISVNGnomeKeyringPasswordProvider- Throws:
SVNException
-