bootic_client 0.0.6 → 0.0.7
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8095f21114667841cc61f8048100b8f31e56f34e
|
4
|
+
data.tar.gz: 1022b40385355b90b2a478af677dd7221d5bc68b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff530bf2fc8d5c4215ddf7838685fb7550e6e38b2085c109d8d5878ddae3ef263cb667803f751dfba15cfe0e8be127cbcf9654e9735091b87ba0164334039e00
|
7
|
+
data.tar.gz: aada7437aa9a191accd6cd72e96fd21ff22fb85cd53ebe024929523d9ace1c95fe02fd24ff953a51b6b5bbdfb8ff547b46878a1193bbc8b30d63a1657d68a6c4
|
@@ -11,9 +11,9 @@ module BooticClient
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def get_token
|
14
|
-
# The JWT grant must have an expiration date, in seconds since the epoch.
|
14
|
+
# The JWT grant must have an expiration date, in seconds since the epoch.
|
15
15
|
# For most cases a few seconds should be enough.
|
16
|
-
exp = Time.now.utc.to_i +
|
16
|
+
exp = Time.now.utc.to_i + 30
|
17
17
|
|
18
18
|
# Use the "assertion" flow to exchange the JWT grant for an access token
|
19
19
|
access_token = auth.assertion.get_token(
|
@@ -35,4 +35,4 @@ module BooticClient
|
|
35
35
|
end
|
36
36
|
|
37
37
|
strategies[:authorized] = Strategies::Authorized
|
38
|
-
end
|
38
|
+
end
|
@@ -12,7 +12,7 @@ describe 'BooticClient::Strategies::Authorized' do
|
|
12
12
|
iss: client_id,
|
13
13
|
aud: 'api',
|
14
14
|
prn: expired_token,
|
15
|
-
exp: now.utc.to_i +
|
15
|
+
exp: now.utc.to_i + 30
|
16
16
|
}, client_secret, 'HS256')
|
17
17
|
end
|
18
18
|
|
@@ -28,11 +28,11 @@ describe 'BooticClient::Strategies::Authorized' do
|
|
28
28
|
|
29
29
|
stub_request(:post, "https://auth.bootic.net/oauth/token").
|
30
30
|
with(body: {
|
31
|
-
"assertion" => jwt_assertion(expired_token, now),
|
31
|
+
"assertion" => jwt_assertion(expired_token, now),
|
32
32
|
"assertion_type" => "urn:ietf:params:oauth:grant-type:jwt-bearer",
|
33
33
|
"client_id" => "",
|
34
|
-
"client_secret" => "",
|
35
|
-
"grant_type" => "assertion",
|
34
|
+
"client_secret" => "",
|
35
|
+
"grant_type" => "assertion",
|
36
36
|
"scope"=>""
|
37
37
|
},
|
38
38
|
headers: {
|
@@ -147,7 +147,7 @@ describe 'BooticClient::Strategies::Authorized' do
|
|
147
147
|
|
148
148
|
describe '#from_hash' do
|
149
149
|
it 'builds and returns an entity' do
|
150
|
-
entity = client.from_hash('name' => 'foo', '_links' => {'delete' => {'href' => '/foo/bar'}})
|
150
|
+
entity = client.from_hash('name' => 'foo', '_links' => {'delete' => {'href' => '/foo/bar'}})
|
151
151
|
expect(entity).to be_kind_of(BooticClient::Entity)
|
152
152
|
expect(entity.name).to eql('foo')
|
153
153
|
expect(entity.can?(:delete)).to be true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootic_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ismael Celis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|