{"id":25569791,"url":"https://github.com/deatil/zig-jwt","last_synced_at":"2026-03-20T22:30:22.630Z","repository":{"id":278552217,"uuid":"935997027","full_name":"deatil/zig-jwt","owner":"deatil","description":"A JWT library for zig.","archived":false,"fork":false,"pushed_at":"2025-02-20T11:13:56.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-20T12:24:13.639Z","etag":null,"topics":["jwt","zig","zig-jwt"],"latest_commit_sha":null,"homepage":"https://github.com/deatil/zig-jwt","language":"Zig","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/deatil.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":"2025-02-20T11:10:53.000Z","updated_at":"2025-02-20T11:20:44.000Z","dependencies_parsed_at":"2025-02-20T12:34:21.047Z","dependency_job_id":null,"html_url":"https://github.com/deatil/zig-jwt","commit_stats":null,"previous_names":["deatil/zig-jwt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fzig-jwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fzig-jwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fzig-jwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fzig-jwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deatil","download_url":"https://codeload.github.com/deatil/zig-jwt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239934477,"owners_count":19720956,"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","zig","zig-jwt"],"created_at":"2025-02-21T00:39:52.517Z","updated_at":"2026-03-20T22:30:22.585Z","avatar_url":"https://github.com/deatil.png","language":"Zig","readme":"## Zig-jwt \n\nA JWT library for zig.\n\n\n### Env\n\n - Zig \u003e= 0.14.0-dev.2851+b074fb7dd\n\n\n### Adding zig-jwt as a dependency\n\nAdd the dependency to your project:\n\n```sh\nzig fetch --save=zig-jwt git+https://github.com/deatil/zig-jwt#main\n```\n\nor use local path to add dependency at `build.zig.zon` file\n\n```zig\n.{\n    .dependencies = .{\n        .@\"zig-jwt\" = .{\n            .path = \"./lib/zig-jwt\",\n        },\n        ...\n    }\n}\n```\n\nAnd the following to your `build.zig` file:\n\n```zig\nconst zig_jwt_dep = b.dependency(\"zig-jwt\", .{});\nexe.root_module.addImport(\"zig-jwt\", zig_jwt_dep.module(\"zig-jwt\"));\n```\n\nThe `zig-jwt` structure can be imported in your application with:\n\n```zig\nconst zig_jwt = @import(\"zig-jwt\");\n```\n\n\n### Get Starting\n\n~~~zig\nconst std = @import(\"std\");\nconst jwt = @import(\"zig-jwt\");\n\npub fn main() !void {\n    const alloc = std.heap.page_allocator;\n\n    const kp = jwt.eddsa.Ed25519.KeyPair.generate();\n\n    const claims = .{\n        .aud = \"example.com\",\n        .iat = \"foo\",\n    };\n\n    const s = jwt.SigningMethodEdDSA.init(alloc);\n    const token_string = try s.make(claims, kp.secret_key);\n    \n    // output: \n    // make jwt: eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSJ9.eyJhdWQiOiJleGFtcGxlLmNvbSIsImlhdCI6ImZvbyJ9.zXaymzzL0dtQZdK7DS32nqES2qoAvzFGPtcQFRvIC0k4XfRybivp1MpCjwJrI-7SIQ8zMV5wK_zIdEHS9A8tDg\n    std.debug.print(\"make jwt: {s} \\n\", .{token_string});\n\n    const p = jwt.SigningMethodEdDSA.init(alloc);\n    var parsed = try p.parse(token_string, kp.public_key);\n    \n    // output: \n    // claims aud: example.com\n    const claims2 = try parsed.getClaims();\n    std.debug.print(\"claims aud: {s} \\n\", .{claims2.object.get(\"aud\").?.string});\n}\n~~~\n\n\n### Signing Methods\n\nThe JWT library have signing methods:\n\n - `ES256`: jwt.SigningMethodES256\n - `ES384`: jwt.SigningMethodES384\n \n - `EdDSA`: jwt.SigningMethodEdDSA\n - `ED25519`: jwt.SigningMethodED25519\n\n - `HS256`: jwt.SigningMethodHS256\n - `HS384`: jwt.SigningMethodHS384\n - `HS512`: jwt.SigningMethodHS512\n\n - `none`: jwt.SigningMethodNone\n\n\n### LICENSE\n\n*  The library LICENSE is `Apache2`, using the library need keep the LICENSE.\n\n\n### Copyright\n\n*  Copyright deatil(https://github.com/deatil).\n","funding_links":[],"categories":["Libraries","Network \u0026 Web"],"sub_categories":["Web Framework"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeatil%2Fzig-jwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeatil%2Fzig-jwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeatil%2Fzig-jwt/lists"}