proxes 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42814a990cb8968bf9c06437a45a00c8e5cb8e22
4
- data.tar.gz: ff4f4225994fd1042c047e896ccd08ea5865cf1e
3
+ metadata.gz: b7409fa9ea1b118954e8b3b1d8edc19b4ca1b8c5
4
+ data.tar.gz: 6b2a541c7296b4f01897426fc564d8be355e6b14
5
5
  SHA512:
6
- metadata.gz: '08e167c6693db2b4c176d7ee64ed5dc877a9b25e74b4b81c7d2b1fd3ff19a5c7bc55ce5c8bf3b06e0ff34986b8be4edc1e420897146d5e3d97d926e6994cbd36'
7
- data.tar.gz: e933e3dbba6b3f4924a142060ca2a1207147a43b170cd87eadee4b4c97f5205929e60fb45347accb6251815c2fc97e16d43b618deaab8dc46a4684447c90527f
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 params['password'] == params['password_confirmation']
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(params['old_password'])
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 back
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
@@ -8,6 +8,7 @@ module ProxES
8
8
  patterns = Permission.for_user(user, 'INDEX').map do |permission|
9
9
  permission.pattern.gsub(/\{user.(.*)\}/) { |_match| user.send(Regexp.last_match[1].to_sym) }
10
10
  end
11
+ p scope.index
11
12
  filter scope.index, patterns
12
13
  end
13
14
  end
@@ -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'
@@ -30,7 +30,7 @@ module ProxES
30
30
  end
31
31
 
32
32
  def indices?
33
- true
33
+ type != ['scroll']
34
34
  end
35
35
  end
36
36
  end
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ProxES
4
- VERSION = '0.5.1'.freeze
4
+ VERSION = '0.5.2'.freeze
5
5
  end
@@ -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.1
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-17 00:00:00.000000000 Z
11
+ date: 2017-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler