Skip to content

Commit

Permalink
Merge pull request #2 from Adscore/feature/ADS-276_update_readme_1.0.4
Browse files Browse the repository at this point in the history
[ADS-276] Update readme & rename submodules into sample
  • Loading branch information
DonCziken authored Mar 1, 2021
2 parents 346bf67 + 953b9f7 commit 8d4c329
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "submodules/client-libs-java-samples"]
path = submodules/client-libs-java-samples
url = https://github.com/Adscore/client-libs-java-samples
[submodule "sample/client-libs-java-samples"]
path = sample/client-libs-java-samples
url = https://github.com/Adscore/client-libs-java-samples.git
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ The definition of verify function looks as follows:
* customers this should be always set to 'customer'
* @param key string containing related zone key
* @param ipAddresses array of strings containing ip4 or ip6 addresses against which we check
* signature
* signature. Usually, is fulfilled from httpXForwardForIpAddresses or/and remoteIpAddresses
* header. All possible ip addresses may be provided at once, in case of correct result,
* verifier returns list of chosen ip addresses that matched with the signature.
* @param expiry number which is time in seconds. IF signatureTime + expiry > CurrentDateInSeconds
* THEN result is expired. If null than expiry is not checked.
* @param isKeyBase64Encoded boolean defining if passed key is base64 encoded or not
Expand All @@ -124,6 +126,9 @@ The definition of verify function looks as follows:
[Integer expiry (=null),] // optional due existance of overloaded function
String... ipAddresses) {
```
<b>Executable</b> samples you can find on:
https://github.com/Adscore/client-libs-java-samples
<br> (See section <b>Samples</b> above).

Following are few quick examples of how to use verifier, first import the entry point for library:

Expand Down Expand Up @@ -172,6 +177,8 @@ than you have at least few options of how to verify signatures:
"customer",
"key_non_base64_encoded",
false, // notify that we use non encoded key

//Multiple ip addresses either from httpXForwardForIpAddresses and remoteIpAddresses header
"73.109.57.137", "73.109.57.138", "73.109.57.139", "73.109.57.140", "0:0:0:0:0:ffff:4d73:55d3", "0:0:0:0:0:fffff:4d73:55d4", "0:0:0:0:0:fffff:4d73:55d5", "0:0:0:0:0:fffff:4d73:55d6");
[..]

Expand Down
16 changes: 12 additions & 4 deletions src/main/java/com/adscore/signature/SignatureVerifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ public class SignatureVerifier {
* customers this should be always set to 'customer'
* @param key string containing related zone key
* @param ipAddresses array of strings containing ip4 or ip6 addresses against which we check
* signature
* signature. Usually, is fulfilled from httpXForwardForIpAddresses or/and remoteIpAddresses
* header. All possible ip addresses may be provided at once, in case of correct result,
* verifier returns list of chosen ip addresses that matched with the signature.
* @return VerificationResult
*/
public static SignatureVerificationResult verify(
Expand All @@ -61,7 +63,9 @@ public static SignatureVerificationResult verify(
* customers this should be always set to 'customer'
* @param key string containing related zone key
* @param ipAddresses array of strings containing ip4 or ip6 addresses against which we check
* signature
* signature. Usually, is fulfilled from httpXForwardForIpAddresses or/and remoteIpAddresses
* header. All possible ip addresses may be provided at once, in case of correct result,
* verifier returns list of chosen ip addresses that matched with the signature.
* @param expiry number which is time in seconds. IF signatureTime + expiry > CurrentDateInSeconds
* THEN result is expired
* @return VerificationResult
Expand All @@ -87,7 +91,9 @@ public static SignatureVerificationResult verify(
* customers this should be always set to 'customer'
* @param key string containing related zone key
* @param ipAddresses array of strings containing ip4 or ip6 addresses against which we check
* signature
* signature. Usually, is fulfilled from httpXForwardForIpAddresses or/and remoteIpAddresses
* header. All possible ip addresses may be provided at once, in case of correct result,
* verifier returns list of chosen ip addresses that matched with the signature.
* @param isKeyBase64Encoded boolean defining if passed key is base64 encoded or not
* @return VerificationResult
*/
Expand Down Expand Up @@ -117,7 +123,9 @@ public static SignatureVerificationResult verify(
* customers this should be always set to 'customer'
* @param key string containing related zone key
* @param ipAddresses array of strings containing ip4 or ip6 addresses against which we check
* signature
* signature. Usually, is fulfilled from httpXForwardForIpAddresses or/and remoteIpAddresses
* header. All possible ip addresses may be provided at once, in case of correct result,
* verifier returns list of chosen ip addresses that matched with the signature.
* @param expiry number which is time in seconds. IF signatureTime + expiry > CurrentDateInSeconds
* THEN result is expired
* @param isKeyBase64Encoded boolean defining if passed key is base64 encoded or not
Expand Down

0 comments on commit 8d4c329

Please sign in to comment.