Skip to content

Commit

Permalink
force utf-8 for free ipa remote user headers
Browse files Browse the repository at this point in the history
  • Loading branch information
codez committed May 31, 2017
1 parent 3156429 commit 82de4af
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions app/controllers/auth/remote_header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def remote_user_params
h['REMOTE_USER_GROUPS'],
h['REMOTE_USER_FIRST_NAME'],
h['REMOTE_USER_LAST_NAME']]
.map { |str| str && str.force_encoding('UTF-8') }
end

end
Expand Down
4 changes: 0 additions & 4 deletions config/initializers/callback_terminator.rb

This file was deleted.

2 changes: 1 addition & 1 deletion config/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test:
ssl: false
host_name: example.com
base_path:
admin_groups: 'admin, root'
admin_groups: 'admins, root'
days_to_expire_api_key:
minutes_to_expire_jwt_token: 60

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
admin:
username: admin
api_key: <%= SecureRandom.base58(24) %>
groups: admin, grooveexpress
groups: admins, grooveexpress

speedee:
username: speedee
Expand Down
4 changes: 2 additions & 2 deletions test/models/user_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class UserTest < ActiveSupport::TestCase

test '#admin? is true if all groups are present' do
user = users(:admin)
user.groups = 'root, admin'
user.groups = 'root, admins'
assert user.admin?
end

Expand All @@ -49,7 +49,7 @@ class UserTest < ActiveSupport::TestCase

test '#group_list returns array' do
user = users(:admin)
assert_equal %w(admin grooveexpress), user.group_list
assert_equal %w(admins grooveexpress), user.group_list
end

test '#groups= serializes arrays' do
Expand Down

0 comments on commit 82de4af

Please sign in to comment.