Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Approach discussion for user module #2

Open
kartik-v opened this issue Mar 30, 2014 · 19 comments
Open

Approach discussion for user module #2

kartik-v opened this issue Mar 30, 2014 · 19 comments

Comments

@kartik-v
Copy link
Member

An initial take on SOD (of course we will jump into help each other anyway) - let know

@evercode1
Copy link

@kartik-v I'm 100% in. I will need a lot of guidance from you since I have not done this before, so please don't be shy about telling me what I need to do and when.

@robregonm
Copy link
Collaborator

Ok, looks fine for me.

@schmunk42
Copy link

RBAC and e-mail is fine, but I am not very experienced in Unit Tests.

Von meinem iPhone gesendet

Am 30.03.2014 um 15:21 schrieb Kartik Visweswaran [email protected]:

An initial take on SOD (of course we will jump into help each other anyway) - let know

DB/Module config: Jointly
Models: Jointly
Basic user authentication: @robregonm
Views, Widgets, & UI: @kartik-v
RBAC integration, Email Integration, and Unit Tests: @schmunk42
Remote & Social: @nineinchnick
Documentation: @evercode1

Reply to this email directly or view it on GitHub.

@kartik-v
Copy link
Member Author

@schmunk42 no problems... I am bad at unit tests as well... and hence was looking for help here

@evercode1 would you be able to contribute in unit tests (we may not require documentation effort until we reach into an advanced coding stage)... or is anyone else better in carrying out tests?

Will need confirmation from @nineinchnick and we can start then... I suppose @nineinchnick and @robregonm can put more inputs on the user authentication piece since they have already coded it in their modules.

I personally will try to come up with a initial draft of Module Design and everyone can chip in...

@evercode1
Copy link

@kartik-v The short version:

I've never done any unit tests, my fear is I would drag down the timeline learning from scratch.

The longer version :)

Also, I looked at your docs for your existing social module and they are very impressive.
Your installation, configuration, and usage docs are concise, precise and easy to follow.

The reason I looked is I wanted to see what a good example looks like. I asked myself if I could do as good of a job on it and then I realized, in order to write docs correctly, one has to have full command of the code. This is a fairly deep extension that reaches into a lot of complex areas or at least they seem complex to me because of my level of experience.

The one thing I think I can bring to this is a beginner's perspective, which would help flush out what beginners might stumble over. Although I'm just a beginner programmer, I have a more advanced perspective on the industry which I've been a part of for 15 years.

I think this social extension is very important to Yii 2 and to the people who will want to use it. Having fully researched php frameworks, inlcuding Symfony and Laravel, I concluded Yii and especially Yii 2 was the best platform by far. I would love to contribute to this in any way I can. If you want me to start to learn unit testing, I will do it. Just point me in the right direction...

@nineinchnick
Copy link
Collaborator

Nobody likes to do unit tests 😄 I can do social, I did recently did an integration with Paypal using OAuth 2.0 and I tested Facebook on my demo site, I got the main scenarios covered.

@kartik-v
Copy link
Member Author

Worked on an initial specification for the yii2-user Module. Kindly have a relook and let's finalize these configuration parameters.

@schmunk42
Copy link

@kartik-v Looks pretty sharp so far. If possible we may even simplify a few things, but we'll see.

@kartik-v
Copy link
Member Author

Few more settings updated in the the yii2-user Module. Various small modifications have been incorporated: i.e. the password reset key settings, form view settings, global widget settings for each form that will be also made available as a widget (as a plugin into views).

@nineinchnick
Copy link
Collaborator

Do we really need the ability to override each view? Can't themes or setting view path be used for that?

@kartik-v
Copy link
Member Author

Yes, views can be overridden with themes/view path as you said - this is the normal default. So we may not need configuration to override a view.

In addition, I had proposed separate widgets for each of those FORM_ areas. The configuration is for those. Advantage is that these can be directly embedded in any page the developer wants. For example LoginFormWidget or RegistrationFormWidget can be embedded on the home page at a particular location.

@nineinchnick
Copy link
Collaborator

Wouldn't such widgets have too many options? Even if there are only two inputs they need to have labels, error messages etc. Isn't a partial view simpler?

@kartik-v
Copy link
Member Author

Not sure there should be many options (unless we want them to). We pick most of these information from the model attributes. Any labels/messages/hints should be translateable. This should work for most use cases. Think of it as if you have these prebuilt widgets, you can easily plug them anywhere in your layout without resorting to or recreating the entire view:

  • LoginFormWidget
  • SocialButtonsWidget
  • RegistrationFormWidget

Inspite of all this, If the developer still feels this is not enough, he can entirely make his own view/layout and set it in the view map.

@evercode1
Copy link

prebuilt widgets such as these would be intuitive and easy to work with, similar to Kartik's exsiting social module. Very easy to implement and understand...

@kartik-v
Copy link
Member Author

Sample use cases (which many can benefit from)

  • Inline login form on the navbar
  • Login form inside a modal dialog
  • Control positioning of social buttons within the login process
  • Can think of same for registration form - if you want to embed it merge - with an extended registration or the contact form etc.

A widget is easier to control (than renderPartial view). We assume bootstrap theme as default (like Yii) and can offer bootstrap styling options (like vertical, horizontal, or inline forms, and basic additional HTML attributes/options for styling). In fact we can reuse each widget code and embed in our default views.

@evercode1
Copy link

This would be very effective because the developer would have many ways to encourage social login throughout the site with simple widgets, and not just a single method. With the widgets, a developer could quickly play with the options to determine what is best for their site. I think developers would love this, I certainly would.

@kartik-v
Copy link
Member Author

Updated DESIGN, Module Specs, and an Initial Stab at the User Model. The model needs more refining and thought to finalize (need to add all scenarios and other validations).

I have kept only 4 user statuses as of now (removed confirmed status - simply because it makes less sense when we have a social auth system which will automatically activate the user on login).

@robregonm and @nineinchnick - once we finalize the models -- can you suggest and include the IdentityInterfaces and the related validations.

@kartik-v kartik-v changed the title Rough Segregation Of Duties Approach and Plan for user module Mar 31, 2014
@kartik-v kartik-v changed the title Approach and Plan for user module Approach discussion for user module Mar 31, 2014
@kartik-v
Copy link
Member Author

@schmunk42 can you have a look and suggest on the ROLE column design for a simple RBAC scenario... and anything else to do for emails/templates.

@kartik-v
Copy link
Member Author

Included a draft for all models, mysql script, and the IdentityInterface empty skeleton in components.

You have been given access to do a git pull and push directly to the yii2-user repo directly.

I have also added in a LoginForm model which is relatively simple and is more or less complete. The social auth will need to be appended into the login form separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants