Skip to content

Commit

Permalink
Use util method for masking
Browse files Browse the repository at this point in the history
  • Loading branch information
piraveena committed Jul 20, 2023
1 parent 4e7dda5 commit d446651
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,6 @@ public static class LogConstants {
public static final String CREATE_OAUTH_APPLICATION = "CREATE OAUTH APPLICATION";
public static final String UPDATE_OAUTH_APPLICATION = "UPDATE OAUTH APPLICATION";
public static final String DELETE_OAUTH_APPLICATION = "DELETE OAUTH APPLICATION";
public static final String DELETE_OAUTH_APPLICATIONS_IN_THE_GIVEN_ORG = "DELETE OAUTH APPLICATION IN GIVEN ORG";
public static final String REGENERATE_CLIENT_SECRET = "REGENERATE CLIENT SECRET";
public static final String UPDATE_APP_STATE = "UPDATE APP STATE";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@

import static org.wso2.carbon.identity.application.mgt.ApplicationConstants.LogConstants.TARGET_APPLICATION;
import static org.wso2.carbon.identity.application.mgt.ApplicationConstants.LogConstants.USER;
import static org.wso2.carbon.identity.application.mgt.ApplicationMgtUtil.MASKING_CHARACTER;
import static org.wso2.carbon.identity.application.mgt.ApplicationMgtUtil.MASKING_REGEX;
import static org.wso2.carbon.identity.central.log.mgt.utils.LoggerUtils.triggerAuditLogEvent;
import static org.wso2.carbon.identity.oauth.Error.AUTHENTICATED_USER_NOT_FOUND;
import static org.wso2.carbon.identity.oauth.Error.INVALID_OAUTH_CLIENT;
Expand Down Expand Up @@ -448,8 +446,7 @@ private static void maskClientSecret(JSONObject oauthApp) {
return;
}
String secret = oauthApp.get("oauthConsumerSecret").toString();
String maskedSecret = secret.replaceAll(MASKING_REGEX, MASKING_CHARACTER);
oauthApp.put("oauthConsumerSecret", maskedSecret);
oauthApp.put("oauthConsumerSecret", LoggerUtils.getMaskedContent(secret));
}

private void validateAudiences(OAuthConsumerAppDTO application) throws IdentityOAuthClientException {
Expand Down

0 comments on commit d446651

Please sign in to comment.