Class CdpProfileCredentialsProvider

  • All Implemented Interfaces:
    CdpCredentialsProvider

    public class CdpProfileCredentialsProvider
    extends Object
    implements 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 Detail

      • CDP_DEFAULT_PROFILE

        public static final String 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:
        Constant Field Values
      • CDP_DEFAULT_PROFILE_NAME

        public static final String CDP_DEFAULT_PROFILE_NAME
        Name of the profile in the users credentials file to read.
        See Also:
        Constant Field Values
    • Constructor Detail

      • 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

        public CdpProfileCredentialsProvider​(@Nullable
                                             String profileName)
        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

        public CdpProfileCredentialsProvider​(String profileFilePath,
                                             @Nullable
                                             String profileName)
        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 file
        profileName - profile name to use, "default" is used if null
    • Method Detail

      • getCredentials

        public CdpCredentials 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 interface CdpCredentialsProvider
        Returns:
        CdpCredentials which the caller can use to authenticate an CDP request.