Live data from Hacker News

Phoenix 1.3.0 Released

phoenixframework.org

51–60 of 143 posts

Re: Phoenix 1.3.0 Released

#51

Phoenix is great! I only wish there was one recommended way for authentication and authorization - there are so many [1] different libraries that I got stuck in researching the options - I am confused, do not know which one to use. What is your preferred way? I would like to avoid to implement every little detail on my own - to get security done right was the main reason for me using open source libraries. It would b…

The beautiful thing about Phoenix framework is that there is no "one-true way" to do things. Rails is omakase, Phoenix is not, and that's a good thing. You want the whole enchilada? Use Guardian. Need oauth? Use ueberauth. Just want email and password? Use comeonin to hash your password. It's liberating to know exactly how your system works and that it's not hidden behind some magical blackbox like Devise.

A blackbox is not what I was asking for. I would be happy to find the features you described (and many more) in one (extensible) place like e.g. Phoenix.Security.

Re: Phoenix 1.3.0 Released

#52

Are there any "here be dragons" for Phoenix? Does it play well with legacy systems? Support for different protocols, etc.

YMMV on protocols, just depends on what you're looking for. Most reasonable protocols you'd want are supportable. The only time I've been left scratching my head was trying to get the VM running on a SOCKS proxy, which I think probably speaks more to my lack of familiarity with doing so (though in the source of this I found that the native SOCKS libraries were removed some time ago.

We're using it at a client as a kind of nexus of all our legacy systems, in fact.

Re: Phoenix 1.3.0 Released

#53

Phoenix is great! I only wish there was one recommended way for authentication and authorization - there are so many [1] different libraries that I got stuck in researching the options - I am confused, do not know which one to use. What is your preferred way? I would like to avoid to implement every little detail on my own - to get security done right was the main reason for me using open source libraries. It would b…

The beautiful thing about Phoenix framework is that there is no "one-true way" to do things. Rails is omakase, Phoenix is not, and that's a good thing. You want the whole enchilada? Use Guardian. Need oauth? Use ueberauth. Just want email and password? Use comeonin to hash your password. It's liberating to know exactly how your system works and that it's not hidden behind some magical blackbox like Devise.

For me the sweet spot is somewhere in between. If it just shipped with a decent auth module that would work for 90% of people, but that could also be easily replaced or extended if needed, that would be the best of both worlds.

Re: Phoenix 1.3.0 Released

#54

Earlier quoted context omitted.

The beautiful thing about Phoenix framework is that there is no "one-true way" to do things. Rails is omakase, Phoenix is not, and that's a good thing. You want the whole enchilada? Use Guardian. Need oauth? Use ueberauth. Just want email and password? Use comeonin to hash your password. It's liberating to know exactly how your system works and that it's not hidden behind some magical blackbox like Devise.

A blackbox is not what I was asking for. I would be happy to find the features you described (and many more) in one (extensible) place like e.g. Phoenix.Security.

The problem with that approach is that imagine if Phoenix had a Phoenix.Security.sign_in function. How do you want to sign in?

With a cookie?

With a server-side session?

With a database session?

With an authentication token GET params?

With an authentication token in the header?

You make the choices for your specific use case and implement them using laser-focused, great packages. One system I built authenticates with an `authenticationToken` GET params, I look for that in a Plug, then assign the current_user to the conn object.

For non-api requests, I use plain old sessions.

Re: Phoenix 1.3.0 Released

#55
post #15

I've been working professionally in Elixir/Phoenix for the past 4 months. Summary: It's amazingly productive, pleasant to work with and simple. Coming from a background spanning Python/Django, C#/.net and Node/Express I really believe it blows them out of the water. Thank you for all the hardwork of the Phoenix team and the amazing community you've made.

As a .NET developer by day, I'm curious what you like about Elixir over C#/.NET? I have a copy of Elixir in Action on my nightstand, I just haven't had a chance to crack it open yet.

I wouldn't say I like things over C#/.NET (I love C# and use it for mobile/desktop devel, but I've never used it for web).. but I'll list some things I like about Elixir:

Erlang's concurrency model is amazing. It's like having micro-microservices running inside your virtual machine. And you can distribute across nodes. Nothing else really has this kind of thing.

Pattern matching is beautiful and it's easy to use. Other languages have this too, so it's not like this is unique. This is one of my favorite things though; you can destructure things, you can pattern match inside a function using case, and you can pattern match on functions themselves like:

    def say("Hi"), do: IO.puts("Hello")
    def say("Bye"), do: IO.puts("Goodbye")
    def say(_msg), do: IO.puts("Where am I?")
That's basically the equivalent of having a single say() function that then does a switch/case on the input.

And a more recent addition to the language is "with". This is fantastic, it's one of my favorite things now. Usually you might have code that sets a variable from something, checks to make sure it's valid, sets another variable, checks to make sure it's valid, etc, etc... until finally you're function is ready to actually perform its purpose. Any of those checks might cause it to exit early or to switch paths. So Elixir has this "with" feature that looks sort of like this:

    def create(conn, %{"id" => group_id, "friend_id" => friend_id}) do
      with {:ok, user} 
          conn
          |> put_status(:unprocessable_entity)
          |> render("failure.json", msg: msg)
      end
    end
I love this feature. It makes code so much more readable and maintainable in my opinion.

Re: Phoenix 1.3.0 Released

#56

Would you suggest to choose Elixir / Phoenix for an api for a startup? Is it too risky now, or good enough + very attractive?

Just me personally, I probably wouldn't do it in anything else... Not that there aren't some other good options out there depending on your background. I just prefer Elixir, I know it scales in both maintenance and performance (the former being the more difficult goal in my mind) I think the market is growing such that finding engineers who a) have experience, or b) want experience with it, won't be a real problem. I can tackle software and hardware problems alike, there are good options for integrating native code when performance counts, and in general I consider it to be the safest option available to me.

Re: Phoenix 1.3.0 Released

#58

Phoenix is great! I only wish there was one recommended way for authentication and authorization - there are so many [1] different libraries that I got stuck in researching the options - I am confused, do not know which one to use. What is your preferred way? I would like to avoid to implement every little detail on my own - to get security done right was the main reason for me using open source libraries. It would b…

The beautiful thing about Phoenix framework is that there is no "one-true way" to do things. Rails is omakase, Phoenix is not, and that's a good thing. You want the whole enchilada? Use Guardian. Need oauth? Use ueberauth. Just want email and password? Use comeonin to hash your password. It's liberating to know exactly how your system works and that it's not hidden behind some magical blackbox like Devise.

Guardian is annoying to setup but works for me. I just want something that generates JWT and takes a JWT.

Re: Phoenix 1.3.0 Released

#59
I've always been intrigued by Phoenix/Elixir but I was worried it may just be a fad. Seems like it's had solid growth over the last couple years though, so I may end up diving into it over the weekend.

Re: Phoenix 1.3.0 Released

#60
post #40

Earlier quoted context omitted.

Pattern Matching makes it easy to write small, understandable code The Concurrency Model is simple to the point where creating a whole pubsub system to handle events, push out notifications, and handles backpressure can be done in Finally the pipe operator is like C#'s LINQ statements but with so much more power and flexibility, hard to explain but I highly recommend cracking open that book on your nightstand!

The Elixir pipe operator |> is the equivalent of the Clojure thread first macro ->, right?

Yep, exactly.

https://elixir-lang.org/getting-started/enumerables-and-stre...

Post reply on HN