{"id":19227416,"url":"https://github.com/akshitvadodariya1201/jwt_auth","last_synced_at":"2025-07-29T07:07:07.432Z","repository":{"id":249809703,"uuid":"832525249","full_name":"AkshitVadodariya1201/jwt_auth","owner":"AkshitVadodariya1201","description":"This repository contains a Rust-based web service that utilizes JSON Web Tokens (JWT) for authentication.","archived":false,"fork":false,"pushed_at":"2024-07-23T10:10:59.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-04T22:20:04.294Z","etag":null,"topics":["api","cargo","jwt-authentication","jwt-token","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AkshitVadodariya1201.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-23T07:45:24.000Z","updated_at":"2024-07-23T10:53:40.000Z","dependencies_parsed_at":"2024-07-23T13:57:00.947Z","dependency_job_id":"e8eebd66-93a6-4912-8b70-4a3bdde7a879","html_url":"https://github.com/AkshitVadodariya1201/jwt_auth","commit_stats":null,"previous_names":["akshitvadodariya1201/jwt_auth"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkshitVadodariya1201%2Fjwt_auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkshitVadodariya1201%2Fjwt_auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkshitVadodariya1201%2Fjwt_auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkshitVadodariya1201%2Fjwt_auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AkshitVadodariya1201","download_url":"https://codeload.github.com/AkshitVadodariya1201/jwt_auth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240301261,"owners_count":19779788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","cargo","jwt-authentication","jwt-token","rust"],"created_at":"2024-11-09T15:23:12.371Z","updated_at":"2025-02-23T10:25:47.418Z","avatar_url":"https://github.com/AkshitVadodariya1201.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JWT Authentication Service\n\nThis repository contains a Rust-based web service that utilizes JSON Web Tokens (JWT) for authentication. The service is built using the Axum framework for creating web applications with Rust. It demonstrates a simple login system where users can log in to receive a JWT token and then use this token to access protected routes.\n\n## Features\n\n- **User Authentication**: Implements a basic user authentication flow where users can log in using their credentials to receive a JWT token.\n- **Protected Routes**: Includes examples of protected routes that require a valid JWT token to access.\n- **JWT Token Management**: Utilizes the `jsonwebtoken` crate for encoding and decoding JWT tokens, ensuring secure token management.\n\n## Dependencies\n\nThe project relies on several key Rust crates:\n\n- `tokio`: An asynchronous runtime for Rust, used as the foundation for running the web server and handling asynchronous operations.\n- `jsonwebtoken`: A crate for encoding and decoding JWT tokens, providing the core functionality for token management.\n- `axum`: A web application framework built on top of Hyper, providing routing and request handling.\n- `serde` and `serde_json`: Serialization and deserialization libraries for converting Rust structs to JSON and vice versa.\n- `chrono`: A date and time library for Rust, used for handling time-based operations in JWT tokens.\n\n## Project Structure\n\n- `src/main.rs`: The entry point of the application, setting up the web server and routes.\n- `src/controler.rs`: Contains the route handlers, including the login handler and a handler for retrieving protected information.\n- `src/model.rs`: Defines the data models used in the application, including structures for login information and responses.\n\n## Getting Started\n\nTo run the project, ensure you have Rust and Cargo installed. Then, navigate to the project directory and run:\n\n```sh\ncargo run\n```\n\nThis will start the web server on `http://localhost:3000`. You can then use tools like `curl` or Postman or Hoppscotch to interact with the service.\n\n### Routes\n\n- `POST /login`: Logs in a user and returns a JWT token.\n- `GET /get_info`: Returns protected information that requires a valid JWT token.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshitvadodariya1201%2Fjwt_auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakshitvadodariya1201%2Fjwt_auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshitvadodariya1201%2Fjwt_auth/lists"}