omniauth-oauth_oidc 0.0.1 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e54afdf6d7654f496f5dbe08582d146a6ec5ae1ef23450802ddad6b3a522a26
4
- data.tar.gz: fa4fc5ea5ba1b5c65809dc72a1934be9cade29d4cb4a2090680fc696875fc257
3
+ metadata.gz: 0fa89dcb282db4791409a5a30f6a116f8d099a261443444e2e820978050a1eaf
4
+ data.tar.gz: da9b63b81d17123989eaec89474ccf4335f1a6b55432c62b4c7f51a6c705ca32
5
5
  SHA512:
6
- metadata.gz: 21163b952f6c9d570ff1b35895f258f62590e69314240a364cb098d552e95f82b6d4ca3db3beecd7096fb000d4db4c61380934457b2017959e18a5c72036ccd5
7
- data.tar.gz: 01a50ef7e2e5524a5033903caa2838b03ed732884a86ae8b28b03954c226e3e22151abd7380662fbf292e933dbd133aa0ad150b40641b5e373079d6d57e3f53d
6
+ metadata.gz: 1beadd010d56b1b0a81a2d9693246e187c2e05f12b6f467f04e128561efb27e692702b3d509f3d102f73d6ade750180742229afbe4188c7d84717b74882bf11e
7
+ data.tar.gz: 7f1e441d69a1b06b2f94da8a68542748ecbcb6ee21c1a91a8b9ab13aac154546998ebd9997c3c0a53b71aac4857daa1558bbe20cfd164df19e11c4150f6a32bc
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module OpenIDConnect
5
- VERSION = '0.0.1'
5
+ VERSION = '0.0.2'
6
6
  end
7
7
  end
@@ -55,6 +55,7 @@ module OmniAuth
55
55
  option :client_auth_method
56
56
  option :post_logout_redirect_uri
57
57
  option :extra_authorize_params, {}
58
+ option :allow_authorize_params, []
58
59
  option :uid_field, 'sub'
59
60
  option :pkce, false
60
61
  option :pkce_verifier, nil
@@ -189,6 +190,10 @@ module OmniAuth
189
190
  session["omniauth.pkce.verifier"] = options.pkce_verifier
190
191
  end
191
192
 
193
+ options.allow_authorize_params.each do |key|
194
+ opts[key] = request.params[key.to_s] unless opts.key?(key)
195
+ end
196
+
192
197
  client.authorization_uri(opts.reject { |_k, v| v.nil? })
193
198
  end
194
199
 
@@ -150,6 +150,19 @@ module OmniAuth
150
150
  assert(strategy.authorize_uri =~ /resource=xyz/, 'URI must contain custom params')
151
151
  end
152
152
 
153
+ def test_request_phase_with_allowed_params
154
+ strategy.options.issuer = 'example.com'
155
+ strategy.options.allow_authorize_params = [:name, :logo, :resource]
156
+ strategy.options.extra_authorize_params = {resource: 'xyz'}
157
+ strategy.options.client_options.host = 'example.com'
158
+ request.stubs(:params).returns('name' => 'example', 'logo' => 'example_logo', 'resource' => 'abc', 'not_allowed' => 'filter_me')
159
+
160
+ assert(strategy.authorize_uri =~ /resource=xyz/, 'URI must contain fixed param resource')
161
+ assert(strategy.authorize_uri =~ /name=example/, 'URI must contain dynamic param name')
162
+ assert(strategy.authorize_uri =~ /logo=example_logo/, 'URI must contain dynamic param logo')
163
+ refute(strategy.authorize_uri =~ /not_allowed=filter_me/, 'URI must filter not allowed param')
164
+ end
165
+
153
166
  def test_uid
154
167
  assert_equal user_info.sub, strategy.uid
155
168
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-oauth_oidc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Bohn