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

org.http4k.connect.amazon.sts.stsExtensions.kt Maven / Gradle / Ivy

There is a newer version: 5.35.2.0
Show newest version
package org.http4k.connect.amazon.sts

import dev.forkhandles.result4k.Result
import java.time.Duration
import kotlin.Long
import kotlin.String
import kotlin.collections.List
import org.http4k.connect.RemoteFailure
import org.http4k.connect.amazon.core.model.ARN
import org.http4k.connect.amazon.core.model.RoleSessionName
import org.http4k.connect.amazon.core.model.Tag
import org.http4k.connect.amazon.core.model.WebIdentityToken
import org.http4k.connect.amazon.sts.action.AssumeRole
import org.http4k.connect.amazon.sts.action.AssumeRoleWithWebIdentity
import org.http4k.connect.amazon.sts.action.AssumedRoleWithWebIdentityResponse
import org.http4k.connect.amazon.sts.action.SimpleAssumedRole
import org.http4k.connect.amazon.sts.model.TokenCode

/**
 * @see org.http4k.connect.amazon.sts.action.AssumeRole
 */
public fun STS.assumeRole(
  RoleArn: ARN,
  RoleSessionName: RoleSessionName,
  TokenCode: TokenCode? = null,
  SerialNumber: Long? = null,
  DurationSeconds: Duration? = null,
  ExternalId: String? = null,
  Policy: String? = null,
  PolicyArns: List? = null,
  Tags: List? = null,
  TransitiveTagKeys: List? = null,
): Result = invoke(AssumeRole(RoleArn, RoleSessionName, TokenCode,
    SerialNumber, DurationSeconds, ExternalId, Policy, PolicyArns, Tags, TransitiveTagKeys))

/**
 * @see org.http4k.connect.amazon.sts.action.AssumeRoleWithWebIdentity
 */
public fun STS.assumeRoleWithWebIdentity(
  RoleArn: ARN,
  RoleSessionName: RoleSessionName,
  WebIdentityToken: WebIdentityToken,
  DurationSeconds: Duration? = null,
  Policy: String? = null,
  PolicyArns: List? = null,
  ProviderId: String? = null,
  Tags: List? = null,
): Result =
    invoke(AssumeRoleWithWebIdentity(RoleArn, RoleSessionName, WebIdentityToken, DurationSeconds,
    Policy, PolicyArns, ProviderId, Tags))




© 2015 - 2024 Weber Informatics LLC | Privacy Policy