-
Notifications
You must be signed in to change notification settings - Fork 194
Assignment9 and Beyond #172
Comments
I know I've not been doing the exercises or delivering assignments, but I've been following the project. Personally, I would really be interested in seeing more about cache handling and role-base authorization, and I would like to see some examples of image/file uploading, but I feel that could be done on a a future assignment where you allow some privileged users to upload photos and store information about them on a database (or something similar...) Anyway these are just my votes! |
@Couto good to have your input :-) |
I have to admit that I don't dwell too much with backend code, so take my case with a grain of salt, or dismiss it at all if it doesn't make sense. My problem with RBAC is when several roles can use the same endpoint to perform an action but with different privileges. e.g.: Having regular users, moderators and administrators. All roles can upload an avatar to their profiles by performing a POST request to What's the best way to manage all this? I guess that in the specific above example we'll always have to get the image first, check its dimensions and then perform the appropriated action, and I have to admit that I'm missing a better use case, something where you could check their privilege before performing any kind of action. Mostly likely I'm just missing something simple... :) |
On the topic of role-based authorization, it's worth checking out the mrhorse plugin, which allows you to add lifecycle hooks on route configurations (called "policies"). There's also rumor hapi9 may have proper per-route lifecycle hooks: hapijs/hapi#2566. |
@devinivy Thanks for the suggestion! I can see mrhorse being quite useful 👍 |
I'm also interested in role-based authorization |
Personally I would love to see a demonstrated approach/assignment that details database integration. I've learned heaps from the assignments so far - can't wait for the next - thanks! |
Would there be any interest in a version of this tutorial extended into an assignment? It would be about integrating hapi with waterline ORM to create an API. |
@devinivy Looks great. From a newbie perspective I'd be keen to understand the low level aspects first (i.e. what these plugins literally save me doing) before moving on to an ORM and so on. The assignment with 'glue' was really useful in that sense because I could see how much effort it was saving me and what the objectives were. |
Thanks for the feedback. Yeah, this is a few steps further removed from hapi than glue, and it's a bit more complicated to relate the value of these plugins. If there's more interest, it would also be nice to reach out to @moklick who wrote that tutorial. In the interest of transparency, I'm the lead maintainer of those two plugins and a collaborator with waterline ORM. That both makes me a good candidate to help write the assignment, and also necessarily biased :P. But if there's interest in working with databases in hapi, I do believe it would be a useful route to explore. |
@devinivy and @james-gardner @mikejerome and @Couto It is really good to have everyones input. From the above comments it seems that most people are interested in role-based access controls and integrating a database. I suggest we pursue both of these objectives in the next couple assignments by: one, integrating a database into the project. two, providing features that utilize RBAC (Role based access controls). In respect to a database, over the past several weeks, I have been researching intergrating couchdb into our project. There are several things I really like about couchdb:
How to approach couchdb.I suggest using couchdb with nano because nano
note about redisEventually, redis should be included in this project but to approach two databases Please give feedback. |
I'm still very interested, when are we coming off |
@rutaihwa Good to hear from you.
Work responsibilities have been big so have not tackled writing another assignment. However, on the positive side of things, the current project covers the core elements of setting up the hapijs framework and people seem to be making good use of it. Next week plan to share more thoughts. Or, if someone is motivated and wants to contribute an assignment, please open up an issue and make a proposal. With the combination of the holiday coming the end of this month and work being busy, I will not be able to make any assignments until next year. But, I do plan to publish all the couchdb user crud data as mentioned above. Cheers! |
Thanks @zoe-1 this project has been very good and helpful (speaking for my self at least). I am having my semester final exams this coming week and holiday is coming along with some travellings. I have been a lot more fixated on working on some sort of beautiful api design but I have not yet started playing with couchDB, but I would like to learn and work it out. I could also help with updating to the current hapi version. All in all, would like to contribute. |
@rutaihwa I am glad you want to contribute to the project. I just put up a bunch of couchdb request logic at https://github.com/sofajs/sample . |
sample user couchdb queries completed.
|
Thanks @zoe-1 will play with sofajs. |
Your welcome @rutaihwa. |
Where are we going next? Most of the goals discussed at: #132 have been achieved.
Below is a list of subjects discussed earlier that have not yet been covered or were lightly
covered. @FennNaten made most of the below recommendations in the discussion at: #132.
Read the below and share your thoughts about the direction of the university :-)
Caching correctly is critical to have reactive websites.
but it would be cool for everyone to try an implementation, saying e.g. that roles that can access a route should be provided as route configuration,
and role-check performed at post-authentication. This would drive us into using request lifecycle hooks.
for people wanting to display our latest news on their own site) Some form of content negociation.
Let's say e.g. that our nice 'latest news' endpoint can serve the data as xml, json or plain text depending on request headers.
Routes documentation with lout.
Provide error pages to hook on some http statuses (unauthorized, 404, server errors).
Would be another opportunity to hook on the request/response lifecycle.
I have not researched this but it's here for discussion.
Over the past several months, many expressed the desire to include a database (See Potential [Assignment 5] Glue and HTML views #132).
At this point in the project, it would be reasonable to include a DB. Since hapijs is part of the
JavaScript and node.js universe, it would be appropriate to use a JSON document database like couchDB or Mongo. Or, perhaps the community wants to keep the university focused on JavaScript and hapijs. What are your thoughts? Personally, I think database support would make the university much more interesting and attractive to people who are considering changing technologies and begin using hapijs.
I have been preparing to use couchdb in a hapijs application by writing logic with 100% test coverage here: sofajs This project is not complete but it illustrates a direction we could head with couchdb (nano and 100% hapijs/lab test coverage)
Other Ideas:
Most developers would benefit from some file uploading code. Coming from Rails I still appreciate plugins like: paperclip. I have not seen anything like this in the node.js world. Perhaps it exists, but I have not found it yet.
If you see a subject in the above list you have experience with, consider sharing your knowledge by writing an assignment :-) You will learn more by teaching a subject than studying it.
The text was updated successfully, but these errors were encountered: