rollout_control 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8393199604c124688b2befe39e071b0fb92d34fc
|
4
|
+
data.tar.gz: 6c30f2fb5862b01a177eee3f0da0b1fecf72ee1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 558c4651305ad9059b54be11151167cd6f176f6dd403be15dd422d6c875df68b0765d98f7e818f7565614d9caf0986835c668319e6364a8c386dee7c191ed253
|
7
|
+
data.tar.gz: 6be784928448b8ef08cc17fdffe089c60f2947964d6679ee6ca20082d2c2da635758d2e63546f3edfd825170b4ac524357260ed2d2d524dd1b87dd68e28db606
|
@@ -1,10 +1,24 @@
|
|
1
1
|
module RolloutControl
|
2
2
|
class ApplicationController < ActionController::Base
|
3
|
+
before_filter :authenticate
|
3
4
|
|
4
5
|
private
|
5
6
|
|
6
7
|
def rollout
|
7
8
|
RolloutControl.rollout
|
8
9
|
end
|
10
|
+
|
11
|
+
def authenticate
|
12
|
+
unless RolloutControl.unprotected
|
13
|
+
authenticate_or_request_with_http_basic('Rollout Control') do |username, password|
|
14
|
+
rc_username, rc_password = RolloutControl.basic_auth_username, RolloutControl.basic_auth_password
|
15
|
+
if rc_username.present? && rc_password.present?
|
16
|
+
username == rc_username && password == rc_password
|
17
|
+
else
|
18
|
+
false
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
9
23
|
end
|
10
24
|
end
|
@@ -1,18 +1,5 @@
|
|
1
1
|
module RolloutControl
|
2
2
|
class Engine < ::Rails::Engine
|
3
3
|
isolate_namespace RolloutControl
|
4
|
-
|
5
|
-
initializer 'Basic Auth' do |app|
|
6
|
-
unless RolloutControl.unprotected
|
7
|
-
app.config.middleware.use Rack::Auth::Basic do |username, password|
|
8
|
-
rc_username, rc_password = RolloutControl.basic_auth_username, RolloutControl.basic_auth_password
|
9
|
-
if rc_username.present? && rc_password.present?
|
10
|
-
username == rc_username && password == rc_password
|
11
|
-
else
|
12
|
-
false
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
4
|
end
|
18
5
|
end
|