Skip to content

prosapient/dev_space_auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevSpaceAuth

DevSpaceAuth is a wrapper around Plug.BasicAuth with rate limiting. It is designed to protect endpoints that are used only by developers.

Installation

Add dev_space_auth to your list of dependencies in mix.exs:

def deps do
  [
    {:dev_space_auth, github: "prosapient/dev_space_auth"}
  ]
end

Setup

  1. Define a rate limiter module in your app:
defmodule MyApp.RateLimit do
  use Hammer, backend: :ets
end
  1. Add it to your supervision tree (before the endpoint):
children = [
  MyApp.RateLimit,
  MyAppWeb.Endpoint
]
  1. Use the plug with the rate_limiter option:
pipeline :dev_space_auth do
  plug DevSpaceAuth, rate_limiter: MyApp.RateLimit
end
  1. Configure credentials:
config :dev_space_auth,
  username: "username",
  password: "password"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages