{"id":25421552,"url":"https://github.com/reecerussell/gojwt","last_synced_at":"2025-07-31T18:33:08.075Z","repository":{"id":37034376,"uuid":"319629184","full_name":"reecerussell/gojwt","owner":"reecerussell","description":"A simple, extendible JSON-Web-Token library, written in Golang with no third-party dependencies (kind of).","archived":false,"fork":false,"pushed_at":"2022-06-20T21:24:52.000Z","size":75,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T13:12:02.981Z","etag":null,"topics":["golang","jwt"],"latest_commit_sha":null,"homepage":"","language":"Go","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/reecerussell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-08T12:16:48.000Z","updated_at":"2024-04-20T16:38:35.000Z","dependencies_parsed_at":"2022-06-25T13:04:14.201Z","dependency_job_id":null,"html_url":"https://github.com/reecerussell/gojwt","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reecerussell%2Fgojwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reecerussell%2Fgojwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reecerussell%2Fgojwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reecerussell%2Fgojwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reecerussell","download_url":"https://codeload.github.com/reecerussell/gojwt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239195493,"owners_count":19598037,"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":["golang","jwt"],"created_at":"2025-02-16T20:48:57.412Z","updated_at":"2025-02-16T20:48:57.974Z","avatar_url":"https://github.com/reecerussell.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/reecerussell/gojwt)](https://goreportcard.com/badge/github.com/reecerussell/gojwt)\n[![codecov](https://codecov.io/gh/reecerussell/gojwt/branch/master/graph/badge.svg)](https://codecov.io/gh/reecerussell/gojwt)\n[![Go Docs](https://godoc.org/github.com/reecerussell/gojwt?status.svg)](https://godoc.org/github.com/reecerussell/gojwt)\n\n# GOJWT\n\nA simple, extendible JSON-Web-Token library, written in Golang with no third-party dependencies.\n\n## Installation\n\nSimply, just run this command to install the package into your module.\n\n```\n$ go get -u github.com/reecerussell/gojwt\n```\n\n## Supported Algorithms\n\n-   [RSA](/rsa)\n-   [AWS KMS](/kms)\n\n## Usage\n\nThis package is based on a JWt builder object, which is used to construct the token and sign it. And an algorithm interface, which allows abstractions to be created to support many differnt signing algorithms.\n\nHere is a basic example of using an algorithm and builder:\n\n```go\n// Initiating an Algorithm, in this case RSA.\nconst myPrivateKeyFile string = \"./super_secret_key.pem\"\nalg, err := rsa.NewFromFile(myPrivateKeyFile, crypto.SHA256)\nif err != nil {\n    panic(err)\n}\n\n// Creating a new builder object, then adding some claims.\nbuilder, err := gojwt.New(alg)\nif err != nil {\n    panic(err)\n}\n\nbuilder.AddClaim(\"name\", \"John Doe\").\n    SetExpiry(time.Now().Add(1 * time.Hour))\n\n// Finally, building the token.\ntoken, err := builder.Build()\nif err != nil {\n    panic(err)\n}\n\nfmt.Println(token)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freecerussell%2Fgojwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freecerussell%2Fgojwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freecerussell%2Fgojwt/lists"}