nsa_panel 0.0.4 → 0.0.5
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.
- data/README.md +11 -1
- data/app/assets/javascripts/nsa_panel/dashboard.js +5 -0
- data/app/controllers/nsa_panel/application_controller.rb +15 -1
- data/app/controllers/nsa_panel/dashboard_controller.rb +19 -0
- data/app/helpers/nsa_panel/dashboard_helper.rb +4 -0
- data/app/views/nsa_panel/dashboard/law_accordance_check.html.erb +4 -0
- data/config/routes.rb +4 -1
- data/lib/nsa_panel/version.rb +1 -1
- data/test/dummy/log/development.log +2169 -0
- data/test/dummy/tmp/cache/assets/D12/870/sprockets%2F4b81d5532be95396ec25b13aefe78053 +0 -0
- data/test/dummy/tmp/cache/assets/D33/AF0/sprockets%2Fcdeb00261f07c945b39f4c0a61b43e85 +0 -0
- data/test/dummy/tmp/cache/assets/D39/610/sprockets%2F8d2e10b2572fefe0785371a6a1ce57a4 +0 -0
- data/test/dummy/tmp/cache/assets/D6E/410/sprockets%2Fd82c68c0c287a712c7bd2fe34e3a991a +0 -0
- data/test/dummy/tmp/cache/assets/E0B/F60/sprockets%2Fc2e14aeedcbfbc9e4fc16a818872598f +0 -0
- data/test/dummy/tmp/pids/server.pid +1 -1
- data/test/functional/nsa_panel/dashboard_controller_test.rb +3 -5
- metadata +7 -3
data/README.md
CHANGED
@@ -3,7 +3,15 @@
|
|
3
3
|

|
4
4
|
|
5
5
|
The easiest way to add a special panel for NSA agents to monitor your
|
6
|
-
users' data. Let's ~~
|
6
|
+
users' data. Let's ~~destroy the right to privacy~~ fight terrorism together!
|
7
|
+
|
8
|
+
Why?
|
9
|
+
|
10
|
+
Well, the government wants to protect you and your users from those
|
11
|
+
crazy guys that blow up everything. Everyone wants to be safe. No liberty
|
12
|
+
should be superior to the safety and every government is good!
|
13
|
+
|
14
|
+
Besides, you and your users really have got **nothing to hide**, haven't you?
|
7
15
|
|
8
16
|
## Example
|
9
17
|
|
@@ -84,6 +92,8 @@ Easy, eh?
|
|
84
92
|
|
85
93
|
## What it looks like
|
86
94
|
|
95
|
+

|
96
|
+
|
87
97
|

|
88
98
|
|
89
99
|

|
@@ -1,11 +1,25 @@
|
|
1
1
|
module NsaPanel
|
2
2
|
class ApplicationController < ActionController::Base
|
3
|
-
before_filter :authenticate
|
3
|
+
before_filter :authenticate, :require_warrant
|
4
|
+
|
5
|
+
private
|
4
6
|
|
5
7
|
def authenticate
|
6
8
|
authenticate_or_request_with_http_basic do |username, password|
|
7
9
|
NsaPanel.username == username && NsaPanel.password == password
|
8
10
|
end
|
9
11
|
end
|
12
|
+
|
13
|
+
def require_warrant
|
14
|
+
render 'nsa_panel/dashboard/law_accordance_check' unless has_warrant?
|
15
|
+
end
|
16
|
+
|
17
|
+
def has_warrant?
|
18
|
+
session[:has_warrant] == true
|
19
|
+
end
|
20
|
+
|
21
|
+
def has_warrant!
|
22
|
+
session[:has_warrant] = true
|
23
|
+
end
|
10
24
|
end
|
11
25
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require_dependency "nsa_panel/application_controller"
|
2
|
+
|
3
|
+
module NsaPanel
|
4
|
+
class DashboardController < ApplicationController
|
5
|
+
skip_before_filter :require_warrant, only: [:proceed]
|
6
|
+
|
7
|
+
def index
|
8
|
+
redirect_to users_path
|
9
|
+
end
|
10
|
+
|
11
|
+
def law_accordance_check
|
12
|
+
end
|
13
|
+
|
14
|
+
def proceed
|
15
|
+
has_warrant!
|
16
|
+
redirect_to users_path
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<h3>We want to make sure you are accessing this portal in accordance with the law</h3>
|
2
|
+
|
3
|
+
<%= link_to 'I have received a FISA warrant', dashboard_proceed_path, method: :post, class: 'btn btn-large btn-block btn-success' %>
|
4
|
+
<%= link_to 'I have not received a FISA warrant', '#', class: 'btn btn-large btn-block btn-danger', id: 'no-warrant-btn' %>
|
data/config/routes.rb
CHANGED
@@ -3,5 +3,8 @@ NsaPanel::Engine.routes.draw do
|
|
3
3
|
resources :data
|
4
4
|
end
|
5
5
|
|
6
|
-
|
6
|
+
get '/check' => 'dashboard#law_accordance_check', as: :dashboard_law_accordance_check
|
7
|
+
post '/proceed' => 'dashboard#proceed', as: :dashboard_proceed
|
8
|
+
|
9
|
+
root to: 'dashboard#index'
|
7
10
|
end
|
data/lib/nsa_panel/version.rb
CHANGED