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 +5 -5
- data/CHANGELOG.md +8 -0
- data/README.md +20 -2
- data/lib/omniauth/procore/version.rb +1 -1
- data/lib/omniauth/strategies/procore.rb +8 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7223e5c4a2afb7550bd40112c09e98a55731e1b4
|
4
|
+
data.tar.gz: 921b3ab685211a2e339787312de8dae18418ed8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e952b5719fb694edab8061f2e86ad5897e26254bdef65b4f667d5582cfe94cbd5dbf1d510513f4a271b3ade04820cb44d25e4537387a30f0c0a03525fec8f162
|
7
|
+
data.tar.gz: 5008316c136047c1318ce109c4b1374ee3b934a6529c530abd279e19d1acf7bb2ef1dd3025a15cf6d02037fc24880dfb86bd0a12fa0e745b6eff44655d86fafb
|
data/CHANGELOG.md
CHANGED
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.
|
@@ -5,10 +5,13 @@ module OmniAuth
|
|
5
5
|
class Procore < OmniAuth::Strategies::OAuth2
|
6
6
|
option :name, 'procore'
|
7
7
|
|
8
|
-
option
|
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
|
-
|
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.
|
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:
|
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.
|
116
|
+
rubygems_version: 2.6.14
|
117
117
|
signing_key:
|
118
118
|
specification_version: 4
|
119
119
|
summary: Official OmniAuth strategy for Procore.
|