{"id":17338497,"url":"https://github.com/mitmaro/http-authorization-header","last_synced_at":"2025-07-06T00:03:01.559Z","repository":{"id":44177174,"uuid":"119299451","full_name":"MitMaro/http-authorization-header","owner":"MitMaro","description":"Parse and create HTTP Authorization headers.","archived":false,"fork":false,"pushed_at":"2022-12-30T17:51:11.000Z","size":568,"stargazers_count":4,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T07:11:21.520Z","etag":null,"topics":["authorization","headers","http","javascript","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MitMaro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-01-28T21:28:50.000Z","updated_at":"2020-09-24T00:49:20.000Z","dependencies_parsed_at":"2023-01-31T12:31:27.530Z","dependency_job_id":null,"html_url":"https://github.com/MitMaro/http-authorization-header","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MitMaro%2Fhttp-authorization-header","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MitMaro%2Fhttp-authorization-header/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MitMaro%2Fhttp-authorization-header/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MitMaro%2Fhttp-authorization-header/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MitMaro","download_url":"https://codeload.github.com/MitMaro/http-authorization-header/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248938465,"owners_count":21186412,"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":["authorization","headers","http","javascript","nodejs"],"created_at":"2024-10-15T15:38:27.646Z","updated_at":"2025-04-14T18:42:52.487Z","avatar_url":"https://github.com/MitMaro.png","language":"JavaScript","readme":"# Node HTTP Authorization Header Parser and Generator\n\n[![Dependency Status](https://david-dm.org/MitMaro/http-authorization-header.svg)][1]\n[![Build Status](https://travis-ci.org/MitMaro/http-authorization-header.svg?branch=master)][2]\n[![Coverage Status](https://coveralls.io/repos/github/MitMaro/http-authorization-header/badge.svg?branch=master)][3]\n[![NPM version](https://img.shields.io/npm/v/@mitmaro/http-authorization-header.svg)][4]\n[![GitHub license](https://img.shields.io/badge/license-ISC-blue.svg)][5]\n\nParses and generates HTTP Authorization and Proxy-Authorization headers strictly following [RFC-7235][6]. Supports\nlegacy style auth-schemes (Basic, Digest, Bearer) as well as the more modern key-value auth params.\n\n## Install\n\n```bash\nnpm install --save @mitmaro/http-authorization-header\n```\n\n## Documentation\n\n* [API Documentation][10]\n\n## Usage\n\n### Parse Header\n\n```javascript\nconst http = require('http');\nconst {parse} = require('@mitmaro/http-authorization-header');\n\nconst httpServer = http.createServer((req, res) =\u003e {\n    const authHeader = req.getHeader('Authorization');\n    // authHeader =\u003e 'myscheme foo=bar, baz=foobar, buzz=\"quoted \\\"value!\\\"\"\n    \n    const authData = parse(authHeader);\n    \n    console.log(authData);\n    /*\n    {\n        scheme: 'myscheme',\n        values: [\n            ['foo', 'bar'],\n            ['baz', 'foobar],\n            ['buzz', 'quotes \"value!\"']\n        ]\n    }\n    */\n}).listen();\n```\n\n### Create Header\n\n```javascript\nconst {create, createToken68} = require('@mitmaro/http-authorization-header');\n\n// legacy header value support (Basic, Digest, Bearer)\nconst basicAuthHeader = createToken68('Basic', Buffer.from('username:password').toString('base64'));\n// Basic dXNlcm5hbWU6cGFzc3dvcmQ=\n\n// modern form\nconst rfc7235Header = create('Custom', [['foo', 'bar'], ['foo', 'fuzz'], ['buzz', 'quoted \"value!\"']]);\n// Custom foo=bar,foo=fuzz,buzz=\"quoted \\\"value!\\\"\"\n```\n\n### All exports\n\n```javascript\nconst {\n\tcreate,\n\tcreateUnsafe,\n\tcreateToken68,\n\tcreateToken68Unsafe,\n\tparse,\n\tInvalidHeaderError,\n\tInvalidInputError,\n} = require('@mitmaro/http-authorization-header');\n```\n\n## Contributing\n\nIf the library is not in compliance with RFC-7235 then create an issue explaining the issue with sample data, or even\nbetter create a pull request that adds a test that fails.\n\n## Development\n\nDevelopment is done using Node 8 and NPM 5, and tested against both Node 6 and Node 8. To get started\n\n* Install Node 8 from [NodeJS.org][7] or using [nvm]\n* Clone the repository using `git clone git@github.com:MitMaro/http-authorization-header.git`\n* `cd http-authorization-header`\n* Install the dependencies `npm install`\n* Make changes, add tests, etc.\n* Run linting and test suite using `npm run test`\n\n## License\n\nBased on [auth-header][8] which was licensed under [CC0-1.0][9]. This project is released under the\n[ISC license](LICENSE).\n\n[1]:https://david-dm.org/MitMaro/http-authorization-header\n[2]:https://travis-ci.org/MitMaro/http-authorization-header\n[3]:https://coveralls.io/github/MitMaro/http-authorization-header?branch=master\n[4]:https://www.npmjs.com/package/@mitmaro/http-authorization-header\n[5]:https://raw.githubusercontent.com/MitMaro/http-authorization-header/master/LICENSE\n[6]:https://tools.ietf.org/html/rfc7235\n[7]:https://nodejs.org/en/download/\n[8]:https://github.com/izaakschroeder/auth-header\n[9]:https://creativecommons.org/publicdomain/zero/1.0/\n[10]:http://www.mitmaro.ca/http-authorization-header/\n[nvm]:https://github.com/creationix/nvm#installation\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitmaro%2Fhttp-authorization-header","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitmaro%2Fhttp-authorization-header","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitmaro%2Fhttp-authorization-header/lists"}