org.http4k.contract.security.BasicAuthSecurity.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http4k-contract Show documentation
Show all versions of http4k-contract Show documentation
http4k typesafe HTTP contracts and OpenApi support
package org.http4k.contract.security
import org.http4k.core.Credentials
import org.http4k.core.Filter
import org.http4k.filter.ServerFilters
/**
* Checks the presence of basic auth credentials. Filter returns 401 if auth fails.
*/
class BasicAuthSecurity(realm: String, credentials: Credentials, val name: String = "basicAuth") : Security {
override val filter: Filter = ServerFilters.BasicAuth(realm, credentials)
companion object
}