Skip to content
Snippets Groups Projects
Commit 1267bf3f authored by Riabokon Stanislav(EPAM)[GCP]'s avatar Riabokon Stanislav(EPAM)[GCP]
Browse files

Merge branch 'fix-test-endpoint' into 'master'

Fix GC test endpoint

See merge request !398
parents dc20c592 fb8bd020
No related branches found
No related tags found
1 merge request!398Fix GC test endpoint
Pipeline #214378 canceled
......@@ -86,7 +86,7 @@ The following software have components provided under the terms of this license:
- Byte Buddy (without dependencies) (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy)
- Byte Buddy Java agent (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent)
- ClassMate (from http://github.com/cowtowncoder/java-classmate)
- Cloud Key Management Service (KMS) API v1-rev20230421-2.0.0 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms)
- Cloud Key Management Service (KMS) API (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms)
- Collections (from https://repo1.maven.org/maven2/commons-collections/commons-collections)
- Commons Digester (from http://commons.apache.org/digester/)
- Converter: Jackson (from https://github.com/square/retrofit, https://repo1.maven.org/maven2/com/squareup/retrofit2/converter-jackson)
......
......@@ -47,7 +47,7 @@ public class SubscriberListenerTestApi {
try {
signatureService.verifyHmacSignature(hmac, this.serviceConfig.getSubscriberSecret());
logger.debug("GC tests: Signature verified and sending response");
notificationsState.put(path, new AtomicLong());
notificationsState.putIfAbsent(path, new AtomicLong());
// Use the secret you send to the subscriber registration create request
return new ChallengeResponse(HashingUtil.hashString(crc, this.serviceConfig.getSubscriberSecret()));
} catch (SignatureServiceException e) {
......@@ -63,6 +63,7 @@ public class SubscriberListenerTestApi {
// Performing End Point Notification Acknowledgement
try {
testSubscription.performTestAcknowledgement();
notificationsState.putIfAbsent(path, new AtomicLong());
notificationsState.get(path).getAndIncrement();
} catch (Exception e) {
logger.error("An error occurred in Test Acknowledgement: " + e.toString());
......@@ -78,7 +79,7 @@ public class SubscriberListenerTestApi {
if (!gsaTokenVerifier.verify(headers.getAuthorization())) {
throw new ValidationException("GC tests: Authorization signature validation Failed");
}
notificationsState.put(path, new AtomicLong());
notificationsState.putIfAbsent(path, new AtomicLong());
logger.debug("GC tests: Token verified and sending response");
return new ChallengeResponse(HashingUtil.hashString(crc, this.serviceConfig.getSubscriberPrivateKeyId()));
}
......@@ -89,6 +90,7 @@ public class SubscriberListenerTestApi {
if (!gsaTokenVerifier.verify(headers.getAuthorization())) {
throw new ValidationException("Authorization signature validation Failed");
}
notificationsState.putIfAbsent(path, new AtomicLong());
notificationsState.get(path).getAndIncrement();
logger.debug("Sending acknowledgement from gsa endpoint");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment