prx_access 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/prx_access/prx_hyper_resource.rb +5 -0
- data/lib/prx_access/version.rb +1 -1
- data/prx_access.gemspec +2 -0
- metadata +30 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 195773cf0339a009a8fe8880c5f4129cc404edb1050de6eb9abc259c51862b0b
|
4
|
+
data.tar.gz: dd4ed3685efd4071ff51aa7b367c77e1b63845b4c4cd083bc28328770178dff5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ce5f1690c6048d915a7ca265fdc8e733f3b002872f890c8650441d1ae255e2b9910f6f7bded125a1d6468238da190bda0c37011060cd29b427cc49515216d68
|
7
|
+
data.tar.gz: 5c5437e132b25fd05cca9ecf232c557cefb615831c16372455b6b896f897b60f0631efd32436f78d9adfee75db993e48fc97264235b1fd174f6504e772216b96
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'hyperresource'
|
2
2
|
require 'active_support/core_ext/hash'
|
3
|
+
require 'oauth2'
|
3
4
|
|
4
5
|
module PRXAccess
|
5
6
|
|
@@ -105,6 +106,10 @@ module PRXAccess
|
|
105
106
|
def get_account_token(account)
|
106
107
|
id = ENV['PRX_CLIENT_ID']
|
107
108
|
se = ENV['PRX_SECRET']
|
109
|
+
|
110
|
+
raise 'Missing PRX_CLIENT_ID PRX_SECRET ENV vars' if id.nil? || se.nil?
|
111
|
+
raise 'Missing ID_HOST ENV var' if ENV['ID_HOST'].nil?
|
112
|
+
|
108
113
|
oauth_options = { site: id_root, token_url: '/token' }
|
109
114
|
client = OAuth2::Client.new(id, se, oauth_options) do |faraday|
|
110
115
|
faraday.request :url_encoded
|
data/lib/prx_access/version.rb
CHANGED
data/prx_access.gemspec
CHANGED
@@ -31,6 +31,8 @@ Gem::Specification.new do |spec|
|
|
31
31
|
|
32
32
|
spec.add_dependency "hyperresource", "~> 0.9.4"
|
33
33
|
spec.add_dependency "activesupport", ">= 4.0.0"
|
34
|
+
spec.add_dependency "oauth2", "~> 1.4.1"
|
35
|
+
spec.add_dependency "excon", "~> 0.62.0"
|
34
36
|
|
35
37
|
spec.add_development_dependency "webmock"
|
36
38
|
spec.add_development_dependency "pry"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prx_access
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Vevang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hyperresource
|
@@ -38,6 +38,34 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 4.0.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: oauth2
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.4.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.4.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: excon
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.62.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.62.0
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: webmock
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|