Uploaded image for project: 'Shiro'
  1. Shiro
  2. SHIRO-369

Guice integration property setting doesn't always work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.2.0
    • None
    • Integration: Guice
    • 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.

      Attachments

        Activity

          People

            deraj123 Jared Bunting
            deraj123 Jared Bunting
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: