{"id":13590340,"url":"https://github.com/hertz-contrib/paseto","last_synced_at":"2026-01-24T09:36:46.114Z","repository":{"id":151007898,"uuid":"617226316","full_name":"hertz-contrib/paseto","owner":"hertz-contrib","description":"Paseto middleware for Hertz.","archived":false,"fork":false,"pushed_at":"2023-05-08T02:30:22.000Z","size":16,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-30T21:45:56.563Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/hertz-contrib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-03-22T00:10:12.000Z","updated_at":"2025-06-14T09:46:03.000Z","dependencies_parsed_at":"2024-01-14T04:12:35.783Z","dependency_job_id":"cfa2d54f-1d43-46c1-b0de-acb9c05653c1","html_url":"https://github.com/hertz-contrib/paseto","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"cloudwego/.github","purl":"pkg:github/hertz-contrib/paseto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hertz-contrib%2Fpaseto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hertz-contrib%2Fpaseto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hertz-contrib%2Fpaseto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hertz-contrib%2Fpaseto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hertz-contrib","download_url":"https://codeload.github.com/hertz-contrib/paseto/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hertz-contrib%2Fpaseto/sbom","scorecard":{"id":462443,"data":{"date":"2025-08-11","repo":{"name":"github.com/hertz-contrib/paseto","commit":"71af6635a26c5f517a5e75f69791c33c81646dfd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":6,"reason":"Found 2/3 approved changesets -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":0,"reason":"dangerous workflow patterns detected","details":["Warn: script injection with untrusted input ' github.head_ref ': .github/workflows/release-check.yml:15","Warn: script injection with untrusted input ' github.head_ref ': .github/workflows/release-check.yml:15"],"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/pr-check.yml:1","Warn: no topLevel permission defined: .github/workflows/release-check.yml:1","Warn: no topLevel permission defined: .github/workflows/tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-check.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/hertz-contrib/paseto/pr-check.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-check.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/hertz-contrib/paseto/pr-check.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-check.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/hertz-contrib/paseto/pr-check.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-check.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/hertz-contrib/paseto/pr-check.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-check.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/hertz-contrib/paseto/pr-check.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-check.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/hertz-contrib/paseto/pr-check.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-check.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/hertz-contrib/paseto/pr-check.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-check.yml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/hertz-contrib/paseto/pr-check.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-check.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/hertz-contrib/paseto/pr-check.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-check.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/hertz-contrib/paseto/pr-check.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-check.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/hertz-contrib/paseto/release-check.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/hertz-contrib/paseto/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/hertz-contrib/paseto/tests.yml/main?enable=pin","Info:   0 out of   9 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE-APACHE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE-APACHE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2024-2611 / GHSA-8r3f-844c-mc37"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T11:30:10.867Z","repository_id":151007898,"created_at":"2025-08-19T11:30:10.867Z","updated_at":"2025-08-19T11:30:10.867Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28723503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T08:27:05.734Z","status":"ssl_error","status_checked_at":"2026-01-24T08:27:01.197Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-08-01T16:00:43.897Z","updated_at":"2026-01-24T09:36:46.098Z","avatar_url":"https://github.com/hertz-contrib.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# PASETO (This is a community driven project)\n\nPaseto is everything you love about JOSE (JWT, JWE, JWS) without any of the [many design deficits that plague the JOSE standards](https://paragonie.com/blog/2017/03/jwt-json-web-tokens-is-bad-standard-that-everyone-should-avoid).\n\nThis is the PASETO middleware for [Hertz](https://github.com/cloudwego/hertz) framework.\n\n## Usage\n\n**Install**\n\n```sh\ngo get github.com/hertz-contrib/paseto\n```\n\n**Import**\n\n```go\nimport \"github.com/hertz-contrib/paseto\"\n```\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/cloudwego/hertz/pkg/app\"\n\t\"github.com/cloudwego/hertz/pkg/app/client\"\n\t\"github.com/cloudwego/hertz/pkg/app/server\"\n\t\"github.com/cloudwego/hertz/pkg/common/hlog\"\n\t\"github.com/cloudwego/hertz/pkg/protocol\"\n\t\"github.com/hertz-contrib/paseto\"\n)\n\nfunc performRequest() {\n\ttime.Sleep(time.Second)\n\tc, _ := client.NewClient()\n\treq, resp := protocol.AcquireRequest(), protocol.AcquireResponse()\n\treq.SetRequestURI(\"http://127.0.0.1:8080/paseto\")\n\n\treq.SetMethod(\"GET\")\n\t_ = c.Do(context.Background(), req, resp)\n\tfmt.Printf(\"get token: %s\\n\", resp.Body())\n\n\treq.SetMethod(\"POST\")\n\treq.SetHeader(\"Authorization\", string(resp.Body()))\n\t_ = c.Do(context.Background(), req, resp)\n\tfmt.Printf(\"Authorization response :%s\", resp.Body())\n}\n\nfunc main() {\n\th := server.New(server.WithHostPorts(\":8080\"))\n\th.GET(\"/paseto\", func(c context.Context, ctx *app.RequestContext) {\n\t\tnow := time.Now()\n\t\tgenTokenFunc := paseto.DefaultGenTokenFunc()\n\t\ttoken, err := genTokenFunc(\u0026paseto.StandardClaims{\n\t\t\tIssuer:    \"cwg-issuer\",\n\t\t\tExpiredAt: now.Add(time.Hour),\n\t\t\tNotBefore: now,\n\t\t\tIssuedAt:  now,\n\t\t}, nil, nil)\n\t\tif err != nil {\n\t\t\thlog.Error(\"generate token failed\")\n\t\t}\n\t\tctx.String(http.StatusOK, token)\n\t})\n\n\th.POST(\"/paseto\", paseto.New(), func(c context.Context, ctx *app.RequestContext) {\n\t\tctx.String(http.StatusOK, \"token is valid\")\n\t})\n\n\tgo performRequest()\n\n\th.Spin()\n}\n\n```\n\n## Options\n\n| Option         | Default                                 | Description                                                                                                                         |\n|----------------|-----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| Next           | `nil`                                   | Next defines a function to skip this middleware when returned true.                                                                 |\n| ErrorFunc      | `output log and response 401`           | ErrorFunc defines a function which is executed when an error occurs.                                                                |\n| SuccessHandler | `save the claims to app.RequestContext` | SuccessHandler defines a function which is executed    when the token is valid.                                                     |\n| KeyLookup      | `\"header:Authorization\"`                | KeyLookup is a string in the form of \"\u003csource\u003e:\u003ckey\u003e\" that is used to create an Extractor that extracts the token from the request. |\n| TokenPrefix    | `\"\"`                                    | TokenPrefix is a string that holds the prefix for the token lookup.                                                                 |\n| ParseFunc      | `parse V4 Public Token`                 | ParseFunc parse and verify token.                                                                                                   |\n\n## Version comparison\n\n| Version | Local                                                        | Public                          |\n| ------- | ------------------------------------------------------------ | ------------------------------- |\n| v1      | Encrypted with `AES-256-CBC` and signed with HMAC-SHA-256    | Signed with `RSA-SHA-256`       |\n| v2      | Encrypted with `XSalsa20Poly1305` and signed with `HMAC-SHA-384` | Signed with `EdDSA `(`Ed25519`) |\n| v3      | Encrypted with `XChaCha20Poly1305` and signed with` HMAC-SHA-384` | Signed with `EdDSA `(`Ed25519`) |\n| v4      | Encrypted with `XChaCha20Poly1305` and signed with `HMAC-SHA-512-256` | Signed with `EdDSA `(`Ed448`)   |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhertz-contrib%2Fpaseto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhertz-contrib%2Fpaseto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhertz-contrib%2Fpaseto/lists"}