Invalid data-partition-id will create 500 code with no Authorize message.
While making calls to OSDU services, such as secret
and storage
service, testers discover that if they put invalid symbols in data_partition_id
, we will have 500 code, but with reason of Access Denied.
After investigation, we realize the partition service did not consider the situation that user put invalid URI symbols like @#$%
in data partition
id, which will make the normalizeStringUrl
function have Java.Lang exception in this UrlNormalizationUtil.java.
Caused by: java.lang.IllegalArgumentException: Malformed escape pair at index 57: http://os-partition:8080/api/partition/v1/partitions/osdu%
at java.net.URI.create(URI.java:852)
at org.opengroup.osdu.core.common.util.UrlNormalizationUtil.normalizeStringUrl(UrlNormalizationUtil.java:27)
This will generate a 500 code in entitlement service since the service will treat this error as a general error in SpringExceptionMapper.java, instead a 400 code.
Also in Entitlements the error message is processed within AuthorizationServiceImpl.java, so it will have "Access denied", "The user is not authorized to perform this action"
error message.
Here is a MR that will handle the 500 code produced from java.lang.IllegalArgumentException
!219 (closed)