endpoints.documented.openapi.BasicAuthentication.scala Maven / Gradle / Ivy
package endpoints
package documented
package openapi
import endpoints.algebra.BasicAuthentication.Credentials
/**
* Interpreter for [[algebra.BasicAuthentication]] that produces
* OpenAPI documentation.
*/
trait BasicAuthentication
extends algebra.BasicAuthentication
with Endpoints {
private[endpoints] def basicAuthentication: RequestHeaders[Credentials] =
DocumentedHeaders("Authorization" :: Nil)
private[endpoints] def authenticated[A](response: Response[A], documentation: String): Response[Option[A]] =
DocumentedResponse(401, documentation, content = Map.empty) :: response
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy