omniauth-lever 0.2.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 296ada79f8a81b145e934494d264720ff53bec69542a7b20d5af9fc5ed7916a3
4
- data.tar.gz: 6583a4e1e38792d0fbff50bab29cf770056ea15a79fefaf7ffb5c3c7b0db7847
3
+ metadata.gz: a128b5d11a2242cd19085a4eac6f6d3d761d2e0a7a87354eeec7969b3a368b49
4
+ data.tar.gz: 86006b3e4718122afc42d044e8ba18cfc669227efaa8eba5648a97dce0fbe645
5
5
  SHA512:
6
- metadata.gz: e540c56a94da66b808890ba5066cdbd542465f88b257ab0e3476f586c29fb5168b23c1d1754edf87a950adef85224293a86129d321dcf34ce703c198b98ff938
7
- data.tar.gz: 0fceecafeef6f00d1ee1eb9b284abbe3ea4a3ac2242cfecbacf9c42c0b0b6872ff2847d70966257306c5e0a85387d6bc3e966c6b658ae4bb38b1a0373033ada6
6
+ metadata.gz: 643e72be77b979ddcc3dcb640c76b44e31c9a91d057ffa1b271a11363de2942e4af627d29c839fd063685bc964647e75ac25fc9543ed5210c7b035b6b96d863f
7
+ data.tar.gz: eff8b4a0b14903860e54ad3b2b05d5f0624408a72308c525cf95a7eb6b8c028ae0abcd4732b259c853175f9b2b739607df646f4e6edbb736237d9a813f20159e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Changelog
2
2
 
3
+ ### [0.4.1](https://www.github.com/ScreenLoop/omniauth-lever/compare/v0.4.0...v0.4.1) (2022-01-27)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * prettify ([d7f4d25](https://www.github.com/ScreenLoop/omniauth-lever/commit/d7f4d250241de9e70d2388abaa4aff699c5b56d1))
9
+
10
+ ## [0.4.0](https://www.github.com/ScreenLoop/omniauth-lever/compare/v0.3.1...v0.4.0) (2022-01-27)
11
+
12
+
13
+ ### Features
14
+
15
+ * SL-811 Add opportunities stages scopes ([3b76c57](https://www.github.com/ScreenLoop/omniauth-lever/commit/3b76c5776bc4ac90464c5268aea56b5135dcc861))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * SL-811 Remove opportunities:read scope ([36f557d](https://www.github.com/ScreenLoop/omniauth-lever/commit/36f557d128dbfb42b55082ecc881388d2dc0a96b))
21
+
22
+ ### [0.3.1](https://www.github.com/ScreenLoop/omniauth-lever/compare/v0.3.0...v0.3.1) (2021-09-24)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * Add audience option ([6e06fe6](https://www.github.com/ScreenLoop/omniauth-lever/commit/6e06fe6b8fb156a4bc7775283d29ede714c4fd80))
28
+
29
+ ### [0.3.1](https://www.github.com/ScreenLoop/omniauth-lever/compare/v0.3.0...v0.3.1) (2021-09-24)
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * Add audience option ([6e06fe6](https://www.github.com/ScreenLoop/omniauth-lever/commit/6e06fe6b8fb156a4bc7775283d29ede714c4fd80))
35
+
36
+ ## [0.3.0](https://www.github.com/ScreenLoop/omniauth-lever/compare/v0.2.1...v0.3.0) (2021-09-16)
37
+
38
+
39
+ ### Features
40
+
41
+ * Add support to sandbox instance ([12a9531](https://www.github.com/ScreenLoop/omniauth-lever/commit/12a9531d888cb8c50312d36ddcf24830517e83ee))
42
+
3
43
  ### [0.2.1](https://www.github.com/ScreenLoop/omniauth-lever/compare/v0.2.0...v0.2.1) (2021-09-13)
4
44
 
5
45
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-lever (0.2.1)
4
+ omniauth-lever (0.4.1)
5
5
  omniauth (~> 2.0)
6
6
  omniauth-oauth2 (~> 1.7.1)
7
7
 
@@ -10,27 +10,31 @@ GEM
10
10
  specs:
11
11
  ast (2.4.2)
12
12
  diff-lcs (1.4.4)
13
- faraday (1.7.1)
13
+ faraday (1.9.3)
14
14
  faraday-em_http (~> 1.0)
15
15
  faraday-em_synchrony (~> 1.0)
16
16
  faraday-excon (~> 1.1)
17
- faraday-httpclient (~> 1.0.1)
17
+ faraday-httpclient (~> 1.0)
18
+ faraday-multipart (~> 1.0)
18
19
  faraday-net_http (~> 1.0)
19
- faraday-net_http_persistent (~> 1.1)
20
+ faraday-net_http_persistent (~> 1.0)
20
21
  faraday-patron (~> 1.0)
21
22
  faraday-rack (~> 1.0)
22
- multipart-post (>= 1.2, < 3)
23
+ faraday-retry (~> 1.0)
23
24
  ruby2_keywords (>= 0.0.4)
24
25
  faraday-em_http (1.0.0)
25
26
  faraday-em_synchrony (1.0.0)
26
27
  faraday-excon (1.1.0)
27
28
  faraday-httpclient (1.0.1)
29
+ faraday-multipart (1.0.3)
30
+ multipart-post (>= 1.2, < 3)
28
31
  faraday-net_http (1.0.1)
29
32
  faraday-net_http_persistent (1.2.0)
30
33
  faraday-patron (1.0.0)
31
34
  faraday-rack (1.0.0)
32
- hashie (4.1.0)
33
- jwt (2.2.3)
35
+ faraday-retry (1.0.3)
36
+ hashie (5.0.0)
37
+ jwt (2.3.0)
34
38
  multi_json (1.15.0)
35
39
  multi_xml (0.6.0)
36
40
  multipart-post (2.1.1)
@@ -44,7 +48,7 @@ GEM
44
48
  hashie (>= 3.4.6)
45
49
  rack (>= 1.6.2, < 3)
46
50
  rack-protection
47
- omniauth-oauth2 (1.7.1)
51
+ omniauth-oauth2 (1.7.2)
48
52
  oauth2 (~> 1.4)
49
53
  omniauth (>= 1.9, < 3)
50
54
  parallel (1.20.1)
@@ -99,4 +103,4 @@ DEPENDENCIES
99
103
  rubocop-rspec (~> 2.4.0)
100
104
 
101
105
  BUNDLED WITH
102
- 2.1.4
106
+ 2.2.20
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Lever
5
- VERSION = '0.2.1'
5
+ VERSION = '0.4.1'
6
6
  end
7
7
  end
@@ -7,13 +7,47 @@ require 'omniauth-oauth2'
7
7
  module OmniAuth
8
8
  module Strategies
9
9
  class Lever < OmniAuth::Strategies::OAuth2
10
+ DEFAULT_PROMPT = 'consent'
11
+ DEFAULT_RESPONSE_TYPE = 'code'
12
+ DEFAULT_SCOPE = 'offline_access stages:read:admin opportunities:write:admin archive_reasons:read:admin users:read:admin interviews:read:admin postings:read:admin feedback_templates:read:admin notes:write:admin'
13
+ SANDBOX_OAUTH_URL = 'https://sandbox-lever.auth0.com'
14
+ SANDBOX_CLIENT_OPTIONS = {
15
+ site: 'https://api.sandbox.lever.co/v1',
16
+ audience: 'https://api.sandbox.lever.co/v1/',
17
+ authorize_url: "#{SANDBOX_OAUTH_URL}/authorize",
18
+ token_url: "#{SANDBOX_OAUTH_URL}/oauth/token",
19
+ }
20
+
10
21
  option :name, 'lever'
11
22
 
12
23
  option :client_options, {
13
24
  site: 'https://api.lever.co/v1',
25
+ audience: 'https://api.lever.co/v1/',
14
26
  authorize_url: 'https://auth.lever.co/authorize',
15
- token_url: 'oauth/token',
27
+ token_url: 'https://auth.lever.co/oauth/token',
16
28
  }
29
+
30
+ option :authorize_options, [
31
+ :prompt,
32
+ :response_type,
33
+ :scope,
34
+ ]
35
+
36
+ option :sandbox, false
37
+
38
+ def setup_phase
39
+ options.client_options.merge!(SANDBOX_CLIENT_OPTIONS) if options.sandbox
40
+ super
41
+ end
42
+
43
+ def authorize_params
44
+ super.tap do |params|
45
+ params[:prompt] ||= DEFAULT_PROMPT
46
+ params[:response_type] ||= DEFAULT_RESPONSE_TYPE
47
+ params[:scope] ||= DEFAULT_SCOPE
48
+ params[:audience] ||= options.client_options[:audience]
49
+ end
50
+ end
17
51
  end
18
52
  end
19
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-lever
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Santos
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-13 00:00:00.000000000 Z
11
+ date: 2022-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth