Skip to content

Commit

Permalink
Merge pull request #7 from akamai/release/2.0.0
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
mgwoj authored Oct 14, 2022
2 parents f60a3be + d750781 commit 65fc3e0
Show file tree
Hide file tree
Showing 23 changed files with 4,738 additions and 1,493 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ composer.phar
vendor/
build/
akamai-open-edgegrid-auth*.phar
.phpunit.result.cache
.php-cs-fixer.cache

### IntelliJ ###
*.iml
Expand Down
25 changes: 0 additions & 25 deletions .scrutinizer.yml

This file was deleted.

73 changes: 0 additions & 73 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
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]
Expand Down
119 changes: 44 additions & 75 deletions README.md
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.
70 changes: 0 additions & 70 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion box.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
}
],
"compression": "BZ2",
"bootstrap": "build/phar/bootstrap.php",
"git-version": "package_version",
"main": false,
"output": "akamai-open-edgegrid-auth.phar",
"stub": "build/phar/stub.php"
}
Loading

0 comments on commit 65fc3e0

Please sign in to comment.