toke 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/toke/commands/get_access_token_command.rb +17 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3a15c20d5122ef444728ef83ae23f4569d9ae4c
|
4
|
+
data.tar.gz: eb72c563e495de821ee0a69bf3fe4d24bc7e225a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5a6544be965530c98de9adb10df0f324dbbd0f58da83f89f00d76187285f71c2bb4ebdaa5fce7cd01e182513c7d5097ce48ffdbd2e6bb7e98aa196006b25d55
|
7
|
+
data.tar.gz: 2464c046357f588552ec35eb64059faea9af0c495c92483c86bfc4a40c115f4602eba88c740b8604abb7d41edad84488234d9a35bb5d2f699433a0ef86666afe
|
data/README.md
CHANGED
@@ -6,10 +6,13 @@ module Toke
|
|
6
6
|
def execute(params)
|
7
7
|
params = GetAccessTokenParams.new(params)
|
8
8
|
|
9
|
+
response = nil
|
10
|
+
|
9
11
|
if params.valid?
|
10
|
-
AccessTokenResponse.new
|
12
|
+
response = AccessTokenResponse.new(post(params))
|
13
|
+
scrub response, params
|
11
14
|
else
|
12
|
-
AccessTokenResponse.new
|
15
|
+
response = AccessTokenResponse.new
|
13
16
|
end
|
14
17
|
end
|
15
18
|
|
@@ -25,5 +28,17 @@ module Toke
|
|
25
28
|
def endpoint
|
26
29
|
'token'
|
27
30
|
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def scrub(response, params)
|
35
|
+
response.scrub params.client_id, 'CLIENT_ID'
|
36
|
+
response.scrub params.client_secret, 'CLIENT_SECRET'
|
37
|
+
response.scrub params.refresh_token, 'REFRESH_TOKEN'
|
38
|
+
|
39
|
+
response.scrub (response.data && response.data.token), 'ACCESS_TOKEN'
|
40
|
+
|
41
|
+
response
|
42
|
+
end
|
28
43
|
end
|
29
44
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Travis Herrick
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-06-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: reverb
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 0.0.4
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 0.0.4
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: faraday
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '4'
|
48
|
+
version: '4.1'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '4'
|
55
|
+
version: '4.1'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: gems
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|