mellon alternatives and similar packages
Based on the "Framework Components" category.
Alternatively, view mellon alternatives based on common mentions on social networks and blogs.
-
dayron
A repository `similar` to Ecto.Repo that maps to an underlying http client, sending requests to an external rest api instead of a database -
rummage_phoenix
Full Phoenix Support for Rummage. It can be used for searching, sorting and paginating collections in phoenix. -
phoenix_token_auth
Token authentication solution for Phoenix. Useful for APIs for e.g. single page apps. -
access pass
provides a full user authentication experience for an API. Includes login,logout,register,forgot password, forgot username, confirmation email and all that other good stuff. Includes plug for checking for authenticated users and macro for generating the required routes. -
Votex
Implements vote / like / follow functionality for Ecto models in Elixir. Inspired from Acts as Votable gem in Ruby on Rails -
plug_canonical_host
PlugCanonicalHost ensures that all requests are served by a single canonical host. -
trailing_format_plug
An elixir plug to support legacy APIs that use a rails-like trailing format: http://api.dev/resources.json
InfluxDB - Purpose built for real-time analytics at any scale.
Do you think we are missing an alternative of mellon or a related project?
Popular Comparisons
README
Mellon
An authentication module for Plug applications.
Intallation
defp deps do
[{:mellon, "~> 0.1.1"}]
end
How to use
See /examples for a working example.
defmodule MyApp do
import Plug.Conn
use Plug.Builder
plug Mellon, validator: {MyApp, :validate, []}, header: "X-AUTH"
plug :index
def validate({conn, token}) do
case token do
"ValidToken" -> {:ok, {"userdata"}, conn}
_ -> {:error, [], conn}
end
def index(conn, _opts) do
send_resp(conn, 200, "Secure area")
end
end
To authenticated for this example using curl you might do the following:
curl --header "X-AUTH: Token: ValidToken" localhost:4000/hello
Configuration
You can configure some parameters while initializing Mellon.
Required
validator
: The function that validates the token. Must return {:ok, userdata, conn} if valid and {:error, conn} if not.
Optional
header
: The http header used for tokens. Will default to 'Authorization'.
block
: Boolean representing if we should return a 401 and stop the chain, if the user is unauthenticated. set block: false, and you can handle displaying a message, oredirecting from the controller.
Return object from validator
The validator can return some options.
All requests that are authenticated should return
{:ok, cargo, conn}
cargo can be any object that you would like to pass along. it will be assigned to the request so you can access it later in your controller.
It will be assigned to :credentials
. To access it later you could do the following: conn.assigns[:credentials]
.
If authentication fails you should return {:error, options, conn}
.
Where options is a Keyword
containing status:
and message
.
Both are optional.
In case you want a custom Unauthenticated message include [message: 'Get out of here!']