[
https://issues.apache.org/jira/browse/ARTEMIS-5902?focusedWorklogId=1007695&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1007695
]
ASF GitHub Bot logged work on ARTEMIS-5902:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 03/Mar/26 15:07
Start Date: 03/Mar/26 15:07
Worklog Time Spent: 10m
Work Description: jbertram commented on code in PR #6258:
URL: https://github.com/apache/artemis/pull/6258#discussion_r2878816086
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/security/impl/SecurityStoreImpl.java:
##########
@@ -95,6 +99,12 @@ public class SecurityStoreImpl implements SecurityStore,
HierarchicalRepositoryC
private static final AtomicLongFieldUpdater<SecurityStoreImpl>
AUTHORIZATION_FAILURE_COUNT_UPDATER =
AtomicLongFieldUpdater.newUpdater(SecurityStoreImpl.class,
"authorizationFailureCount");
private volatile long authorizationFailureCount;
+ private static final MessageDigest SHA256;
Review Comment:
Of course!
Issue Time Tracking
-------------------
Worklog Id: (was: 1007695)
Time Spent: 1h (was: 50m)
> Optimize authentication cache key creation
> ------------------------------------------
>
> Key: ARTEMIS-5902
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5902
> Project: Artemis
> Issue Type: Improvement
> Reporter: Justin Bertram
> Assignee: Justin Bertram
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Currently the process to create an authentication cache key involves _always_
> invoking {{java.security.MessageDigest#getInstance(java.lang.String)}}. This
> isn't strictly necessary. We can use a pattern similar to
> {{org.apache.activemq.artemis.protocol.amqp.sasl.scram.ScramServerFunctionalityImpl}}
> which uses {{clone()}} on the {{MessageDigest}} to avoid invoking
> {{getInstance}} every time.
> Also, we can hash fewer bytes and avoid unnecessary String concatenations by
> inspecting each part of the input and only adding bytes that actually make a
> difference to the final hash.
> These are relatively minor improvements, but are simple and still worth doing.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]