openid-token-proxy 0.1.4 → 0.1.5

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: 52ad78b2ab59d7d79acc5ad4e5f1619fb97bb77e
4
- data.tar.gz: 8b39777e46e9887f21482b10822648d1a0ddf274
3
+ metadata.gz: 1852cecc6e9e7277ab992bd28fd2404ab689ccef
4
+ data.tar.gz: 09c707163098b24846daf45a01615e4fd4818f49
5
5
  SHA512:
6
- metadata.gz: d7cb5fd53234fec4ae748b106f8ccff6d102c0a7f84bb85fc773cf05e526e8853f9c30ff8b4c75e9b2139c0cb0d6be057214f01ef2e9bb12359c9c8ca5a4e5d0
7
- data.tar.gz: d19b04ccc60eb2febafb4421c39950b1448f684d3a0a7a05f8f18b3016c7829aa6f780ccde75fd967a767c010903410e95935f48ff932789cfb7d2e02e41fbef
6
+ metadata.gz: 71b4178d73d08c1189ace2394c5f8ab31515f13be91fef9abf04d068e371395b8136274d550c47811a472addef00aa005db709ae7dde2c36cfd647e8c5b4a474
7
+ data.tar.gz: 7d6be97f388a8d8cf82c049ba4ffd5e5b15853433c14ad54b182c2f4814b854b4c649cf57ba96f7b3368469ea607a029f0b6f973546fdcb9b3ccb20fa80f34c8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ### v0.1.5 - September 3, 2015
4
+
5
+ - Exposes `Config#end_session_endpoint` for logging out.
6
+
7
+
3
8
  ### v0.1.4 - June 29, 2015
4
9
 
5
10
  - Adds `Token#valid?`.
@@ -4,8 +4,12 @@ module OpenIDTokenProxy
4
4
  class Config
5
5
  attr_accessor :client_id, :client_secret, :issuer
6
6
  attr_accessor :domain_hint, :prompt, :redirect_uri, :resource
7
+
7
8
  attr_accessor :authorization_uri
8
- attr_accessor :authorization_endpoint, :token_endpoint, :userinfo_endpoint
9
+
10
+ attr_accessor :authorization_endpoint, :token_endpoint,
11
+ :userinfo_endpoint, :end_session_endpoint
12
+
9
13
  attr_accessor :token_acquirement_hook
10
14
  attr_accessor :public_keys
11
15
 
@@ -24,6 +28,7 @@ module OpenIDTokenProxy
24
28
  @authorization_endpoint = ENV['OPENID_AUTHORIZATION_ENDPOINT']
25
29
  @token_endpoint = ENV['OPENID_TOKEN_ENDPOINT']
26
30
  @userinfo_endpoint = ENV['OPENID_USERINFO_ENDPOINT']
31
+ @end_session_endpoint = ENV['OPENID_END_SESSION_ENDPOINT']
27
32
 
28
33
  @token_acquirement_hook = proc { }
29
34
 
@@ -49,6 +54,10 @@ module OpenIDTokenProxy
49
54
  @userinfo_endpoint || provider_config.userinfo_endpoint
50
55
  end
51
56
 
57
+ def end_session_endpoint
58
+ @end_session_endpoint || provider_config.raw['end_session_endpoint']
59
+ end
60
+
52
61
  def public_keys
53
62
  @public_keys ||= provider_config.public_keys
54
63
  end
@@ -1,3 +1,3 @@
1
1
  module OpenIDTokenProxy
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
@@ -209,6 +209,26 @@ RSpec.describe OpenIDTokenProxy::Config do
209
209
  end
210
210
  end
211
211
 
212
+ describe '#end_session_endpoint' do
213
+ it 'obtains its default from environment' do
214
+ stub_env('OPENID_END_SESSION_ENDPOINT', 'from env')
215
+ expect(subject.end_session_endpoint).to eq 'from env'
216
+ end
217
+
218
+ it 'may be set explicitly' do
219
+ subject.end_session_endpoint = 'overridden'
220
+ expect(subject.end_session_endpoint).to eq 'overridden'
221
+ end
222
+
223
+ context 'when not set' do
224
+ it 'defaults to endpoint from provider config' do
225
+ stub_env('OPENID_END_SESSION_ENDPOINT')
226
+ ep = with_valid_issuer.end_session_endpoint
227
+ expect(ep).to eq 'https://login.windows.net/common/oauth2/logout'
228
+ end
229
+ end
230
+ end
231
+
212
232
  describe '#public_keys' do
213
233
  it 'may be set explicitly' do
214
234
  subject.public_keys = []
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openid-token-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Kurvers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-29 00:00:00.000000000 Z
11
+ date: 2015-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: openid_connect