Skip to content

Commit 2e027b7

Browse files
authored
DXE-4826 Merge pull request #58 from akamai/release/6.0.2
DXE-4826 Release/6.0.2
2 parents 631da42 + 5f45e01 commit 2e027b7

File tree

52 files changed

+528
-1071
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+528
-1071
lines changed

CHANGELOG.md

Lines changed: 50 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
# Change log
22

3-
## 6.0.1 (December 17, 2024)
3+
## 6.0.2 (Apr 10, 2025)
44

55
### Fixes
66

7-
* Fixed vulnerability by upgrading the `asynchttpclient` module to 3.0.1 .
7+
* Fixed a vulnerability by upgrading the `asynchttpclient` module to `3.0.2`.
8+
* Upgraded `dependency-check` to 12.1.0 to fix the build issue.
9+
10+
## 6.0.1 (Dec 17, 2024)
11+
12+
### Fixes
13+
14+
* Fixed a vulnerability by upgrading the `asynchttpclient` module to `3.0.1`.
815
* Removed checks in the `AsyncHttpClientEdgeGridRequestSigner` class for the `ReactiveStreamsBodyGenerator` case, which is no longer available in a new version of the `asynchttpclient` module.
916
* Fixed some build errors by upgrading the JaCoCo library.
1017

11-
## 6.0.0 (August 21, 2024)
18+
## 6.0.0 (Aug 21, 2024)
1219

1320
### BREAKING CHANGES
1421

@@ -21,105 +28,105 @@
2128

2229
### Fixes
2330

24-
* Fixes for various vulnerabilities by upgrading `grpc-context`, `netty` and `commons-configuration2`.
25-
* Fixed issue when path param is an url for rest assured
31+
* Fixed various vulnerabilities by upgrading `grpc-context`, `netty`, and `commons-configuration2`.
32+
* Fixed an issue when a path param is a url for rest-assured.
2633

2734

28-
## 5.1.1 (December 6, 2023)
35+
## 5.1.1 (Dec 6, 2023)
2936

3037
### Fixes
3138

32-
* Fixes for various CVE vulnerabilities by upgrading logback classic, netty and dependency-check.
39+
* Fixed various CVE vulnerabilities by upgrading logback classic, netty and dependency-check.
3340

3441

35-
## 5.1.0 (September 5, 2023)
42+
## 5.1.0 (Sep 5, 2023)
3643

3744
### Improvements
3845

39-
* Add support for Apache HTTP Client version 5.
46+
* Added support for Apache HTTP Client version 5.
4047

4148
### Fixes
4249

43-
* Fixes for various CVE vulnerabilities by upgrading netty, dependency-check and guava libraries.
44-
* Fixes some build errors by upgrading Jacoco library.
45-
* Resolve various Javadoc warnings in different modules.
50+
* Fixed various CVE vulnerabilities by upgrading netty, dependency-check, and guava libraries.
51+
* Fixed some build errors by upgrading Jacoco library.
52+
* Resolved various Javadoc warnings in different modules.
4653

47-
## 5.0.0 (January 19, 2023)
54+
## 5.0.0 (Jan 19, 2023)
4855

4956
### BREAKING CHANGES
5057

5158
* Minimum Java version is 11.
5259

53-
## 4.1.2 (July 21, 2022)
60+
## 4.1.2 (Jul 21, 2022)
5461

5562
### Improvements
5663

57-
* Extract edgegrid-signer-gatling module to a separate project.
64+
* Extracted the `edgegrid-signer-gatling` module to a separate project.
5865

5966
### Fixes
6067

61-
* Fixes for various vulnerabilities: OSSRH-66257, CVE-2020-36518, sonatype-2021-4682, CVE-2022-24823, sonatype-2019-0673, sonatype-2012-0050, sonatype-2021-4916
68+
* Fixed various vulnerabilities: `OSSRH-66257`, `CVE-2020-36518`, `sonatype-2021-4682`, `CVE-2022-24823`, `sonatype-2019-0673`, `sonatype-2012-0050`, `sonatype-2021-4916`.
6269

