Class CdpProfileCredentialsProvider
java.lang.Object
com.cloudera.cdp.authentication.credentials.CdpProfileCredentialsProvider
- All Implemented Interfaces:
CdpCredentialsProvider
Credentials provider based on CDP configuration profiles. This provider
reads credentials from the profile configuration file for the default
profile, or for a specific, named profile.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionUses the default CDP location (~/.cdp/credentials) and default profile name.CdpProfileCredentialsProvider
(String profileName) Uses the default CDP location (~/.cdp/credentials) and input profile name, or the default if the input profile name is null.CdpProfileCredentialsProvider
(String profileFilePath, String profileName) Uses the input profile file path and input profile name, or the default if the input profile name is null. -
Method Summary
Modifier and TypeMethodDescriptionReturns CdpCredentials which the caller can use to authenticate a CDP request.
-
Field Details
-
CDP_DEFAULT_PROFILE
Name of system environment variable holding the name of profile to use when reading the credentials file. Overrides CDP_DEFAULT_PROFILE_NAME.- See Also:
-
CDP_DEFAULT_PROFILE_NAME
Name of the profile in the users credentials file to read.- See Also:
-
-
Constructor Details
-
CdpProfileCredentialsProvider
public CdpProfileCredentialsProvider()Uses the default CDP location (~/.cdp/credentials) and default profile name. Loading of the credential file is deferred until getCredentials() method is called -
CdpProfileCredentialsProvider
Uses the default CDP location (~/.cdp/credentials) and input profile name, or the default if the input profile name is null. Loading of the credential file is deferred until getCredentials() method is called.- Parameters:
profileName
- profile name to use, "default" is used if null
-
CdpProfileCredentialsProvider
Uses the input profile file path and input profile name, or the default if the input profile name is null. Loading of credential file is deferred until getCredentials() method is called.- Parameters:
profileFilePath
- path to the credentials fileprofileName
- profile name to use, "default" is used if null
-
-
Method Details
-
getCredentials
Description copied from interface:CdpCredentialsProvider
Returns CdpCredentials which the caller can use to authenticate a CDP request. Each implementation of CdpCredentialsProvider can chose its own strategy for loading credentials. For example, an implementation might load credentials from an existing key management system, or load new credentials when credentials are rotated.- Specified by:
getCredentials
in interfaceCdpCredentialsProvider
- Returns:
- CdpCredentials which the caller can use to authenticate an CDP request.
-