proxes 0.5.1 → 0.5.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 +4 -4
- data/lib/proxes/controllers/users.rb +4 -3
- data/lib/proxes/helpers/authentication.rb +1 -0
- data/lib/proxes/policies/request/search_policy.rb +1 -0
- data/lib/proxes/rake_tasks.rb +2 -2
- data/lib/proxes/request/search.rb +1 -1
- data/lib/proxes/security.rb +2 -2
- data/lib/proxes/version.rb +1 -1
- data/views/users/display.haml +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7409fa9ea1b118954e8b3b1d8edc19b4ca1b8c5
|
4
|
+
data.tar.gz: 6b2a541c7296b4f01897426fc564d8be355e6b14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ad3f9a49be714b6f4cf93574b8ad824d6516990bb670e0e3971b225157d8ab55a6ce46ada46e2f090966961111274275198d770921e83edb2f5338715542257
|
7
|
+
data.tar.gz: 3edd89d337056d9873cc77254c70150791b8c549d445b3f88671c0e9801f0a6e19a75cfe7ceea17cf541daa20e789420a6ca4450ba175bd4145408c8c5ba63af
|
@@ -117,13 +117,14 @@ module ProxES
|
|
117
117
|
authorize entity, :update
|
118
118
|
|
119
119
|
identity = entity.identity.first
|
120
|
+
identity_params = params['identity']
|
120
121
|
|
121
|
-
unless
|
122
|
+
unless identity_params['password'] == identity_params['password_confirmation']
|
122
123
|
flash[:warning] = 'Password didn\'t match'
|
123
124
|
return redirect back
|
124
125
|
end
|
125
126
|
|
126
|
-
unless current_user.super_admin? || identity.authenticate(
|
127
|
+
unless current_user.super_admin? || identity.authenticate(identity_params['old_password'])
|
127
128
|
log_action("#{dehumanized}_update_password_failed".to_sym) if settings.track_actions
|
128
129
|
flash[:danger] = 'Old Password didn\'t match'
|
129
130
|
return redirect back
|
@@ -134,7 +135,7 @@ module ProxES
|
|
134
135
|
if identity.valid? && identity.save
|
135
136
|
log_action("#{dehumanized}_update_password".to_sym) if settings.track_actions
|
136
137
|
flash[:success] = 'Password Updated'
|
137
|
-
redirect
|
138
|
+
redirect "#{base_path}/#{entity.id}"
|
138
139
|
elsif current_user.super_admin?
|
139
140
|
haml :"#{view_location}/display", locals: { entity: entity, identity: identity, title: heading }
|
140
141
|
else
|
@@ -36,6 +36,7 @@ module ProxES
|
|
36
36
|
return unless auth.basic?
|
37
37
|
|
38
38
|
identity = ::ProxES::Identity.find(username: auth.credentials[0])
|
39
|
+
identity = ::ProxES::Identity.find(username: URI.unescape(auth.credentials[0])) unless identity
|
39
40
|
raise NotAuthenticated unless identity
|
40
41
|
self.current_user = identity.user if identity.authenticate(auth.credentials[1])
|
41
42
|
end
|
data/lib/proxes/rake_tasks.rb
CHANGED
@@ -143,8 +143,8 @@ module ProxES
|
|
143
143
|
task :generate_tokens do
|
144
144
|
puts 'Generating the ProxES tokens'
|
145
145
|
require 'securerandom'
|
146
|
-
File.write('.session_secret', SecureRandom.random_bytes(40))
|
147
|
-
File.write('.token_secret', SecureRandom.random_bytes(40))
|
146
|
+
File.write('.session_secret', SecureRandom.random_bytes(40)) unless File.file?('.session_secret')
|
147
|
+
File.write('.token_secret', SecureRandom.random_bytes(40)) unless File.file?('.token_secret')
|
148
148
|
end
|
149
149
|
|
150
150
|
desc 'Seed the ProxES database'
|
data/lib/proxes/security.rb
CHANGED
@@ -32,7 +32,7 @@ module ProxES
|
|
32
32
|
request = Request.from_env(env)
|
33
33
|
|
34
34
|
logger.debug '==========================BEFORE================================================'
|
35
|
-
logger.debug '= ' + "Request: #{request.fullpath}".ljust(76) + ' ='
|
35
|
+
logger.debug '= ' + "Request: #{request.request_method} #{request.fullpath}".ljust(76) + ' ='
|
36
36
|
logger.debug '= ' + "Endpoint: #{request.endpoint}".ljust(76) + ' ='
|
37
37
|
logger.debug '================================================================================'
|
38
38
|
|
@@ -47,7 +47,7 @@ module ProxES
|
|
47
47
|
request.index = policy_scope(request) if request.indices?
|
48
48
|
|
49
49
|
logger.debug '==========================AFTER================================================='
|
50
|
-
logger.debug '= ' + "Request: #{request.fullpath}".ljust(76) + ' ='
|
50
|
+
logger.debug '= ' + "Request: #{request.request_method} #{request.fullpath}".ljust(76) + ' ='
|
51
51
|
logger.debug '= ' + "Endpoint: #{request.endpoint}".ljust(76) + ' ='
|
52
52
|
logger.debug '================================================================================'
|
53
53
|
|
data/lib/proxes/version.rb
CHANGED
data/views/users/display.haml
CHANGED
@@ -59,8 +59,8 @@
|
|
59
59
|
.panel-body
|
60
60
|
%form.form-horizontal{ method: 'post', action: "#{base_path}/#{entity.id}/identity" }
|
61
61
|
%input{ name: '_method', value: 'PUT', type: 'hidden' }
|
62
|
-
= form_control(:password, entity.identity.first, type: 'password', placeholder: 'Your password')
|
63
|
-
= form_control(:password_confirmation, entity.identity.first, type: 'password', label: 'Confirm Password', placeholder: 'Confirm your password')
|
62
|
+
= form_control(:password, entity.identity.first, type: 'password', placeholder: 'Your password', group: 'identity')
|
63
|
+
= form_control(:password_confirmation, entity.identity.first, type: 'password', label: 'Confirm Password', placeholder: 'Confirm your password', group: 'identity')
|
64
64
|
%button.btn.btn-primary{ type: 'submit' }
|
65
65
|
Change Password
|
66
66
|
.col-md-2
|
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.5.
|
4
|
+
version: 0.5.2
|
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-06-
|
11
|
+
date: 2017-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|