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

templates.kotlin-micronaut.client.auth.configuration.HttpBasicAuthConfiguration.mustache Maven / Gradle / Ivy

{{>common/licenseInfo}}
package {{invokerPackage}}.auth.configuration

import io.micronaut.context.annotation.ConfigurationInject
import io.micronaut.context.annotation.EachProperty
import io.micronaut.context.annotation.Parameter
import io.micronaut.core.annotation.NonNull
import io.micronaut.http.MutableHttpRequest
{{#generatedAnnotation}}
import {{javaxPackage}}.annotation.Generated
{{/generatedAnnotation}}

{{#generatedAnnotation}}
{{>common/generatedAnnotation}}
{{/generatedAnnotation}}
@EachProperty("security.basic-auth")
data class HttpBasicAuthConfiguration(
    @Parameter override val name: String,
    @NonNull var username: String,
    @NonNull var password: String
) : ConfigurableAuthorization {

    override fun applyAuthorization(@NonNull request: MutableHttpRequest<*>) {
        request.basicAuth(username, password)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy