{"id":13440203,"url":"https://github.com/GildedHonour/frank_jwt","last_synced_at":"2025-03-20T09:32:28.242Z","repository":{"id":22219088,"uuid":"25551888","full_name":"GildedHonour/frank_jwt","owner":"GildedHonour","description":"JSON Web Token implementation in Rust.","archived":false,"fork":false,"pushed_at":"2023-11-24T14:06:15.000Z","size":186,"stargazers_count":252,"open_issues_count":0,"forks_count":47,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-11T15:22:06.348Z","etag":null,"topics":["auth0-jwt","authentication","cryptography","jwt","jwt-token","rust"],"latest_commit_sha":null,"homepage":"https://jwt.io","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GildedHonour.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}},"created_at":"2014-10-21T23:45:01.000Z","updated_at":"2025-02-07T10:26:14.000Z","dependencies_parsed_at":"2024-01-08T14:30:36.062Z","dependency_job_id":"e77dff8e-0ccd-45dc-94c3-02924fbcfb89","html_url":"https://github.com/GildedHonour/frank_jwt","commit_stats":{"total_commits":144,"total_committers":19,"mean_commits":7.578947368421052,"dds":"0.22916666666666663","last_synced_commit":"876e22cc8f830bcffcf0925e13ba5daeea416792"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GildedHonour%2Ffrank_jwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GildedHonour%2Ffrank_jwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GildedHonour%2Ffrank_jwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GildedHonour%2Ffrank_jwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GildedHonour","download_url":"https://codeload.github.com/GildedHonour/frank_jwt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244257252,"owners_count":20424131,"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":["auth0-jwt","authentication","cryptography","jwt","jwt-token","rust"],"created_at":"2024-07-31T03:01:20.649Z","updated_at":"2025-03-20T09:32:28.225Z","avatar_url":"https://github.com/GildedHonour.png","language":"Rust","funding_links":[],"categories":["Libraries","库 Libraries","Rust","库"],"sub_categories":["Web programming","网络编程 Web programming","网页编程","web编程 Web programming","Rust"],"readme":"Frank JWT [![Build Status](https://travis-ci.org/GildedHonour/frank_jwt.svg)](https://travis-ci.org/GildedHonour/frank_jwt) [![crates.io](https://img.shields.io/crates/v/frank_jwt.svg)](https://crates.io/crates/frank_jwt)\n================================================\n\nImplementation of [JSON Web Tokens](https://jwt.io) in Rust.\n\n## Algorithms and features supported\n- [x] HS256\n- [x] HS384\n- [x] HS512\n- [x] RS256\n- [x] RS384\n- [x] RS512\n- [x] ES256\n- [x] ES384\n- [x] ES512\n- [x] Sign\n- [x] Verify\n- [ ] iss (issuer) check\n- [ ] sub (subject) check\n- [ ] aud (audience) check\n- [x] exp (expiration time) check\n- [ ] nbf (not before time) check\n- [ ] iat (issued at) check\n- [ ] jti (JWT id) check\n\n## Usage\n\nPut this into your `Cargo.toml`:\n\n```toml\n[dependencies]\nfrank_jwt = \"\u003ccurrent version of frank_jwt\u003e\"\n```\n\nAnd this in your crate root:\n\n```rust\nextern crate frank_jwt;\n#[macro_use] extern crate serde_json;\n\n\nuse frank_jwt::{Algorithm, encode, decode};\n```\n\n## Example\n\n```rust\n//HS256\nlet mut payload = json!({\n    \"key1\": \"val1\",\n    \"key2\": \"val2\"\n});\n\nlet mut header = json!({});\nlet secret = \"secret123\";\nlet jwt = encode(\u0026header, secret.to_string(), \u0026payload, Algorithm::HS256);\n\n//RS256\nuse std::env;\n\nlet mut payload = json!({\n    \"key1\": \"val1\",\n    \"key2\": \"val2\"\n});\n\nlet mut header = json!({});\nlet mut keypath = env::current_dir().unwrap();\nkeypath.push(\"some_folder\");\nkeypath.push(\"my_rsa_2048_key.pem\");\nlet jwt = encode(\u0026header, \u0026keypath.to_path_buf(), \u0026payload, Algorithm::RS256);\nlet (header, payload) = decode(\u0026jwt, \u0026keypath.to_path_buf(), Algorithm::RS256, \u0026ValidationOptions::default());\n```\n\n## Validation Options\nThe ValidationOptions structure allows for control over which checks should be preformed when decoding a JWT. Calling new on this will provide a default set of values. There is also a dangerous function that will return validation options that doesn't perform any checking.\n\nThe default values are:\n\n* Perform expiry check\n* Allow 0 leeway for the expiry check.\n\nIt's worth noting that if the expiry check is requested and an exp claim is not within the JWT the check will fail validation.\n\n## License\n\nApache 2.0\n\n## Tests\n\n```shell\ncargo test\n```\n\n\n## Contributors\n\nTODO\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGildedHonour%2Ffrank_jwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGildedHonour%2Ffrank_jwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGildedHonour%2Ffrank_jwt/lists"}