Skip to content

Commit

Permalink
The local deployment no longer uses basic authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
x-ji committed Jan 9, 2019
1 parent b2bedd5 commit d7ed18f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [0.2.1] - 2018-01-09

### Changed

- The local deployment no longer uses basic authentication.

### Fixed

- Allow socket connection from any host, since we don't constrain where the user hosts the frontend \_babe experiment.
Expand Down
5 changes: 4 additions & 1 deletion web/controllers/custom_record_controller.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
defmodule BABE.CustomRecordController do
@moduledoc false
use BABE.Web, :controller
plug(BasicAuth, use_config: {:babe, :authentication})

if Application.get_env(:babe, :environment) != :local do
plug(BasicAuth, use_config: {:babe, :authentication})
end

alias BABE.CustomRecord

Expand Down
14 changes: 8 additions & 6 deletions web/controllers/experiment_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ defmodule BABE.ExperimentController do
@moduledoc false
use BABE.Web, :controller

plug(
BasicAuth,
[use_config: {:babe, :authentication}]
when not (action in [:submit, :retrieve_as_json, :check_valid])
)
if Application.get_env(:babe, :environment) != :local do
plug(
BasicAuth,
[use_config: {:babe, :authentication}]
when not (action in [:submit, :retrieve_as_json, :check_valid])
)
end

require Logger
require Iteraptor

alias BABE.{Experiment, ExperimentStatus, ExperimentResult}
alias BABE.{Experiment, ExperimentResult}
alias Ecto.Multi

import BABE.ExperimentHelper
Expand Down
5 changes: 4 additions & 1 deletion web/controllers/page_controller.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
defmodule BABE.PageController do
@moduledoc false
use BABE.Web, :controller
plug(BasicAuth, use_config: {:babe, :authentication})

if Application.get_env(:babe, :environment) != :local do
plug(BasicAuth, use_config: {:babe, :authentication})
end

def index(conn, _params) do
render(conn, "index.html")
Expand Down

0 comments on commit d7ed18f

Please sign in to comment.