Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mozilla-iam/dino-park-gate
DinoPark Gate (controlling Dinos since 2019)
https://github.com/mozilla-iam/dino-park-gate
Last synced: about 1 month ago
JSON representation
DinoPark Gate (controlling Dinos since 2019)
- Host: GitHub
- URL: https://github.com/mozilla-iam/dino-park-gate
- Owner: mozilla-iam
- License: mit
- Created: 2019-03-30T13:50:31.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-17T21:11:06.000Z (about 1 year ago)
- Last Synced: 2023-12-18T04:55:45.225Z (about 1 year ago)
- Language: Rust
- Size: 120 KB
- Stars: 0
- Watchers: 10
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# DinoPark Gate (controlling Dinos since 2019)
[![Build Status](https://travis-ci.org/mozilla-iam/dino-park-gate.svg?branch=master)](https://travis-ci.org/mozilla-iam/dino-park-gate)## A basic authentication middleware for [actix-web](https://actix.rs/)
```rust
use actix_web::{web, App, HttpRequest, HttpServer, Responder};
use dino_park_gate::provider::Provider;
use dino_park_gate::simple::SimpleAuth;async fn root(_: HttpRequest) -> impl Responder {
"Authorized!"
}#[actix_rt::main]
async fn main() -> std::io::Result<()> {
let provider = Provider::from_issuer("https://auth.mozilla.auth0.com/")
.await
.unwrap();
HttpServer::new(move || {
let auth = SimpleAuth {
checker: provider.clone(),
validation_options: Default::default(),
};
App::new().wrap(auth).service(web::resource("/").to(root))
})
.workers(1)
.bind("127.0.0.1:8000")?
.run()
.await
}
```