Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 66 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,71 @@
# php-http-signature

HTTP Signature Authentication library for PHP that has client and
server components for Joyent's HTTP Signature Scheme, as specified
at http://tools.ietf.org/html/draft-cavage-http-signatures-00 and
implemented at https://github.com/joyent/node-http-signature.
Note: I've updated the source file and directory structure to follow psr-4 layout for autoloading as composer package.

For example in composer.json, you can add the following to autoload the class...

```
"repositories": {
"http-signer": {
"type": "package",
"package": {
"name": "gwynne/http-signer",
"version": "1.0.0",
"source": {
"url": "https://github.com/58bits/php-http-signature",
"type": "git",
"reference": "7abfde5fc7ad29b62446fb59c967458f48227220"
}
}
}
},

"autoload": {
"psr-4": {
"Gwynne\\": "vendor/gwynne/http-signer/src/"
}
}
```

`composer install` would then automatically clone the repository into the following vendor directory...

```
── composer.json
├── composer.lock
└── vendor
├── autoload.php
├── composer
└── gwynne
└── http-signer
├── LICENSE
├── README.md
└── src
└── HTTPSignature.php
```

Using the signature class then becomes...

```
require 'vendor/autoload.php'; // Loads all vendor related 'requires'.

$date = gmdate(DATE_RFC1123);
$headers = array('date' => $date);

Gwynne\HTTPSignature::sign($headers, array(
'key' => '46653e78ce9df4f2d9ae93gft5f5c281',
'keyId' => '18KF2FGK6807ZQA9FGT4',
'algorithm' => 'hmac-sha1'
));
```

(although this class should really contain instance members and be 'new'd' up when used.")

I've submitted a pull request to the author.

# Original README


HTTP Signature Authentication library for PHP that has client and server components for Joyent's HTTP Signature Scheme, as specified at http://tools.ietf.org/html/draft-cavage-http-signatures-00 and implemented at https://github.com/joyent/node-http-signature.

## Usage

Expand Down
Loading