summaryrefslogtreecommitdiff
path: root/app/controllers/v1
diff options
context:
space:
mode:
authorazul <azul@leap.se>2014-07-21 10:36:22 +0200
committerazul <azul@leap.se>2014-07-21 10:36:22 +0200
commit791033d4a3021cc0a476a514667b17a6d519aa89 (patch)
tree650d0dff3c8f4ee77efdd237087df7c10b60cf8c /app/controllers/v1
parentbbd41c9bfd2cb88a88d7436dd58a8b46a5d10cf1 (diff)
parent11d1efaef622335fe6d45917ce0b50a02e4a24a1 (diff)
Merge pull request #181 from azul/feature/allow_anonymous_config_access
Allow fetching configs if anonymous EIP access is allowed
Diffstat (limited to 'app/controllers/v1')
-rw-r--r--app/controllers/v1/configs_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/v1/configs_controller.rb b/app/controllers/v1/configs_controller.rb
index accdf5a..9c01605 100644
--- a/app/controllers/v1/configs_controller.rb
+++ b/app/controllers/v1/configs_controller.rb
@@ -1,7 +1,7 @@
class V1::ConfigsController < ApiController
include ControllerExtension::JsonFile
- before_filter :require_login
+ before_filter :require_login, :unless => :anonymous_certs_allowed?
before_filter :sanitize_filename, only: :show
before_filter :fetch_file, only: :show
@@ -21,6 +21,10 @@ class V1::ConfigsController < ApiController
protected
+ def anonymous_certs_allowed?
+ APP_CONFIG[:allow_anonymous_certs]
+ end
+
def service_paths
Hash[SERVICES.map{|k,v| [k,"/1/configs/#{v}"] } ]
end