Giter Site home page Giter Site logo

watchtower_server's Introduction

JWT Authentication in Rust using Axum Framework

Are you interested in building a secure authentication system for your Rust web application? Look no further than the Axum framework and JSON Web Tokens (JWTs)! Axum is a fast and scalable Rust web framework that provides a reliable and efficient platform for developing microservices and APIs.

JWT Authentication in Rust using Axum Framework

Topics Covered

  • Set Up and Test the Rust Axum JWT Authentication Project
  • Setup the Rust Axum Project
  • Setup the PostgreSQL and pgAdmin Servers
  • Load the Environment Variables
  • Create and Push the Database Migrations
  • Connect the App to the PostgreSQL Database
  • Define the SQLX Database Model
  • Define the Response Structures
  • Create the Axum JWT Authentication Middleware
  • Implement the JWT Authentication in Axum
    • Axum User Registration Handler
    • Axum User Login Handler
    • Axum User Logout Handler
    • Axum Handler to Fetch Logged-in User
    • The Complete Code for the Axum Handlers
  • Create the API Routes
  • Register the API Router and Setup CORS
  • Conclusion

Read the entire article here: https://codevoweb.com/jwt-authentication-in-rust-using-axum-framework/

watchtower_server's People

Contributors

marchand-nicolas avatar th0rgal avatar

Watchers

 avatar

watchtower_server's Issues

Fix watchtower db backup

Error
Error while saving db: 2023-11-01T08:57:35.598+0000 Failed: can't create session: failed to connect to mongodb://quests:[email protected]/?retryWrites=true&w=majority: connection() error occurred during connection handshake: auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-1": (AuthenticationFailed) Authentication failed.

Build initial Watchtower Server

See https://app.skiff.com/file/cab5aed0-f072-4e18-9754-393e9937f498

The Watchtower Server is built using Rust and Axum. It plays a key role in log management and spotting potential issues in real-time. It consists of two main sections:

Services Interface: This part collects logs from different StarknetID services. it is gated by a jwt token, generated by a user (via a user jwt).

User Interface: This part lets users view logs. Like the services interface, it is also gated by a jwt token, generated via a password from the config.

The server works alongside a MongoDB database and a web app built with Next.js to keep StarknetID's systems running smoothly.

In the future, new features like automatic backups for databases could be nice.

https://github.com/starknet-id/quest_server can be used as inspiration for writing a HTTP server in rust

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.