llnut / authorization-server

Authorization Server with Rust using Tonic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

authorization-server

Authorization Server with Rust using Tonic.

Function implemented

  • User registration and profile store
  • Change password
  • Login
  • Token authentication
  • Get and automatically refreshes Token

Usage

  • Install the Diesel CLI tool
cargo install diesel_cli --no-default-features --features mysql
  • Make sure your .env file already exists and that DATABASE_URL is set
echo DATABASE_URL=mysql://username:password@localhost/authorization_server > .env
  • Create database and run migration
diesel setup
  • Run server
cargo run --bin server
  • Run client
cargo run --bin client

Crates Used

  • tonic // A gRPC over HTTP/2 implementation focused on high performance, interoperability, and flexibility.
  • tonic-build // Codegen module of tonic gRPC implementation.
  • tokio // An event-driven, non-blocking I/O platform for writing asynchronous I/O backed applications.
  • rust-argon2 // crate for hashing passwords using the cryptographically-secure Argon2 hashing algorithm.
  • chrono // Date and time library for Rust.
  • diesel // A safe, extensible ORM and Query Builder for PostgreSQL, SQLite, and MySQL.
  • dotenv // A dotenv implementation for Rust.
  • derive_more // Convenience macros to derive tarits easily
  • env_logger // A logging implementation for log which is configured via an environment variable.
  • once_cell // Single assignment cells and lazy values.
  • thiserror // This library provides a convenient derive macro for the standard library's std::error::Error trait.
  • serde // A generic serialization/deserialization framework.
  • serde_json // A JSON serialization file format.
  • config // Layered configuration system for Rust applications.
  • tracing // Application-level tracing for Rust.
  • tracing-subscriber // Utilities for implementing and composing tracing subscribers.
  • rand // Random number generators and other randomness functionality.
  • redis // Redis driver for Rust.
  • jsonwebtoken // Create and decode JWTs in a strongly typed way.
  • prost // A Protocol Buffers implementation for the Rust Language.
  • prost-derive // prost-derive handles generating encoding and decoding implementations for Rust types annotated with prost annotation.

TODO

  • Request cache
  • Error stack trace
  • Pg support
  • Middleware
  • etc

About

Authorization Server with Rust using Tonic

License:Apache License 2.0


Languages

Language:Rust 99.3%Language:Shell 0.7%