omniauth-uaa-oauth2 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +1 -1
- data/examples/config.ru +0 -13
- data/lib/omniauth-uaa-oauth2.rb +0 -13
- data/lib/omniauth/cloudfoundry.rb +0 -13
- data/lib/omniauth/strategies/cloudfoundry.rb +2 -14
- data/lib/omniauth/uaa_oauth2/version.rb +1 -14
- data/omniauth-uaa-oauth2.gemspec +0 -13
- data/spec/omniauth/strategies/uaa_oauth2_spec.rb +11 -0
- metadata +1 -2
- data/Gemfile.lock +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cca254fbc2a4e6c9c7a4c954a9ea26f101d20a24ad0e5d036675d45e73ddd12e
|
4
|
+
data.tar.gz: 9ef68fb73b96b82a8d36aa1e80bbb3569e361a91ca8e04cfe0118e793ba7a5bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d7aa40472f14f9ddef7dce728c1f07218ee7a275c118ce101ff0c4d98f59ecdfefa64480b930d026f6b67e441d81b2b3501026c3e4b591b1cef36859804938e
|
7
|
+
data.tar.gz: 46abec421931388b7dba1d8ce92fa47869c05073ba190c5d9829cf0d295e66de269a011998e43917f5001471595f48df6915651c2b58330a5f89ca1fc39071c6
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/examples/config.ru
CHANGED
@@ -1,16 +1,3 @@
|
|
1
|
-
#--
|
2
|
-
# Cloud Foundry 2012.02.03 Beta
|
3
|
-
# Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
|
4
|
-
#
|
5
|
-
# This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
6
|
-
# You may not use this product except in compliance with the License.
|
7
|
-
#
|
8
|
-
# This product includes a number of subcomponents with
|
9
|
-
# separate copyright notices and license terms. Your use of these
|
10
|
-
# subcomponents is subject to the terms and conditions of the
|
11
|
-
# subcomponent's license, as noted in the LICENSE file.
|
12
|
-
#++
|
13
|
-
|
14
1
|
# Run with "bundle exec rackup"
|
15
2
|
|
16
3
|
require 'rubygems'
|
data/lib/omniauth-uaa-oauth2.rb
CHANGED
@@ -1,14 +1 @@
|
|
1
|
-
#--
|
2
|
-
# Cloud Foundry 2012.02.03 Beta
|
3
|
-
# Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
|
4
|
-
#
|
5
|
-
# This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
6
|
-
# You may not use this product except in compliance with the License.
|
7
|
-
#
|
8
|
-
# This product includes a number of subcomponents with
|
9
|
-
# separate copyright notices and license terms. Your use of these
|
10
|
-
# subcomponents is subject to the terms and conditions of the
|
11
|
-
# subcomponent's license, as noted in the LICENSE file.
|
12
|
-
#++
|
13
|
-
|
14
1
|
require "omniauth/cloudfoundry"
|
@@ -1,14 +1 @@
|
|
1
|
-
#--
|
2
|
-
# Cloud Foundry 2012.02.03 Beta
|
3
|
-
# Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
|
4
|
-
#
|
5
|
-
# This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
6
|
-
# You may not use this product except in compliance with the License.
|
7
|
-
#
|
8
|
-
# This product includes a number of subcomponents with
|
9
|
-
# separate copyright notices and license terms. Your use of these
|
10
|
-
# subcomponents is subject to the terms and conditions of the
|
11
|
-
# subcomponent's license, as noted in the LICENSE file.
|
12
|
-
#++
|
13
|
-
|
14
1
|
require 'omniauth/strategies/cloudfoundry'
|
@@ -1,16 +1,3 @@
|
|
1
|
-
#--
|
2
|
-
# Cloud Foundry 2012.02.03 Beta
|
3
|
-
# Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
|
4
|
-
#
|
5
|
-
# This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
6
|
-
# You may not use this product except in compliance with the License.
|
7
|
-
#
|
8
|
-
# This product includes a number of subcomponents with
|
9
|
-
# separate copyright notices and license terms. Your use of these
|
10
|
-
# subcomponents is subject to the terms and conditions of the
|
11
|
-
# subcomponent's license, as noted in the LICENSE file.
|
12
|
-
#++
|
13
|
-
|
14
1
|
require 'uaa'
|
15
2
|
require 'omniauth'
|
16
3
|
require 'timeout'
|
@@ -187,7 +174,8 @@ module OmniAuth
|
|
187
174
|
|
188
175
|
def expired?(access_token)
|
189
176
|
access_token = access_token.auth_header if access_token.respond_to? :auth_header
|
190
|
-
|
177
|
+
# Don't need to verify signature of token if we're just inspecting its expiry date
|
178
|
+
expiry = CF::UAA::TokenCoder.decode(access_token.split()[1], verify: false, symbolize_keys: true)[:expires_at]
|
191
179
|
expiry.is_a?(Integer) && expiry <= Time.now.to_i
|
192
180
|
end
|
193
181
|
|
@@ -1,18 +1,5 @@
|
|
1
|
-
#--
|
2
|
-
# Cloud Foundry 2012.02.03 Beta
|
3
|
-
# Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
|
4
|
-
#
|
5
|
-
# This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
6
|
-
# You may not use this product except in compliance with the License.
|
7
|
-
#
|
8
|
-
# This product includes a number of subcomponents with
|
9
|
-
# separate copyright notices and license terms. Your use of these
|
10
|
-
# subcomponents is subject to the terms and conditions of the
|
11
|
-
# subcomponent's license, as noted in the LICENSE file.
|
12
|
-
#++
|
13
|
-
|
14
1
|
module OmniAuth
|
15
2
|
module Cloudfoundry
|
16
|
-
VERSION = "0.0.
|
3
|
+
VERSION = "0.0.8"
|
17
4
|
end
|
18
5
|
end
|
data/omniauth-uaa-oauth2.gemspec
CHANGED
@@ -1,17 +1,4 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Cloud Foundry 2012.02.03 Beta
|
4
|
-
# Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
|
5
|
-
#
|
6
|
-
# This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
7
|
-
# You may not use this product except in compliance with the License.
|
8
|
-
#
|
9
|
-
# This product includes a number of subcomponents with
|
10
|
-
# separate copyright notices and license terms. Your use of these
|
11
|
-
# subcomponents is subject to the terms and conditions of the
|
12
|
-
# subcomponent's license, as noted in the LICENSE file.
|
13
|
-
#
|
14
|
-
|
15
2
|
require File.expand_path('../lib/omniauth/uaa_oauth2/version', __FILE__)
|
16
3
|
|
17
4
|
Gem::Specification.new do |gem|
|
@@ -211,4 +211,15 @@ describe OmniAuth::Strategies::Cloudfoundry do
|
|
211
211
|
subject.build_access_token('query-string').should be_empty
|
212
212
|
end
|
213
213
|
end
|
214
|
+
|
215
|
+
describe '#expired?' do
|
216
|
+
it 'sets params correctly on TokenCoder#decode' do
|
217
|
+
subject.access_token = OmniAuth::Strategies::CFAccessToken.new
|
218
|
+
CF::UAA::TokenCoder.should_receive(:decode)
|
219
|
+
.with(subject.access_token.auth_header.split()[1], verify: false, symbolize_keys: true)
|
220
|
+
.and_return({expires_at: 12345})
|
221
|
+
|
222
|
+
subject.expired?(subject.access_token)
|
223
|
+
end
|
224
|
+
end
|
214
225
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-uaa-oauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel D'sa
|
@@ -90,7 +90,6 @@ files:
|
|
90
90
|
- ".gitignore"
|
91
91
|
- ".travis.yml"
|
92
92
|
- Gemfile
|
93
|
-
- Gemfile.lock
|
94
93
|
- LICENSE
|
95
94
|
- NOTICE
|
96
95
|
- README.md
|
data/Gemfile.lock
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
omniauth-uaa-oauth2 (0.0.7)
|
5
|
-
cf-uaa-lib (>= 3.2, < 4.0)
|
6
|
-
omniauth (~> 1.0)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: http://rubygems.org/
|
10
|
-
specs:
|
11
|
-
cf-uaa-lib (3.2.4)
|
12
|
-
multi_json
|
13
|
-
diff-lcs (1.1.3)
|
14
|
-
hashie (3.5.7)
|
15
|
-
multi_json (1.11.2)
|
16
|
-
omniauth (1.4.2)
|
17
|
-
hashie (>= 1.2, < 4)
|
18
|
-
rack (>= 1.0, < 3)
|
19
|
-
rack (1.4.1)
|
20
|
-
rack-protection (1.2.0)
|
21
|
-
rack
|
22
|
-
rake (0.9.2.2)
|
23
|
-
rspec (2.6.0)
|
24
|
-
rspec-core (~> 2.6.0)
|
25
|
-
rspec-expectations (~> 2.6.0)
|
26
|
-
rspec-mocks (~> 2.6.0)
|
27
|
-
rspec-core (2.6.4)
|
28
|
-
rspec-expectations (2.6.0)
|
29
|
-
diff-lcs (~> 1.1.2)
|
30
|
-
rspec-mocks (2.6.0)
|
31
|
-
sinatra (1.3.3)
|
32
|
-
rack (~> 1.3, >= 1.3.6)
|
33
|
-
rack-protection (~> 1.2)
|
34
|
-
tilt (~> 1.3, >= 1.3.3)
|
35
|
-
tilt (1.3.3)
|
36
|
-
|
37
|
-
PLATFORMS
|
38
|
-
ruby
|
39
|
-
|
40
|
-
DEPENDENCIES
|
41
|
-
cf-uaa-lib (~> 3.2.4)
|
42
|
-
omniauth-uaa-oauth2!
|
43
|
-
rake
|
44
|
-
rspec (~> 2.6.0)
|
45
|
-
sinatra
|
46
|
-
|
47
|
-
BUNDLED WITH
|
48
|
-
1.16.2
|