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

akka.stream.alpakka.s3.auth.AWSCredentials.scala Maven / Gradle / Ivy

Go to download

Alpakka is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Akka.

There is a newer version: 2.0.2
Show newest version
/*
 * Copyright (C) 2016-2018 Lightbend Inc. 
 */

package akka.stream.alpakka.s3.auth

import com.amazonaws.auth
import com.amazonaws.auth.{BasicAWSCredentials, BasicSessionCredentials}

@deprecated("use com.amazonaws.auth.* entities", "0.11")
sealed trait AWSCredentials {
  def accessKeyId: String
  def secretAccessKey: String

  def toAmazonCredentials(): auth.AWSCredentials =
    this match {
      case BasicCredentials(ak, sk) ⇒
        new BasicAWSCredentials(ak, sk)
      case AWSSessionCredentials(ak, sk, tok) ⇒
        new BasicSessionCredentials(ak, sk, tok)
    }
}

@deprecated("use com.amazonaws.auth.* entities", "0.11")
final case class BasicCredentials(accessKeyId: String, secretAccessKey: String) extends AWSCredentials

@deprecated("use com.amazonaws.auth.* entities", "0.11")
final case class AWSSessionCredentials(accessKeyId: String, secretAccessKey: String, sessionToken: String)
    extends AWSCredentials

object AWSCredentials {
  @deprecated("use com.amazonaws.auth.* entities", "0.11")
  def apply(accessKeyId: String, secretAccessKey: String): BasicCredentials =
    BasicCredentials(accessKeyId, secretAccessKey)

  @deprecated("use com.amazonaws.auth.* entities", "0.11")
  def create(accessKeyId: String, secretAccessKey: String): BasicCredentials =
    apply(accessKeyId, secretAccessKey)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy