Authentication and authorization service, written in Rust

Overview

auth-rs

GitHub top language GitHub GitHub release (with filter) Test

auth-rs provides a simple authentication and authorization service for use in other services. The service is written in Rust and uses the actix-web framework.

Users, when authenticated, will be given a JWT token which can be used to access other services.

A React-based frontend for auth-rs is also available here.

Table of Contents

Features

  • Authentication
  • Authorization
  • Audit trail
  • Password hashing
  • JWT generation
  • JWT verification
  • Pagination
  • OpenAPI / Swagger UI
  • CORS support
  • Docker support
  • MongoDB integration
  • MongoDB Atlas integration

Usage

Development

  1. Clone the repository
  2. Copy .env.example to .env in the root of the project and fill in / adjust the values
  3. Execute cargo run to start the service

Docker

You can execute auth-rs using Docker:

docker run -d -p 8080:8080 --env-file .env opserva/auth-rs

Configuration

auth-rs can be configured using environment variables to fit your environment and requirements.

For more information about the environment variables, see the Configuration documentation.

API

auth-rs exposes a REST API that can be used to interact with the service using Create, Read, Update and Delete (CRUD) requests. Other (micro)services can use this API to authenticate and authorize users (and generate and verify JWT tokens).

See the full API documentation for more information.

Building

In order to build auth-rs, you will need to have Rust installed. You can install Rust by following the instructions here.

cargo

You can build auth-rs using cargo:

cargo build

You can build an optimized release version of auth-rs using cargo:

cargo build --release

Docker

You can build a docker image of auth-rs using the provided Dockerfile:

docker build -t auth-rs .

Dependencies

A couple of dependencies are required in order to build auth-rs:

About

This library is maintained by CodeDead. You can find more about us using the following links:

Copyright © 2023 CodeDead

You might also like...
A web-based streaming service with improved privacy, performance, and simplicity.

Majiix Majiix is a web-based open-source streaming service. The backend that handles the core streaming logic is written in Rust and makes use of cutt

Bracket QOS - a Quality of Service/Experience server system writtin in Rust. Derived from the excellent LibreQOS Project.

Bracket QOS - Open Source Edition This project is based on the excellent LibreQOS project. It is hoped that this can be useful for the upstream projec

Service-Oriented Design Patterns for Rust

SOD: Service-Oriented Design Overview This crate provides Service, MutService, and AsyncService traits and associated utilities to facilitiate service

policy-driven signing service

