Class DefaultSVNPersistentAuthenticationProvider
java.lang.Object
org.tmatesoft.svn.core.internal.wc.DefaultSVNPersistentAuthenticationProvider
- All Implemented Interfaces:
ISVNAuthenticationProvider
,ISVNPersistentAuthenticationProvider
public class DefaultSVNPersistentAuthenticationProvider
extends Object
implements ISVNAuthenticationProvider, ISVNPersistentAuthenticationProvider
- Version:
- 1.3
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
static interface
protected class
protected class
protected class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
private ISVNAuthenticationStorageOptions
private DefaultSVNOptions
private File
private ISVNHostOptionsProvider
private String
static final String
static final String
static final String
Fields inherited from interface org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider
ACCEPTED, ACCEPTED_TEMPORARY, REJECTED
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DefaultSVNPersistentAuthenticationProvider
(File directory, String userName, ISVNAuthenticationStorageOptions authOptions, DefaultSVNOptions defaultOptions, ISVNHostOptionsProvider hostOptionsProvider) -
Method Summary
Modifier and TypeMethodDescriptionint
acceptServerAuthentication
(SVNURL url, String r, Object serverAuth, boolean resultMayBeStored) Checks a server authentication certificate and whether accepts it (if the client trusts it) or not.createPasswordStorages
(DefaultSVNOptions options) protected String
getAuthFileName
(String realm) getPasswordStorage
(String passType) boolean
byte[]
loadFingerprints
(String realm) protected String
preprocessRealm
(String realm) private char[]
readPassphrase
(String realm, DefaultSVNPersistentAuthenticationProvider.IPasswordStorage passwordStorage, SVNProperties authValues) private char[]
readPassword
(String realm, String userName, DefaultSVNPersistentAuthenticationProvider.IPasswordStorage passwordStorage, SVNProperties authValues) private SVNPasswordAuthentication
readSSLPassphrase
(String kind, String realm, boolean storageAllowed, SVNURL url) private SVNPasswordAuthentication
readSSLPassphrase
(String expectedCertificatePath, SVNWCProperties props) 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.void
saveAuthentication
(SVNAuthentication auth, String kind, String realm) void
saveFingerprints
(String realm, byte[] fingerprints) private void
savePasswordCredential
(SVNProperties values, SVNAuthentication auth, String realm) private void
saveSSHCredential
(SVNProperties values, SVNAuthentication auth, String realm) private boolean
saveSSLCredential
(SVNProperties values, SVNAuthentication auth, String realm) private void
saveUserNameCredential
(SVNProperties values, SVNAuthentication auth) private boolean
shouldSaveCredentials
(String kind, SVNProperties newValues, SVNProperties oldValues)
-
Field Details
-
WINDOWS_CRYPTO_API_PASSWORD_STORAGE
- See Also:
-
MAC_OS_KEYCHAIN_PASSWORD_STORAGE
- See Also:
-
GNOME_KEYRING_PASSWORD_STORAGE
- See Also:
-
SIMPLE_PASSTYPE
- See Also:
-
WIN_CRYPT_PASSTYPE
- See Also:
-
MAC_OS_KEYCHAIN_PASSTYPE
- See Also:
-
GNOME_KEYRING_PASSTYPE
- See Also:
-
myDirectory
-
myUserName
-
myPasswordStorages
-
myAuthOptions
-
myDefaultOptions
-
myHostOptionsProvider
-
-
Constructor Details
-
DefaultSVNPersistentAuthenticationProvider
protected DefaultSVNPersistentAuthenticationProvider(File directory, String userName, ISVNAuthenticationStorageOptions authOptions, DefaultSVNOptions defaultOptions, ISVNHostOptionsProvider hostOptionsProvider)
-
-
Method Details
-
createPasswordStorages
protected DefaultSVNPersistentAuthenticationProvider.IPasswordStorage[] createPasswordStorages(DefaultSVNOptions options) -
getPasswordStorage
private DefaultSVNPersistentAuthenticationProvider.IPasswordStorage getPasswordStorage(String passType) -
readSSLPassphrase
private SVNPasswordAuthentication readSSLPassphrase(String kind, String realm, boolean storageAllowed, SVNURL url) -
readSSLPassphrase
private SVNPasswordAuthentication readSSLPassphrase(String expectedCertificatePath, SVNWCProperties props) throws SVNException - Throws:
SVNException
-
readPassword
private char[] readPassword(String realm, String userName, DefaultSVNPersistentAuthenticationProvider.IPasswordStorage passwordStorage, SVNProperties authValues) throws SVNException - Throws:
SVNException
-
readPassphrase
private char[] readPassphrase(String realm, DefaultSVNPersistentAuthenticationProvider.IPasswordStorage passwordStorage, SVNProperties authValues) throws SVNException - Throws:
SVNException
-
requestClientAuthentication
public SVNAuthentication requestClientAuthentication(String kind, SVNURL url, String realm, SVNErrorMessage errorMessage, SVNAuthentication previousAuth, boolean authMayBeStored) Description copied from interface:ISVNAuthenticationProvider
Returns 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
previousAuth
is set to null.- Specified by:
requestClientAuthentication
in 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
-
preprocessRealm
-
isMSCapi
-
saveAuthentication
public void saveAuthentication(SVNAuthentication auth, String kind, String realm) throws SVNException - Specified by:
saveAuthentication
in interfaceISVNPersistentAuthenticationProvider
- Throws:
SVNException
-
getAuthFileName
-
acceptServerAuthentication
public int acceptServerAuthentication(SVNURL url, String r, Object serverAuth, boolean resultMayBeStored) Description copied from interface:ISVNAuthenticationProvider
Checks 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:
acceptServerAuthentication
in interfaceISVNAuthenticationProvider
- Parameters:
url
- a repository location that is accessedr
- a repository authentication realm (host, port, realm string)serverAuth
- 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
)
-
shouldSaveCredentials
private boolean shouldSaveCredentials(String kind, SVNProperties newValues, SVNProperties oldValues) throws SVNException - Throws:
SVNException
-
saveUserNameCredential
-
savePasswordCredential
private void savePasswordCredential(SVNProperties values, SVNAuthentication auth, String realm) throws SVNException - Throws:
SVNException
-
saveSSHCredential
private void saveSSHCredential(SVNProperties values, SVNAuthentication auth, String realm) throws SVNException - Throws:
SVNException
-
saveSSLCredential
private boolean saveSSLCredential(SVNProperties values, SVNAuthentication auth, String realm) throws SVNException - Throws:
SVNException
-
loadFingerprints
- Specified by:
loadFingerprints
in interfaceISVNPersistentAuthenticationProvider
-
saveFingerprints
- Specified by:
saveFingerprints
in interfaceISVNPersistentAuthenticationProvider
-