Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@mitmaro/http-authorization-header
Advanced tools
Changelog
1.0.0 - 2018-01-28
Readme
Parses and generates HTTP Authorization and Proxy-Authorization headers strictly following RFC-7235. Supports legacy style auth-schemes (Basic, Digest, Bearer) as well as the more modern key-value auth params.
npm install --save @mitmaro/http-authorization-header
const http = require('http');
const {parse} = require('@mitmaro/http-authorization-header');
const httpServer = http.createServer((req, res) => {
const authHeader = req.getHeader('Authorization');
// authHeader => 'myscheme foo=bar, baz=foobar, buzz="quoted \"value!\""
const authData = parse(authHeader);
console.log(authData);
/*
{
scheme: 'myscheme',
values: [
['foo', 'bar'],
['baz', 'foobar],
['buzz', 'quotes "value!"']
]
}
*/
}).listen();
const {create, createToken68} = require('@mitmaro/http-authorization-header');
// legacy header value support (Basic, Digest, Bearer)
const basicAuthHeader = createToken68('Basic', Buffer.from('username:password').toString('base64'));
// Basic dXNlcm5hbWU6cGFzc3dvcmQ=
// modern form
const rfc7235Header = create('Custom', [['foo', 'bar'], ['foo', 'fuzz'], ['buzz', 'quoted "value!"']]);
// Custom foo=bar,foo=fuzz,buzz="quoted \"value!\""
const {
create,
createUnsafe,
createToken68,
createToken68Unsafe,
parse,
InvalidHeaderError,
InvalidInputError,
} = require('@mitmaro/http-authorization-header');
If the library is not in compliance with RFC-7235 then create an issue explaining the issue with sample data, or even better create a pull request that adds a test that fails.
Development is done using Node 8 and NPM 5, and tested against both Node 6 and Node 8. To get started
git clone git@github.com:MitMaro/http-authorization-header.git
cd http-authorization-header
npm install
npm run test
Based on auth-header which was licensed under CC0-1.0. This project is released under the ISC license.
FAQs
Parse and create HTTP Authorization headers.
The npm package @mitmaro/http-authorization-header receives a total of 2,477 weekly downloads. As such, @mitmaro/http-authorization-header popularity was classified as popular.
We found that @mitmaro/http-authorization-header demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.