Snap.Auth.Plain (Snap v0.4.2) View Source

Implements HTTP Basic Auth, if necessary.

If the cluster config defines a username and password, an Authorization: Basic header is added to the request.

config :my_app, MyApp.Cluster,
  url: "http://localhost:9200",
  username: "foo",
  password: "bar

Or you can define a username and password in the URL itself:

config :my_app, MyApp.Cluster,
  url: "http://username:password@localhost:9200"

If no username or password is defined, no Authorization header is added, making it suitable for local development.

Link to this section Summary

Link to this section Functions

Link to this function

sign(config, method, path, headers, body)

View Source

Callback implementation for Snap.Auth.sign/5.