{"id":34552941,"url":"https://github.com/mjbondra/koa-session-mongoose","last_synced_at":"2025-12-24T08:05:28.418Z","repository":{"id":12841129,"uuid":"15516711","full_name":"mjbondra/koa-session-mongoose","owner":"mjbondra","description":"Mongoose store for Koa sessions","archived":false,"fork":false,"pushed_at":"2023-01-23T19:27:11.000Z","size":809,"stargazers_count":29,"open_issues_count":16,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-15T05:25:06.215Z","etag":null,"topics":["koa","koa-session","mongo","mongodb","mongoose","session","session-store"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/mjbondra.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}},"created_at":"2013-12-29T23:27:12.000Z","updated_at":"2023-05-29T13:08:59.000Z","dependencies_parsed_at":"2023-02-13T02:20:15.328Z","dependency_job_id":null,"html_url":"https://github.com/mjbondra/koa-session-mongoose","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/mjbondra/koa-session-mongoose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjbondra%2Fkoa-session-mongoose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjbondra%2Fkoa-session-mongoose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjbondra%2Fkoa-session-mongoose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjbondra%2Fkoa-session-mongoose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjbondra","download_url":"https://codeload.github.com/mjbondra/koa-session-mongoose/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjbondra%2Fkoa-session-mongoose/sbom","scorecard":{"id":651366,"data":{"date":"2025-08-11","repo":{"name":"github.com/mjbondra/koa-session-mongoose","commit":"70ce4da2c904ea4eb2d63a0b0fa33de9b6651e4e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","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":"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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"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":"Vulnerabilities","score":0,"reason":"50 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-4jwp-vfvf-657p","Warn: Project is vulnerable to: GHSA-v8w9-2789-6hhr","Warn: Project is vulnerable to: GHSA-h452-7996-h45h","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-593f-38f6-jp5m","Warn: Project is vulnerable to: GHSA-x2rg-q646-7m2v","Warn: Project is vulnerable to: GHSA-jgmv-j7ww-jx2x","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-f825-f98c-gj3g","Warn: Project is vulnerable to: GHSA-h8hf-x3f4-xwgp","Warn: Project is vulnerable to: GHSA-9m93-w8w6-76hh","Warn: Project is vulnerable to: GHSA-m7xq-9374-9rvx","Warn: Project is vulnerable to: GHSA-vg7j-7cwx-8wgw","Warn: Project is vulnerable to: GHSA-p92x-r36w-9395","Warn: Project is vulnerable to: GHSA-45q2-34rf-mr94","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-3329-pjwv-fjpg","Warn: Project is vulnerable to: GHSA-p6j9-7xhc-rhwp","Warn: Project is vulnerable to: GHSA-89gv-h8wf-cg8r","Warn: Project is vulnerable to: GHSA-gcv8-gh4r-25x6","Warn: Project is vulnerable to: GHSA-gmv4-r438-p67f","Warn: Project is vulnerable to: GHSA-8h2f-7jc4-7m3m","Warn: Project is vulnerable to: GHSA-3vjf-82ff-p4r3","Warn: Project is vulnerable to: GHSA-g694-m8vq-gv9h","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"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-21T13:35:16.201Z","repository_id":12841129,"created_at":"2025-08-21T13:35:16.201Z","updated_at":"2025-08-21T13:35:16.201Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27998473,"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","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"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":["koa","koa-session","mongo","mongodb","mongoose","session","session-store"],"created_at":"2025-12-24T08:04:52.807Z","updated_at":"2025-12-24T08:05:28.413Z","avatar_url":"https://github.com/mjbondra.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# koa-session-mongoose\n\nMongoose storage layer for [koa-session](https://github.com/koajs/session).\n\n## Installation\n\n```shell\nnpm i --save koa-session-mongoose\n```\n\n**OR**\n\n```shell\nyarn add koa-session-mongoose\n```\n\n## Usage\n\n### Prerequisites\n\nThis store requires [node@\u003e=8.3.0](https://nodejs.org), [koa@\u003e=2.0.0](http://koajs.com), and [koa-session@\u003e=5.0.0](https://github.com/koajs/session).\n\nIt has a peer-dependency of [mongoose@\u003e=5.0.0](https://mongoosejs.com/).\n\nIf you are using older dependencies, consider using [koa-session-mongoose@^1.0.0](https://gitlab.com/wondermonger/koa-session-mongoose/tree/v1.0.0) or [koa-session-mongoose@^2.0.0](https://gitlab.com/wondermonger/koa-session-mongoose/tree/v2.0.0).\n\n### Code Examples\n\n```javascript\nconst Koa = require(\"koa\");\nconst mongoose = require(\"mongoose\");\nconst MongooseStore = require(\"koa-session-mongoose\");\nconst session = require(\"koa-session\");\n\n// mongoose connection must exist before creating a store with koa-session-mongoose\nmongoose.connect(\"mongodb://some_host/some_db\");\n\nconst app = new Koa();\n\n// needed for cookie-signing\napp.keys = [\"some secret key\"];\n\napp.use(session({ store: new MongooseStore() }, app));\n\napp.use(async ctx =\u003e {\n  const { session } = ctx;\n  let n = session.views || 0;\n  session.views = ++n;\n  ctx.body = `${n} view(s)`;\n});\n\napp.listen(3000);\n```\n\nYou can optionally specify collection name (`collection`), model name (`name`), expiration time in seconds (`expires`), and Mongoose connection (`connection`):\n\n```javascript\nasync function init (uri) =\u003e {\n  const connection = await mongoose.connect(uri, {\n    useCreateIndex: true,\n    useFindAndModify: false,\n    useNewUrlParser: true,\n    useUnifiedTopology: true\n  });\n\n  app.use(session({\n    store: new MongooseStore({\n      collection: 'appSessions',\n      connection: connection,\n      expires: 86400, // 1 day is the default\n      name: 'AppSession'\n    })\n  }, app));\n}\n\n```\n\n## Related Modules\n\n- [koa-session](https://github.com/koajs/session)\n\n## Development\n\nMerge requests should be submitted to [https://gitlab.com/wondermonger/koa-session-mongoose](https://gitlab.com/wondermonger/koa-session-mongoose).\n\nA mirror of the project will persist at [https://github.com/mjbondra/koa-session-mongoose](https://github.com/mjbondra/koa-session-mongoose), but all future development will be directed to the new repository.\n\n### Installation\n\n```shell\nnpm i\n```\n\n### Linting\n\n```shell\nnpm run lint\n```\n\n### Testing\n\n```shell\n# all tests\nnpm run test\n\n# integration tests\nnpm run test:integration\n\n# unit tests\nnpm run test:unit\n```\n\nIf you require a MongoDB URI other than the default (`mongodb://127.0.0.1/koa-session-mongoose`), specify it as follows before executing `npm run test` or `npm run test:integration`:\n\n```shell\nMONGODB_URI=\"mongodb://[username:password@]host[:port]/[database]\"\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013-2019 Michael J. Bondra \u003cmjbondra@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjbondra%2Fkoa-session-mongoose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjbondra%2Fkoa-session-mongoose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjbondra%2Fkoa-session-mongoose/lists"}