proxes 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/lib/ditty/components/proxes.rb +2 -0
- data/lib/proxes/controllers/permissions.rb +22 -0
- data/lib/proxes/controllers/status.rb +70 -0
- data/lib/proxes/forwarder.rb +13 -6
- data/lib/proxes/helpers/es.rb +15 -0
- data/lib/proxes/policies/request/bulk_policy.rb +34 -0
- data/lib/proxes/policies/request/cat_policy.rb +1 -1
- data/lib/proxes/policies/request/create_policy.rb +1 -1
- data/lib/proxes/policies/request/index_policy.rb +2 -2
- data/lib/proxes/policies/request/root_policy.rb +1 -1
- data/lib/proxes/policies/request/search_policy.rb +1 -1
- data/lib/proxes/policies/request/snapshot_policy.rb +1 -1
- data/lib/proxes/policies/request/stats_policy.rb +1 -1
- data/lib/proxes/policies/request_policy.rb +5 -3
- data/lib/proxes/policies/status_policy.rb +21 -0
- data/lib/proxes/request/bulk.rb +43 -0
- data/lib/proxes/security.rb +3 -2
- data/lib/proxes/version.rb +1 -1
- data/migrate/{20170207_permissions.rb → 20170209_permissions.rb} +0 -0
- data/proxes.gemspec +1 -1
- data/public/js/bundle.js +150 -16
- data/views/permissions/index.haml +2 -0
- data/views/status/check.haml +12 -0
- metadata +11 -6
- data/lib/proxes/policies/token_policy.rb +0 -43
@@ -0,0 +1,12 @@
|
|
1
|
+
%table.table
|
2
|
+
%thead
|
3
|
+
%tr
|
4
|
+
%th Check
|
5
|
+
%th Value
|
6
|
+
%th Passed
|
7
|
+
%tbody
|
8
|
+
- checks.each do |check|
|
9
|
+
%tr{ class: check[:passed] ? 'success' : 'warning' }
|
10
|
+
%td= check[:text]
|
11
|
+
%td= check[:value].is_a?(Array) ? check[:value].join('<br>') : check[:value]
|
12
|
+
%td= check[:passed] ? 'Yes' : 'No'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proxes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jurgens du Toit
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: '3.
|
145
|
+
version: '3.1'
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: '3.
|
152
|
+
version: '3.1'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: elasticsearch
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -405,11 +405,14 @@ files:
|
|
405
405
|
- lib/ditty/components/proxes.rb
|
406
406
|
- lib/proxes.rb
|
407
407
|
- lib/proxes/controllers/permissions.rb
|
408
|
+
- lib/proxes/controllers/status.rb
|
408
409
|
- lib/proxes/forwarder.rb
|
410
|
+
- lib/proxes/helpers/es.rb
|
409
411
|
- lib/proxes/helpers/indices.rb
|
410
412
|
- lib/proxes/loggers/elasticsearch.rb
|
411
413
|
- lib/proxes/models/permission.rb
|
412
414
|
- lib/proxes/policies/permission_policy.rb
|
415
|
+
- lib/proxes/policies/request/bulk_policy.rb
|
413
416
|
- lib/proxes/policies/request/cat_policy.rb
|
414
417
|
- lib/proxes/policies/request/create_policy.rb
|
415
418
|
- lib/proxes/policies/request/index_policy.rb
|
@@ -418,8 +421,9 @@ files:
|
|
418
421
|
- lib/proxes/policies/request/snapshot_policy.rb
|
419
422
|
- lib/proxes/policies/request/stats_policy.rb
|
420
423
|
- lib/proxes/policies/request_policy.rb
|
421
|
-
- lib/proxes/policies/
|
424
|
+
- lib/proxes/policies/status_policy.rb
|
422
425
|
- lib/proxes/request.rb
|
426
|
+
- lib/proxes/request/bulk.rb
|
423
427
|
- lib/proxes/request/cat.rb
|
424
428
|
- lib/proxes/request/create.rb
|
425
429
|
- lib/proxes/request/index.rb
|
@@ -429,7 +433,7 @@ files:
|
|
429
433
|
- lib/proxes/request/stats.rb
|
430
434
|
- lib/proxes/security.rb
|
431
435
|
- lib/proxes/version.rb
|
432
|
-
- migrate/
|
436
|
+
- migrate/20170209_permissions.rb
|
433
437
|
- migrate/20170416_user_specific_permissions.rb
|
434
438
|
- package.json
|
435
439
|
- proxes.gemspec
|
@@ -451,6 +455,7 @@ files:
|
|
451
455
|
- views/permissions/form.haml
|
452
456
|
- views/permissions/index.haml
|
453
457
|
- views/permissions/new.haml
|
458
|
+
- views/status/check.haml
|
454
459
|
homepage: https://github.com/eagerelk/proxes
|
455
460
|
licenses:
|
456
461
|
- LGPL-3.0
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'application_policy'
|
4
|
-
|
5
|
-
module ProxES
|
6
|
-
class TokenPolicy < ApplicationPolicy
|
7
|
-
def create?
|
8
|
-
user.super_admin?
|
9
|
-
end
|
10
|
-
|
11
|
-
def list?
|
12
|
-
create?
|
13
|
-
end
|
14
|
-
|
15
|
-
def read?
|
16
|
-
record.id == user.id || user.super_admin?
|
17
|
-
end
|
18
|
-
|
19
|
-
def update?
|
20
|
-
read?
|
21
|
-
end
|
22
|
-
|
23
|
-
def delete?
|
24
|
-
create?
|
25
|
-
end
|
26
|
-
|
27
|
-
def register?
|
28
|
-
true
|
29
|
-
end
|
30
|
-
|
31
|
-
def permitted_attributes
|
32
|
-
attribs = %i[email name surname]
|
33
|
-
attribs << :role if user.super_admin?
|
34
|
-
attribs
|
35
|
-
end
|
36
|
-
|
37
|
-
class Scope < ApplicationPolicy::Scope
|
38
|
-
def resolve
|
39
|
-
user && user.super_admin? ? scope : scope.where(id: -1)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|