Skip to content

Commit c9d6ca8

Browse files
authored
Merge pull request #28 from RadiusNetworks/filter-fields
Add Rails filters to remove more sensitive fields
2 parents 2c2ac06 + 4e7bfd1 commit c9d6ca8

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ script: bin/rake
66
rvm:
77
- 2.3.3
88
- 2.4.0
9+
- 2.5.0
910
env:
11+
- RAILS_VERSION='~> 5.1.0'
1012
- RAILS_VERSION='~> 5.0.0'
1113
- RAILS_VERSION='~> 4.2.8'
1214
- RAILS_VERSION='4-2-stable'
1315
- RAILS_VERSION='5-0-stable'
16+
- RAILS_VERSION='5-1-stable'
1417
matrix:
1518
include:
1619
- rvm: 2.2.3

Gemfile-rails-dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ if version && !version.empty?
2424
elsif RUBY_VERSION.to_f < 2.4
2525
gem "rails", "~> 4.2.0"
2626
else
27-
gem "rails", "~> 5.0"
27+
gem "rails", "~> 5.1"
2828
end

lib/kracken/railtie.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,27 @@ class Railtie < ::Rails::Railtie
77
app.middleware.insert_after ActionDispatch::DebugExceptions,
88
::Kracken::JsonApi::PublicExceptions
99
end
10+
11+
config.before_initialize do |app|
12+
app.config.filter_parameters += %i[
13+
code
14+
email
15+
linked_accounts
16+
raw_info
17+
redirect_to
18+
redirect_uri
19+
state
20+
token
21+
]
22+
app.config.filter_redirect += [
23+
"auth/radius",
24+
"auth/token",
25+
]
26+
end
27+
28+
# Allow apps to configure the provider in initializers
29+
config.after_initialize do |app|
30+
app.config.filter_redirect << URI(Kracken.config.provider_url).host
31+
end
1032
end
1133
end

0 commit comments

Comments
 (0)