-
Notifications
You must be signed in to change notification settings - Fork 98
questions on docs #8
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
Comments
question 2: I saw both |
question 3: I see an example like this: Two concerns here:
I like the v0.x |
Thanks for reviewing things. Much appreciated.
V1 authentication and permissions has been a large undertaking that ekryski is still wrapping up. I did not use the v1 API in the docs as parts were in flux or outstanding. I decided to either wait until v1 was wrapped up or, even better, have ekryski update the docs for So the examples are v0.7 and I have yet to understand how to convert them to V1.
The notifier handler However we should standardize on a name and make the docs consistent. [Edited] I've changed the names to
Agreed on the issue. I was thinking authenticate, if configured to do so, would check
I frankly don't know. Its best to ask ekrsyki.
[Edited]
[Edited} Updated.
Thanks for the catch. Let me know if I missed answering anything. My apologies for not being able to be more helpful on the v1 stuff. |
Thank you @eddyystop for the quick reply. ;) As for the naming of APIs, I do agree that since this is now an official package and will go wide public, we need to refine some names. Here are my thoughts: In general, we now have some long camelCase names, which I think is fine as long as their meanings are clear. Being long is not the problem since we do have some complex logic and contexts that can only be made clear via long names. Long and clear, this is my criteria in the following suggestions.
For the service options:
For database field names:
For the
(the names seem so long... but when I used the old APIs I was always puzzled due to the unclear names. I think these long names could help developers to precisely understand what these actions or wrapper functions do.) |
Some API reconsiderations: For
// resend sign up verification notification
authManagement.create({ action: 'resendVerifySignup',
value: identifyUser, // {email}, {token: verifyToken}
notifierOptions: {}, // options passed to options.notifier, e.g. {prefersTransport: 'cellphone'}
}) I wonder why we have to make this a three-layer object ( // resend sign up verification notification
authManagement.create({
action: 'resendTokenToVerifySignup',
user: {email: email},
transport: 'cellphone' // bring this to the top level
someOtherProp: ... // put possible new options here at the top level too, making the param flat.
}) So we eliminate the name
Here my idea is: If we make the param structure of action method calls simple and flat, then we only need to pass this original param to the notifier function as a whole. We don't need to touch other props in this whole param object before pass them to here notifier function, only need to populate the |
Following the above comment we might be able to flatten the structures of params of all the methods/wrappers like this: // check props are unique in the users items
authManagement.create({
action: 'checkUniqueness',
user: ..., // e.g. {email, username}. Props with null or undefined are ignored. SIMPLY USE 'USER' HERE.
ownId, // excludes your current user from the search
ErrMsg, // if return an error.message if not unique. FLATTEN, REMOVE 'meta'
})
// resend sign up verification notification
authManagement.create({
action: 'resendTokenToVerifySignup',
user: ..., // {email}, {token: verifyToken} *DON"T UNDERSTAND WHY 'token' could also be used here?*
transport: ..., // 'cellphone',
otherProps: ...
})
// sign up or identityChange verification with long token
authManagement.create({
action: 'verifySignupWithLongToken',
token: ...
})
// sign up or identityChange verification with short token
authManagement.create({
action: 'verifySignupWithShortToken',
user: ..., // identify user, e.g. {email: 'a@a.com'}. See options.identityUserProps.
token: ..., // compares to .verifyTokenShort
}
})
// send forgotten password notification
authManagement.create({
action: 'sendTokenToResetPassword',
user: ..., // {email}, {token: verifyToken} SAME ABOVE, WHY token here?
transport: ..., // 'email'
otherProps: ...
})
// forgotten password verification with long token
authManagement.create({
action: 'resetPassorwdWithLongToken',
token: ..., // compares to .resetToken
password: ..., // new password
})
// forgotten password verification with short token
authManagement.create({
action: 'resetPasswordWithShortToken',
user: ..., // identify user, e.g. {email: 'a@a.com'}. See options.identityUserProps.
token: ..., // compares to .resetTokenShort
password: ..., // new password
})
// change password
authManagement.create({
action: 'changePassword',
user: ..., // identify user, e.g. {email: 'a@a.com'}. See options.identityUserProps.
oldPassword: ..., // old password for verification
newPassword: ..., // new password
})
// change communications
authManagement.create({
action: 'changeIdentities',{
user: ..., // identify user, e.g. {email: 'a@a.com'}. See options.identityUserProps.
password:..., // current password for verification
changes: ..., // {email: 'a@a.com'} or {email: 'a@a.com', cellphone: '+1-800-555-1212'}
}) |
As for the wrapper functions, I strongly suggest not using multiple params, but using one single option param and put all things in it as its props. See this: // forgotten password verification with short token
authManagement.resetPwdShort(resetShortToken, identifyUser, password)
// change password
authManagement.passwordChange(oldPassword, password, identifyUser) It's hard for developers to remember the order of multiple params: when It would be much nicer in this way (I guess since this is a new repo so we don't need to make the API backward compatible with the previous verifyReste reop?): // check props are unique in the users items
authManagement.checkUniqueness({user, ownId, errMsg}) //RENAME TO errMsg
// resend sign up verification notification
authManagement.resendTokenTOVerifySignup({user, transport, ...otherProps})
// sign up or identityChange verification with long token
authManagement.verifySignupWithLongToken({token})
// sign up or identityChange verification with short token
authManagement.verifySignupWithShortToken({user, token})
// send forgotten password notification
authManagement.sendTokenToResetPassword({user, tranport, ...otherProps})
// forgotten password verification with long token
authManagement.resetPassorwdWithLongToken({token, password})
// forgotten password verification with short token
authManagement.resetPassorwdWithShortToken({user, token, password})
// change password
authManagement.changePassword({user, oldPassword, newPassword})
// change identity
authManagement.changeIdentities({user, password, changes})
// Authenticate user and log on if user is verified. SURELY CAN WORK IN auth v1.0
authManagement.authenticate({user, password}) |
Wow. I made an effort to use clear names but that gets difficult when you are so close to the code. So I appreciate your more clear-sighted comments. I agree clarity is more important than the length of a name. I know a few people have started using the package, so we have the issue of backwards compatibility to consider. We can alias some names but it seems too early in this version's lifecycle to start doing that. I need to consider the pros and cons, once I have more coffee. :)
Thank you.
The dev can include any params he wants in
LOL. You write better English that most people. |
We've been told several times we need a better introduction to Feathers. The main point seems to be to get across that you can work with the DB on the client just as you would on the server, without any boilerplate. We suspect we may be too close to the code to write for the person just starting to look at Feathers. Do you anyone just starting to look at or use Feathers that could write notes on their experience? We could then correctany misunderstandings and flesh out the intro. |
I mean we could flatten the structure of the params and meanwhile still allow the dev to do so. For example, as I understand, currently we have this API: authManagement.create({
action: 'resendVerifySignup',
value: {email: email},
notifierOptions: {prefersTransport: 'cellphone'}
}) When calling this method, the
While I suggest this: authManagement.create({
action: 'resendTokenToVerifySignup',
user: ..., // {email}, {token: verifyToken} *DON"T UNDERSTAND WHY 'token' could also be used here?*
transport: ..., // 'cellphone',
otherProps: ...
}) Then the
So basically we don't eliminate the |
My understanding of Feathers at the very beginning is exactly like that: 'Wow, this is a db connector which wraps REST in nice APIs, and these APIs are nearly universal for all kinds of dbs! And I like the way to write hooks!' After several months my understanding evolved, and I find Feathers useful not only at the backend, but also at the frontend. The key point is how to understand and make use of service in Feathers. At the beginning I only understood services as wrappers of database tables/collections. Then I found Then I figured out that a service could also work only at the frontend. That means Feathers can also be used as a frontend data model manager. I can define services at the frontend, write hooks for them, make them communicate with backend services if needed. (my 'feathers-cache' repo uses services in this way). Currently I use feathers in this way: frontend UI View: vuejs |
You make a great point about "frontend data model manager". I moved away from client work after doing the basics and before comprehending that.
+1
|
Would you be interested in discussing a tutorial some more? If so any suggestions as to where? This repo isn't appropriate. |
I doubt I won't have much spare time in the following couple of weeks~ You mean the Feathers core team is planning to make a new tutorial for the coming Auk version? If so, I suggest you referring to vuejs' highly appreciated official docs at first. Vue's docs not only introduce APIs, but also explain why these APIs are made, why the APIs are designed in such ways, and provide many use cases. To be frankly it's WAY better than Feathers' current docs. Feathers docs always use very hard English -- long sentences, vague terminologies, etc. -- and are lack of detailed explanations on the thoughts behind the APIs. I am very willing to take part in discussing about the tutorial after I finished my current project. ;) BTW yesterday in a Chinese web dev forum I just introduced Feathers to @yyx990803, vuejs' core member. He might be interested in learning Feathers. |
Thanks for showing @yyx990803 <https://github.com/yyx990803> Feathers! We
do consider Vue docs to be setting the standard.
I'm the only person free enough to consider putting together a tutorial, so
I'm working on an outline.
…On Wed, Dec 21, 2016 at 11:34 AM, Beep LIN ***@***.***> wrote:
I doubt I won't have much spare time in the following couple of weeks~
You mean the Feathers core team is planning to make a new tutorial for the
coming Auk version? If so, I suggest you referring to vuejs' highly
appreciated official docs at first. Vue's docs not only introduce APIs, but
also explain why these APIs are made, why the APIs are designed in such
ways, and provide many use cases. To be frankly it's WAY better than
Feathers' current docs. Feathers docs always use very hard English -- long
sentences, vague terminologies, etc. -- and are lack of detailed
explanations on the thoughts behind the APIs.
I am very willing to take part in discussing about the tutorial after I
finished my current project. ;)
BTW yesterday in a Chinese web dev forum I just introduced Feathers to
@yyx990803 <https://github.com/yyx990803>, vuejs' core member. He might
be interested in learning Feathers.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABezn2BoGvmAJJLsCFqKYVQR3gxIWeJ6ks5rKVUigaJpZM4LRx8L>
.
|
@beeplin I've run across another idea for Feathers. A "service-builder" custom service could dynamically define another service. I assume that new service could then be used by any client. Therefore a client could use the service-builder to define a service for its own use. ( Use cases?
|
you mean only services built by Currently Feathers allows accessing all services from client, and yes, I have to manually disable the CRUD of most services via the AND another similar thing: currently once we use socket.io/primus, all services are sending websocket events to all client by default, and we have to manually disable most of the pushing behavior in the event filters (I am not sure if this still cost many server CPU/memory resources even if we filter most websocket events). I wonder if it's possible to do a white-list of socket event pushing. |
Sorry, I meant the client could ask the server to create additional
services. The client could use any pre-defined ones as well as any
dynamically created cones.
A priority after Auk is to create a chat-rooms type filter for events.
I'll be asking that it be flexible, efficient enough so a new repo could
allow clients to subscribe to part of a DB.
|
@eddyystop How are the new auth & permissions going? I know you guys are working on the docs, but if the codes/APIs are already settled, I would begin to use the new version from now. |
Things have been slow because its the holiday season in Canada, and it appears some core people may be having "real job" projects going live. Personally I would revisit the situation the 2nd week of Jan. I've seen an increase in new Feathers users who are coming from other technologies such as PHP, Ruby, and Meteor. They start with the generator and some appear to struggle. I wrote a simplistic introduction to basic Feathers for them at eddyystop/feathers-an-introduction. I would appreciate your comments if you have the time to read it. The next guide is starting to be outlined there in patterns/outline.md. |
@beeplin I would appreciate knowing what you think of the new Feathers docs if you have the time to look at them. https://docs.feathersjs.com/ p.s. Permission docs have been delayed a while. |
wow~ I will take some time to read it. Seems a total rewrite, cool! |
I've gone through the new docs from begining to end, and i is just wonderful! |
I grown to respect your comments so this is good to hear. Any suggestions? |
some concerns:
|
Noted. Thanks. |
About (1) I feel that alphabetical works better. We tried to relate hooks which work together with a See also ... at the end of some hooks. I agree the page is very long. However the TOC makes it easy to move about. About (2) |
@beeplin, I do remember you mentioning feathers-cache months ago but it skipped my mind while thinking about feathers-offline-realtime. I only ran across it while looking at localForage. I don't know if feathers-offline-realtime has any advantage over yours. I have offline queuing working elsewhere (the own-* and sync-* strategies) and need to consider adding them in now. |
yeah I noticed feathers-offline-realtime and it is cool! Overall it has a way better architecture than my feathers-cache. Only three considerations that might be helpful:
|
The current architecture is the 4th rewrite: sweat, not enlightenment. The previous iteration persisted in any client-side Feathers service but requiring the coding of hooks for optimistic/offline mutation was ugly. I think a dedicated localForage store would have a simpler API. There is also an effort underway elsewhere for a platform independant verion of NeDB. Best URL I have is https://github.com/tsturzl/teDB The optimistic mutator is forked from feathers-memory and has I don't understand the connection with feathers-reactive, which I would think is mutally exclusive. I'll look into your other suggestions, and thanks! |
Edited to section with redux. Stopping here and pushing to get feedback. Issue feathersjs-ecosystem#883. feathersjs-ecosystem/feathers-authentication-management#8 might hold some improvements also (have not read the issue yet).
question 1: In the docs I read:
Isn't
populateUser
has been deprecated?The text was updated successfully, but these errors were encountered: