Shiro
  1. Shiro
  2. SHIRO-129

Aspecjt integration for annotation base authorization

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Here's the code I'm donating to the Shiro project to use aspectj as the aop kit to perform authorization of method invocation based on the defined Shiro's annotation.

      The zip files contains the following:

      • java/src: source files to adapt an aspectj joint point to a shiro method invocation
      • java/test: unit test classes
      • conf: configuration file for the test cases

      To compile and run properly, the code requires the following:

      • junit jar
      • shiro jar
      • aspectj jars (I used AJDT within eclipse, so everything was integrated)
      1. shiro-aspectj integration.zip
        696 kB
        Jean-Cédric Desrochers
      2. shiro example bank service.zip
        2.77 MB
        Jean-Cédric Desrochers

        Activity

        Jean-Cédric Desrochers created issue -
        Hide
        Jean-Cédric Desrochers added a comment -

        aspectj integration source code

        Show
        Jean-Cédric Desrochers added a comment - aspectj integration source code
        Jean-Cédric Desrochers made changes -
        Field Original Value New Value
        Attachment shiro-aspectj integration.zip [ 12430030 ]
        Hide
        Jean-Cédric Desrochers added a comment -

        a little sample bank service I'm giving as well to have a more concrete example of how to use the aspectj integration.

        The content of the zip file is:

        • java/src: main source code of the sample
        • java/test: unit tests
        • conf: configuration files for shiro and the aspectj weaver tool
        • lib: required jar files to compile and run the test cases

        To run the test cases you need to:
        1) define the following vm argument: -javaagent:./lib/aspectjweaver.jar (where ./lib/spectjweaver.jar is the path to the weaver tool)
        2) add in the classpath the conf/ directory and the jars of the lib/ directory

        Upon VM launch, the weaver tool will look for the META-INF/aop.xml file (in the conf/ directory) to discover the aspects to apply and the scope of the weavable classes. It is currently configured for the classes of the BankService sample.

        I did not make a runnable little application to demonstrate the BankService in action, for me the test cases are self-explanatory.

        Show
        Jean-Cédric Desrochers added a comment - a little sample bank service I'm giving as well to have a more concrete example of how to use the aspectj integration. The content of the zip file is: java/src: main source code of the sample java/test: unit tests conf: configuration files for shiro and the aspectj weaver tool lib: required jar files to compile and run the test cases To run the test cases you need to: 1) define the following vm argument: -javaagent:./lib/aspectjweaver.jar (where ./lib/spectjweaver.jar is the path to the weaver tool) 2) add in the classpath the conf/ directory and the jars of the lib/ directory Upon VM launch, the weaver tool will look for the META-INF/aop.xml file (in the conf/ directory) to discover the aspects to apply and the scope of the weavable classes. It is currently configured for the classes of the BankService sample. I did not make a runnable little application to demonstrate the BankService in action, for me the test cases are self-explanatory.
        Jean-Cédric Desrochers made changes -
        Attachment shiro example bank service.zip [ 12430031 ]
        Kalle Korhonen made changes -
        Assignee Kalle Korhonen [ kaosko ]
        Kalle Korhonen logged work - 26/Jan/10 07:07
        • Time Spent:
          2h
           
          <No comment>
        Kalle Korhonen made changes -
        Remaining Estimate 1h [ 3600 ]
        Time Spent 2h [ 7200 ]
        Kalle Korhonen made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Kalle Korhonen added a comment -

        Mavenized and committed as a new support module and a new sample (which might still undergo some refactoring but will be handled as a separate issue). Thanks for the contribution!

        Show
        Kalle Korhonen added a comment - Mavenized and committed as a new support module and a new sample (which might still undergo some refactoring but will be handled as a separate issue). Thanks for the contribution!
        Kalle Korhonen made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 1.0 [ 12314078 ]
        Resolution Fixed [ 1 ]
        Kalle Korhonen logged work - 02/Feb/10 13:31
        • Time Spent:
          1h
           
          <No comment>
        Kalle Korhonen made changes -
        Remaining Estimate 1h [ 3600 ] 0h [ 0 ]
        Time Spent 2h [ 7200 ] 3h [ 10800 ]
        Hide
        Les Hazlewood added a comment -

        Closing all resolved issues due to a successful 1.0.0-incubating release

        Show
        Les Hazlewood added a comment - Closing all resolved issues due to a successful 1.0.0-incubating release
        Les Hazlewood made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Kalle Korhonen
            Reporter:
            Jean-Cédric Desrochers
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0h
              0h
              Logged:
              Time Spent - 3h
              3h

                Development