Skip to content
Snippets Groups Projects
Commit 98bbd692 authored by Komal Makkar's avatar Komal Makkar
Browse files

intermediate changes

parent e8cd03db
No related branches found
No related tags found
1 merge request!38Changes in IT to match Infra
......@@ -86,6 +86,7 @@ public class PubsubEndpoint {
@PostMapping("/records-changed")
@PreAuthorize("@authorizationFilter.hasAnyPermission('" + Config.OPS + "', '" + Config.PUBSUB + "')")
public ResponseEntity recordChanged() throws Exception {
this.log.info("komakkar recieved recoreds changed request " );
if(this.pubsubRequestBodyExtractor.isHandshakeRequest()) {
String handshakeResponse = this.pubsubHandshakeHandler.getHandshakeResponse();
return ResponseEntity.ok(handshakeResponse);
......@@ -122,10 +123,12 @@ public class PubsubEndpoint {
requestHeader.put("Authorization", idToken);
}
this.log.info("sending out notification to endpoint: " + endpoint);
this.log.info("komakkar sending out notification to endpoint: " + pushUrl);
requestHeader.put(DpsHeaders.CONTENT_TYPE, "application/json");
requestHeader.put(DpsHeaders.CORRELATION_ID, headerAttributes.get(DpsHeaders.CORRELATION_ID));
requestHeader.put(DpsHeaders.DATA_PARTITION_ID, headerAttributes.get(DpsHeaders.DATA_PARTITION_ID));
this.log.info("komakkar sending out notification to endpoint: " + headers.toString());
HttpRequest request = HttpRequest.post().url(pushUrl).headers(requestHeader).body(pubsubMessage).connectionTimeout(WAITING_TIME).build();
HttpResponse response = httpClient.send(request);
if (!response.isSuccessCode()) {
......
......@@ -87,7 +87,7 @@ public class ServiceAccountJwtAzureClientImpl implements IServiceAccountJwtClien
Future<AuthenticationResult> future = context.acquireToken(this.config.getAadClientID(), credential, null);
if (future == null) {
throw new AppException(HttpStatus.SC_FORBIDDEN, "Access denied", "The user is not authorized to perform this action");
throw new AppException(HttpStatus.SC_FORBIDDEN, "Token not generated", "The user is not authorized to obtain Token From AAD");
}
ACCESS_TOKEN = future.get().getAccessToken();
} catch (MalformedURLException malformedURLException) {
......
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