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

endpoints.documented.openapi.BasicAuthentication.scala Maven / Gradle / Ivy

There is a newer version: 0.10.1
Show newest version
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