Package com.oracle.bmc.auth
Class ConfigFileAuthenticationDetailsProvider
- java.lang.Object
-
- com.oracle.bmc.auth.ConfigFileAuthenticationDetailsProvider
-
- All Implemented Interfaces:
AbstractAuthenticationDetailsProvider
,AuthenticationDetailsProvider
,BasicAuthenticationDetailsProvider
,ProvidesClientConfigurators
,RegionProvider
public class ConfigFileAuthenticationDetailsProvider extends Object implements AuthenticationDetailsProvider, RegionProvider, ProvidesClientConfigurators
Implementation ofAuthenticationDetailsProvider
that uses a standard OCI configuration file as an input.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ConfigFileAuthenticationDetailsProvider.ConfigFileInstancePrincipalAuthenticationDetailsProvider
protected static class
ConfigFileAuthenticationDetailsProvider.ConfigFileResourcePrincipalAuthenticationDetailsProvider
protected static class
ConfigFileAuthenticationDetailsProvider.ConfigFileSimpleAuthenticationDetailsProvider
-
Field Summary
Fields Modifier and Type Field Description protected BasicConfigFileAuthenticationProvider
delegate
-
Constructor Summary
Constructors Constructor Description ConfigFileAuthenticationDetailsProvider(ConfigFileReader.ConfigFile configFile)
Creates a new instance.ConfigFileAuthenticationDetailsProvider(String profile)
Creates a new instance using the config file at the default location, seeConfigFileReader.DEFAULT_FILE_PATH
.ConfigFileAuthenticationDetailsProvider(String configurationFilePath, String profile)
Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method 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()
-
-
-
Field Detail
-
delegate
protected final BasicConfigFileAuthenticationProvider delegate
-
-
Constructor Detail
-
ConfigFileAuthenticationDetailsProvider
public ConfigFileAuthenticationDetailsProvider(String profile) throws IOException
Creates a new instance using the config file at the default location, seeConfigFileReader.DEFAULT_FILE_PATH
.- Parameters:
profile
- profile to load, optional- Throws:
IOException
- if the configuration file could not be loaded
-
ConfigFileAuthenticationDetailsProvider
public ConfigFileAuthenticationDetailsProvider(String configurationFilePath, String profile) throws IOException
Creates a new instance.- Parameters:
configurationFilePath
- path to the OCI configuration fileprofile
- profile to load, optional- Throws:
IOException
- if the configuration file could not be loaded
-
ConfigFileAuthenticationDetailsProvider
public ConfigFileAuthenticationDetailsProvider(ConfigFileReader.ConfigFile configFile)
Creates a new instance.- Parameters:
configFile
- The configuration file to use.
-
-
Method Detail
-
getRegionFromConfigFile
public static Region getRegionFromConfigFile(ConfigFileReader.ConfigFile configFile)
-
getFingerprint
public String getFingerprint()
Description copied from interface:AuthenticationDetailsProvider
Returns the fingerprint of the key being used.- Specified by:
getFingerprint
in interfaceAuthenticationDetailsProvider
- Returns:
- The fingerprint.
-
getTenantId
public String getTenantId()
Description copied from interface:AuthenticationDetailsProvider
Returns the tenant OCID.- Specified by:
getTenantId
in interfaceAuthenticationDetailsProvider
- Returns:
- The tenant OCID.
-
getUserId
public String getUserId()
Description copied from interface:AuthenticationDetailsProvider
Returns the user OCID.- Specified by:
getUserId
in interfaceAuthenticationDetailsProvider
- Returns:
- The user OCID.
-
getClientConfigurators
public List<ClientConfigurator> getClientConfigurators()
- Specified by:
getClientConfigurators
in interfaceProvidesClientConfigurators
-
getPassPhrase
@Deprecated public String getPassPhrase()
Deprecated.Description copied from interface:BasicAuthenticationDetailsProvider
Returns the optional pass phrase for the (encrypted) private key.- Specified by:
getPassPhrase
in interfaceBasicAuthenticationDetailsProvider
- Returns:
- The pass phrase, or null if not applicable
-
getPassphraseCharacters
public char[] getPassphraseCharacters()
Description copied from interface:BasicAuthenticationDetailsProvider
Returns the optional pass phrase for the (encrypted) private key, as a character array.- Specified by:
getPassphraseCharacters
in interfaceBasicAuthenticationDetailsProvider
- Returns:
- The pass phrase as character array, or null if not applicable
-
getPrivateKey
public InputStream getPrivateKey()
Description copied from interface:BasicAuthenticationDetailsProvider
Returns a new InputStream to the private key.This stream should be closed by the caller, implementations should return new streams each time.
- Specified by:
getPrivateKey
in interfaceBasicAuthenticationDetailsProvider
- Returns:
- A new InputStream.
-
getKeyId
public String getKeyId()
Description copied from interface:BasicAuthenticationDetailsProvider
Returns the keyId used to sign requests.- Specified by:
getKeyId
in interfaceBasicAuthenticationDetailsProvider
- Returns:
- The keyId.
-
getRegion
public Region getRegion()
Description copied from interface:RegionProvider
Returns the region.- Specified by:
getRegion
in interfaceRegionProvider
- Returns:
- Region object.
-
getPemFilePath
public String getPemFilePath()
Returns the file path to the private key.- Returns:
- the PEM File Path.
-
-