Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
System
Notification
Commits
98bbd692
Commit
98bbd692
authored
Nov 20, 2020
by
Komal Makkar
Browse files
intermediate changes
parent
e8cd03db
Changes
2
Hide whitespace changes
Inline
Side-by-side
notification-core/src/main/java/org/opengroup/osdu/notification/api/PubsubEndpoint.java
View file @
98bbd692
...
...
@@ -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
())
{
...
...
provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/util/ServiceAccountJwtAzureClientImpl.java
View file @
98bbd692
...
...
@@ -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 deni
ed"
,
"The user is not authorized to
perform this action
"
);
throw
new
AppException
(
HttpStatus
.
SC_FORBIDDEN
,
"
Token not generat
ed"
,
"The user is not authorized to
obtain Token From AAD
"
);
}
ACCESS_TOKEN
=
future
.
get
().
getAccessToken
();
}
catch
(
MalformedURLException
malformedURLException
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment