-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from akamai/release/2.0.0
Release 2.0.0
- Loading branch information
Showing
23 changed files
with
4,738 additions
and
1,493 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
2.0.0 | ||
--- | ||
[17 Oct, 2022] | ||
* Upgrade to php 8.1 | ||
|
||
1.0.1 | ||
--- | ||
[01 Sep, 2017] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,120 +1,89 @@ | ||
# akamai-open/edgegrid-auth | ||
|
||
[![License](https://img.shields.io/github/license/akamai/AkamaiOPEN-edgegrid-php.png)](https://github.com/akamai/AkamaiOPEN-edgegrid-php/blob/master/LICENSE) | ||
[![Build Status](https://travis-ci.org/akamai/AkamaiOPEN-edgegrid-php.svg?branch=master)](https://travis-ci.org/akamai/AkamaiOPEN-edgegrid-php) | ||
[![Code Coverage](https://scrutinizer-ci.com/g/akamai/AkamaiOPEN-edgegrid-php/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/akamai/AkamaiOPEN-edgegrid-php/?branch=master) | ||
[![API Docs](https://img.shields.io/badge/api-docs-blue.svg)](http://akamai.github.io/AkamaiOPEN-edgegrid-php-client/) | ||
[Akamai EdgeGrid Authentication](https://techdocs.akamai.com/developer/docs/set-up-authentication-credentials) for PHP | ||
|
||
[Akamai {OPEN} EdgeGrid Authentication] for PHP | ||
This library requires PHP 8+ and implements the Akamai EdgeGrid Authentication scheme for PHP. | ||
|
||
> **Note:** in version 0.6.0 of the `akamai-open/edgegrid-client` it was moved to it's | ||
> [own repository](https://github.com/akamai/AkamaiOPEN-edgegrid-php-client), and the | ||
> `\Akamai\Open\EdgeGrid\Authentication` library was seperated into the `akamai-open/edgegrid-auth` package (this repo). | ||
This library implements the Akamai {OPEN} EdgeGrid Authentication scheme. | ||
|
||
For more information visit the [Akamai {OPEN} Developer Community](https://developer.akamai.com). | ||
|
||
## Installation | ||
|
||
This library requires PHP 5.3.9+, or HHVM 3.5+ to be used with the built-in Guzzle HTTP client. | ||
|
||
> PHP 5.3 has been end of life (EOL) since August 14th, 2014, and has **known** security vulnerabilities, therefore we do not recommend using it. However, we understand that many actively supported LTS distributions are still shipping with PHP 5.3. | ||
## Install | ||
|
||
To install, use [`composer`](http://getcomposer.org): | ||
|
||
```sh | ||
$ composer require akamai-open/edgegrid-auth | ||
``` | ||
|
||
### Alternative Install: Single File (PHAR) | ||
### Alternative installation methods | ||
|
||
Alternatively, download the PHAR file from the [releases](https://github.com/akamai/AkamaiOPEN-edgegrid-php/releases) page. | ||
#### Single file (PHAR) | ||
|
||
To use it, you just include it inside your code: | ||
Download the PHAR file from the [releases](https://github.com/akamai/AkamaiOPEN-edgegrid-php/releases) page and include it inside your code: | ||
|
||
```php | ||
include 'akamai-open-edgegrid-auth.phar'; | ||
```php | ||
include 'akamai-open-edgegrid-auth.phar'; | ||
|
||
// Library is ready to use | ||
``` | ||
// Library is ready to use | ||
``` | ||
|
||
### Alternative Install: Git/Subversion/ZIP Archive | ||
#### Clone or download | ||
|
||
You can clone [this repository](https://github.com/akamai/AkamaiOPEN-edgegrid-php.git) using git, | ||
[this repository](https://github.com/akamai/AkamaiOPEN-edgegrid-php) using subversion, or download | ||
the latest [ZIP archive](https://github.com/akamai/AkamaiOPEN-edgegrid-php/archive/master.zip) or a | ||
[specific release ZIP archive](https://github.com/akamai/AkamaiOPEN-edgegrid-php/releases). | ||
1. Either clone or download to pull down a copy of this repository. | ||
|
||
#### Using the Composer Autoloader | ||
* Clone the repository using [git](https://github.com/akamai/AkamaiOPEN-edgegrid-php.git) or [subversion](https://github.com/akamai/AkamaiOPEN-edgegrid-php). | ||
* Download the latest [ZIP archive](https://github.com/akamai/AkamaiOPEN-edgegrid-php/archive/master.zip) or [specific release ZIP archive](https://github.com/akamai/AkamaiOPEN-edgegrid-php/releases). | ||
|
||
To use the composer autoloader, you must install the dependencies using: | ||
1. Use the composer autoloader and install the dependencies. | ||
|
||
```sh | ||
$ composer install | ||
``` | ||
```bash | ||
$ composer install | ||
``` | ||
|
||
Then include the autoloader: | ||
1. Include the autoloader. | ||
|
||
```php | ||
require_once 'vendor/autoload.php'; | ||
``` | ||
```php | ||
require_once 'vendor/autoload.php'; | ||
``` | ||
|
||
#### Without Composer Autoloader | ||
If you don't use the autoloader, include all the required classes manually in your code. | ||
Include all the required classes manually in your code: | ||
```php | ||
require_once 'src/Authentication.php'; | ||
require_once 'src/Authentication/Timestamp.php'; | ||
require_once 'src/Authentication/Nonce.php'; | ||
require_once 'src/Authentication/Exception.php'; | ||
require_once 'src/Authentication/Exception/ConfigException.php'; | ||
require_once 'src/Authentication/Exception/SignerException.php'; | ||
require_once 'src/Authentication/Exception/SignerException/InvalidSignDataException.php'; | ||
``` | ||
```php | ||
require_once 'src/Authentication.php'; | ||
require_once 'src/Authentication/Timestamp.php'; | ||
require_once 'src/Authentication/Nonce.php'; | ||
require_once 'src/Authentication/Exception.php'; | ||
require_once 'src/Authentication/Exception/ConfigException.php'; | ||
require_once 'src/Authentication/Exception/SignerException.php'; | ||
require_once 'src/Authentication/Exception/SignerException/InvalidSignDataException.php'; | ||
``` | ||
## Use | ||
### Usage | ||
Once you have installed the library, you can create the header value by calling the appropriate `\Akamai\Open\Edgegrid\Authentication::set*()` methods. | ||
Once you have installed the library, you can create the header value by calling the appropriate | ||
[`\Akamai\Open\Edgegrid\Authentication::set*()` methods](https://akamai.github.io/AkamaiOPEN-edgegrid-php-client/class-Akamai.Open.EdgeGrid.Authentication.html#methods). | ||
For example, using it with the built-in streams HTTP client might look like the following: | ||
```php | ||
$auth = \Akamai\Open\EdgeGrid\Authentication::createFromEdgeRcFile('default', '/.edgerc'); | ||
$auth->setHttpMethod('GET'); | ||
$auth->setPath('/diagnostic-tools/v1/locations'); | ||
$auth->setPath('/identity-management/v3/user-profile'); | ||
$context = array( | ||
'http' => array( | ||
'header' => array( | ||
'Authorization: ' . $auth->createAuthHeader(), | ||
'Content-Type: application/json' | ||
) | ||
) | ||
'http' => array( | ||
'header' => array( | ||
'Authorization: ' . $auth->createAuthHeader(), | ||
'Content-Type: application/json' | ||
) | ||
) | ||
); | ||
$context = stream_context_create($context); | ||
$response = json_decode(file_get_contents('https://' . $auth->getHost() . $auth->getPath(), null, $context)); | ||
``` | ||
## Author | ||
|
||
Davey Shafik <[email protected]> | ||
|
||
## License | ||
Copyright 2016 Akamai Technologies, Inc. All rights reserved. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at <http://www.apache.org/licenses/LICENSE-2.0>. | ||
Copyright © 2022 Akamai Technologies, Inc. All rights reserved | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at <http://www.apache.org/licenses/LICENSE-2.0>. | ||
[Akamai {OPEN} EdgeGrid Authentication]: https://developer.akamai.com/introduction/Client_Auth.html | ||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.