SigningService (maybe we'll have a more clever name one day!) What is this? This repo has a little "serverless" (runs on lambda and some other service

📸 website screenshots as a service
📸 website screenshots as a service

website-screenshot 📸 website screenshots as a service Features 💫 powered by Rust 🚀 blazing fast 👮 ‍‍ built-in ratelimiter 👜 built-in storage prov

Plex webhook service to automatically update your Anilist watching list.

anifunnel Plex webhook service to automatically update your Anilist watching list. Description anifunnel is a web server that will consume incoming Pl

COCONUT Secure VM Service Module

This is the source code repository for the COCONUT Secure VM Service Module (SVSM), a software which aims to provide secure services and device emulations to guest operating systems in confidential virtual machines (CVMs). It requires AMD Secure Encrypted Virtualization with Secure Nested Paging (AMD SEV-SNP), especially the VM Privilege Level (VMPL) feature.

A monitor (service) for your monitor (display). Intercepts window behaviour when monitor configuration changes.

Mon-Mon A monitor (service) for your monitor (display). Listens for changes to display configuration (e.g. plugging in an additional screen) and allow

A reconciliation service to sync a key-value map over multiple instances.

reconcile-rs Docs This crate provides a key-data map structure HRTree that can be used together with the reconciliation Service. Different instances c

Releases(v0.2.0)
  • v0.2.0(Aug 21, 2023)

    What's Changed

    • Refactored password hashing code, made email optional field, dependen… by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/21
    • Improved error handling, updated docs, dependency upgrades by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/22
    • feat: added pagination by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/23
    • feat: system will no longer create audit log, audit logs will always … by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/24
    • Dependency upgrades by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/25
    • feat: improved security by providing random salt by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/26
    • feat: user first name and last name are optional, removed unused meth… by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/27
    • feat: register audits for account registrations by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/28
    • feat: added ability to configure TTL index for audit documents by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/29
    • feat: dependency upgrades, updated readme by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/30

    Full Changelog: https://github.com/Opserva-io/auth-rs/compare/v0.1.0...v0.2.0

    Source code(tar.gz)
    Source code(zip)
    auth-rs-linux(18.26 MB)
    auth-rs-macos(17.10 MB)
    auth-rs.exe(17.05 MB)
  • v0.1.0(Aug 8, 2023)

    What's Changed

    • Added fancy images by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/1
    • feat: Added more documentation by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/2
    • feat: refactoring, added ability to search for users, roles and permi… by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/3
    • feat: added more documentation by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/4
    • Dependency upgrades by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/5
    • Added ability to register users by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/6
    • Feature/documentation by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/7
    • Added docs about searching by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/8
    • Added a release work flow by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/9
    • Release/v0.1.0 by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/10
    • feat: scope under api/v1, improved docs by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/11
    • feat: added endpoint to delete own user by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/12
    • Added health endpoint by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/13
    • Feature/openapi by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/14
    • Added ability to update own user, fixed some routes by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/15
    • Feature/audit trail by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/16
    • Feature/audit trails improvements by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/17
    • Feature/object-id by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/18
    • feat: refactoring, performance and code improvements by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/19
    • feat: added docker publish step by @CodeDead in https://github.com/Opserva-io/auth-rs/pull/20

    New Contributors

    • @CodeDead made their first contribution in https://github.com/Opserva-io/auth-rs/pull/1

    Full Changelog: https://github.com/Opserva-io/auth-rs/commits/v0.1.0

    Source code(tar.gz)
    Source code(zip)
    auth-rs-linux(18.35 MB)
    auth-rs-macos(17.21 MB)
    auth-rs.exe(17.13 MB)
Owner
OpServa
OpServa
Galileo OSNMA (Open Service Navigation Message Authentication)

galileo-osnma galileo-osnma is a Rust implementation of the Galileo OSNMA (Open Service Navigation Message Authentication) protocol. This protocol is

Daniel Estévez 26 Nov 25, 2022
A strong, compile-time enforced authorization framework for rust applications.

DACquiri A compile-time enforced authorization framework for Rust applications. Authorization In typical applications, authorization checks are perfor

resync 247 Dec 20, 2022
Infino - Fast and scalable service to store time series and logs - written in Rust

Infino 〽️ ?? — ?? ?? — ⚖️ ?? Ingest Metrics and Logs — Query and Insights — Scale and Save $$ Infino is an observability platform for storing metrics

null 6 Apr 23, 2023
Authentication workaround for N-Central Report Manager

reportlinkfix Authentication workaround for N-Central Report Manager. Takes the link that N-Central creates for Report Manager and outputs a working l

501 Commons 1 Jan 31, 2022
This PAM module provides ssh-agent based authentication

PAM-RSSH This PAM module provides ssh-agent based authentication. The primary design goal is to avoid typing password when you sudo on remote servers.

Yuxiang Zhang 21 Dec 14, 2022
Command-line OAuth2 authentication daemon

pizauth: a background OAuth2 token requester pizauth is a simple program for obtaining, handing out, and refreshing OAuth2 access tokens. pizauth is f

Laurence Tratt 15 Dec 8, 2022
Backend service to build customer facing dashboards 10x faster. Written in Rust.

Frolic is an open source backend service (written in Rust) to build customer facing dashboards 10x faster. You can directly connect your database to t

Frolic 82 Aug 7, 2023
Conference Monitoring Project based on Image Recognition that uses Rust Language and AWS Rekognition service to get the level of image similarity.

Conference Monitoring System based on Image Recognition in Rust This is a Conference Monitoring Project based on Image Recognition that uses Rust Lang

Pankaj Chaudhary 6 Dec 18, 2022
By mirroring traffic to and from your machine, mirrord surrounds your local service with a mirror image of its cloud environment.

mirrord lets you easily mirror traffic from your Kubernetes cluster to your development environment. It comes as both Visual Studio Code extension and

MetalBear 2.1k Jan 3, 2023
Safer Nostr is a service that helps protect users by loading sensitive information (IP leak) and using AI to prevent inappropriate images from being uploaded.

Safer Nostr is a service that helps protect users by loading sensitive information (IP leak) and using AI to prevent inappropriate images from being uploaded. It also offers image optimization and storage options. It has configurable privacy and storage settings, as well as custom cache expiration.

Thomas 4 Dec 29, 2022