All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.shiftforward.apso.aws.ConfigCredentialsProvider.scala Maven / Gradle / Ivy

There is a newer version: 0.13.11
Show newest version
package eu.shiftforward.apso.aws

import com.amazonaws.auth._
import com.typesafe.config.{ Config, ConfigFactory }

/**
 * AWS credentials provider that retrieves credentials from a typesafe configuration.
 * @param config the typesafe configuration
 * @param accessKeyPath the path in the configuration that contains the access key
 * @param secretKeyPath the path in the configuration that contains the secret key
 */
case class ConfigCredentialsProvider(
  config: Config = ConfigFactory.load(),
  accessKeyPath: String = "aws.access-key",
  secretKeyPath: String = "aws.secret-key")
    extends AWSCredentialsProvider {

  def getCredentials: AWSCredentials =
    new BasicAWSCredentials(
      config.getString(accessKeyPath),
      config.getString(secretKeyPath))

  def refresh() {}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy