Skip to content

Commit

Permalink
refactor/added log for checkConsumerIsActiveAndMatched method -step2
Browse files Browse the repository at this point in the history
  • Loading branch information
hongwei1 committed Jul 15, 2024
1 parent edf7632 commit c81e439
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions obp-api/src/main/scala/code/api/util/ConsentUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,13 @@ object Consent extends MdcLoggable {
def removeBreakLines(input: String) = input
.replace("\n", "")
.replace("\r", "")
if (removeBreakLines(clientCert) == removeBreakLines(consumerFromConsent.clientCertificate.get))
val certificate = consumerFromConsent.clientCertificate
logger.debug(s"code.api.util.Consent.checkConsumerIsActiveAndMatched.consumer.certificate:: certificate($certificate)")
logger.debug(s"code.api.util.Consent.checkConsumerIsActiveAndMatched.consumer.certificate.dbNotNull_?(${certificate.dbNotNull_?})")
if (certificate.dbNotNull_? && removeBreakLines(clientCert) == removeBreakLines(certificate.get)) {
logger.debug(s"certificate.dbNotNull_? && removeBreakLines(clientCert) == removeBreakLines(consumerFromConsent.clientCertificate.get) result == true")
Full(true) // This consent can be used by current application
else // This consent can NOT be used by current application
} else // This consent can NOT be used by current application
Failure(ErrorMessages.ConsentDoesNotMatchConsumer)
case "NONE" => // This instance does not require validation method
Full(true)
Expand Down

0 comments on commit c81e439

Please sign in to comment.