diff options
author | Endi S. Dewata <edewata@redhat.com> | 2017-06-21 00:48:39 +0200 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2017-06-24 00:04:03 +0200 |
commit | db84bffad64dd4b9a9d684255794719ae13d677f (patch) | |
tree | ae053e4062ce95d7a890e0817b473f381dbce13d /base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java | |
parent | 5b2d619e9fdd3d020edda96196cac4e70a27fd6e (diff) | |
download | pki-db84bffad64dd4b9a9d684255794719ae13d677f.tar.gz pki-db84bffad64dd4b9a9d684255794719ae13d677f.tar.xz pki-db84bffad64dd4b9a9d684255794719ae13d677f.zip |
Refactored signed audit logger.
Signed audit logger creation has been simplified into:
Logger signedAuditLogger = SignedAuditLogger.getLogger();
The null checks on signed audit logger have been removed since
it cannot be null. Audit messages can be logged as follows:
signedAuditLogger.log(message);
https://pagure.io/dogtagpki/issue/2689
Change-Id: I3bf781b0194a6cbb166f71751c098d1c2a3a657a
Diffstat (limited to 'base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java')
-rw-r--r-- | base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java b/base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java index 94411671b..8d70b8dfe 100644 --- a/base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java +++ b/base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java @@ -87,6 +87,8 @@ import com.netscape.certsrv.profile.IProfileAuthenticator; import com.netscape.certsrv.property.Descriptor; import com.netscape.certsrv.property.IDescriptor; import com.netscape.certsrv.request.IRequest; +import com.netscape.cms.logging.Logger; +import com.netscape.cms.logging.SignedAuditLogger; import com.netscape.cmsutil.crypto.CryptoUtil; import com.netscape.cmsutil.util.Utils; @@ -110,6 +112,9 @@ import netscape.security.x509.X509Key; public class CMCAuth implements IAuthManager, IExtendedPluginInfo, IProfileAuthenticator { + private static ILogger mLogger = CMS.getLogger(); + private static Logger signedAuditLogger = SignedAuditLogger.getLogger(); + //////////////////////// // default parameters // //////////////////////// @@ -173,11 +178,6 @@ public class CMCAuth implements IAuthManager, IExtendedPluginInfo, // Logger parameters // /////////////////////// - /* the system's logger */ - private ILogger mLogger = CMS.getLogger(); - - /* signed audit parameters */ - private ILogger mSignedAuditLogger = CMS.getSignedAuditLogger(); private final static String SIGNED_AUDIT_ENROLLMENT_REQUEST_TYPE = "enrollment"; private final static String SIGNED_AUDIT_REVOCATION_REQUEST_TYPE = @@ -1068,18 +1068,7 @@ public class CMCAuth implements IAuthManager, IExtendedPluginInfo, * @param msg signed audit log message */ private void audit(String msg) { - // in this case, do NOT strip preceding/trailing whitespace - // from passed-in String parameters - - if (mSignedAuditLogger == null) { - return; - } - - mSignedAuditLogger.log(ILogger.EV_SIGNED_AUDIT, - null, - ILogger.S_SIGNED_AUDIT, - ILogger.LL_SECURITY, - msg); + signedAuditLogger.log(msg); } protected void audit(AuditEvent event) { @@ -1102,10 +1091,6 @@ public class CMCAuth implements IAuthManager, IExtendedPluginInfo, * @return id string containing the signed audit log message SubjectID */ private String auditSubjectID() { - // if no signed audit object exists, bail - if (mSignedAuditLogger == null) { - return null; - } String subjectID = null; |