The AuthInfo class does not need to provide instance methods because the way it was used just to extract authentication info from request class so the AuthInfo constructor injection with HttpServletReqest does not work or necessary:
1. Change the name from AuthInfo to AuthInfoUtil to reflect that it is just a utility class with static methods.
2. Change all the public methods to become public static.
3. Update the unit test file.
4. Update the caller of this class to use the new AuthInfoUtil class.
Hi, Propose to refactor AuthInfo class to a final AuthInfoUtil class which provides static utility ...
15 years, 3 months ago
(2010-11-24 17:30:46 UTC)
#1
Hi,
Propose to refactor AuthInfo class to a final AuthInfoUtil class which provides
static utility methods instead of member instance methods.
The reason is because all the usage for AuthInfo currently just creating new
AuthInfo instance and call the method directly to get/set information from/to
request object so its not necessary to have instance public methods.
For example:
new AuthInfo(req).setAuthType(handler.getName()).setSecurityToken(token);
Any review/suggestion is welcomed.
- Henry
seems okay to me. In general though both of these methods just feel wrong for ...
15 years, 3 months ago
(2010-11-28 00:19:29 UTC)
#2
seems okay to me.
In general though both of these methods just feel wrong for some reason. I'd
almost prefer to see us using guice-servlet @requestscoped annotations
instead...
Issue 3305041: Refactor AuthInfo class to final AuthInfoUtil class with static methods
(Closed)
Created 15 years, 3 months ago by henry.saputra
Modified 14 years, 10 months ago
Reviewers: dev-remailer_shindig.apache.org, johnfargo, Paul Lindner, plindner1
Base URL: http://svn.apache.org/repos/asf/shindig/trunk/
Comments: 0