63-
## 4.1.1 (February 17, 2022)
70+
## 4.1.1 (Feb 17, 2022)
6471

6572
### Enhancements
6673

6774
* Added OWASP dependency check plugin to maven pipeline.
6875

6976
### Fixes
7077

71-
* Fix multiple CVE vulnerabilities by upgrading logback and netty dependencies.
72-
* Fix Travis build by updating Java version to 8.
73-
* Correct README.md inconsistencies.
78+
* Fixed multiple CVE vulnerabilities by upgrading logback and netty dependencies.
79+
* Fixed Travis build by updating Java version to 8.
80+
* Corrected `README.md`'s inconsistencies.
7481

75-
## 4.1.0 (August 26, 2021)
82+
## 4.1.0 (Aug 26, 2021)
7683

7784
### Enhancements
7885

79-
* Upgrade project dependencies.
80-
* Ensure compatibility with Java >= v9.
86+
* Upgraded project dependencies.
87+
* Ensured compatibility with Java >= v9.
8188

8289
## 4.0.1
8390

8491
### Fixes
8592

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

89-
## 4.0
96+
## 4.0 (Feb 19, 2019)
9097

9198
### BREAKING CHANGES
9299

93-
* Split the edgerc file reader into new module [edgerc-reader](edgerc-reader).
94-
* Drop dependency on commons-configuration2 from edgegrid-signer-core.
95-
* Drop dependency on commons-lang3.
96-
* Drop dependency on commons-codec (use Base64 methods from JDK instead).
97-
* Use maven-bundle-plugin to add OSGi headers to MANIFEST.MF.
100+
* Split the edgerc file reader into a new module [edgerc-reader](edgerc-reader).
101+
* Dropped a dependency on `commons-configuration2` from `edgegrid-signer-core`.
102+
* Dropped a dependency on `commons-lang3`.
103+
* Dropped a dependency on `commons-codec` (use Base64 methods from JDK instead).
104+
* Use maven-bundle-plugin to add `OSGi` headers to `MANIFEST.MF`.
98105

99-
## 3.0
106+
## 3.0 (Aug 8, 2018)
100107

101108
### BREAKING CHANGES
102109

103110
* Minimum Java version is now 8.
104111

105112
### Improvements
106113

107-
* Adding binding for Async HTTP Client.
108-
* Adding binding for Gatling.
114+
* Added binding for Async HTTP Client.
115+
* Added binding for Gatling.
109116

110-
## 2.1
117+
## 2.1 (Jul 27, 2017)
111118

112119
### Improvements
113120

114-
* Adding binding for Apache HTTP Client.
115-
* Splitting README.md between relevant modules.
121+
* Added binding for Apache HTTP Client.
122+
* Split `README.md` between relevant modules.
116123

117-
## 2.0
124+
## 2.0 (Jul 27, 2017)
118125

119126
### Improvements
120127

121-
* Signing algorithm tweaks
122-
* Separating binding for Google HTTP Client Library for Java from core
123-
* Adding binding for REST-assured
124-
* Unit tests with TestNG
125-
* Publishing to Maven Central!
128+
* Added signing algorithm tweaks.
129+
* Separated binding for the Google HTTP Client library for Java from the core signing library.
130+
* Added binding for REST-assured.
131+
* Unit tests with TestNG.
132+
* Published to Maven Central.

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright {yyyy} {name of copyright owner}
189+
Copyright 2025 Akamai Technologies, Inc. All rights reserved.
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192-
you may not use this file except in compliance with the License.
192+
you may not use these files except in compliance with the License.
193193
You may obtain a copy of the License at
194194

195195
http://www.apache.org/licenses/LICENSE-2.0

README.md

