Let's say I want to develop a multi user todo and I've followed the examples and now have some Users who log in entering a password. Someone points out that I shouldn't be storing passwords in plain text so I want to store them hashed. Despite there being hints in the documentation that this is possible (migrations shows the password hashed), it's not clear how to carry out this kind of change. A walkthrough of making a change would help convey the use case much better than just templates of "this incantation produces this output".
Well, in this particular case passwords are always hashed. So the platform deals with that for you. Other changes to the data model need a migration, which is covered here: https://alan-platform.com/pages/tuts/migration.html
It looks like you're using SHA256(username||password) in this example. Even if it's only an example, why use a homebrew password hashing scheme based on an unsuitable hash function and bad ad-hoc salt handling, instead of a strong standard password hash with built in salt handling? And what code/specification is required to use a secure algorithm, like bcrypt with a random salt?
People often copy from such tutorials and will then end up with insecure password storage.
As someone who's not a developer but still occasionally looks through these "build an app" tutorials, password/authentication portions always worry me. I wish I could know that best-practices were shown as far as storing/encrypting user data/passwords.
There is a lot the platform can do by itself, but I think you grasped it well enough. The side loaded apps are definitely the escape hatch to enable things it doesn't cover (yet).
Also 'can-create:' and 'can-update:' seem to always have some shared logic. Instead of:
can-create: user +'Roles'?'Manager'|'Yes'
|| user +'Roles'?'Project Manager'|'Yes'
can-update: user +'Roles'?'Manager'|'Yes'
|| user +'Roles'?'Project Manager'|'Yes'
|| equal ( user , $ >'Project Group'>'Owner'>key )
You could do something like:
can-create: user +'Roles'?'Manager'|'Yes'
|| user +'Roles'?'Project Manager'|'Yes'
can-update: &can-create || equal ( user , $ >'Project Group'>'Owner'>key )
Tutorial has some issues. “from_scratch.migration” should be “from_zero.migration”, and visiting server_ip:7584 gives an invalid address error. This is after downloading the virtual box image, installing Alan connect, doing the build steps, importing the built image and starting it.
Edit: Looks like the Alan connect app needs to be restarted after adding the image. Clicking “advanced” nothing was running, it’s fixed after reloading.
Also can’t find a valid username/password for Hours. There is what looks like a username (hello world) and password in the source but they don’t let me log in.
Thanks for catching that. Did I mention we're still moving fast and breaking things? ... Sorry. The tutorial text should be fixed, will be looking into the Alan Connect app.
No worries! Nothing is ever perfect on launch day.
It’s a nice app you have here. My gut instinct is that you will need to allow under the hood customisation if you want it to really catch on. Your potential customers will be afraid of getting 90% of the way to their goal and realising that the last 10% is impossible.
You’re not alone with that gut instinct. We haven’t run into that problem though. Also, that last 10% can probably be achieved using a custom side app, or a custom front end. We didnt cover that in detail in the introduction, but the options are there. Also, current traditional approaches aren’t guaranteed to get you near 100% either. They may hold the promise of getting there, but we’re usually dealing with clients who understand that most projects don’t make good on that promise.
As much as I like the idea. There seems to be a fair number of requirements. I don't particularly feel like installing an 'alan' server, or an 'alan' connector just to test out my application.
Is there any reason why 'alan run' couldn't do these things for me automatically and run it on my local host?
Well it could. We find in practice that it's easier to just have a server running "somewhere" (locally if you have the resources) and push applications to it. But if the feedback shows that the first-run experience needs to improve that's definitely an area we would be looking at.
I agree. I think people would be far more likely to try it out if you could kick off a dev server from the CLI without having to fire up any extra processes.
Comments (173) 46 threads
Earlier commentsLet's say I want to develop a multi user todo and I've followed the examples and now have some Users who log in entering a password.
Someone points out that I shouldn't be storing passwords in plain text so I want to store them hashed.
Despite there being hints in the documentation that this is possible (migrations shows the password hashed), it's not clear how to carry out this kind of change.
A walkthrough of making a change would help convey the use case much better than just templates of "this incantation produces this output".
/* 'Users': collection { 'Password': text }*/
How does the platform know to hash that? Is it looking for magic property names?
Continue this thread — 3 replies
People often copy from such tutorials and will then end up with insecure password storage.
I doubt they will ever care about any of that. a "side loaded application" will likely be the answer to most of those comments.
Edit: Looks like the Alan connect app needs to be restarted after adding the image. Clicking “advanced” nothing was running, it’s fixed after reloading.
It’s a nice app you have here. My gut instinct is that you will need to allow under the hood customisation if you want it to really catch on. Your potential customers will be afraid of getting 90% of the way to their goal and realising that the last 10% is impossible.
You’re not alone with that gut instinct. We haven’t run into that problem though. Also, that last 10% can probably be achieved using a custom side app, or a custom front end. We didnt cover that in detail in the introduction, but the options are there. Also, current traditional approaches aren’t guaranteed to get you near 100% either. They may hold the promise of getting there, but we’re usually dealing with clients who understand that most projects don’t make good on that promise.
Is there any reason why 'alan run' couldn't do these things for me automatically and run it on my local host?
All comments shown.
Couldn't load more comments. Check your connection and try again.