yii2-usuario icon indicating copy to clipboard operation
yii2-usuario copied to clipboard

Usuario 2.0.0

Open tonydspaniard opened this issue 6 years ago • 5 comments

I am planning to make a major refactor to the module so to make the library more manageable and scalable.

This is what is being planned:

  • [ ] Work with current library repository but split its functionality in different independent extensions: gpdr, rbac, 2fa, social login, recaptcha, console.
  • [ ] Implement a plugin system: currently Yii already provides that mechanism throughout behaviors. Nevertheless, I am thinking to allow users to create pluggable Bootstrap classes to the Bootstrap class of the Module so we will be able to do anything from overriding and/or enhancing classes, views, namespaces, etc.
  • [ ] Remove the anti-pattern of using the Container as a ServiceLocator (i.e. $this->make)
  • [ ] Reinforce the idea of using command bus and remove the logic from Controllers actions thus making them even thinner (this has the drawback of being more abstract and would require a bit of learning curve so I leave that up to suggestions)
  • [ ] Make use of Interfaces instead of forcing methods to support X class. For example, that way people won't have to necessarily extend a class to use X event.
  • [ ] Make this library PHP 7.2+ compatible only. It's time to embrace the wonders of this version and on. People could still use versions 1.* if they need other PHP versions supported.
  • [ ] Remove entirely external widgets dependencies

Once the above is done, I will start to create a new usuario for Yii 3 by:

  • Create a unique repository yii-usuario-base for the core of the library
  • Create repositories for the different extensions (i.e. yii-usuario-rbac, yii-usuario-2fa, etc)
  • Add API support

If you would like to see anything else not noted above, please let me know on this thread.

tonydspaniard avatar Jun 26 '19 08:06 tonydspaniard

  • How about LDAP and OAuth2?
  • RBAC could be enhanced with a tree or node view for auth-items or at least showing parent items

schmunk42 avatar Jun 26 '19 08:06 schmunk42

@schmunk42 LDAP could be a simple override for SecurityController (need to review @maxxer work on this, he already did it on a personal repository). For OAuth2, I think is more when provided API support (RestControllers) which I think could be delegated to an external package (i.e. yii-usuario-rest)

Edit:

About RBAC, could you wireframe that with a simple drawing with pen and paper? That would help.

I also think that some of the actions on usuario are only performed by developers and not end-users. RBAC should be working differently to the way it is now, I believe it should work like the yii2-debug bar does. Only showing when working on development/configurable mode. Users should only be allowed to assign roles and its permissions, not working with permissions or rules directly as that is part of the developers to do. Need to think a way where both worlds combine somehow. If working with permissions is allowed, then the UI should provide the different actions within the system so he can assign them and then Controllers should retrieve them dynamically for its filter. Not the way it is now.

tonydspaniard avatar Jun 26 '19 08:06 tonydspaniard

RBAC could be enhanced with a tree or node view for auth-items or at least showing parent items

If we wish see a graph we can use githubjeka/yii2-gui-rbac (or find some another fresh repo like this. I will redefine it for new jquery approx a 1-2 year ago)

bscheshirwork avatar Jun 29 '19 08:06 bscheshirwork

@tonydspaniard can we somehow support you for the Version 2?

I'm missing the line, where we could start

demonking avatar Aug 20 '19 14:08 demonking

@demonking all the checklist points are above. I was currently refactoring the library in a way where I could split the different packages (Work with current library repository but split its functionality in different independent extensions: gpdr, rbac, 2fa, social login, recaptcha, console.)

The branch I am working on is usuario-2.0-dev. Nevertheless, I think I need to do the refactor my self until is on a structure where you guys could jump in.

tonydspaniard avatar Aug 20 '19 19:08 tonydspaniard