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

commonMain.aws.sdk.kotlin.runtime.auth.credentials.internal.ManagedCredentialsProvider.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */
package aws.sdk.kotlin.runtime.auth.credentials.internal

import aws.sdk.kotlin.runtime.InternalSdkApi
import aws.smithy.kotlin.runtime.auth.awscredentials.CloseableCredentialsProvider
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider
import aws.smithy.kotlin.runtime.io.SdkManagedCloseable

private class ManagedCredentialsProvider(
    private val delegate: CloseableCredentialsProvider,
) : SdkManagedCloseable(delegate),
    CloseableCredentialsProvider by delegate

/**
 * Wraps a [CredentialsProvider] for internal runtime management by the SDK.
 */
@InternalSdkApi
public fun CloseableCredentialsProvider.manage(): CredentialsProvider =
    if (this is ManagedCredentialsProvider) this else ManagedCredentialsProvider(this)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy