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

commonMain.aws.smithy.kotlin.runtime.http.auth.BearerTokenProviderChain.kt Maven / Gradle / Ivy

There is a newer version: 1.3.25
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

package aws.smithy.kotlin.runtime.http.auth

import aws.smithy.kotlin.runtime.collections.Attributes
import aws.smithy.kotlin.runtime.identity.IdentityProviderChain

/**
 * Composite [BearerTokenProvider] that delegates to a chain of providers. When asked for identity, providers
 * are consulted in the order given until one succeeds. If none of the providers in the chain can provide an identity
 * then this class will throw an exception. The exception will include the providers tried in the message. Each
 * individual exception is available as a suppressed exception.
 *
 */
public class BearerTokenProviderChain(vararg providers: BearerTokenProvider) :
    IdentityProviderChain(*providers),
    BearerTokenProvider {

    public constructor(providers: List) : this(*providers.toTypedArray())

    override suspend fun resolve(attributes: Attributes): BearerToken = super.resolve(attributes)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy