public class SVNConsoleAuthenticationProvider extends java.lang.Object implements ISVNAuthenticationProvider, ISVNSSLPasspharsePromptSupport, ISVNAuthStoreHandler, ISVNGnomeKeyringPasswordProvider
Modifier and Type | Field and Description |
---|---|
private static int |
MAX_PROMPT_COUNT |
private boolean |
myIsTrustServerCertificate |
private java.util.Map<java.lang.String,java.lang.Integer> |
myRequestsCount |
private static java.lang.String |
OUR_HOST_KEY_PROMPT_TEXT |
private static java.lang.String |
OUR_PASSPHRASE_PROMPT_STRING |
private static java.lang.String |
OUR_PASSPHRASE_PROMPT_TEXT |
private static java.lang.String |
OUR_PASSWORD_PROMPT_STRING |
private static java.lang.String |
OUR_PASSWORD_PROMPT_TEXT |
private java.util.EnumSet<SVNCertificateFailureKind> |
trustServerCertificateFailureKinds |
ACCEPTED, ACCEPTED_TEMPORARY, REJECTED
Constructor and Description |
---|
SVNConsoleAuthenticationProvider(boolean trustServerCertificate) |
SVNConsoleAuthenticationProvider(java.util.EnumSet<SVNCertificateFailureKind> trustServerCertificateFailureKinds) |
Modifier and Type | Method and Description |
---|---|
int |
acceptServerAuthentication(SVNURL url,
java.lang.String realm,
java.lang.Object certificate,
boolean resultMayBeStored)
Checks a server authentication certificate and whether accepts it
(if the client trusts it) or not.
|
boolean |
canStorePlainTextPassphrases(java.lang.String realm,
SVNAuthentication auth) |
boolean |
canStorePlainTextPasswords(java.lang.String realm,
SVNAuthentication auth) |
char[] |
getKeyringPassword(java.lang.String keyringName) |
private boolean |
isPlainTextAllowed(java.lang.String realm,
java.lang.String promptText,
java.lang.String promptString) |
boolean |
isSSLPassphrasePromtSupported() |
private static void |
printRealm(java.lang.String realm) |
private static java.lang.String |
prompt(java.lang.String label) |
private static char[] |
promptPassword(java.lang.String label) |
private static java.lang.String |
readLine() |
SVNAuthentication |
requestClientAuthentication(java.lang.String kind,
SVNURL url,
java.lang.String realm,
SVNErrorMessage errorMessage,
SVNAuthentication previousAuth,
boolean authMayBeStored)
Returns a next user credential of the specified kind for the given
authentication realm.
|
private static final java.lang.String OUR_PASSPHRASE_PROMPT_TEXT
private static final java.lang.String OUR_PASSWORD_PROMPT_TEXT
private static final java.lang.String OUR_HOST_KEY_PROMPT_TEXT
private static final java.lang.String OUR_PASSWORD_PROMPT_STRING
private static final java.lang.String OUR_PASSPHRASE_PROMPT_STRING
private static final int MAX_PROMPT_COUNT
private java.util.Map<java.lang.String,java.lang.Integer> myRequestsCount
private final boolean myIsTrustServerCertificate
private final java.util.EnumSet<SVNCertificateFailureKind> trustServerCertificateFailureKinds
public SVNConsoleAuthenticationProvider(java.util.EnumSet<SVNCertificateFailureKind> trustServerCertificateFailureKinds)
public SVNConsoleAuthenticationProvider(boolean trustServerCertificate)
public int acceptServerAuthentication(SVNURL url, java.lang.String realm, java.lang.Object certificate, boolean resultMayBeStored)
ISVNAuthenticationProvider
This method is used by an SSL manager (see DefaultSVNSSLTrustManager
).
acceptServerAuthentication
in interface ISVNAuthenticationProvider
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 notISVNAuthenticationProvider.REJECTED
, ISVNAuthenticationProvider.ACCEPTED_TEMPORARY
, or ISVNAuthenticationProvider.ACCEPTED
)public SVNAuthentication requestClientAuthentication(java.lang.String kind, SVNURL url, java.lang.String realm, SVNErrorMessage errorMessage, SVNAuthentication previousAuth, boolean authMayBeStored)
ISVNAuthenticationProvider
If this provider has got more than one credentials (say, a list of credentials),
to get the first one of them previousAuth
is set to
null.
requestClientAuthentication
in interface ISVNAuthenticationProvider
kind
- a credential kind (for example, like those defined in
ISVNAuthenticationManager
)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 anywaypublic boolean canStorePlainTextPasswords(java.lang.String realm, SVNAuthentication auth) throws SVNException
canStorePlainTextPasswords
in interface ISVNAuthStoreHandler
SVNException
public boolean canStorePlainTextPassphrases(java.lang.String realm, SVNAuthentication auth) throws SVNException
canStorePlainTextPassphrases
in interface ISVNAuthStoreHandler
SVNException
private boolean isPlainTextAllowed(java.lang.String realm, java.lang.String promptText, java.lang.String promptString)
private static void printRealm(java.lang.String realm)
private static java.lang.String prompt(java.lang.String label)
private static char[] promptPassword(java.lang.String label)
private static java.lang.String readLine()
public boolean isSSLPassphrasePromtSupported()
isSSLPassphrasePromtSupported
in interface ISVNSSLPasspharsePromptSupport
public char[] getKeyringPassword(java.lang.String keyringName) throws SVNException
getKeyringPassword
in interface ISVNGnomeKeyringPasswordProvider
SVNException