proz 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/proz/oauth.rb +3 -3
- data/lib/proz/version.rb +1 -1
- data/spec/proz/oauth_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7436134475d4ba3252d82a038d364d72f9b9b721
|
4
|
+
data.tar.gz: 567a43ef29460f31f0f3d88d3306547ade11ebc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdaab483bf3d52090dfce8c0a626eee92a9bd6c9d6aced42efd923abe3db418601fc3c409a4ef5dc2e8b4658026330185cc4329497087f336d069236af3ee9ea
|
7
|
+
data.tar.gz: a8a1050995b696699cf12bc8e11f9613abdd8a17b84df3bf9ecf093eab9be3283b68006e4ee8de3a0737f77d88790b0ae7295f609bdc5a2b5ced42cc6373e861
|
data/lib/proz/oauth.rb
CHANGED
@@ -12,7 +12,7 @@ module Proz
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def link
|
15
|
-
client.auth_code.authorize_url(:
|
15
|
+
client.auth_code.authorize_url(:redirect_uri => redirect_uri)
|
16
16
|
end
|
17
17
|
|
18
18
|
def exchange_code_for_token(code)
|
@@ -28,13 +28,13 @@ module Proz
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def request_new_token_with_refresh_token(refresh_token)
|
31
|
-
@refreshed_token ||= self.class.post('https://www.proz.com/oauth/token', :body => { :refresh_token => refresh_token, :redirect_uri => redirect_uri, :client_id => client_id, :
|
31
|
+
@refreshed_token ||= self.class.post('https://www.proz.com/oauth/token', :body => { :refresh_token => refresh_token, :redirect_uri => redirect_uri, :client_id => client_id, :client_secret => client_secret, :grant_type => 'refresh_token' })
|
32
32
|
end
|
33
33
|
|
34
34
|
private
|
35
35
|
|
36
36
|
def token(code)
|
37
|
-
@token ||= self.class.post('https://www.proz.com/oauth/token', :body => { :code => code, :redirect_uri => redirect_uri, :client_id => client_id, :
|
37
|
+
@token ||= self.class.post('https://www.proz.com/oauth/token', :body => { :code => code, :redirect_uri => redirect_uri, :client_id => client_id, :client_secret => client_secret, :grant_type => 'authorization_code' })
|
38
38
|
end
|
39
39
|
|
40
40
|
def client
|
data/lib/proz/version.rb
CHANGED
data/spec/proz/oauth_spec.rb
CHANGED
@@ -19,7 +19,7 @@ RSpec.describe Proz::OAuth do
|
|
19
19
|
|
20
20
|
it 'returns a link for the user to authorize the app' do
|
21
21
|
proz = Proz::OAuth.new(client_id: 'abc123xxxxxxxxxxxxxx', client_secret: 'abc123xxxxyyyyy', redirect_uri: 'http://www.example.com')
|
22
|
-
expect(proz.link).to eq("https://www.proz.com/oauth/authorize?client_id=abc123xxxxxxxxxxxxxx&redirect_uri=http%3A%2F%2Fwww.example.com&response_type=code
|
22
|
+
expect(proz.link).to eq("https://www.proz.com/oauth/authorize?client_id=abc123xxxxxxxxxxxxxx&redirect_uri=http%3A%2F%2Fwww.example.com&response_type=code")
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'exchanges a code for an access token' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin S. Dias
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|