proxes 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +7 -0
  2. data/.codeclimate.yml +24 -0
  3. data/.gitignore +13 -0
  4. data/.rspec +2 -0
  5. data/.rubocop.yml +12 -0
  6. data/.ruby-version +1 -0
  7. data/.travis.yml +18 -0
  8. data/Gemfile +4 -0
  9. data/Gemfile.ci +15 -0
  10. data/Gemfile.dev +10 -0
  11. data/Gemfile.dev.lock +155 -0
  12. data/LICENSE.txt +8 -0
  13. data/README.md +83 -0
  14. data/Rakefile +9 -0
  15. data/Vagrantfile +46 -0
  16. data/bin/console +15 -0
  17. data/bin/setup +8 -0
  18. data/config.ru +64 -0
  19. data/config/logger.yml +3 -0
  20. data/gulpfile.js +80 -0
  21. data/lib/proxes.rb +3 -0
  22. data/lib/proxes/app.rb +48 -0
  23. data/lib/proxes/controllers/application.rb +53 -0
  24. data/lib/proxes/controllers/audit_logs.rb +34 -0
  25. data/lib/proxes/controllers/auth_identity.rb +21 -0
  26. data/lib/proxes/controllers/component.rb +108 -0
  27. data/lib/proxes/controllers/permissions.rb +10 -0
  28. data/lib/proxes/controllers/roles.rb +10 -0
  29. data/lib/proxes/controllers/users.rb +119 -0
  30. data/lib/proxes/db.rb +17 -0
  31. data/lib/proxes/helpers/authentication.rb +45 -0
  32. data/lib/proxes/helpers/component.rb +40 -0
  33. data/lib/proxes/helpers/indices.rb +16 -0
  34. data/lib/proxes/helpers/pundit.rb +39 -0
  35. data/lib/proxes/helpers/views.rb +41 -0
  36. data/lib/proxes/loggers/elasticsearch.rb +9 -0
  37. data/lib/proxes/models/audit_log.rb +12 -0
  38. data/lib/proxes/models/identity.rb +67 -0
  39. data/lib/proxes/models/permission.rb +17 -0
  40. data/lib/proxes/models/role.rb +14 -0
  41. data/lib/proxes/models/user.rb +57 -0
  42. data/lib/proxes/policies/application_policy.rb +20 -0
  43. data/lib/proxes/policies/audit_log_policy.rb +40 -0
  44. data/lib/proxes/policies/identity_policy.rb +24 -0
  45. data/lib/proxes/policies/permission_policy.rb +40 -0
  46. data/lib/proxes/policies/request/root_policy.rb +12 -0
  47. data/lib/proxes/policies/request/search_policy.rb +15 -0
  48. data/lib/proxes/policies/request/snapshot_policy.rb +12 -0
  49. data/lib/proxes/policies/request/stats_policy.rb +15 -0
  50. data/lib/proxes/policies/request_policy.rb +69 -0
  51. data/lib/proxes/policies/role_policy.rb +40 -0
  52. data/lib/proxes/policies/token_policy.rb +46 -0
  53. data/lib/proxes/policies/user_policy.rb +46 -0
  54. data/lib/proxes/rake_tasks.rb +59 -0
  55. data/lib/proxes/request.rb +51 -0
  56. data/lib/proxes/request/root.rb +10 -0
  57. data/lib/proxes/request/search.rb +37 -0
  58. data/lib/proxes/request/snapshot.rb +16 -0
  59. data/lib/proxes/request/stats.rb +30 -0
  60. data/lib/proxes/security.rb +59 -0
  61. data/lib/proxes/seed.rb +10 -0
  62. data/lib/proxes/services/logger.rb +50 -0
  63. data/lib/proxes/version.rb +4 -0
  64. data/migrate/001_tables.rb +47 -0
  65. data/migrate/002_audit_log.rb +11 -0
  66. data/package.json +34 -0
  67. data/proxes.gemspec +44 -0
  68. data/public/js/bundle.js +28988 -0
  69. data/src/scripts/app.js +10 -0
  70. data/views/404.haml +1 -0
  71. data/views/audit_logs/index.haml +18 -0
  72. data/views/error.haml +4 -0
  73. data/views/getting_started.haml +16 -0
  74. data/views/identity/login.haml +19 -0
  75. data/views/identity/register.haml +17 -0
  76. data/views/index.haml +3 -0
  77. data/views/layout.haml +48 -0
  78. data/views/partials/delete_form.haml +4 -0
  79. data/views/partials/form_control.haml +21 -0
  80. data/views/partials/navbar.haml +25 -0
  81. data/views/partials/notifications.haml +24 -0
  82. data/views/partials/pager.haml +19 -0
  83. data/views/partials/sidebar.haml +32 -0
  84. data/views/permissions/display.haml +24 -0
  85. data/views/permissions/edit.haml +11 -0
  86. data/views/permissions/form.haml +3 -0
  87. data/views/permissions/index.haml +14 -0
  88. data/views/permissions/new.haml +10 -0
  89. data/views/roles/display.haml +33 -0
  90. data/views/roles/edit.haml +11 -0
  91. data/views/roles/form.haml +1 -0
  92. data/views/roles/index.haml +17 -0
  93. data/views/roles/new.haml +10 -0
  94. data/views/users/display.haml +32 -0
  95. data/views/users/edit.haml +11 -0
  96. data/views/users/identity.haml +3 -0
  97. data/views/users/index.haml +20 -0
  98. data/views/users/new.haml +11 -0
  99. data/views/users/profile.haml +37 -0
  100. data/views/users/user.haml +3 -0
  101. metadata +424 -0
