Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/markcda/cc-auth
Simple backend authorization system
https://github.com/markcda/cc-auth
authentication-middleware redis
Last synced: about 1 month ago
JSON representation
Simple backend authorization system
- Host: GitHub
- URL: https://github.com/markcda/cc-auth
- Owner: markcda
- License: mit
- Created: 2024-06-04T17:07:05.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-06-21T17:58:33.000Z (7 months ago)
- Last Synced: 2024-11-23T17:51:53.532Z (about 2 months ago)
- Topics: authentication-middleware, redis
- Language: Rust
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cc-auth
[![crates.io][crates-badge]][crates-url]
[![MIT licensed][mit-badge]][mit-url]
[![docs.rs][docs-badge]][docs-url][crates-badge]: https://img.shields.io/crates/v/cc-auth.svg
[crates-url]: https://crates.io/crates/cc-auth
[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg
[mit-url]: https://github.com/tokio-rs/tokio/blob/master/LICENSE
[docs-badge]: https://img.shields.io/docsrs/cc-auth
[docs-url]: https://docs.rs/cc-authSimple backend authorization system.
## Simple usage example
```rust
use bb8_redis::{RedisConnectionManager, bb8::Pool};
use cc_auth::{ApiToken, check_token};
use cc_utils::prelude::MResult;pub async fn authorized_action(
cacher: &Pool,
token: ApiToken,
) -> MResult<()> {
let user_id = check_token(&token, cacher).await?;
Ok(())
}
```