https://github.com/technetos/hedgehog
an oauth2 provider for tide apps
https://github.com/technetos/hedgehog
postgres rust tide-web-framework
Last synced: 2 months ago
JSON representation
an oauth2 provider for tide apps
- Host: GitHub
- URL: https://github.com/technetos/hedgehog
- Owner: technetos
- License: apache-2.0
- Created: 2019-04-14T19:23:51.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-15T17:05:29.000Z (about 7 years ago)
- Last Synced: 2024-12-29T05:44:02.119Z (over 1 year ago)
- Topics: postgres, rust, tide-web-framework
- Language: Rust
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hedgehog
HedgeHog is bearer authentication provider for Tide web applications.
## Usage
```
async fn protected_echo_path(cx: Context<()>) -> EndpointResult {
cx.hedgehog().protect()?;
let path: String = cx.param("path")?;
Ok(format!("Your path is: {}", path))
}
fn main() {
let mut app = tide::App::new(());
app.at("/echo_path/:path").get(echo_path);
app.serve("127.0.0.1:8000").unwrap();
}
```
## Hedgehog API
In Tide you can implement traits for the Context type to add functionality to
it. The hedgehog API is made available through the `.hedgehog()` method on the
Context type.