Interface FederationRequestHandler

    • Method Detail

      • getCachableSecretsManager

        CachableSecretsManager getCachableSecretsManager()
        Gets the CachableSecretsManager instance used by this handler. Implementations must provide access to their secrets manager instance.
        Returns:
        The CachableSecretsManager instance
      • getKmsEncryptionProvider

        KmsEncryptionProvider getKmsEncryptionProvider()
        Gets the KmsEncryptionProvider instance used by this handler. Implementations must provide access to their KMS encryption provider instance.
        Returns:
        The KmsEncryptionProvider instance
      • resolveSecrets

        default String resolveSecrets​(String rawString)
        Resolves any secrets found in the supplied string, for example: MyString${WithSecret} would have ${WithSecret} replaced by the corresponding value of the secret in AWS Secrets Manager with that name. If no such secret is found the function throws.
        Parameters:
        rawString - The string in which you'd like to replace SecretsManager placeholders. (e.g. ThisIsA${Secret}Here - The ${Secret} would be replaced with the contents of a SecretsManager secret called Secret. If no such secret is found, the function throws. If no ${} are found in the input string, nothing is replaced and the original string is returned.
        Returns:
        The processed string with secrets resolved
      • resolveWithDefaultCredentials

        default String resolveWithDefaultCredentials​(String rawString)
        Resolves secrets with default credentials format (username:password).
        Parameters:
        rawString - The string containing secret placeholders to resolve
        Returns:
        The processed string with secrets resolved in default credentials format
      • getSecret

        default String getSecret​(String secretName)
        Retrieves a secret from AWS Secrets Manager.
        Parameters:
        secretName - The name of the secret to retrieve
        Returns:
        The secret value
      • getSecret

        default String getSecret​(String secretName,
                                 software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration requestOverrideConfiguration)
        Retrieves a secret from AWS Secrets Manager with request override configuration.
        Parameters:
        secretName - The name of the secret to retrieve
        requestOverrideConfiguration - AWS request override configuration for federated requests
        Returns:
        The secret value
      • getSessionCredentials

        default software.amazon.awssdk.auth.credentials.AwsCredentials getSessionCredentials​(String kmsKeyId,
                                                                                             String tokenString,
                                                                                             KmsEncryptionProvider kmsEncryptionProvider)
      • getRequestOverrideConfig

        default software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration getRequestOverrideConfig​(FederationRequest request)
        Gets the AWS request override configuration for a FederationRequest. This method extracts the configuration options from the federated identity and delegates to the Map-based overload.
        Parameters:
        request - The federation request
        Returns:
        The AWS request override configuration, or null if not a federated request
      • getRequestOverrideConfig

        default software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration getRequestOverrideConfig​(Map<String,​String> configOptions)
        Gets the AWS request override configuration for the given config options. This is a convenience method that delegates to the full overload using the handler's KMS encryption provider.
        Parameters:
        configOptions - The configuration options map
        Returns:
        The AWS request override configuration, or null if not applicable
      • getRequestOverrideConfig

        default software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration getRequestOverrideConfig​(Map<String,​String> configOptions,
                                                                                                        KmsEncryptionProvider kmsEncryptionProvider)
      • getS3Client

        default software.amazon.awssdk.services.s3.S3Client getS3Client​(software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration awsRequestOverrideConfiguration,
                                                                        software.amazon.awssdk.services.s3.S3Client defaultS3)
      • getAthenaClient

        default software.amazon.awssdk.services.athena.AthenaClient getAthenaClient​(software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration awsRequestOverrideConfiguration,
                                                                                    software.amazon.awssdk.services.athena.AthenaClient defaultAthena)
      • getCredentialProvider

        default CredentialsProvider getCredentialProvider​(software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration requestOverrideConfiguration)
        Gets a credentials provider for database connections with optional request override configuration. This method checks if a secret name is configured and creates a credentials provider if available. Subclasses can override createCredentialsProvider() to provide custom credential provider implementations.
        Parameters:
        requestOverrideConfiguration - Optional AWS request override configuration for federated requests
        Returns:
        CredentialsProvider instance or null if no secret is configured
      • createCredentialsProvider

        default CredentialsProvider createCredentialsProvider​(String secretName,
                                                              software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration requestOverrideConfiguration)
        Factory method to create CredentialsProvider. Subclasses can override this to provide custom credential provider implementations (e.g., SnowflakeCredentialsProvider).
        Parameters:
        secretName - The secret name to retrieve credentials from
        requestOverrideConfiguration - Optional AWS request override configuration
        Returns:
        CredentialsProvider instance
      • getDatabaseConnectionSecret

        default String getDatabaseConnectionSecret()
        Gets the database connection secret name. Subclasses that use database credentials should override this method to provide the secret name from their configuration.
        Returns:
        The secret name, or null if not applicable