@@ -0,0 +1,11 @@
1
+ .row
2
+ .col-md-2
3
+ .col-md-8
4
+ .panel.panel-default
5
+ .panel-body
6
+ %form.form-horizontal{ method: 'post', action: "/_proxes/users/#{entity.id}" }
7
+ %input{ name: '_method', value: 'PUT', type: 'hidden' }
8
+ = haml :'users/user', locals: { user: entity }
9
+ %button.btn.btn-primary{ type: 'submit' }
10
+ Update User
11
+ .col-md-2
@@ -0,0 +1,3 @@
1
+ = form_control(:username, identity, label: 'Email', placeholder: 'Your email address')
2
+ = form_control(:password, identity, type: 'password', placeholder: 'Your password')
3
+ = form_control(:password_confirmation, identity, type: 'password', label: 'Confirm Password', placeholder: 'Confirm your password')
@@ -0,0 +1,20 @@
1
+ .row
2
+ .col-md-12
3
+ .panel.panel-default
4
+ %table.table.table-striped
5
+ %thead
6
+ %tr
7
+ %th Email
8
+ %th Name
9
+ %th Surname
10
+ %th Roles
11
+ %tbody
12
+ -list.each do |entity|
13
+ %tr
14
+ %td
15
+ %a{ href: "/_proxes/users/#{entity.id}" }= entity.email
16
+ %td= entity.name
17
+ %td= entity.surname
18
+ %td= entity.roles_dataset.map(:name).map(&:titlecase).join(', ')
19
+ .panel-body.text-right
20
+ %a.btn.btn-primary{ href: '/_proxes/users/new' } New User
@@ -0,0 +1,11 @@
1
+ .row
2
+ .col-md-2
3
+ .col-md-8
4
+ .panel.panel-default
5
+ .panel-body
6
+ %form.form-horizontal{ method: 'post', action: '/_proxes/users' }
7
+ = haml :'users/identity', locals: { identity: identity }
8
+ = haml :'users/user', locals: { user: entity }
9
+ %button.btn.btn-primary.btn{ type: 'submit' }
10
+ Create User
11
+ .col-md-2
@@ -0,0 +1,37 @@
1
+ .row
2
+ .col-md-2
3
+ .col-md-8
4
+ .panel.panel-default
5
+ .panel-body
6
+ .author
7
+ %img.pull-right.thumbnail{ src: entity.gravatar }
8
+ %h4.title= entity.email
9
+
10
+ %hr
11
+ %p.description
12
+ %label Name:
13
+ = entity.name
14
+ %p.description
15
+ %label Surname:
16
+ = entity.surname
17
+ %p.description
18
+ %label Roles:
19
+ = entity.roles_dataset.map(:name).map(&:titlecase).join(', ')
20
+ %p.description
21
+ %label Signed up:
22
+ = entity.created_at.strftime('%Y-%m-%d %H:%M:%S')
23
+
24
+
25
+ .panel.panel-default
26
+ .panel-heading
27
+ %h4 Change Password
28
+ .panel-body
29
+ %form.form-horizontal{ method: 'post', action: "/_proxes/users/#{entity.id}/identity" }
30
+ %input{ name: '_method', value: 'PUT', type: 'hidden' }
31
+ = form_control(:password, identity, type: 'password', placeholder: 'Your password')
32
+ = form_control(:password_confirmation, identity, type: 'password', label: 'Confirm Password', placeholder: 'Confirm your password')
33
+ %button.btn.btn-primary{ type: 'submit' }
34
+ Change Password
35
+ .col-md-2
36
+
37
+
@@ -0,0 +1,3 @@
1
+ = form_control(:name, user)
2
+ = form_control(:surname, user)
3
+ = form_control(:role_id, user, type: 'select', options: ProxES::Role.to_hash(:id, :name), name: 'user[role_id][]', field: :roles, multiple: true)
metadata ADDED
@@ -0,0 +1,424 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: proxes
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Jurgens du Toit
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-01-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.12'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: racksh
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rack-test
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: database_cleaner
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: factory_girl
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rack-proxy
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: sinatra
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: sinatra-flash
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: sinatra-contrib
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: elasticsearch
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: logger
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: pundit
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: sequel
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
223
+ - !ruby/object:Gem::Dependency
224
+ name: bcrypt
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :runtime
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - ">="
235
+ - !ruby/object:Gem::Version
236
+ version: '0'
237
+ - !ruby/object:Gem::Dependency
238
+ name: omniauth
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - ">="
242
+ - !ruby/object:Gem::Version
243
+ version: '0'
244
+ type: :runtime
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - ">="
249
+ - !ruby/object:Gem::Version
250
+ version: '0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: omniauth-identity
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ type: :runtime
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
265
+ - !ruby/object:Gem::Dependency
266
+ name: haml
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - ">="
270
+ - !ruby/object:Gem::Version
271
+ version: '0'
272
+ type: :runtime
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - ">="
277
+ - !ruby/object:Gem::Version
278
+ version: '0'
279
+ - !ruby/object:Gem::Dependency
280
+ name: tilt
281
+ requirement: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - ">="
284
+ - !ruby/object:Gem::Version
285
+ version: '2'
286
+ type: :runtime
287
+ prerelease: false
288
+ version_requirements: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - ">="
291
+ - !ruby/object:Gem::Version
292
+ version: '2'
293
+ description: Rack wrapper around Elasticsearch to provide security and management
294
+ features
295
+ email:
296
+ - jrgns@jadeit.co.za
297
+ executables: []
298
+ extensions: []
299
+ extra_rdoc_files: []
300
+ files:
301
+ - ".codeclimate.yml"
302
+ - ".gitignore"
303
+ - ".rspec"
304
+ - ".rubocop.yml"
305
+ - ".ruby-version"
306
+ - ".travis.yml"
307
+ - Gemfile
308
+ - Gemfile.ci
309
+ - Gemfile.dev
310
+ - Gemfile.dev.lock
311
+ - LICENSE.txt
312
+ - README.md
313
+ - Rakefile
314
+ - Vagrantfile
315
+ - bin/console
316
+ - bin/setup
317
+ - config.ru
318
+ - config/logger.yml
319
+ - gulpfile.js
320
+ - lib/proxes.rb
321
+ - lib/proxes/app.rb
322
+ - lib/proxes/controllers/application.rb
323
+ - lib/proxes/controllers/audit_logs.rb
324
+ - lib/proxes/controllers/auth_identity.rb
325
+ - lib/proxes/controllers/component.rb
326
+ - lib/proxes/controllers/permissions.rb
327
+ - lib/proxes/controllers/roles.rb
328
+ - lib/proxes/controllers/users.rb
329
+ - lib/proxes/db.rb
330
+ - lib/proxes/helpers/authentication.rb
331
+ - lib/proxes/helpers/component.rb
332
+ - lib/proxes/helpers/indices.rb
333
+ - lib/proxes/helpers/pundit.rb
334
+ - lib/proxes/helpers/views.rb
335
+ - lib/proxes/loggers/elasticsearch.rb
336
+ - lib/proxes/models/audit_log.rb
337
+ - lib/proxes/models/identity.rb
338
+ - lib/proxes/models/permission.rb
339
+ - lib/proxes/models/role.rb
340
+ - lib/proxes/models/user.rb
341
+ - lib/proxes/policies/application_policy.rb
342
+ - lib/proxes/policies/audit_log_policy.rb
343
+ - lib/proxes/policies/identity_policy.rb
344
+ - lib/proxes/policies/permission_policy.rb
345
+ - lib/proxes/policies/request/root_policy.rb
346
+ - lib/proxes/policies/request/search_policy.rb
347
+ - lib/proxes/policies/request/snapshot_policy.rb
348
+ - lib/proxes/policies/request/stats_policy.rb
349
+ - lib/proxes/policies/request_policy.rb
350
+ - lib/proxes/policies/role_policy.rb
351
+ - lib/proxes/policies/token_policy.rb
352
+ - lib/proxes/policies/user_policy.rb
353
+ - lib/proxes/rake_tasks.rb
354
+ - lib/proxes/request.rb
355
+ - lib/proxes/request/root.rb
356
+ - lib/proxes/request/search.rb
357
+ - lib/proxes/request/snapshot.rb
358
+ - lib/proxes/request/stats.rb
359
+ - lib/proxes/security.rb
360
+ - lib/proxes/seed.rb
361
+ - lib/proxes/services/logger.rb
362
+ - lib/proxes/version.rb
363
+ - migrate/001_tables.rb
364
+ - migrate/002_audit_log.rb
365
+ - package.json
366
+ - proxes.gemspec
367
+ - public/js/bundle.js
368
+ - src/scripts/app.js
369
+ - views/404.haml
370
+ - views/audit_logs/index.haml
371
+ - views/error.haml
372
+ - views/getting_started.haml
373
+ - views/identity/login.haml
374
+ - views/identity/register.haml
375
+ - views/index.haml
376
+ - views/layout.haml
377
+ - views/partials/delete_form.haml
378
+ - views/partials/form_control.haml
379
+ - views/partials/navbar.haml
380
+ - views/partials/notifications.haml
381
+ - views/partials/pager.haml
382
+ - views/partials/sidebar.haml
383
+ - views/permissions/display.haml
384
+ - views/permissions/edit.haml
385
+ - views/permissions/form.haml
386
+ - views/permissions/index.haml
387
+ - views/permissions/new.haml
388
+ - views/roles/display.haml
389
+ - views/roles/edit.haml
390
+ - views/roles/form.haml
391
+ - views/roles/index.haml
392
+ - views/roles/new.haml
393
+ - views/users/display.haml
394
+ - views/users/edit.haml
395
+ - views/users/identity.haml
396
+ - views/users/index.haml
397
+ - views/users/new.haml
398
+ - views/users/profile.haml
399
+ - views/users/user.haml
400
+ homepage: https://github.com/eagerelk/proxes
401
+ licenses:
402
+ - LGPLv3
403
+ metadata: {}
404
+ post_install_message:
405
+ rdoc_options: []
406
+ require_paths:
407
+ - lib
408
+ required_ruby_version: !ruby/object:Gem::Requirement
409
+ requirements:
410
+ - - ">="
411
+ - !ruby/object:Gem::Version
412
+ version: '0'
413
+ required_rubygems_version: !ruby/object:Gem::Requirement
414
+ requirements:
415
+ - - ">="
416
+ - !ruby/object:Gem::Version
417
+ version: '0'
418
+ requirements: []
419
+ rubyforge_project:
420
+ rubygems_version: 2.6.8
421
+ signing_key:
422
+ specification_version: 4
423
+ summary: Rack wrapper around Elasticsearch to provide security and management features
424
+ test_files: []