{"id":15022281,"url":"https://github.com/http-auth/http-auth-koa","last_synced_at":"2025-07-24T01:03:32.357Z","repository":{"id":42933915,"uuid":"61406061","full_name":"http-auth/http-auth-koa","owner":"http-auth","description":"Koa framework integration with http-auth module.","archived":false,"fork":false,"pushed_at":"2024-06-16T10:32:45.000Z","size":230,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T09:50:37.460Z","etag":null,"topics":["koa","koa-framework"],"latest_commit_sha":null,"homepage":"","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/http-auth.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":"2016-06-17T22:36:07.000Z","updated_at":"2023-02-14T13:16:41.000Z","dependencies_parsed_at":"2025-04-12T12:52:45.234Z","dependency_job_id":"2417b823-e0ca-468b-9a6e-6248ebcae3a2","html_url":"https://github.com/http-auth/http-auth-koa","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/http-auth/http-auth-koa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/http-auth%2Fhttp-auth-koa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/http-auth%2Fhttp-auth-koa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/http-auth%2Fhttp-auth-koa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/http-auth%2Fhttp-auth-koa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/http-auth","download_url":"https://codeload.github.com/http-auth/http-auth-koa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/http-auth%2Fhttp-auth-koa/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265038058,"owners_count":23702038,"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":["koa","koa-framework"],"created_at":"2024-09-24T19:57:44.414Z","updated_at":"2025-07-24T01:03:32.295Z","avatar_url":"https://github.com/http-auth.png","language":"JavaScript","readme":"# http-auth-koa\n[Koa framework](http://koajs.com/) integration with [http-auth](https://github.com/gevorg/http-auth) module.\n\n[![build](https://github.com/http-auth/http-auth-koa/workflows/build/badge.svg)](https://github.com/http-auth/http-auth-koa/actions/workflows/build.yml)\n\n## Installation\n\nVia git (or downloaded tarball):\n\n```bash\n$ git clone git://github.com/http-auth/http-auth-koa.git\n```\nVia [npm](http://npmjs.org/):\n\n```bash\n$ npm install http-auth-koa\n```    \n\n## Usage\n```javascript\n// Authentication module.\nconst auth = require(\"http-auth\");\nconst koaAuth = require(\"http-auth-koa\");\n\nconst basic = auth.basic({\n  realm: \"Simon Area.\",\n  file: __dirname + \"/../data/users.htpasswd\"\n});\n\n// Koa setup.\nconst Koa = require(\"koa\");\nconst app = new Koa();\n\n// Setup basic handler.\napp.use(async (ctx, next) =\u003e {\n  await next();\n  ctx.body = `Welcome to koa ${ctx.req.user}!`;\n});\n\n// Setup auth.\napp.use(koaAuth(basic));\n\n// Start server.\napp.listen(1337, function() {\n  // Log URL.\n  console.log(\"Server running at http://127.0.0.1:1337/\");\n});\n```\n\n\n## Running tests\n\nIt uses [mocha](https://mochajs.org/), so just run following command in package directory:\n\n```bash\n$ npm test\n```\n\n## License\n\nThe MIT License (MIT)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhttp-auth%2Fhttp-auth-koa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhttp-auth%2Fhttp-auth-koa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhttp-auth%2Fhttp-auth-koa/lists"}