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

commonMain.aws.sdk.kotlin.services.eventbridge.auth.DefaultEventBridgeAuthSchemeProvider.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.endpoints.EventBridgeEndpointProvider
import aws.smithy.kotlin.runtime.auth.AuthOption
import aws.smithy.kotlin.runtime.client.endpoints.authOptions
import aws.smithy.kotlin.runtime.http.auth.mergeAuthOptions
import aws.smithy.kotlin.runtime.http.auth.sigV4
import aws.smithy.kotlin.runtime.http.auth.sigV4A

public class DefaultEventBridgeAuthSchemeProvider(private val endpointProvider: EventBridgeEndpointProvider? = null) : EventBridgeAuthSchemeProvider {
    private val operationOverrides = mapOf>(
    )
    private val serviceDefaults = listOf(
        sigV4(),
        sigV4A(),
    )
    override suspend fun resolveAuthScheme(params: EventBridgeAuthSchemeParameters): List {
        val modeledAuthOptions = operationOverrides.getOrElse(params.operationName) {
            serviceDefaults
        }

        val endpointParams = params.endpointParameters
        val endpointAuthOptions = if (endpointProvider != null && endpointParams != null) {
            val endpoint = endpointProvider.resolveEndpoint(endpointParams)
            endpoint.authOptions
        } else {
            emptyList()
        }

        return mergeAuthOptions(modeledAuthOptions, endpointAuthOptions)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy