omniauth-lever 0.2.1 → 0.3.0

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: dc26b031962eae11ecde27dc220a48df43a0c0b6013c30584446a7db8aaf5c23
4
+ data.tar.gz: 653c28cd1f76388f02562af025a26fbbf0fd491715508b8378c8f355f79b9712
5
5
  SHA512:
6
- metadata.gz: e540c56a94da66b808890ba5066cdbd542465f88b257ab0e3476f586c29fb5168b23c1d1754edf87a950adef85224293a86129d321dcf34ce703c198b98ff938
7
- data.tar.gz: 0fceecafeef6f00d1ee1eb9b284abbe3ea4a3ac2242cfecbacf9c42c0b0b6872ff2847d70966257306c5e0a85387d6bc3e966c6b658ae4bb38b1a0373033ada6
6
+ metadata.gz: 880ba47d36e63d675992122a074296139947c1dfd55ea78ea0207456def12aef3c917ba0255aba659118bf9364cd61a1f34a4907c771cbfe827601162c9d0652
7
+ data.tar.gz: 5f7e66d981229818d3b2dc57e03ee9fc1157a69dfa1a3bcae636f118d13de92a4eb723b43a72f23134be457550abf36a7a681600c451f87a4721640e40058af1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.0](https://www.github.com/ScreenLoop/omniauth-lever/compare/v0.2.1...v0.3.0) (2021-09-16)
4
+
5
+
6
+ ### Features
7
+
8
+ * Add support to sandbox instance ([12a9531](https://www.github.com/ScreenLoop/omniauth-lever/commit/12a9531d888cb8c50312d36ddcf24830517e83ee))
9
+
3
10
  ### [0.2.1](https://www.github.com/ScreenLoop/omniauth-lever/compare/v0.2.0...v0.2.1) (2021-09-13)
4
11
 
5
12
 
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.3.0)
5
5
  omniauth (~> 2.0)
6
6
  omniauth-oauth2 (~> 1.7.1)
7
7
 
@@ -10,7 +10,7 @@ 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.7.2)
14
14
  faraday-em_http (~> 1.0)
15
15
  faraday-em_synchrony (~> 1.0)
16
16
  faraday-excon (~> 1.1)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Lever
5
- VERSION = '0.2.1'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
@@ -7,13 +7,39 @@ 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 opportunities:read: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
+ authorize_url: "#{SANDBOX_OAUTH_URL}/authorize",
17
+ token_url: "#{SANDBOX_OAUTH_URL}/oauth/token",
18
+ }
19
+
10
20
  option :name, 'lever'
11
21
 
12
22
  option :client_options, {
13
23
  site: 'https://api.lever.co/v1',
14
24
  authorize_url: 'https://auth.lever.co/authorize',
15
- token_url: 'oauth/token',
25
+ token_url: 'https://auth.lever.co/oauth/token',
16
26
  }
27
+
28
+ option :authorize_options, [:prompt, :response_type, :scope]
29
+ option :sandbox, false
30
+
31
+ def setup_phase
32
+ options.client_options.merge!(SANDBOX_CLIENT_OPTIONS) if options.sandbox
33
+ super
34
+ end
35
+
36
+ def authorize_params
37
+ super.tap do |params|
38
+ params[:prompt] ||= DEFAULT_PROMPT
39
+ params[:response_type] ||= DEFAULT_RESPONSE_TYPE
40
+ params[:scope] ||= DEFAULT_SCOPE
41
+ end
42
+ end
17
43
  end
18
44
  end
19
45
  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.3.0
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: 2021-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth