Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036808Openbravo ERPA. Platformpublic2017-09-07 19:212022-02-01 08:08
caristu 
Triage Platform Base 
normalminoralways
newopen 
5
 
 
Core
No
0036808: AuthenticationManager should be stateless
The AuthenticationManager class should be stateless. This class is used by the HttpSecureAppServlet[1] instances in order to ensure that the servlet requests are properly authenticated.

If this class would be stateless then it could be declared as a singleton (@ApplicationScoped) within those kind of servlets. Thus, just a single instance of this class will be reused by every servlet. Also this will help to solve any possible multi-thread unsafety in this regard.

[1] https://code.openbravo.com/erp/devel/pi/file/1fe55bea0066/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java#l84 [^]
In description
To make this class stateless the following attributes should be declared as private and we should handle their assignments properly:

- protected ConnectionProvider conn
- protected String defaultServletUrl
- protected String localAdress

Please note that this will be an API change affecting those classes extending AuthenticationManager. Besides, this change would require to review those classes in deep in order to ensure that they can work properly as singletons.

No tags attached.
related to defect 0035164 closed caristu AuthenticationManager.username thread unsafe 
Issue History
2017-09-07 19:21caristuNew Issue
2017-09-07 19:21caristuAssigned To => platform
2017-09-07 19:21caristuModules => Core
2017-09-07 19:21caristuTriggers an Emergency Pack => No
2017-09-07 19:21caristuRelationship addedrelated to 0035164
2022-02-01 08:08alostaleAssigned Toplatform => Triage Platform Base

There are no notes attached to this issue.