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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 993d498f3a6140c1f29f964f5d77eca7c73361057bea37efb2adc485ca00a60a
4
- data.tar.gz: 6be33628433e2090b0b7bed7a06098b6b4d968809d75aa825bedec3caac60eea
3
+ metadata.gz: 195773cf0339a009a8fe8880c5f4129cc404edb1050de6eb9abc259c51862b0b
4
+ data.tar.gz: dd4ed3685efd4071ff51aa7b367c77e1b63845b4c4cd083bc28328770178dff5
5
5
  SHA512:
6
- metadata.gz: 8fae3fac0e2698b9eb9133b06c645ef40328af0045429d3e237c885044655594c58b14f642f73e3581f0d64854940f8c35eef2a183d51a242fb65f0c5fd88665
7
- data.tar.gz: 4d1a4587263130aaa5b4f14f43c459ca9c4d8e176772ec24cd3cc7ce00a5fda804c7dc3951733b225d3a1ae47606237d2b9fd65fa21547ee7df517e0378eba91
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
@@ -1,3 +1,3 @@
1
1
  module PRXAccess
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -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.1.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: 2018-12-19 00:00:00.000000000 Z
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