{"id":49450888,"url":"https://github.com/dendavidov/go-utils","last_synced_at":"2026-04-30T02:38:35.535Z","repository":{"id":352970250,"uuid":"622472569","full_name":"dendavidov/go-utils","owner":"dendavidov","description":"Small Go module and CLI: RS256 JWT helpers (pkg/jwt) and jwt-token for local/dev signing.","archived":false,"fork":false,"pushed_at":"2026-04-21T22:31:22.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-22T00:16:33.546Z","etag":null,"topics":["go","golang","jwt","utilities"],"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/dendavidov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-02T08:05:43.000Z","updated_at":"2026-04-21T22:31:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dendavidov/go-utils","commit_stats":null,"previous_names":["dendavidov/go-utils"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dendavidov/go-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dendavidov%2Fgo-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dendavidov%2Fgo-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dendavidov%2Fgo-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dendavidov%2Fgo-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dendavidov","download_url":"https://codeload.github.com/dendavidov/go-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dendavidov%2Fgo-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32452744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["go","golang","jwt","utilities"],"created_at":"2026-04-30T02:38:34.774Z","updated_at":"2026-04-30T02:38:35.530Z","avatar_url":"https://github.com/dendavidov.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-utils\n\nSmall Go utilities with a versioned module and conventional releases.\n\n[![CI](https://github.com/dendavidov/go-utils/actions/workflows/ci.yml/badge.svg)](https://github.com/dendavidov/go-utils/actions/workflows/ci.yml)\n[![GitHub Release](https://img.shields.io/github/v/release/dendavidov/go-utils?sort=semver)](https://github.com/dendavidov/go-utils/releases)\n[![Go Reference](https://pkg.go.dev/badge/github.com/dendavidov/go-utils.svg)](https://pkg.go.dev/github.com/dendavidov/go-utils)\n[![Go Report Card](https://goreportcard.com/badge/github.com/dendavidov/go-utils)](https://goreportcard.com/report/github.com/dendavidov/go-utils)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\n## Install\n\nLibrary:\n\n```bash\ngo get github.com/dendavidov/go-utils@latest\n```\n\nCLI (requires a recent Go toolchain):\n\n```bash\ngo install github.com/dendavidov/go-utils/cmd/jwt-token@latest\n```\n\nPrebuilt binaries appear on [GitHub Releases](https://github.com/dendavidov/go-utils/releases) when a tag is published.\n\n## Package `pkg/jwt`\n\nMint and verify RS256 JWTs with custom claims (`id`, `email`, `isAccessToken`) and standard registered claims (`exp`, `iat`, `nbf`).\n\n```go\nimport \"github.com/dendavidov/go-utils/pkg/jwt\"\n\npriv, err := jwt.ParsePrivateKeyFromBase64(os.Getenv(\"JWT_PRIVATE_KEY_B64\"))\nif err != nil { /* ... */ }\n\ntoken, err := jwt.GenerateToken(priv, jwt.Claims{\n    ID: \"user-1\", Email: \"a@example.com\", IsAccess: true,\n}, 24*time.Hour)\n\nclaims, err := jwt.ParseToken(token, \u0026priv.PublicKey)\n```\n\n## CLI `jwt-token`\n\nPrints a signed JWT to stdout (no trailing newline beyond what `fmt.Print` does for the token string).\n\n```text\njwt-token -id USER -email user@example.com -key \"$JWT_PRIVATE_KEY_B64\"\njwt-token -id USER -email user@example.com -key-file ./private.pem -ttl 720h\n```\n\nEnvironment variables: `JWT_SUBJECT_ID`, `JWT_EMAIL`, `JWT_PRIVATE_KEY_B64`.\n\nFlags override env when set. Use `-version` to print the release version (set at link time by GoReleaser).\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md). This project uses [Conventional Commits](https://www.conventionalcommits.org/) and [release-please](https://github.com/googleapis/release-please) for changelog and tags.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdendavidov%2Fgo-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdendavidov%2Fgo-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdendavidov%2Fgo-utils/lists"}