actframework / act-aaa-plugin

Use OSGL aaa library to mange Authentication/Authorization/Accounting for ActFramework Application
Apache License 2.0
6 stars 2 forks source link

Create an easy integration layer #22

Closed greenlaw110 closed 6 years ago

greenlaw110 commented 6 years ago

At the moment it needs developer to write an adaptor class (which extends from ActAAAService.Base) and implement a few methods to bridge Act with osgl-aaa.

The proposal is to define a few utilities so it can save the developer from writing the adaptor class:

  1. UserModelBase, which implement org.osgl.aaa.Principal directly
  2. Provide a few annotation so user can easily their own UserModel to a Principal data provider:
    • @PrincipalEntity - mark a user model class
    • @RoleProvider - mark a method that returns a Role name list
    • @PermissionProvider - mark a method that returns a permission name list
    • @PrivilegeProvider - mark a method that returns privilege name or level
    • @PasswordVerifier - mark a method that verify password with the user's password hash
  3. Allow developer to specify the above information from configuration file. This is useful when UserModel comes from a third party library.
  4. An AuditBase to be extended by app's Audit record
  5. UserLinked interface along with a DynamicPermissionChecker which create default row level authorisation