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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42957361adcf8f61417fbdfe47967d4627d38d4f
4
- data.tar.gz: 1827400b48c93a1d90ba7433cf2cc325ded06c99
3
+ metadata.gz: e3a15c20d5122ef444728ef83ae23f4569d9ae4c
4
+ data.tar.gz: eb72c563e495de821ee0a69bf3fe4d24bc7e225a
5
5
  SHA512:
6
- metadata.gz: a6bbea6d2dd4b21c21bb6cb09462fa9a9d3e76f3c87615fa9628e12eda33a9cbd9b94104974709f975b8dd29f26e3597135123059d4aaa3d16389d6cb9647427
7
- data.tar.gz: 6778765b132c7fa45f7ccba07566c5438f5f11a39fcc3535e38190f8c434f17268f15f67e1e9f9f5852db743377d9fb4be94987dd0427fb19e32cbbecc663925
6
+ metadata.gz: d5a6544be965530c98de9adb10df0f324dbbd0f58da83f89f00d76187285f71c2bb4ebdaa5fce7cd01e182513c7d5097ce48ffdbd2e6bb7e98aa196006b25d55
7
+ data.tar.gz: 2464c046357f588552ec35eb64059faea9af0c495c92483c86bfc4a40c115f4602eba88c740b8604abb7d41edad84488234d9a35bb5d2f699433a0ef86666afe
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  Toke
2
2
  ====
3
3
 
4
+ [![Build Status](https://semaphoreci.com/api/v1/projects/f4fee9de-4c25-43dd-99af-0b4b3f6bf23b/459184/badge.svg)](https://semaphoreci.com/awesomenesstv/toke)
5
+
4
6
  Retrieve OAuth tokens.
5
7
 
6
8
 
@@ -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 post(params)
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.2
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-04-16 00:00:00.000000000 Z
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: '0'
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: '0'
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