Lurker News

Comments (173) 46 threads

Earlier comments
WorkLifeBalance2 replies#
How do you take this from here to the next step?

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".

WorkLifeBalance1 reply#
Where is the definition of the password being hashed? The tutorial defines it as text:

/* 'Users': collection { 'Password': text }*/
How does the platform know to hash that? Is it looking for magic property names?

klageveen3 replies#
No, there is no magic :) When you set up the users at the top of the model file, you specify which property is the password.

Continue this thread — 3 replies

CodesInChaos1 reply#
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.

byproxy#
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.
gcb01 reply#
the goal is to "step in when excell starts to get in the way"

I doubt they will ever care about any of that. a "side loaded application" will likely be the answer to most of those comments.

klageveen#
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).
nathan_f77#
This is very interesting. I'm looking through the Hours [0] code. Instead of:

    'Week Day': stategroup (
      'Monday' -> { }
      'Tuesday' -> { }
      'Wednesday' -> { }
      'Thursday' -> { }
      'Friday' -> { }
      'Saturday' -> { }
      'Sunday' -> { }
    )

I think it would be nice if you could just write something like:

    'Week Day': stategroup ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday')
Or even something like %w() from Ruby:

    'Week Day': stategroup %w(Monday Tuesday Wednesday Thursday Friday Saturday Sunday)
I also see a lot of "'Yes' -> { }" and "'No' -> { }" stategroups that are quite verbose. So it would be nice if you could just do:

    'Active': stategroup @default: 'Yes' %w(Yes No)
    'Subsidized': stategroup @default: 'Yes' %w(Yes No)
Or even a "Boolean" shorthand instead of 'Yes' and 'No':

    'Active': stategroup @default: 'Yes' Boolean
    'Subsidized': stategroup @default: 'Yes' Boolean

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 )



[0] https://github.com/M-industries/Hours/blob/master/interfaces...
jf-2 replies#
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.

jf-1 reply#
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.
klageveen1 reply#
If you add users to your model, you can generate a new "from_zero" migration that includes an initial user and password. Run

  ./.alan/dataenv/system-types/datastore/scripts/generate_migration.sh migrations/from_zero systems/server/model.lib.link --bootstrap
jf-#
Thanks!
klageveen1 reply#
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.
jf-1 reply#
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.

klageveen#
Thanks for understanding.

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.

Aeolun1 reply#
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?

klageveen1 reply#
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.
Serow2251 reply#
My experience has been that it's valuable to have an easy way to spin up a local server/runtime stack, for a wide variety of reasons.
blobwalker#
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.

Load more comments