Skip to content

Commit

Permalink
fix: negate issuer condition
Browse files Browse the repository at this point in the history
  • Loading branch information
gb-cic committed Dec 11, 2023
1 parent 0135d97 commit 4527948
Showing 1 changed file with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@
*/
package it.finanze.sanita.fse2.ms.gtw.dispatcher.logging;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import it.finanze.sanita.fse2.ms.gtw.dispatcher.client.IConfigClient;
import it.finanze.sanita.fse2.ms.gtw.dispatcher.dto.JWTPayloadDTO;
import it.finanze.sanita.fse2.ms.gtw.dispatcher.dto.LogDTO;
Expand All @@ -30,6 +20,15 @@
import it.finanze.sanita.fse2.ms.gtw.dispatcher.utility.CfUtility;
import it.finanze.sanita.fse2.ms.gtw.dispatcher.utility.StringUtility;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

@Service
@Slf4j
Expand Down Expand Up @@ -86,7 +85,7 @@ public void trace(String logType,String workflowInstanceId, String message, ILog
logDTO.setOp_fiscal_code(CfUtility.extractFiscalCodeFromJwtSub(jwtPayloadDTO.getSub()));
}

if(configSRV.isCfOnIssuerNotAllowed()) {
if(!configSRV.isCfOnIssuerNotAllowed()) {
logDTO.setOp_issuer(jwtPayloadDTO.getIss());
}

Expand Down Expand Up @@ -128,7 +127,7 @@ public void debug(String logType,String workflowInstanceId, String message, ILo
logDTO.setOp_fiscal_code(CfUtility.extractFiscalCodeFromJwtSub(jwtPayloadDTO.getSub()));
}

if(configSRV.isCfOnIssuerNotAllowed()) {
if(!configSRV.isCfOnIssuerNotAllowed()) {
logDTO.setOp_issuer(jwtPayloadDTO.getIss());
}

Expand Down Expand Up @@ -171,7 +170,7 @@ public void info(String logType,String workflowInstanceId, String message, ILogE
logDTO.setOp_fiscal_code(CfUtility.extractFiscalCodeFromJwtSub(jwtPayloadDTO.getSub()));
}

if(configSRV.isCfOnIssuerNotAllowed()) {
if(!configSRV.isCfOnIssuerNotAllowed()) {
logDTO.setOp_issuer(jwtPayloadDTO.getIss());
}

Expand Down Expand Up @@ -211,7 +210,7 @@ public void warn(String logType,String workflowInstanceId, String message, ILogE
logDTO.setOp_fiscal_code(CfUtility.extractFiscalCodeFromJwtSub(jwtPayloadToken.getSub()));
}

if(configSRV.isCfOnIssuerNotAllowed()) {
if(!configSRV.isCfOnIssuerNotAllowed()) {
logDTO.setOp_issuer(jwtPayloadToken.getIss());
}
final String logMessage = StringUtility.toJSON(logDTO);
Expand Down Expand Up @@ -253,7 +252,7 @@ public void error(String logType,String workflowInstanceId, String message, ILog
if(configSRV.isSubjectPersistenceEnabled()) {
logDTO.setOp_fiscal_code(CfUtility.extractFiscalCodeFromJwtSub(jwtPayloadToken.getSub()));
}
if(configSRV.isCfOnIssuerNotAllowed()) {
if(!configSRV.isCfOnIssuerNotAllowed()) {
logDTO.setOp_issuer(jwtPayloadToken.getIss());
}
final String logMessage = StringUtility.toJSON(logDTO);
Expand Down

0 comments on commit 4527948

Please sign in to comment.