Skip to content
GitLab
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
Security and Compliance
Entitlements
Commits
f7233fab
Commit
f7233fab
authored
Aug 17, 2021
by
Rostislav Vatolin [SLB]
Browse files
Merge branch 'reduce-logs' into 'master'
reduce log level in happy path to debug level See merge request
!103
parents
18e801b6
171a00fd
Pipeline
#59216
passed with stages
in 22 minutes and 50 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
NOTICE
View file @
f7233fab
...
...
@@ -120,7 +120,7 @@ The following software have components provided under the terms of this license:
- Google HTTP Client Library for Java (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client)
- Google HTTP Client Library for Java (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client)
- Google OAuth Client Library for Java (from https://repo1.maven.org/maven2/com/google/oauth-client/google-oauth-client)
- Gson (from http://
code.google.
com/
p/
google
-
gson/)
- Gson (from http
s
://
repo1.maven.org/maven2/
com/google
/code/
gson/
gson
)
- Guava InternalFutureFailureAccess and InternalFutures (from https://repo1.maven.org/maven2/com/google/guava/failureaccess)
- Guava: Google Core Libraries for Java (from https://repo1.maven.org/maven2/com/google/guava/guava)
- Guava: Google Core Libraries for Java (from https://repo1.maven.org/maven2/com/google/guava/guava)
...
...
@@ -162,7 +162,7 @@ The following software have components provided under the terms of this license:
- Jackson module: JAXB Annotations (from https://github.com/FasterXML/jackson-modules-base)
- Jackson-annotations (from http://github.com/FasterXML/jackson)
- Jackson-core (from http://wiki.fasterxml.com/JacksonHome)
- Jackson-dataformat-XML (from http://
wiki.fasterxml.com/JacksonExtensionXmlDataBinding
)
- Jackson-dataformat-XML (from http
s
://
github.com/FasterXML/jackson-dataformat-xml
)
- Jackson-dataformat-YAML (from https://github.com/FasterXML/jackson-dataformats-text)
- Jackson-datatype-Joda (from http://wiki.fasterxml.com/JacksonModuleJoda)
- Jackson-module-Afterburner (from http://wiki.fasterxml.com/JacksonHome)
...
...
@@ -225,7 +225,6 @@ The following software have components provided under the terms of this license:
- OAuth 2.0 SDK with OpenID Connect extensions (from https://bitbucket.org/connect2id/oauth-2.0-sdk-with-openid-connect-extensions)
- Objenesis (from http://objenesis.org)
- Objenesis (from http://objenesis.org)
- OkHttp (from https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp)
- Okio (from https://github.com/square/okio/)
- OpenCensus (from https://github.com/census-instrumentation/opencensus-java)
- OpenCensus (from https://github.com/census-instrumentation/opencensus-java)
...
...
@@ -332,6 +331,7 @@ The following software have components provided under the terms of this license:
- micrometer-core (from https://github.com/micrometer-metrics/micrometer)
- micrometer-registry-azure-monitor (from https://github.com/micrometer-metrics/micrometer)
- mockito-core (from https://github.com/mockito/mockito)
- okhttp (from https://square.github.io/okhttp/)
- okhttp-urlconnection (from https://github.com/square/okhttp)
- org.apiguardian:apiguardian-api (from https://github.com/apiguardian-team/apiguardian)
- org.conscrypt:conscrypt-openjdk-uber (from https://conscrypt.org/)
...
...
@@ -732,7 +732,7 @@ The following software have components provided under the terms of this license:
- Javassist (from http://www.javassist.org/)
- Javassist (from http://www.javassist.org/)
-
OkH
ttp (from https://
repo1.maven.org/maven2/com/squareup/okhttp3
/okhttp)
-
okh
ttp (from https://
square.github.io
/okhttp
/
)
========================================================================
PHP-3.01
...
...
entitlements-v2-core/src/main/java/org/opengroup/osdu/entitlements/v2/api/ListGroupApi.java
View file @
f7233fab
...
...
@@ -46,7 +46,7 @@ public class ListGroupApi {
.
desId
(
userId
)
.
memberEmail
(
userId
)
.
build
();
log
.
info
(
String
.
format
(
"ListGroupResponseDto#create done timestamp: %d"
,
System
.
currentTimeMillis
()));
log
.
debug
(
String
.
format
(
"ListGroupResponseDto#create done timestamp: %d"
,
System
.
currentTimeMillis
()));
return
new
ResponseEntity
<>(
body
,
HttpStatus
.
OK
);
}
}
entitlements-v2-core/src/main/java/org/opengroup/osdu/entitlements/v2/auth/AuthorizationFilter.java
View file @
f7233fab
...
...
@@ -22,7 +22,7 @@ public class AuthorizationFilter {
private
RequestInfoUtilService
requestInfoUtilService
;
public
boolean
hasAnyPermission
(
String
...
requiredRoles
)
{
log
.
info
(
String
.
format
(
"authorizeAny timestamp: %d"
,
System
.
currentTimeMillis
()));
log
.
debug
(
String
.
format
(
"authorizeAny timestamp: %d"
,
System
.
currentTimeMillis
()));
DpsHeaders
headers
=
requestInfo
.
getHeaders
();
if
(
StringUtils
.
isBlank
(
headers
.
getAuthorization
()))
{
throw
AppException
.
createUnauthorized
(
"No credentials sent on request."
);
...
...
entitlements-v2-core/src/main/java/org/opengroup/osdu/entitlements/v2/auth/AuthorizationServiceEntitlements.java
View file @
f7233fab
...
...
@@ -27,7 +27,7 @@ public class AuthorizationServiceEntitlements implements AuthorizationService {
@Override
public
boolean
isAuthorized
(
DpsHeaders
headers
,
String
...
roles
)
{
log
.
info
(
String
.
format
(
"authorizeAny timestamp: %d"
,
System
.
currentTimeMillis
()));
log
.
debug
(
String
.
format
(
"authorizeAny timestamp: %d"
,
System
.
currentTimeMillis
()));
String
requesterId
=
requestInfoUtilService
.
getUserId
(
headers
);
List
<
String
>
groupNamesOriginalCaller
=
groupCacheService
.
getFromPartitionCache
(
requesterId
,
headers
.
getPartitionId
())
.
stream
().
map
(
ParentReference:
:
getName
).
collect
(
Collectors
.
toList
());
...
...
entitlements-v2-core/src/main/java/org/opengroup/osdu/entitlements/v2/logging/ResponseLogFilter.java
View file @
f7233fab
...
...
@@ -38,7 +38,7 @@ public class ResponseLogFilter implements Filter {
FilterChain
filterChain
)
throws
IOException
,
ServletException
{
String
uri
=
requestInfo
.
getUri
();
if
(
isNotHealthCheckRequest
(
uri
))
{
logger
.
info
(
String
.
format
(
"ResponseLogFilter#doFilter start timestamp: %d"
,
System
.
currentTimeMillis
()));
logger
.
debug
(
String
.
format
(
"ResponseLogFilter#doFilter start timestamp: %d"
,
System
.
currentTimeMillis
()));
}
HttpServletRequest
httpServletRequest
=
(
HttpServletRequest
)
servletRequest
;
HttpServletResponse
httpServletResponse
=
(
HttpServletResponse
)
servletResponse
;
...
...
@@ -62,7 +62,7 @@ public class ResponseLogFilter implements Filter {
}
finally
{
if
(
isNotHealthCheckRequest
(
uri
))
{
logRequest
(
uri
,
httpServletRequest
,
httpServletResponse
,
startTime
);
logger
.
info
(
String
.
format
(
"ResponseLogFilter#doFilter done timestamp: %d"
,
System
.
currentTimeMillis
()));
logger
.
debug
(
String
.
format
(
"ResponseLogFilter#doFilter done timestamp: %d"
,
System
.
currentTimeMillis
()));
}
}
}
...
...
entitlements-v2-core/src/main/java/org/opengroup/osdu/entitlements/v2/service/CreateGroupService.java
View file @
f7233fab
...
...
@@ -44,7 +44,7 @@ public class CreateGroupService {
throw
new
AppException
(
HttpStatus
.
PRECONDITION_FAILED
.
value
(),
HttpStatus
.
PRECONDITION_FAILED
.
getReasonPhrase
(),
String
.
format
(
"%s's group quota hit. Identity can't belong to more than %d groups"
,
dataRootGroupNode
.
getNodeId
(),
dataRootGroupQuota
));
}
log
.
info
(
String
.
format
(
"Creating a group with root group node: %s"
,
dataRootGroupNode
.
getName
()));
log
.
debug
(
String
.
format
(
"Creating a group with root group node: %s"
,
dataRootGroupNode
.
getName
()));
CreateGroupRepoDto
createGroupRepoDto
=
CreateGroupRepoDto
.
builder
()
.
requesterNode
(
requesterNode
)
.
dataRootGroupNode
(
dataRootGroupNode
)
...
...
@@ -52,7 +52,7 @@ public class CreateGroupService {
.
partitionId
(
createGroupServiceDto
.
getPartitionId
()).
build
();
createGroup
(
groupNode
,
createGroupRepoDto
);
}
else
{
log
.
info
(
"Creating a group with no root group node"
);
log
.
debug
(
"Creating a group with no root group node"
);
CreateGroupRepoDto
createGroupRepoDto
=
CreateGroupRepoDto
.
builder
()
.
requesterNode
(
requesterNode
)
.
dataRootGroupNode
(
null
)
...
...
entitlements-v2-core/src/main/java/org/opengroup/osdu/entitlements/v2/service/ListGroupService.java
View file @
f7233fab
...
...
@@ -24,13 +24,13 @@ public class ListGroupService {
private
final
GroupCacheService
groupCacheService
;
public
Set
<
ParentReference
>
getGroups
(
ListGroupServiceDto
listGroupServiceDto
)
{
log
.
info
(
String
.
format
(
"ListGroupService#run timestamp: %d"
,
System
.
currentTimeMillis
()));
log
.
debug
(
String
.
format
(
"ListGroupService#run timestamp: %d"
,
System
.
currentTimeMillis
()));
String
requesterId
=
listGroupServiceDto
.
getRequesterId
();
log
.
info
(
String
.
format
(
"requested by %s"
,
requesterId
));
Set
<
ParentReference
>
groups
=
new
HashSet
<>();
listGroupServiceDto
.
getPartitionIds
().
forEach
(
partitionId
->
groups
.
addAll
(
groupCacheService
.
getFromPartitionCache
(
requesterId
,
partitionId
)));
log
.
info
(
String
.
format
(
"ListGroupService#run cache look up done timestamp: %d"
,
System
.
currentTimeMillis
()));
log
.
debug
(
String
.
format
(
"ListGroupService#run cache look up done timestamp: %d"
,
System
.
currentTimeMillis
()));
String
serviceAccount
=
requestInfo
.
getTenantInfo
().
getServiceAccount
();
if
(
serviceAccount
.
equalsIgnoreCase
(
requesterId
)
||
Strings
.
isNullOrEmpty
(
listGroupServiceDto
.
getAppId
()))
{
return
groups
;
...
...
@@ -41,11 +41,11 @@ public class ListGroupService {
private
Set
<
ParentReference
>
filterGroupsByAppId
(
Set
<
ParentReference
>
groups
,
ListGroupServiceDto
listGroupServiceDto
)
{
String
appId
=
listGroupServiceDto
.
getAppId
();
log
.
info
(
String
.
format
(
"Filtering groups based on caller's appId: %s"
,
appId
));
log
.
debug
(
String
.
format
(
"Filtering groups based on caller's appId: %s"
,
appId
));
Set
<
ParentReference
>
accessibleGroups
=
new
HashSet
<>();
listGroupServiceDto
.
getPartitionIds
().
forEach
(
partitionId
->
accessibleGroups
.
addAll
(
retrieveGroupRepo
.
filterParentsByAppId
(
groups
,
partitionId
,
appId
)));
log
.
info
(
String
.
format
(
log
.
debug
(
String
.
format
(
"ListGroupService#run cache app id filter done timestamp: %d"
,
System
.
currentTimeMillis
()));
return
accessibleGroups
;
}
...
...
entitlements-v2-core/src/main/java/org/opengroup/osdu/entitlements/v2/util/RequestInfoUtilService.java
View file @
f7233fab
...
...
@@ -23,13 +23,13 @@ public class RequestInfoUtilService {
public
String
getAppId
(
final
DpsHeaders
dpsHeaders
)
{
String
appId
=
dpsHeaders
.
getAppId
();
log
.
info
(
String
.
format
(
"Getting App Id from Headers: %s"
,
appId
));
log
.
debug
(
String
.
format
(
"Getting App Id from Headers: %s"
,
appId
));
return
appId
;
}
public
String
getUserId
(
final
DpsHeaders
dpsHeaders
)
{
String
userId
=
dpsHeaders
.
getUserId
();
log
.
info
(
String
.
format
(
"Getting User Id from Headers: %s"
,
userId
));
log
.
debug
(
String
.
format
(
"Getting User Id from Headers: %s"
,
userId
));
return
userId
;
}
...
...
provider/entitlements-v2-azure/src/main/resources/application.properties
View file @
f7233fab
...
...
@@ -3,6 +3,7 @@ spring.application.name=entitlements
# Logging configuration
logging.level.org.springframework.web
=
${LOGGING_LEVEL:DEBUG}
logging.ignore.servlet.paths
=
/swagger-ui.html
# Server configuration
server.servlet.contextPath
=
/api/entitlements/v2
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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