public class DefaultCredentialStorePluginImpl extends Object implements org.azyva.dragom.execcontext.plugin.CredentialStorePlugin
CredentialStorePlugin uses
CredentialStore to manage credentials.
The default master password file is that defined by CredentialStore, namely dragom-master-password in the user home directory. If the org.azyva.dragom.MasterKeyFile system property is defined, it specifies the Path of the master password file.
The default credential file is credentials.properties in the workspace metadata directory. If the org.azyva.dragom.CredentialFile is defined, it specifies the Path of the credential file. The default credential file defined by CredentialStore is not used.
This mappings between resource Pattern's and corresponding realms and users are defined using runtime properties defined on the root ClassificationNode:
CredentialStore.ResourcePatternRealmUser is
created.
CredentialStore.ResourcePatternRealmUser.patternResource.
CredentialStore.ResourcePatternRealmUser.realm.
CredentialStore.ResourcePatternRealmUser.user.
UserInteractionCallbackPlugin.isBatchMode() returns false, this class
interacts with the user when appropriate to obtain missing passwords, as
recommended in CredentialStorePlugin.
In addition to implementing CredentialStorePlugin, this class publicly provides access to the CredentialStore instance allowing to obtain information about realms and explicitly modify the passwords, operations which are not supported by the interface. This is meant to be used by a tool that would assume this specific implementation of the CredentialStorePlugin to allow the user to manage the credential store. CredentialManagerTool from dragom-cli-tools is such a CLI tool.
| Modifier and Type | Field and Description |
|---|---|
static String |
RUNTIME_PROPERTY_PREFIX_RESOURCE_PATTERN_REALM_USER_MAPPING_REALM
Runtime property prefix for the realm for a given
resource-pattern-realm-user mapping.
|
static String |
RUNTIME_PROPERTY_PREFIX_RESOURCE_PATTERN_REALM_USER_MAPPING_RESOURCE_PATTERN
Runtime property prefix for the resource Pattern for a given
resource-pattern-realm-user mapping.
|
static String |
RUNTIME_PROPERTY_PREFIX_RESOURCE_PATTERN_REALM_USER_MAPPING_USER
Runtime property prefix for the user for a given
resource-pattern-realm-user mapping.
|
static String |
RUNTIME_PROPERTY_RESOURCE_PATTERN_REALM_USER_MAPPINGS
Runtime property for the list of resource-pattern-realm-user mappings.
|
static String |
SYS_PROPERTY_MASTER_KEY_FILE
System property that specifies the master password file.
|
| Constructor and Description |
|---|
DefaultCredentialStorePluginImpl(org.azyva.dragom.execcontext.ExecContext execContext)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
org.azyva.dragom.execcontext.plugin.CredentialStorePlugin.Credentials |
getCredentials(String resource,
String user,
org.azyva.dragom.execcontext.plugin.CredentialStorePlugin.CredentialValidator credentialValidator) |
org.azyva.dragom.execcontext.plugin.CredentialStorePlugin.Credentials |
getCredentialsInternal(String resource,
String user,
org.azyva.dragom.execcontext.plugin.CredentialStorePlugin.CredentialValidator credentialValidator)
The code for
isCredentialsExist(java.lang.String, java.lang.String, org.azyva.dragom.execcontext.plugin.CredentialStorePlugin.CredentialValidator) and getCredentials(java.lang.String, java.lang.String, org.azyva.dragom.execcontext.plugin.CredentialStorePlugin.CredentialValidator) is very
similar and is factored out here. |
CredentialStore |
getCredentialStore() |
boolean |
isCredentialsExist(String resource,
String user,
org.azyva.dragom.execcontext.plugin.CredentialStorePlugin.CredentialValidator credentialValidator) |
void |
resetCredentials(String resource,
String user) |
public static final String SYS_PROPERTY_MASTER_KEY_FILE
public static final String RUNTIME_PROPERTY_RESOURCE_PATTERN_REALM_USER_MAPPINGS
public static final String RUNTIME_PROPERTY_PREFIX_RESOURCE_PATTERN_REALM_USER_MAPPING_RESOURCE_PATTERN
public static final String RUNTIME_PROPERTY_PREFIX_RESOURCE_PATTERN_REALM_USER_MAPPING_REALM
public static final String RUNTIME_PROPERTY_PREFIX_RESOURCE_PATTERN_REALM_USER_MAPPING_USER
public DefaultCredentialStorePluginImpl(org.azyva.dragom.execcontext.ExecContext execContext)
execContext - ExecContext.public CredentialStore getCredentialStore()
public boolean isCredentialsExist(String resource, String user, org.azyva.dragom.execcontext.plugin.CredentialStorePlugin.CredentialValidator credentialValidator)
isCredentialsExist in interface org.azyva.dragom.execcontext.plugin.CredentialStorePluginpublic org.azyva.dragom.execcontext.plugin.CredentialStorePlugin.Credentials getCredentials(String resource, String user, org.azyva.dragom.execcontext.plugin.CredentialStorePlugin.CredentialValidator credentialValidator)
getCredentials in interface org.azyva.dragom.execcontext.plugin.CredentialStorePluginpublic org.azyva.dragom.execcontext.plugin.CredentialStorePlugin.Credentials getCredentialsInternal(String resource, String user, org.azyva.dragom.execcontext.plugin.CredentialStorePlugin.CredentialValidator credentialValidator)
isCredentialsExist(java.lang.String, java.lang.String, org.azyva.dragom.execcontext.plugin.CredentialStorePlugin.CredentialValidator) and getCredentials(java.lang.String, java.lang.String, org.azyva.dragom.execcontext.plugin.CredentialStorePlugin.CredentialValidator) is very
similar and is factored out here.
The difference between this method and getCredentials is that this one returns null if the requested credentials are not available, making it usable for isCredentialsExist.
resource - Resource.user - User. Can be null.credentialValidator - CredentialValidator.Copyright © 2015–2016 AZYVA INC.. All rights reserved.