Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cf-auth-middleware

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-auth-middleware - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

package.json

@@ -5,3 +5,3 @@ {

"description": "Authentication middleware for APIs using cf-auth-provider",
"version": "0.1.0",
"version": "0.1.1",
"tags": [],

@@ -8,0 +8,0 @@ "repository": {

@@ -25,4 +25,23 @@ # cf-auth-middleware

`@todo` explain how the client must sign the request, and what headers are required.
An authenticated request contains the following headers:
```
Content-Type: 'application/json'
x-cf-date: 'Tue, 05 Nov 2013 12:22:23 GMT'
authorization: 'Catfish {authorizing entity id}:{signed request}'
```
The client must sign the request with the following algorithm:
```js
var crypto = require('crypto')
function createSignature(key, method, contentType, date, path) {
var hmac = crypto.createHmac('sha1', key)
, packet = method + '\n\n' + (contentType || '') + '\n' + date + '\n\n' + path
return hmac.update(packet).digest('base64')
}
```
## Credits

@@ -29,0 +48,0 @@ Built by developers at [Clock](http://clock.co.uk).

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc