{"id":21421405,"url":"https://github.com/percival33/rust-jwt-server","last_synced_at":"2025-03-16T20:14:03.604Z","repository":{"id":198572969,"uuid":"701064525","full_name":"Percival33/rust-jwt-server","owner":"Percival33","description":"Rust exploration playground demonstrating JWT authentication using the Warp framework","archived":false,"fork":false,"pushed_at":"2023-10-05T20:53:51.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T06:44:58.183Z","etag":null,"topics":["jwt","rust","warp"],"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/Percival33.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":"2023-10-05T20:53:27.000Z","updated_at":"2024-03-24T00:12:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"366dc97e-0a97-450b-a2f0-8e46bb861e4b","html_url":"https://github.com/Percival33/rust-jwt-server","commit_stats":null,"previous_names":["percival33/rust-jwt-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percival33%2Frust-jwt-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percival33%2Frust-jwt-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percival33%2Frust-jwt-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percival33%2Frust-jwt-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Percival33","download_url":"https://codeload.github.com/Percival33/rust-jwt-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243926072,"owners_count":20369910,"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":["jwt","rust","warp"],"created_at":"2024-11-22T20:34:07.510Z","updated_at":"2025-03-16T20:14:03.580Z","avatar_url":"https://github.com/Percival33.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rust-jwt-server\n\nThis is a playground repo where I explore rust based on [this](https://youtu.be/6oMoHZZeyb0) tutorial.\n\nIt is example JWT authentication using Warp framework.\n\n## Usage\n\nThere are two users:\n\n|       | email            | password |\n|-------|------------------|----------|\n| user  | user@jarcin.dev  | 1234     |\n| admin | admin@jarcin.dev | 4321     |\n\n### Login\n\n```bash\ncurl http://localhost:8000/login -d '{\"email\": \"\", \"password\": \"\"}' -H 'Content-Type: application/json'\n```\nThis will response with a token which you need to copy in order to use user endpoint\n\n### User Endpoint\nFirst, log in as user\n\n\u003e **To use this endpoint you need to replace `\u003cTOKEN\u003e` with token acquired from login endpoint**\n\n```bash\ncurl http://localhost:8000/user -H 'Authorization: Bearer \u003cTOKEN\u003e' -H 'Content-Type: application/json'\n```\nThis should be the response: `Hello User 1`\n\nand to this command\n```bash\ncurl http://localhost:8000/admin -H 'Authorization: Bearer \u003cTOKEN\u003e' -H 'Content-Type: application/json'\n```\nThis should be the response after using token from logging as user: ` {\"message\":\"no permission\",\"status\":\"401 Unauthorized\"} `\n\n\n### Admin Endpoint\nFirst log in as admin.\n\n\u003e **To use this endpoint you need to replace `\u003cTOKEN\u003e` with token acquired from login endpoint**\n\nAfter using admin endpoint, such as this:\n```bash\ncurl http://localhost:8000/admin -H 'Authorization: Bearer \u003cTOKEN\u003e' -H 'Content-Type: application/json'\n```\nThis should be the response: `Hello Admin 2`\n\nAfter using user endpoint, such as this:\n```bash\ncurl http://localhost:8000/user -H 'Authorization: Bearer \u003cTOKEN\u003e' -H 'Content-Type: application/json'\n```\nThis should be the response: `Hello User 2`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercival33%2Frust-jwt-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpercival33%2Frust-jwt-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercival33%2Frust-jwt-server/lists"}