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

commonMain.aws.sdk.kotlin.services.eventbridge.auth.EventBridgeAuthSchemeProviderAdapter.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.eventbridge.auth

import aws.sdk.kotlin.services.eventbridge.EventBridgeClient
import aws.sdk.kotlin.services.eventbridge.endpoints.internal.resolveEndpointParams
import aws.smithy.kotlin.runtime.auth.AuthOption
import aws.smithy.kotlin.runtime.client.SdkClientOption
import aws.smithy.kotlin.runtime.collections.get
import aws.smithy.kotlin.runtime.http.auth.AnonymousIdentity
import aws.smithy.kotlin.runtime.http.operation.AuthSchemeResolver
import aws.smithy.kotlin.runtime.http.operation.ResolveEndpointRequest
import aws.smithy.kotlin.runtime.http.operation.SdkHttpRequest
import aws.smithy.kotlin.runtime.http.request.immutableView

/**
 * Adapts the service specific auth scheme resolver to the agnostic runtime interface and binds the auth parameters
 */
internal class EventBridgeAuthSchemeProviderAdapter(private val config: EventBridgeClient.Config): AuthSchemeResolver {
    override suspend fun resolve(request: SdkHttpRequest): List {
        val params = EventBridgeAuthSchemeParameters {
            operationName = request.context[SdkClientOption.OperationName]
            val resolveEndpointReq = ResolveEndpointRequest(request.context, request.subject.immutableView(), AnonymousIdentity)
            endpointParameters = resolveEndpointParams(config, resolveEndpointReq)
        }
        return config.authSchemeProvider.resolveAuthScheme(params)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy