omniauth-procore 0.6.0 → 0.7.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
- SHA256:
3
- metadata.gz: '019461a22649480fe0460028789c7c49371b6d4d2e385587462e1f11ca3fabe8'
4
- data.tar.gz: d3fb0433a6d9fbd3ec20d19784c8e93ce7dee5cb99adcd11a00acaebe82b04b8
2
+ SHA1:
3
+ metadata.gz: 7223e5c4a2afb7550bd40112c09e98a55731e1b4
4
+ data.tar.gz: 921b3ab685211a2e339787312de8dae18418ed8a
5
5
  SHA512:
6
- metadata.gz: eeb0f7dc8520d00976c2fe11138ead0bdf26d94aa19686805b7613e3732ef23da6d45d1f8d095d542d496700ab4b3b30f38c12059120b20504f86da02a3251d3
7
- data.tar.gz: 2eefea36d2cd278cc8bd9de2f08dc3ecd06ab617b9428161f04db5100e1a7d463bad3fca0775123a2105dbba5972fc50f1ebb25f3880b2a2e9fab7f1469883f5
6
+ metadata.gz: e952b5719fb694edab8061f2e86ad5897e26254bdef65b4f667d5582cfe94cbd5dbf1d510513f4a271b3ade04820cb44d25e4537387a30f0c0a03525fec8f162
7
+ data.tar.gz: 5008316c136047c1318ce109c4b1374ee3b934a6529c530abd279e19d1acf7bb2ef1dd3025a15cf6d02037fc24880dfb86bd0a12fa0e745b6eff44655d86fafb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.7.0 (March 1, 2021)
2
+
3
+ * Add API :version option. Defaults to v1.0.
4
+
5
+ PR #8 - https://github.com/procore/omniauth-procore/pull/8
6
+
7
+ *Nate Baer*
8
+
1
9
  ## 0.6.0 (November 9, 2018)
2
10
 
3
11
  * Fix fetching user details, add :app_site client option
data/README.md CHANGED
@@ -23,11 +23,29 @@ Or install it yourself as:
23
23
  ## Usage
24
24
 
25
25
  ```ruby
26
- use OmniAuth::Builder do
27
- provider :procore, ENV['PROCORE_KEY'], ENV['PROCORE_SECRET']
26
+ Rails.application.config.middleware.use OmniAuth::Builder do
27
+ provider :procore, ENV['PROCORE_KEY'], ENV['PROCORE_SECRET'],
28
+ client_options: {} # Optional
28
29
  end
29
30
  ```
30
31
 
32
+ To specify a different Procore environment (e.g. sandbox):
33
+
34
+ ```ruby
35
+ client_options: {
36
+ site: 'https://sandbox.procore.com',
37
+ api_site: 'https://sandbox.procore.com',
38
+ }
39
+ ```
40
+
41
+ Procore API version `v1.0` is used by default to request user information. It is not recommended to change this, but it can be set to support the legacy API `vapid` and possible future versions (e.g. `v2.0`).
42
+
43
+ ```ruby
44
+ client_options: {
45
+ version: `vapid`
46
+ }
47
+ ```
48
+
31
49
  ## Development
32
50
 
33
51
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Procore
3
- VERSION = "0.6.0"
3
+ VERSION = "0.7.0"
4
4
  end
5
5
  end
@@ -5,10 +5,13 @@ module OmniAuth
5
5
  class Procore < OmniAuth::Strategies::OAuth2
6
6
  option :name, 'procore'
7
7
 
8
- option :client_options,
8
+ option(
9
+ :client_options,
9
10
  site: 'https://login.procore.com',
10
11
  api_site: 'https://api.procore.com',
11
- authorize_path: '/oauth/authorize'
12
+ authorize_path: '/oauth/authorize',
13
+ version: 'v1.0'
14
+ )
12
15
 
13
16
  uid do
14
17
  raw_info['id']
@@ -24,7 +27,9 @@ module OmniAuth
24
27
 
25
28
  def raw_info
26
29
  access_token.client.site = options[:client_options][:api_site]
27
- @raw_info ||= access_token.get('/vapid/me').parsed
30
+ version = options[:client_options][:version]
31
+ path = /\Av\d+\.\d+\z/.match?(version) ? "/rest/#{version}" : "/#{version}"
32
+ @raw_info ||= access_token.get("#{path}/me").parsed
28
33
  end
29
34
 
30
35
  def callback_url
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-procore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Procore Engineering
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-09 00:00:00.000000000 Z
11
+ date: 2021-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  version: '0'
114
114
  requirements: []
115
115
  rubyforge_project:
116
- rubygems_version: 2.7.6
116
+ rubygems_version: 2.6.14
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: Official OmniAuth strategy for Procore.