omniauth-lever 0.1.1 → 0.3.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 +4 -4
- data/.rubocop.yml +55 -0
- data/CHANGELOG.md +28 -0
- data/Gemfile +5 -3
- data/Gemfile.lock +70 -2
- data/Rakefile +2 -0
- data/lib/omniauth/lever/version.rb +3 -1
- data/lib/omniauth/lever.rb +3 -7
- data/lib/omniauth/strategies/lever.rb +48 -0
- data/lib/omniauth-lever.rb +1 -0
- data/omniauth-lever.gemspec +22 -14
- metadata +63 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33ab8aa2719ff086d47b59ace1d6de1bd05b1871ac4c143441213f5a18c08199
|
4
|
+
data.tar.gz: f85ba69417902735bdb0249cff3da174b75f75dbcc31ce73e906b7414c81e74a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c3aab28674a4a0064c095e6c16357c49717fc66960b887b8bde6fb29828acc528929f2e776b89ccc694e269d211dcdda8fe7976bfa0fef178d08d2055dbde46
|
7
|
+
data.tar.gz: 02a8a8ee5a18ac77a2066ad4275c027be70f448d82eee4383871eb1e3961db40a3fac8a4274a7a6a8dd7a1a9a3de8212f43ba09a41352592a8cc60aaf3556e24
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
|
4
|
+
AllCops:
|
5
|
+
NewCops: enable
|
6
|
+
TargetRubyVersion: 2.6
|
7
|
+
Exclude:
|
8
|
+
- 'bin/**/*'
|
9
|
+
Layout/ParameterAlignment:
|
10
|
+
EnforcedStyle: with_fixed_indentation
|
11
|
+
Layout/ArgumentAlignment:
|
12
|
+
EnforcedStyle: with_fixed_indentation
|
13
|
+
Layout/FirstArgumentIndentation:
|
14
|
+
EnforcedStyle: consistent
|
15
|
+
Layout/FirstArrayElementIndentation:
|
16
|
+
EnforcedStyle: consistent
|
17
|
+
Layout/FirstHashElementIndentation:
|
18
|
+
EnforcedStyle: consistent
|
19
|
+
Layout/MultilineMethodCallIndentation:
|
20
|
+
EnforcedStyle: indented
|
21
|
+
Layout/MultilineOperationIndentation:
|
22
|
+
EnforcedStyle: indented
|
23
|
+
Lint/ConstantDefinitionInBlock:
|
24
|
+
AllowedMethods:
|
25
|
+
- enums
|
26
|
+
Metrics/BlockLength:
|
27
|
+
Exclude:
|
28
|
+
- 'spec/**/*'
|
29
|
+
Metrics/ClassLength:
|
30
|
+
Max: 120
|
31
|
+
Metrics/MethodLength:
|
32
|
+
Max: 20
|
33
|
+
Exclude:
|
34
|
+
- 'spec/**/*'
|
35
|
+
Naming/InclusiveLanguage:
|
36
|
+
Enabled: false
|
37
|
+
RSpec/ExampleLength:
|
38
|
+
Enabled: false
|
39
|
+
RSpec/FilePath:
|
40
|
+
CustomTransform:
|
41
|
+
OmniAuth: omniauth
|
42
|
+
RSpec/NestedGroups:
|
43
|
+
Enabled: false
|
44
|
+
Style/AccessorGrouping:
|
45
|
+
Enabled: false
|
46
|
+
Style/Documentation:
|
47
|
+
Enabled: false
|
48
|
+
Style/SymbolArray:
|
49
|
+
EnforcedStyle: brackets
|
50
|
+
Style/TrailingCommaInArguments:
|
51
|
+
EnforcedStyleForMultiline: comma
|
52
|
+
Style/TrailingCommaInArrayLiteral:
|
53
|
+
EnforcedStyleForMultiline: comma
|
54
|
+
Style/TrailingCommaInHashLiteral:
|
55
|
+
EnforcedStyleForMultiline: comma
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,33 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### [0.3.1](https://www.github.com/ScreenLoop/omniauth-lever/compare/v0.3.0...v0.3.1) (2021-09-24)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* Add audience option ([6e06fe6](https://www.github.com/ScreenLoop/omniauth-lever/commit/6e06fe6b8fb156a4bc7775283d29ede714c4fd80))
|
9
|
+
|
10
|
+
## [0.3.0](https://www.github.com/ScreenLoop/omniauth-lever/compare/v0.2.1...v0.3.0) (2021-09-16)
|
11
|
+
|
12
|
+
|
13
|
+
### Features
|
14
|
+
|
15
|
+
* Add support to sandbox instance ([12a9531](https://www.github.com/ScreenLoop/omniauth-lever/commit/12a9531d888cb8c50312d36ddcf24830517e83ee))
|
16
|
+
|
17
|
+
### [0.2.1](https://www.github.com/ScreenLoop/omniauth-lever/compare/v0.2.0...v0.2.1) (2021-09-13)
|
18
|
+
|
19
|
+
|
20
|
+
### Bug Fixes
|
21
|
+
|
22
|
+
* Fix imports for omniauth-lever gem ([f26ea25](https://www.github.com/ScreenLoop/omniauth-lever/commit/f26ea25a1c43abdbb01a0d6122cf7618e40bf25d))
|
23
|
+
|
24
|
+
## [0.2.0](https://www.github.com/ScreenLoop/omniauth-lever/compare/v0.1.1...v0.2.0) (2021-09-10)
|
25
|
+
|
26
|
+
|
27
|
+
### Features
|
28
|
+
|
29
|
+
* Add initial support to Lever strategy ([48eb4e2](https://www.github.com/ScreenLoop/omniauth-lever/commit/48eb4e2279be80affb3e877606acd30d1e59e65b))
|
30
|
+
|
3
31
|
### [0.1.1](https://www.github.com/ScreenLoop/omniauth-lever/compare/v0.1.0...v0.1.1) (2021-09-10)
|
4
32
|
|
5
33
|
|
data/Gemfile
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
# Specify your gem's dependencies in omniauth-lever.gemspec
|
4
6
|
gemspec
|
5
7
|
|
6
|
-
gem
|
7
|
-
gem
|
8
|
+
gem 'rake', '~> 12.0'
|
9
|
+
gem 'rspec', '~> 3.0'
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,62 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
omniauth-lever (0.
|
4
|
+
omniauth-lever (0.3.1)
|
5
|
+
omniauth (~> 2.0)
|
6
|
+
omniauth-oauth2 (~> 1.7.1)
|
5
7
|
|
6
8
|
GEM
|
7
9
|
remote: https://rubygems.org/
|
8
10
|
specs:
|
11
|
+
ast (2.4.2)
|
9
12
|
diff-lcs (1.4.4)
|
13
|
+
faraday (1.8.0)
|
14
|
+
faraday-em_http (~> 1.0)
|
15
|
+
faraday-em_synchrony (~> 1.0)
|
16
|
+
faraday-excon (~> 1.1)
|
17
|
+
faraday-httpclient (~> 1.0.1)
|
18
|
+
faraday-net_http (~> 1.0)
|
19
|
+
faraday-net_http_persistent (~> 1.1)
|
20
|
+
faraday-patron (~> 1.0)
|
21
|
+
faraday-rack (~> 1.0)
|
22
|
+
multipart-post (>= 1.2, < 3)
|
23
|
+
ruby2_keywords (>= 0.0.4)
|
24
|
+
faraday-em_http (1.0.0)
|
25
|
+
faraday-em_synchrony (1.0.0)
|
26
|
+
faraday-excon (1.1.0)
|
27
|
+
faraday-httpclient (1.0.1)
|
28
|
+
faraday-net_http (1.0.1)
|
29
|
+
faraday-net_http_persistent (1.2.0)
|
30
|
+
faraday-patron (1.0.0)
|
31
|
+
faraday-rack (1.0.0)
|
32
|
+
hashie (4.1.0)
|
33
|
+
jwt (2.2.3)
|
34
|
+
multi_json (1.15.0)
|
35
|
+
multi_xml (0.6.0)
|
36
|
+
multipart-post (2.1.1)
|
37
|
+
oauth2 (1.4.7)
|
38
|
+
faraday (>= 0.8, < 2.0)
|
39
|
+
jwt (>= 1.0, < 3.0)
|
40
|
+
multi_json (~> 1.3)
|
41
|
+
multi_xml (~> 0.5)
|
42
|
+
rack (>= 1.2, < 3)
|
43
|
+
omniauth (2.0.4)
|
44
|
+
hashie (>= 3.4.6)
|
45
|
+
rack (>= 1.6.2, < 3)
|
46
|
+
rack-protection
|
47
|
+
omniauth-oauth2 (1.7.1)
|
48
|
+
oauth2 (~> 1.4)
|
49
|
+
omniauth (>= 1.9, < 3)
|
50
|
+
parallel (1.20.1)
|
51
|
+
parser (3.0.2.0)
|
52
|
+
ast (~> 2.4.1)
|
53
|
+
rack (2.2.3)
|
54
|
+
rack-protection (2.1.0)
|
55
|
+
rack
|
56
|
+
rainbow (3.0.0)
|
10
57
|
rake (12.3.3)
|
58
|
+
regexp_parser (2.1.1)
|
59
|
+
rexml (3.2.5)
|
11
60
|
rspec (3.10.0)
|
12
61
|
rspec-core (~> 3.10.0)
|
13
62
|
rspec-expectations (~> 3.10.0)
|
@@ -21,6 +70,23 @@ GEM
|
|
21
70
|
diff-lcs (>= 1.2.0, < 2.0)
|
22
71
|
rspec-support (~> 3.10.0)
|
23
72
|
rspec-support (3.10.2)
|
73
|
+
rubocop (1.20.0)
|
74
|
+
parallel (~> 1.10)
|
75
|
+
parser (>= 3.0.0.0)
|
76
|
+
rainbow (>= 2.2.2, < 4.0)
|
77
|
+
regexp_parser (>= 1.8, < 3.0)
|
78
|
+
rexml
|
79
|
+
rubocop-ast (>= 1.9.1, < 2.0)
|
80
|
+
ruby-progressbar (~> 1.7)
|
81
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
82
|
+
rubocop-ast (1.11.0)
|
83
|
+
parser (>= 3.0.1.1)
|
84
|
+
rubocop-rspec (2.4.0)
|
85
|
+
rubocop (~> 1.0)
|
86
|
+
rubocop-ast (>= 1.1.0)
|
87
|
+
ruby-progressbar (1.11.0)
|
88
|
+
ruby2_keywords (0.0.5)
|
89
|
+
unicode-display_width (2.0.0)
|
24
90
|
|
25
91
|
PLATFORMS
|
26
92
|
ruby
|
@@ -29,6 +95,8 @@ DEPENDENCIES
|
|
29
95
|
omniauth-lever!
|
30
96
|
rake (~> 12.0)
|
31
97
|
rspec (~> 3.0)
|
98
|
+
rubocop (~> 1.20.0)
|
99
|
+
rubocop-rspec (~> 2.4.0)
|
32
100
|
|
33
101
|
BUNDLED WITH
|
34
|
-
2.
|
102
|
+
2.2.20
|
data/Rakefile
CHANGED
data/lib/omniauth/lever.rb
CHANGED
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'base64'
|
4
|
+
require 'oauth2'
|
5
|
+
require 'omniauth-oauth2'
|
6
|
+
|
7
|
+
module OmniAuth
|
8
|
+
module Strategies
|
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
|
+
audience: 'https://api.sandbox.lever.co/v1/',
|
17
|
+
authorize_url: "#{SANDBOX_OAUTH_URL}/authorize",
|
18
|
+
token_url: "#{SANDBOX_OAUTH_URL}/oauth/token",
|
19
|
+
}
|
20
|
+
|
21
|
+
option :name, 'lever'
|
22
|
+
|
23
|
+
option :client_options, {
|
24
|
+
site: 'https://api.lever.co/v1',
|
25
|
+
audience: 'https://api.lever.co/v1/',
|
26
|
+
authorize_url: 'https://auth.lever.co/authorize',
|
27
|
+
token_url: 'https://auth.lever.co/oauth/token',
|
28
|
+
}
|
29
|
+
|
30
|
+
option :authorize_options, [:prompt, :response_type, :scope]
|
31
|
+
option :sandbox, false
|
32
|
+
|
33
|
+
def setup_phase
|
34
|
+
options.client_options.merge!(SANDBOX_CLIENT_OPTIONS) if options.sandbox
|
35
|
+
super
|
36
|
+
end
|
37
|
+
|
38
|
+
def authorize_params
|
39
|
+
super.tap do |params|
|
40
|
+
params[:prompt] ||= DEFAULT_PROMPT
|
41
|
+
params[:response_type] ||= DEFAULT_RESPONSE_TYPE
|
42
|
+
params[:scope] ||= DEFAULT_SCOPE
|
43
|
+
params[:audience] ||= options.client_options[:audience]
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'omniauth/lever'
|
data/omniauth-lever.gemspec
CHANGED
@@ -1,29 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'lib/omniauth/lever/version'
|
2
4
|
|
3
5
|
Gem::Specification.new do |spec|
|
4
|
-
spec.name =
|
6
|
+
spec.name = 'omniauth-lever'
|
5
7
|
spec.version = OmniAuth::Lever::VERSION
|
6
|
-
spec.authors = [
|
7
|
-
spec.email = [
|
8
|
+
spec.authors = ['Alex Santos']
|
9
|
+
spec.email = ['hello@alexcsantos.com']
|
8
10
|
|
9
|
-
spec.summary =
|
10
|
-
spec.homepage =
|
11
|
-
spec.required_ruby_version = Gem::Requirement.new(
|
11
|
+
spec.summary = 'OmniAuth implementation for Lever'
|
12
|
+
spec.homepage = 'https://github.com/ScreenLoop/omniauth-lever'
|
13
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.6.0')
|
12
14
|
|
13
15
|
spec.metadata = {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
'bug_tracker_uri' => "#{spec.homepage}/issues",
|
17
|
+
'changelog_uri' => "#{spec.homepage}/blob/main/CHANGELOG.md",
|
18
|
+
'documentation_uri' => spec.homepage.to_s,
|
19
|
+
'homepage_uri' => spec.homepage.to_s,
|
20
|
+
'source_code_uri' => spec.homepage.to_s,
|
19
21
|
}
|
20
22
|
|
21
23
|
# Specify which files should be added to the gem when it is released.
|
22
24
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
|
-
spec.files
|
25
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
24
26
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
27
|
end
|
26
|
-
spec.bindir =
|
28
|
+
spec.bindir = 'exe'
|
27
29
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
-
spec.require_paths = [
|
30
|
+
spec.require_paths = ['lib']
|
31
|
+
|
32
|
+
spec.add_runtime_dependency 'omniauth', '~> 2.0'
|
33
|
+
spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.7.1'
|
34
|
+
|
35
|
+
spec.add_development_dependency 'rubocop', '~> 1.20.0'
|
36
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.4.0'
|
29
37
|
end
|
metadata
CHANGED
@@ -1,15 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-lever
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.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-
|
12
|
-
dependencies:
|
11
|
+
date: 2021-09-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: omniauth
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: omniauth-oauth2
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.7.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.7.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.20.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.20.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop-rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.4.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.4.0
|
13
69
|
description:
|
14
70
|
email:
|
15
71
|
- hello@alexcsantos.com
|
@@ -20,6 +76,7 @@ files:
|
|
20
76
|
- ".github/workflows/release.yml"
|
21
77
|
- ".gitignore"
|
22
78
|
- ".rspec"
|
79
|
+
- ".rubocop.yml"
|
23
80
|
- CHANGELOG.md
|
24
81
|
- Gemfile
|
25
82
|
- Gemfile.lock
|
@@ -27,8 +84,10 @@ files:
|
|
27
84
|
- Rakefile
|
28
85
|
- bin/console
|
29
86
|
- bin/setup
|
87
|
+
- lib/omniauth-lever.rb
|
30
88
|
- lib/omniauth/lever.rb
|
31
89
|
- lib/omniauth/lever/version.rb
|
90
|
+
- lib/omniauth/strategies/lever.rb
|
32
91
|
- omniauth-lever.gemspec
|
33
92
|
homepage: https://github.com/ScreenLoop/omniauth-lever
|
34
93
|
licenses: []
|
@@ -46,7 +105,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
46
105
|
requirements:
|
47
106
|
- - ">="
|
48
107
|
- !ruby/object:Gem::Version
|
49
|
-
version: 2.
|
108
|
+
version: 2.6.0
|
50
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
110
|
requirements:
|
52
111
|
- - ">="
|