Packages
wisp_basic_auth_courtcircuits
1.0.298
Basic HTTP Authentication Scheme for Wisp - just testing gealm export
Current section
Files
Jump to
Current section
Files
wisp_basic_auth_courtcircuits
README.md
README.md
# wisp_basic_auth
[Wisp][wisp] middleware of the [Basic Authentication Scheme][basicaa].
> The basic authentication scheme is a non-secure method of filtering unauthorized access to resources on an HTTP server. It is based on the assumption that the connection between the client and the server can be regarded as a trusted carrier. As this is not generally true on an open network, the basic authentication scheme should be used accordingly.
[](https://hex.pm/packages/wisp_basic_auth)
[](https://hexdocs.pm/wisp_basic_auth/)
```sh
gleam add wisp_basic_auth@1
```
Prepend the middleware in your handler or router:
```gleam
import wisp_basic_auth
const realm = "Secure"
const known_clients = [#("Aladdin", "open sesame")]
pub fn handle_request(request: Request) -> Response {
use request <- validate_basic_auth(realm, known_clients)
wisp.ok()
}
```
Further documentation can be found at <https://hexdocs.pm/wisp_basic_auth>.
## Development
```sh
gleam test
```
[basicaa]: https://www.w3.org/Protocols/HTTP/1.0/spec.html#BasicAA
[wisp]: https://hex.pm/packages/wisp