News for hackers. Stuff that matters.
Re:Learnings from One Year of Building an Open Source Elixir... by rpazyaquian on Tuesday August 15, 2017 @10:07AM (#15018268)
This seems to be the case in many places outside of Rails. I know that Clojure, at least, seems to encourage implementing things yourself by way of leveraging smaller libraries and modules.

Auth is genuinely hard, and turnkey solutions often aren't enough.

Re:Learnings from One Year of Building an Open Source Elixir... by fny on Tuesday August 15, 2017 @03:15PM (#15021387)
Auth is genuinely hard, and a hand-rolled solution's definitely not enough...

Given the massive attack surface for a web application, it's absurd to think someone could (or should*) develop an entire auth framework from scratch for all their projects. Turnkey solutions, like Ruby's Devise, are a godsend. Even in situations were a custom flow was needed, it's saved both me and my clients hundreds of hours.

In addition, I benefit from the community around a turnkey solution. Think of all the years the software has been tested by in umpteen production environments. Think of all the people that have an eye on the code and report security flaws while you sleep. Your custom session management implementation will never have that benefit.

Also, why the hell are you building auth when you could be building app? Is that really such a critical experiential part of your app that you can't possibly rely on something turnkey and then move on to the features that actually matter?

Re:Learnings from One Year of Building an Open Source Elixir... by pdimitar on Wednesday August 16, 2017 @03:34PM (#15030477)
All of what you say is true but I feel important details are lost.

Elixir's Phoenix framework has very good plugins -- like Guardian -- that give you 95% of the tools you might need for your own security solution and you can assemble it together in 15-60 minutes (this of course assumes your security model isn't wildly different than what the various plugins support). You have separate Plugs -- think of them as pipes of sort -- who handle cookie session management, another that handles JWT tokens, HTTP basic auth etc.

The only thing you must do is to assemble such pieces in a code module that basically serves as a pipeline with several Plugs (pipes) connected in the order you deem appropriate for the security model of your app. Any of these Plugs can modify or remove headers or tokens, can consult a 3rd party system (say, for single sign-on), can provide throttling, temporarily lock out an account that made too many invalid login attempts, can refuse a session due to non-whitelisted IP, etc. etc.

So no, you're not inventing cookie session management or anything there. You simply have control on which security mechanisms -- and when, and at which conditions -- happen on request.

Re:Learnings from One Year of Building an Open Source Elixir... by jacquesm on Tuesday August 15, 2017 @11:32PM (#15024762)
> Even in situations were a custom flow was needed, it's saved both me and my clients hundreds of hours.

And it possibly saved you from embarrassment as well.

Re:Learnings from One Year of Building an Open Source Elixir... by s0l1dsnak3123 on Tuesday August 15, 2017 @10:48AM (#15018662)
Let's not also forget that lots of projects people are using Phoenix for are APIs (either for mobile apps or single page web applications). Because of that, it makes sense to glue together smaller libs to match your house style for how you want that auth contract to work.
Re:Learnings from One Year of Building an Open Source Elixir... by throwaway47861 on Wednesday August 16, 2017 @03:41PM (#15030559)
Can confirm. Currently working on several Elixir API apps, they are absolute joy to work on and you get tons of freedom on how exactly to structure them.

The "cruft" from the Phoenix framework is absolutely minimal -- mandatory 4-6 files per project at the most. And they're quite small, too.

Re:Learnings from One Year of Building an Open Source Elixir... by WillPostForFood on Tuesday August 15, 2017 @02:04PM (#15020717)
I agree Auth is hard, but that makes me want a good turnkey solution even more.