Skip to content

Commit

Permalink
Merge pull request #42 from akamai/release/4.1.1
Browse files Browse the repository at this point in the history
Release/4.1.1
  • Loading branch information
Piyush Kaushik authored Feb 17, 2022
2 parents 5c68ea6 + e1fd58c commit 9829e8e
Show file tree
Hide file tree
Showing 18 changed files with 202 additions and 188 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ dist: trusty
sudo: false
language: java
jdk:
- openjdk7
- openjdk8
66 changes: 63 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,65 @@
# 4.1.0 (August 26, 2021)
# Change log

## 4.1.1 (February 17, 2022)

### Enhancements

* Added OWASP dependency check plugin to maven pipeline.

### Fixes

* Fix multiple CVE vulnerabilities by upgrading logback and netty dependencies.
* Fix Travis build by updating Java version to 8.
* Correct README.md inconsistencies.

## 4.1.0 (August 26, 2021)

### Enhancements

## Enhancements
* Upgrade project dependencies.
* Ensure compatibility with Java > v9.
* Ensure compatibility with Java >= v9.

## 4.0.1

### Fixes

* Fix Issue #35, a broken unit test.
* Use [URI#getRawPath()](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html#getRawPath--) when constructing a signature.

## 4.0

### BREAKING CHANGES

* Split the edgerc file reader into new module [edgerc-reader](edgerc-reader).
* Drop dependency on commons-configuration2 from edgegrid-signer-core.
* Drop dependency on commons-lang3.
* Drop dependency on commons-codec (use Base64 methods from JDK instead).
* Use maven-bundle-plugin to add OSGi headers to MANIFEST.MF.

## 3.0

### BREAKING CHANGES

* Minimum Java version is now 8.

### Improvements

* Adding binding for Async HTTP Client.
* Adding binding for Gatling.

## 2.1

### Improvements

* Adding binding for Apache HTTP Client.
* Splitting README.md between relevant modules.

## 2.0

### Improvements

* Signing algorithm tweaks
* Separating binding for Google HTTP Client Library for Java from core
* Adding binding for REST-assured
* Unit tests with TestNG
* Publishing to Maven Central!
109 changes: 48 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,59 @@
# EdgeGrid Client for Java

Java implementation of Akamai {OPEN} EdgeGrid signing.
This library implements [EdgeGrid authentication](https://techdocs.akamai.com/developer/docs/authenticate-with-edgegrid) for Java.

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.akamai.edgegrid/edgegrid-signer-parent/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.akamai.edgegrid/edgegrid-signer-parent)
[![Javadocs](http://www.javadoc.io/badge/com.akamai.edgegrid/edgegrid-signer-parent.svg)](http://www.javadoc.io/doc/com.akamai.edgegrid/edgegrid-signer-parent)
Before you begin, you need to [Create authentication credentials](https://techdocs.akamai.com/developer/docs/set-up-authentication-credentials).

## Install required software

## Description
In order to use EdgeGrid Client for Java, you need [Java version 8+](https://www.java.com/en/download/help/download_options.xml).

This library implements [Akamai {OPEN} EdgeGrid Authentication][1] for Java.
It is presented as a core module which can be used independently of any
particular HTTP client library and three implementations for specific HTTP client
libraries.
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.akamai.edgegrid/edgegrid-signer-parent/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.akamai.edgegrid/edgegrid-signer-parent)
[![Javadocs](http://www.javadoc.io/badge/com.akamai.edgegrid/edgegrid-signer-parent.svg)](https://www.javadoc.io/doc/com.akamai.edgegrid)

## Make an API call
You'll need the values for the tokens from your [.edgerc](https://techdocs.akamai.com/developer/docs/set-up-authentication-credentials#add-credential-to-edgerc-file) file.

```
ClientCredential credential = ClientCredential.builder()
.accessToken("akaa-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx")
.clientToken("akaa-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx")
.clientSecret("SOMESECRET")
.host("akaa-baseurl-xxxxxxxxxxx-xxxxxxxxxxxxx.luna.akamaiapis.net")
.build();
```

Example API call:
```
Request request = Request.builder()
.method("POST")
.uri("https://akaa-baseurl-xxxxxxxxxxx-xxxxxxxxxxxxx.luna.akamaiapis.net/diagnostic-tools/v2/ghost-locations/available")
.body("{ \"field\": \"field value\" }".getBytes())
.header("X-Some-Signed-Header", "header value")
.header("X-Some-Other-Signed-Header", "header value 2")
.build();
```

This is an example of an API call to [List available edge server locations](https://techdocs.akamai.com/diagnostic-tools/reference/ghost-locationsavailable). Change the `uri` element to reference an endpoint in any of the [Akamai APIs](https://developer.akamai.com/api).

## Modules

This project contains a core implementation module and five bindings to specific HTTP client libraries.

* [edgegrid-signer-core](edgegrid-signer-core) is the core signing implementation and base classes used by the individual library implementations.
* [edgerc-reader](edgerc-reader) is a configuration file reader that supports edgerc files. These files are basically INI files with certain sections and properties.
* [edgerc-reader](edgerc-reader) is a configuration file reader that supports `.edgerc` files. These files are basically INI files with certain sections and properties.
* [edgegrid-signer-apache-http-client](edgegrid-signer-apache-http-client) is a binding for [Apache HTTP Client][2].
* [edgegrid-signer-google-http-client](edgegrid-signer-google-http-client) is a binding for [Google HTTP Client Library for Java][3].
* [edgegrid-signer-rest-assured](edgegrid-signer-rest-assured) is a binding for [REST-assured][4].
* [edgegrid-signer-async-http-client](edgegrid-signer-async-http-client) is a binding for [Async HTTP Client][13].
* [edgegrid-signer-gatling](edgegrid-signer-gatling) is a binding for [Gatling][14].

## Changes

4.0.2:
- Upgrade libraries.
- Add missing dependencies for Java ≥ 9.

4.0.1:
- Fix Issue #35, a broken unit test.
- Use [URI#getRawPath()](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html#getRawPath--) when constructing a signature.

4.0:
- BREAKING CHANGE: Split the edgerc file reader into new module [edgerc-reader](edgerc-reader).
- Drop dependency on commons-configuration2 from edgegrid-signer-core.
- Drop dependency on commons-lang3.
- Drop dependency on commons-codec (use Base64 methods from JDK instead).
- Use maven-bundle-plugin to add OSGi headers to MANIFEST.MF.

3.0:
- Minimum Java version is now 8.
- Adding binding for Async HTTP Client.
- Adding binding for Gatling.

2.1:
- Adding binding for Apache HTTP Client.
- Splitting README.md between relevant modules.

2.0:
- Signing algorithm tweaks
- Separating binding for Google HTTP Client Library for Java from core
- Adding binding for REST-assured
- Unit tests with TestNG
- Publishing to Maven Central!

## Similar tools

A number of similar libraries for signing requests exist for popular
programming languages:

* There are two Python bindings: a [command line tool similar to curl][5] and a [Python library][6].
* [Ruby binding][7]
* [Perl binding][8]
* [Powershell binding][9]
* [NodeJS binding][10]
* [C# binding][11]
* [Go binding][12]

[1]: https://developer.akamai.com/introduction/Client_Auth.html

> Note: A number of similar libraries for signing requests exist for popular
programming languages, and you can find them at [https://github.com/akamai?q=edgegrid](https://github.com/akamai?q=edgegrid)


[1]: https://techdocs.akamai.com/developer/docs/authenticate-with-edgegrid
[2]: https://hc.apache.org/
[3]: https://github.com/google/google-http-java-client
[4]: https://github.com/rest-assured/rest-assured
Expand All @@ -87,15 +70,19 @@ programming languages:

## Authors

### Active authors
Martin Meyer <mmeyer@akamai.com>
### Active

Roberto López López <rlopezlo@akamai.com>
Michał Wójcik <miwojci@akamai.com>

### Inactive authors
### Inactive

Martin Meyer <mmeyer@akamai.com>
Maciej Gawinecki <mgawinec@akamai.com>

## Contribute!
## Contribute

This is an open-source library, and contributions are welcome. You're welcome
to fork this project and send us a pull request.

For more information about OPEN API visit the [Akamai {OPEN} Developer Community](https://developer.akamai.com/).
Find valuable resources on the [Akamai Developer](https://developer.akamai.com/) website.
30 changes: 11 additions & 19 deletions edgegrid-signer-apache-http-client/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
# EdgeGrid Client for Java
# Apache HTTP Client module - EdgeGrid Client for Java

Java implementation of Akamai {OPEN} EdgeGrid signing.
-[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.akamai.edgegrid/edgegrid-signer-apache-http-client/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.akamai.edgegrid/edgegrid-signer-apache-http-client)
-[![Javadoc](http://www.javadoc.io/badge/com.akamai.edgegrid/edgegrid-signer-apache-http-client.svg)](http://www.javadoc.io/doc/com.akamai.edgegrid/edgegrid-signer-apache-http-client)

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.akamai.edgegrid/edgegrid-signer-apache-http-client/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.akamai.edgegrid/edgegrid-signer-apache-http-client)
[![Javadoc](http://www.javadoc.io/badge/com.akamai.edgegrid/edgegrid-signer-apache-http-client.svg)](http://www.javadoc.io/doc/com.akamai.edgegrid/edgegrid-signer-apache-http-client)
This library implements [Akamai EdgeGrid Authentication](https://techdocs.akamai.com/developer/docs/authenticate-with-edgegrid) for Java.
This particular module is a binding for the [Apache HTTP Client library](https://hc.apache.org/).
This project contains installation and usage instructions in the [README.md](../README.md).

## Description

This library implements [Akamai {OPEN} EdgeGrid Authentication][1] for Java.
This particular module is a binding for the [Apache HTTP Client library][2].

## Usage of Apache HTTP Client
## Use Apache HTTP Client

Include the following Maven dependency in your project POM:

```xml
<dependency>
<groupId>com.akamai.edgegrid</groupId>
<artifactId>edgegrid-signer-apache-http-client</artifactId>
<version>4.0.2</version>
<version>4.1.1</version>
</dependency>
```

Expand All @@ -34,10 +31,10 @@ HttpGet request = new HttpGet("http://endpoint.net/billing-usage/v1/reportSource
client.execute(request);
```

## Usage with REST-assured
## Use with REST-assured

This signing module can also be used with [REST-assured][3] instead of using the
[REST-assured signing module][4]. In this situation you would be configuring the
This signing module can also be used with [REST-assured](https://github.com/rest-assured/rest-assured) instead of using the
[EdgeGrid REST-assured signing module](../edgegrid-signer-rest-assured). In this situation you'd configure the
Apache HTTP Client as the low-level transport for REST-assured requests and the
`RestAssuredEdgeGridFilter` would not be used at all. This may be advantageous
because of some capabilities available to the Apache HTTP Client that are not
Expand Down Expand Up @@ -71,8 +68,3 @@ given()
.then()
.statusCode(200);
```

[1]: https://developer.akamai.com/introduction/Client_Auth.html
[2]: https://hc.apache.org/
[3]: https://github.com/rest-assured/rest-assured
[4]: ../edgegrid-signer-rest-assured
2 changes: 1 addition & 1 deletion edgegrid-signer-apache-http-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>edgegrid-signer-parent</artifactId>
<groupId>com.akamai.edgegrid</groupId>
<version>4.1.0</version>
<version>4.1.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
32 changes: 13 additions & 19 deletions edgegrid-signer-async-http-client/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
# EdgeGrid Client for Java
# Async HTTP Client library - EdgeGrid Client for Java

Java implementation of Akamai {OPEN} EdgeGrid signing.
-[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.akamai.edgegrid/edgegrid-signer-async-http-client/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.akamai.edgegrid/edgegrid-signer-async-http-client)
-[![Javadoc](http://www.javadoc.io/badge/com.akamai.edgegrid/edgegrid-signer-async-http-client.svg)](http://www.javadoc.io/doc/com.akamai.edgegrid/edgegrid-signer-async-http-client)

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.akamai.edgegrid/edgegrid-signer-async-http-client/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.akamai.edgegrid/edgegrid-signer-async-http-client)
[![Javadoc](http://www.javadoc.io/badge/com.akamai.edgegrid/edgegrid-signer-async-http-client.svg)](http://www.javadoc.io/doc/com.akamai.edgegrid/edgegrid-signer-async-http-client)
This library implements [Akamai EdgeGrid Authentication](https://techdocs.akamai.com/developer/docs/authenticate-with-edgegrid) for Java.
This particular module is a binding for the [Async HTTP Client library](https://github.com/AsyncHttpClient/async-http-client).
This project contains installation and usage instructions in the [README.md](../README.md).

## Description

This library implements [Akamai {OPEN} EdgeGrid Authentication][1] for Java.
This particular module is a binding for the [Async HTTP Client library][2].

## Usage of Async HTTP Client
## Use Async HTTP Client

Include the following Maven dependency in your project POM:

```xml
<dependency>
<groupId>com.akamai.edgegrid</groupId>
<artifactId>edgegrid-signer-async-http-client</artifactId>
<version>4.0.2</version>
<version>4.1.1</version>
</dependency>
```

Expand All @@ -35,6 +32,10 @@ Request request = new RequestBuilder("POST")
.build();

asyncHttpClient().executeRequest(request).get();

> Note: The `host` part of the URI will be replaced by the provided `AsyncHttpClientEdgeGridSignatureCalculator`
with the host from the client credential in the `.edgerc` file.

```

Alternatively, create an HTTP client that will sign each HTTP request with a defined client
Expand All @@ -52,11 +53,4 @@ client.preparePost("https://localhost/papi/v0/properties")
.execute().get();
```

Note, in the latter case requests *must* be prepared with the HTTP client.

Note, in both cases the host part of the URI does not matter, because it will be replaced by
the provided `AsyncHttpClientEdgeGridSignatureCalculator` with the host from the provided client
credential.

[1]: https://developer.akamai.com/introduction/Client_Auth.html
[2]: https://github.com/AsyncHttpClient/async-http-client
> Note: In this case you need to prepare requests with the HTTP client.
2 changes: 1 addition & 1 deletion edgegrid-signer-async-http-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>edgegrid-signer-parent</artifactId>
<groupId>com.akamai.edgegrid</groupId>
<version>4.1.0</version>
<version>4.1.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
11 changes: 1 addition & 10 deletions edgegrid-signer-core/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
# EdgeGrid Client for Java

Java implementation of Akamai {OPEN} EdgeGrid signing.

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.akamai.edgegrid/edgegrid-signer-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.akamai.edgegrid/edgegrid-signer-core)
[![Javadoc](http://www.javadoc.io/badge/com.akamai.edgegrid/edgegrid-signer-core.svg)](http://www.javadoc.io/doc/com.akamai.edgegrid/edgegrid-signer-core)

## Description

This library implements [Akamai {OPEN} EdgeGrid Authentication][1] for Java.
This library implements [Akamai EdgeGrid Authentication](https://techdocs.akamai.com/developer/docs/authenticate-with-edgegrid) for Java.
This particular module is the core implementation, containing base classes and
a signing algorithm implementation.

Expand Down Expand Up @@ -81,5 +74,3 @@ credential.
`ClientCredentialProvider` which always returns the same `ClientCredential`.
The constructors for all the `AbstractEdgeGridRequestSigner` implementations
create one of these transparently whenever they are passed a `ClientCredential`.

[1]: https://developer.akamai.com/introduction/Client_Auth.html
2 changes: 1 addition & 1 deletion edgegrid-signer-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>edgegrid-signer-parent</artifactId>
<groupId>com.akamai.edgegrid</groupId>
<version>4.1.0</version>
<version>4.1.1</version>
</parent>

<artifactId>edgegrid-signer-core</artifactId>
Expand Down
Loading

0 comments on commit 9829e8e

Please sign in to comment.