Skip to content

Commit

Permalink
removed ip address
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterITA committed Nov 2, 2023
1 parent 7ebdeda commit 09564aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ final case class AuthApiServiceImpl(
contexts: Seq[(String, String)]
): Future[KeyWithClient] =
authorizationManagementService
.getKeyWithClient(clientId, kid)(contexts.filter(c => List(CORRELATION_ID_HEADER, IP_ADDRESS).contains(c._1)))
.getKeyWithClient(clientId, kid)(contexts.filter(c => List(CORRELATION_ID_HEADER).contains(c._1)))

private def generateConsumerToken(client: Client, clientAssertion: ClientAssertion)(implicit
context: Seq[(String, String)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import it.pagopa.interop.authorizationserver.service.{AuthorizationManagementInv
import it.pagopa.interop.commons.logging.{CanLogContextFields, ContextFieldsToLog}
import it.pagopa.interop.commons.utils.AkkaUtils.fastGetOpt
import it.pagopa.interop.commons.utils.errors.GenericComponentErrors
import it.pagopa.interop.commons.utils.{CORRELATION_ID_HEADER, IP_ADDRESS}
import it.pagopa.interop.commons.utils.CORRELATION_ID_HEADER

import java.util.UUID
import scala.concurrent.{ExecutionContext, Future}
Expand All @@ -27,9 +27,8 @@ class AuthorizationManagementServiceImpl(
contexts: Seq[(String, String)]
): Future[KeyWithClient] = fastGetOpt(contexts)(CORRELATION_ID_HEADER)
.fold(Future.failed[KeyWithClient](GenericComponentErrors.MissingHeader(CORRELATION_ID_HEADER))) { correlationId =>
val ip: Option[String] = fastGetOpt(contexts)(IP_ADDRESS)
val request: ApiRequest[KeyWithClient] =
tokenGenerationApi.getKeyWithClientByKeyId(xCorrelationId = correlationId, clientId, kid, xForwardedFor = ip)
tokenGenerationApi.getKeyWithClientByKeyId(xCorrelationId = correlationId, clientId, kid)
invoker
.invoke(request, "Key Retrieve")
.recoverWith {
Expand Down

0 comments on commit 09564aa

Please sign in to comment.