{"id":22356351,"url":"https://github.com/do-/node-doix-http-cookie-jwt","last_synced_at":"2026-02-16T13:33:07.109Z","repository":{"id":216062973,"uuid":"739529526","full_name":"do-/node-doix-http-cookie-jwt","owner":"do-","description":"doix http cookie based sessions using jwt","archived":false,"fork":false,"pushed_at":"2024-09-07T16:17:36.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T21:37:35.766Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/do-.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,"zenodo":null}},"created_at":"2024-01-05T19:38:54.000Z","updated_at":"2024-09-07T16:17:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b37d4bb-1f69-41e3-a881-a8c2ac6bbf5c","html_url":"https://github.com/do-/node-doix-http-cookie-jwt","commit_stats":null,"previous_names":["do-/node-doix-http-cookie-jwt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/do-/node-doix-http-cookie-jwt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-%2Fnode-doix-http-cookie-jwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-%2Fnode-doix-http-cookie-jwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-%2Fnode-doix-http-cookie-jwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-%2Fnode-doix-http-cookie-jwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/do-","download_url":"https://codeload.github.com/do-/node-doix-http-cookie-jwt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-%2Fnode-doix-http-cookie-jwt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29509133,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: 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-12-04T14:09:58.210Z","updated_at":"2026-02-16T13:33:07.085Z","avatar_url":"https://github.com/do-.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![workflow](https://github.com/do-/node-doix-http-cookie-jwt/actions/workflows/main.yml/badge.svg)\n![Jest coverage](./badges/coverage-jest%20coverage.svg)\n\n\n`node-doix-http-cookie-jwt` is a plug in for the [`doix`](https://github.com/do-/node-doix) framework providing an HTTP cookie based session mechanism using [JSON Web Tokens](https://jwt.io/).\n\nHere, the whole user information record (seen as `this.user` in each [Job](https://github.com/do-/node-doix/wiki/Job) instance) is completely included in the cookie value as the `sub` property of the JSON Web Token's `claim`.\n\n# Installation\n```\nnpm install doix-http-cookie-jwt\n```\n# Usage\nUpon instantiating your [WebService](https://github.com/do-/node-doix-http/wiki/WebService) descendant as `myWebService`:\n\n```js\nconst {CookieJWT} = require ('doix-http-cookie-jwt')\n\nconst sessionProvider = new CookieJWT ({\n  //  name: 'sid',\n  //  ttl: 60,\n  //  claim: {},\n  //  sign: {},\n  //  verify: {},\n})\n\n// sessionProvider.getPrivateKey = async () =\u003e {...}\n// sessionProvider.getPublicKey  = async () =\u003e {...}\n\nsessionProvider.plugInto (myWebService)\n```\n\n# Options\n| Name | Type | Default | Description | Note\n| ---- | -- | -- | -- | -- |\n| `name` | String | `'sid'` | name of the cookie |\n| `ttl` | int | 60 | time to live, in minutes | defines the `expiresIn` JWT property\n| `claim` | Object | `{}` | the claim part of the JWT | the `sub` property is always overridden with the user info\n| `sign` | Object | `{}` | options for [sign ()](https://github.com/auth0/node-jsonwebtoken#jwtsignpayload-secretorprivatekey-options-callback) | \n| `verify` | Object | `{}` | options for [verify ()](https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback) | \n\n# Methods\n| Name | Description | Default implementation\n| ---- | -- | -- \n| `getPrivateKey ()` | returns the private key for using with [sign ()](https://github.com/auth0/node-jsonwebtoken#jwtsignpayload-secretorprivatekey-options-callback) | `' '`\n| `getPublicKey ()` | returns the public key for using with [verify ()](https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback) | `' '`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdo-%2Fnode-doix-http-cookie-jwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdo-%2Fnode-doix-http-cookie-jwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdo-%2Fnode-doix-http-cookie-jwt/lists"}