public class ConfigFileAuthenticationDetailsProvider extends Object implements AuthenticationDetailsProvider, RegionProvider, ProvidesClientConfigurators
Implementation of AuthenticationDetailsProvider
that uses a standard OCI configuration
file as an input.
Modifier and Type | Class and Description |
---|---|
protected static class |
ConfigFileAuthenticationDetailsProvider.ConfigFileInstancePrincipalAuthenticationDetailsProvider |
protected static class |
ConfigFileAuthenticationDetailsProvider.ConfigFileResourcePrincipalAuthenticationDetailsProvider |
protected static class |
ConfigFileAuthenticationDetailsProvider.ConfigFileSimpleAuthenticationDetailsProvider |
Modifier and Type | Field and Description |
---|---|
protected BasicConfigFileAuthenticationProvider |
delegate |
Constructor and Description |
---|
ConfigFileAuthenticationDetailsProvider(ConfigFileReader.ConfigFile configFile)
Creates a new instance.
|
ConfigFileAuthenticationDetailsProvider(String profile)
Creates a new instance using the config file at the default location, see
ConfigFileReader.DEFAULT_FILE_PATH . |
ConfigFileAuthenticationDetailsProvider(String configurationFilePath,
String profile)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
List<ClientConfigurator> |
getClientConfigurators() |
String |
getFingerprint()
Returns the fingerprint of the key being used.
|
String |
getKeyId()
Returns the keyId used to sign requests.
|
String |
getPassPhrase()
Deprecated.
|
char[] |
getPassphraseCharacters()
Returns the optional pass phrase for the (encrypted) private key, as a character array.
|
String |
getPemFilePath()
Returns the file path to the private key.
|
InputStream |
getPrivateKey()
Returns a new InputStream to the private key.
|
Region |
getRegion()
Returns the region.
|
static Region |
getRegionFromConfigFile(ConfigFileReader.ConfigFile configFile) |
String |
getTenantId()
Returns the tenant OCID.
|
String |
getUserId()
Returns the user OCID.
|
String |
toString() |
protected final BasicConfigFileAuthenticationProvider delegate
public ConfigFileAuthenticationDetailsProvider(String profile) throws IOException
Creates a new instance using the config file at the default location, see ConfigFileReader.DEFAULT_FILE_PATH
.
profile
- profile to load, optionalIOException
- if the configuration file could not be loadedpublic ConfigFileAuthenticationDetailsProvider(String configurationFilePath, String profile) throws IOException
Creates a new instance.
configurationFilePath
- path to the OCI configuration fileprofile
- profile to load, optionalIOException
- if the configuration file could not be loadedpublic ConfigFileAuthenticationDetailsProvider(ConfigFileReader.ConfigFile configFile)
Creates a new instance.
configFile
- The configuration file to use.public static Region getRegionFromConfigFile(ConfigFileReader.ConfigFile configFile)
public String getFingerprint()
AuthenticationDetailsProvider
Returns the fingerprint of the key being used.
getFingerprint
in interface AuthenticationDetailsProvider
public String getTenantId()
AuthenticationDetailsProvider
Returns the tenant OCID.
getTenantId
in interface AuthenticationDetailsProvider
public String getUserId()
AuthenticationDetailsProvider
Returns the user OCID.
getUserId
in interface AuthenticationDetailsProvider
public List<ClientConfigurator> getClientConfigurators()
getClientConfigurators
in interface ProvidesClientConfigurators
@Deprecated public String getPassPhrase()
BasicAuthenticationDetailsProvider
Returns the optional pass phrase for the (encrypted) private key.
getPassPhrase
in interface BasicAuthenticationDetailsProvider
public char[] getPassphraseCharacters()
BasicAuthenticationDetailsProvider
Returns the optional pass phrase for the (encrypted) private key, as a character array.
getPassphraseCharacters
in interface BasicAuthenticationDetailsProvider
public InputStream getPrivateKey()
BasicAuthenticationDetailsProvider
Returns a new InputStream to the private key. This stream should be closed by the caller, implementations should return new streams each time.
getPrivateKey
in interface BasicAuthenticationDetailsProvider
public String getKeyId()
BasicAuthenticationDetailsProvider
Returns the keyId used to sign requests.
getKeyId
in interface BasicAuthenticationDetailsProvider
public Region getRegion()
RegionProvider
Returns the region.
getRegion
in interface RegionProvider
public String getPemFilePath()
Returns the file path to the private key.
Copyright © 2016–2024. All rights reserved.