Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.2.0
-
None
-
None
Description
The mechanism to allow the setting of arbitrary properties on shiro objects in Guice doesn't always work and sometimes require a workaround. The workaround is to explicitly bind the class that you want the property to be set upon in the ShiroModule. This is less than ideal.
I believe that the issue is because the type listener that does the property setting is bound in the private module, meaning that it only affects beans bound in that private module. However, when bindings to classes aren't made specifically in the private module, they occur as just-in-time bindings, which are effectively bound at the root binder. Therefore, the type listener never gets to see these bindings.
I believe that the solution is to bind all shiro objects in the ShiroModule (and ShiroWebModule as appropriate). This will cause them to always be bound within the private module. To ensure that this is effective, we will also require a test case that scans the classpath for implementations of particular interfaces and ensures that they are bound.