Lines changed: 105 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,134 @@
11
# EdgeGrid Client for Java
22

3-
This library implements [EdgeGrid authentication](https://techdocs.akamai.com/developer/docs/authenticate-with-edgegrid) for Java.
3+
This library implements an Authentication handler for the [Akamai EdgeGrid Authentication](https://techdocs.akamai.com/developer/docs/authenticate-with-edgegrid) scheme in Java.
44

5-
Before you begin, you need to [Create authentication credentials](https://techdocs.akamai.com/developer/docs/set-up-authentication-credentials).
5+
## Install
66

7-
## Install required software
8-
9-
In order to use EdgeGrid Client for Java, you need [Java version 11+](https://www.java.com/en/download/help/download_options.xml).
7+
To use AkamaiOPEN EdgeGrid for Java, you need Java version 11+.
108

119
[![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)
1210
[![Javadocs](http://www.javadoc.io/badge/com.akamai.edgegrid/edgegrid-signer-parent.svg)](https://www.javadoc.io/doc/com.akamai.edgegrid)
1311

14-
## Make an API call
15-
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.
12+
## Modules
1613

17-
```
18-
ClientCredential credential = ClientCredential.builder()
19-
.accessToken("akaa-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx")
20-
.clientToken("akaa-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx")
21-
.clientSecret("SOMESECRET")
22-
.host("akaa-baseurl-xxxxxxxxxxx-xxxxxxxxxxxxx.luna.akamaiapis.net")
23-
.build();
24-
```
14+
This project contains core implementation modules and binding modules to specific HTTP client libraries.
2515

26-
Example API call:
27-
```
28-
Request request = Request.builder()
29-
.method("POST")
30-
.uri("https://akaa-baseurl-xxxxxxxxxxx-xxxxxxxxxxxxx.luna.akamaiapis.net/diagnostic-tools/v2/ghost-locations/available")
31-
.body("{ \"field\": \"field value\" }".getBytes())
32-
.header("X-Some-Signed-Header", "header value")
33-
.header("X-Some-Other-Signed-Header", "header value 2")
34-
.build();
35-
```
16+
### Core
3617

37-
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).
18+
| Module | Description |
19+
| ---------- | ------------ |
20+
| [edgegrid-signer-core](edgegrid-signer-core) | The core signing implementation and base classes used by an individual library. |
21+
| [edgegrid-reader](edgegrid-reader) | A configuration file reader that reads credentials from an `.edgerc` file. This file is an INI file with credential sections and properties. |
3822

39-
## Modules
23+
See the [Authentication](#authentication) section for details on using the classes from these modules.
24+
25+
### Bindings
26+
27+
| Module | Description |
28+
| ---------- | ------------ |
29+
| [edgegrid-signer-apache-http-client](edgegrid-signer-apache-http-client) | A binding for [Apache HTTP Client before version 5.0.0](https://hc.apache.org/httpcomponents-client-4.5.x/). |
30+
| [edgegrid-signer-apache-http-client5](edgegrid-signer-apache-http-client5) | A binding for [Apache HTTP Client version 5.x](https://hc.apache.org/httpcomponents-client-5.4.x/). |
31+
| [edgegrid-signer-async-http-client](edgegrid-signer-async-http-client) | A binding for [Async HTTP Client](https://github.com/AsyncHttpClient/async-http-client). |
32+
| [edgegrid-signer-google-http-client](edgegrid-signer-google-http-client) | A binding for [Google HTTP Client](https://github.com/google/google-http-java-client). |
33+
| [edgegrid-signer-rest-assured](edgegrid-signer-rest-assured) | A binding for [REST-assured](https://github.com/rest-assured/rest-assured). |
34+
35+
36+
> __Note__: Several similar libraries for signing requests exist for popular
37+
programming languages, and you can find them at [https://github.com/akamai?q=edgegrid](https://github.com/akamai?q=edgegrid).
4038

41-
This project contains a core implementation module and five bindings to specific HTTP client libraries.
39+
## Authentication
4240

43-
* [edgegrid-signer-core](edgegrid-signer-core) is the core signing implementation and base classes used by the individual library implementations.
44-
* [edgerc-reader](edgerc-reader) is a configuration file reader that supports `.edgerc` files. These files are basically INI files with certain sections and properties.
45-
* [edgegrid-signer-apache-http-client](edgegrid-signer-apache-http-client) is a binding for [Apache HTTP Client][2].
46-
* [edgegrid-signer-google-http-client](edgegrid-signer-google-http-client) is a binding for [Google HTTP Client Library for Java][3].
47-
* [edgegrid-signer-rest-assured](edgegrid-signer-rest-assured) is a binding for [REST-assured][4].
48-
* [edgegrid-signer-async-http-client](edgegrid-signer-async-http-client) is a binding for [Async HTTP Client][13].
41+
You can get the authentication credentials through an API client. Requests to the API are marked with a timestamp and a signature and are executed immediately.
4942

43+
1. [Create authentication credentials](https://techdocs.akamai.com/developer/docs/set-up-authentication-credentials).
5044

51-
> Note: A number of similar libraries for signing requests exist for popular
52-
programming languages, and you can find them at [https://github.com/akamai?q=edgegrid](https://github.com/akamai?q=edgegrid)
45+
2. Place your credentials in an EdgeGrid resource file `~/.edgerc`, in the `[default]` section.
5346

47+
```
48+
[default]
49+
client_secret = C113nt53KR3TN6N90yVuAgICxIRwsObLi0E67/N8eRN=
50+
host = akab-h05tnam3wl42son7nktnlnnx-kbob3i3v.luna.akamaiapis.net
51+
access_token = akab-acc35t0k3nodujqunph3w7hzp7-gtm6ij
52+
client_token = akab-c113ntt0k3n4qtari252bfxxbsl-yvsdj
53+
```
5454
55-
[1]: https://techdocs.akamai.com/developer/docs/authenticate-with-edgegrid
56-
[2]: https://hc.apache.org/
57-
[3]: https://github.com/google/google-http-java-client
58-
[4]: https://github.com/rest-assured/rest-assured
59-
[5]: https://github.com/akamai-open/edgegrid-curl
60-
[6]: https://github.com/akamai-open/AkamaiOPEN-edgegrid-python
61-
[7]: https://github.com/akamai-open/AkamaiOPEN-edgegrid-ruby
62-
[8]: https://github.com/akamai-open/AkamaiOPEN-edgegrid-perl
63-
[9]: https://github.com/akamai-open/AkamaiOPEN-powershell
64-
[10]: https://github.com/akamai-open/AkamaiOPEN-edgegrid-node
65-
[11]: https://github.com/akamai-open/AkamaiOPEN-edgegrid-C-Sharp
66-
[12]: https://github.com/akamai-open/AkamaiOPEN-edgegrid-golang
67-
[13]: https://github.com/AsyncHttpClient/async-http-client
55+
In addition to the required properties, an `.edgerc` file can optionally contain a `max-body` property. If absent, the implied default is 131072.
6856
69-
## Authors
57+
If you've inherited a `max-body` value of 8192 in your `.edgerc` file, that value is incorrect. If you encounter signature mismatch errors with POST requests, try removing that value from the file before trying anything else.
7058
71-
### Active
59+
3. Use your local `.edgerc` by providing the path to your resource file and credentials' section header in the `EdgeRcClientCredentialProvider` class from the `edgerc-reader` module.
7260
73-
Michał Wójcik <miwojci@akamai.com>
61+
```java
62+
ClientCredential credential = EdgeRcClientCredentialProvider
63+
.fromEdgeRc("path/to/.edgerc", "your-section-header")
64+
.getClientCredential(null);
65+
```
7466
75-
Tatiana Slonimskaia <tslonims@akamai.com>
67+
Or hard code your credentials and pass the values to the `ClientCredential` class from the `edgegrid-signer-core` module.
68+
69+
```java
70+
ClientCredential credential = ClientCredential.builder()
71+
.clientSecret("C113nt53KR3TN6N90yVuAgICxIRwsObLi0E67/N8eRN=")
72+
.host("akab-h05tnam3wl42son7nktnlnnx-kbob3i3v.luna.akamaiapis.net")
73+
.accessToken("akab-acc35t0k3nodujqunph3w7hzp7-gtm6ij")
74+
.clientToken("akab-c113ntt0k3n4qtari252bfxxbsl-yvsdj")
75+
.build();
76+
```
77+
78+
## Use
79+
80+
Using one of the bindings to the HTTP client libraries, provide the path to your `.edgerc`, your credentials' section header, and the appropriate endpoint information.
81+
82+
The following is an example of making an HTTP call with Apache HTTP Client 5, one of the HTTP client libraries for Java that our EdgeGrid plug-in supports.
83+
84+
```java
85+
import java.io.IOException;
86+
87+
import org.apache.commons.configuration2.ex.ConfigurationException;
88+
import org.apache.hc.client5.http.classic.methods.HttpGet;
89+
import org.apache.hc.client5.http.impl.classic.BasicHttpClientResponseHandler;
90+
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
91+
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
92+
93+
import com.akamai.edgegrid.signer.ClientCredential;
94+
import com.akamai.edgegrid.signer.EdgeRcClientCredentialProvider;
95+
import com.akamai.edgegrid.signer.apachehttpclient5.ApacheHttpClient5EdgeGridInterceptor;
96+
import com.akamai.edgegrid.signer.apachehttpclient5.ApacheHttpClient5EdgeGridRoutePlanner;
97+
98+
public class GetUserProfile {
99+
public static void main(String[] args) throws ConfigurationException, IOException {
100+
ClientCredential credential = EdgeRcClientCredentialProvider
101+
.fromEdgeRc("~/.edgerc", "default")
102+
.getClientCredential(null);
103+
104+
try (CloseableHttpClient client = HttpClientBuilder.create()
105+
.addRequestInterceptorFirst(new ApacheHttpClient5EdgeGridInterceptor(credential))
106+
.setRoutePlanner(new ApacheHttpClient5EdgeGridRoutePlanner(credential))
107+
.build()) {
108+
109+
String uri = "https://" + credential.getHost() + "/identity-management/v3/user-profile";
110+
System.out.println(client.execute(new HttpGet(uri), new BasicHttpClientResponseHandler()));
111+
}
112+
}
113+
}
114+
```
76115

77-
### Inactive
116+
For details on how to make a call using this and other bindings to the HTTP client libraries, see each binding module's `README.md` file.
78117

79-
Martin Meyer <mmeyer@akamai.com>
118+
## Reporting issues
80119

81-
Maciej Gawinecki
120+
To report an issue or make a suggestion, create a new [GitHub issue](https://github.com/akamai/AkamaiOPEN-edgegrid-java/issues).
82121

83-
Roberto López López
122+
## License
84123

85-
## Contribute
124+
Copyright 2025 Akamai Technologies, Inc. All rights reserved.
86125

87-
This is an open-source library, and contributions are welcome. You're welcome
88-
to fork this project and send us a pull request.
126+
Licensed under the Apache License, Version 2.0 (the "License");
127+
you may not use these files except in compliance with the License.
128+
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
89129

90-
Find valuable resources on the [Akamai Developer](https://developer.akamai.com/) website.
130+
Unless required by applicable law or agreed to in writing, software
131+
distributed under the License is distributed on an "AS IS" BASIS,
132+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
133+
See the License for the specific language governing permissions and
134+
limitations under the License.

0 commit comments

Comments
 (0)