omniauth-forge 0.1.0 → 0.2.1.1

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
2
  SHA256:
3
- metadata.gz: 030c57825f02ede7d28d7b5e0148f4d4f7ad889f4a663e40ad356696b3e0bfda
4
- data.tar.gz: e981ae3f5c43d3453b402800b182f7becefc9d22ca49406f08811a87c37fed3f
3
+ metadata.gz: 23db255740d8cc71c21972f81dc46c9e719905e53bd49b4b2bf12fa480c24cad
4
+ data.tar.gz: af4fce77defcbce16705cd37ebbb7f0a6f01dfd0d85da86aec7af4e94c8a7c2e
5
5
  SHA512:
6
- metadata.gz: 448329592c1df2d6e731ef6b0e3ef13fa77fa6bb2e35a11bb23d8c67b7d8a5243076fbc5c33276e4ca7686d16c27af594b7412e2dc1a3674502b502e967c5d8b
7
- data.tar.gz: 91cb66df43ddf40cb03e47310aa722c2b85a1d7b806b2ac48812bdc66a8fdee267fdffef9fd1898bffaa7e1b882462b7e7e20a3a49a6cfacd0d2daee5650ab48
6
+ metadata.gz: 7528790d8093ecef0129c77347a20ec5e9f6c3f9bf9a0a5d8173d5cf527e75820037618028901b75bf8f90710c35e7b0855f8f009bc4cc54350ecd2a12f8470a
7
+ data.tar.gz: 9834e9ee4f262fe29e898ffe6fb655520d2842ea74a79bff7605d307a0b59d58bdc9986510618d82ac825c0800db538af8d95ed965f185824b10360fa99345a2
@@ -0,0 +1,63 @@
1
+ name: Test and Release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ tests:
10
+ strategy:
11
+ matrix:
12
+ ruby: [2.5, 2.6, 2.7, 3.0]
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - name: Set up Ruby
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby }}
21
+ bundler-cache: true
22
+ - name: Run linter
23
+ run: bundle exec rubocop
24
+ - name: Run tests
25
+ run: bundle exec rspec
26
+ prettier:
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v2
30
+ - name: Set up Node
31
+ uses: actions/setup-node@v2
32
+ with:
33
+ node-version: '14'
34
+ - name: Set up Ruby
35
+ uses: ruby/setup-ruby@v1
36
+ with:
37
+ ruby-version: 3.0
38
+ bundler-cache: true
39
+ - name: Install yarn dep
40
+ run: yarn install
41
+ - name: Check prettier
42
+ run: yarn prettier -c '**/*.rb'
43
+ release:
44
+ needs: [tests, prettier]
45
+ runs-on: ubuntu-latest
46
+
47
+ steps:
48
+ - uses: actions/checkout@v2
49
+ - name: Set up Ruby
50
+ uses: ruby/setup-ruby@v1
51
+ with:
52
+ ruby-version: 3.0
53
+ bundler-cache: true
54
+ - name: Prepare credentials
55
+ env:
56
+ RUBYGEM_KEY: ${{ secrets.RUBYGEM_KEY }}
57
+ run: "mkdir -p ~/.gem && echo -e \"---\\r\\n:rubygems_api_key: $RUBYGEM_KEY\" > ~/.gem/credentials && chmod 0600 ~/.gem/credentials"
58
+ - name: Setup username/email
59
+ run: "git config --global user.email zaratan@hey.com && git config --global user.name \"Denis <Zaratan> Pasin\""
60
+ - name: Fetch tags from remote
61
+ run: "git fetch -t"
62
+ - name: Publish if version change
63
+ run: 'git diff `git tag | tail -1` -- lib/omniauth/forge/version.rb | grep -E "^\+.*VERSION" && rake release || echo "No release for now"'
@@ -0,0 +1,42 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches-ignore:
6
+ - main
7
+
8
+ jobs:
9
+ tests:
10
+ strategy:
11
+ matrix:
12
+ ruby: [2.5, 2.6, 2.7, 3.0]
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - name: Set up Ruby
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby }}
21
+ bundler-cache: true
22
+ - name: Run linter
23
+ run: bundle exec rubocop
24
+ - name: Run tests
25
+ run: bundle exec rspec
26
+ prettier:
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v2
30
+ - name: Set up Ruby
31
+ uses: ruby/setup-ruby@v1
32
+ with:
33
+ ruby-version: 3.0
34
+ bundler-cache: true
35
+ - name: Set up Node
36
+ uses: actions/setup-node@v2
37
+ with:
38
+ node-version: '14'
39
+ - name: Install yarn dep
40
+ run: yarn install
41
+ - name: Check prettier
42
+ run: yarn prettier -c '**/*.rb'
@@ -0,0 +1,21 @@
1
+ name: Verify version change
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ version_change:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - name: Fetch main branch
15
+ run: git fetch origin main:main
16
+ - name: Verify if there's a change in version
17
+ run: "git diff main -- lib/omniauth/forge/version.rb | grep VERSION"
18
+ - name: Print new version
19
+ run: 'git diff main -- lib/omniauth/forge/version.rb | grep -E "^\+.*VERSION" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?"'
20
+ - name: Verify if higher version
21
+ run: '[[ $(git diff main -- lib/omniauth/forge/version.rb | grep -E "^\+.*VERSION" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?") > $(git diff main -- lib/omniauth/forge/version.rb | grep -E "^-.*VERSION" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?") ]]'
data/.gitignore CHANGED
@@ -10,3 +10,5 @@
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
12
  .env
13
+ Gemfile.lock
14
+ vendor/cache
@@ -1,17 +1,21 @@
1
1
  PreCommit:
2
2
  RuboCop:
3
3
  enabled: true
4
- command: ['rubocop', '-P']
5
- quiet: false
4
+ command: ['bundle', 'exec', 'rubocop'] # Invoke within Bundler context
6
5
  BundleOutdated:
7
6
  enabled: true
8
7
  BundleAudit:
9
8
  enabled: true
10
- command: ['bundle', 'audit', 'check', '--ignore', 'CVE-2015-9284']
9
+ Prettier:
10
+ enabled: true
11
+ required_executable: './bin/prettirun'
11
12
  PrePush:
12
13
  RSpec:
13
14
  enabled: true
14
- command: ['rspec', '-f', 'p'] # Invoke within Bundler context
15
- quiet: false
15
+ command: ['bundle', 'exec', 'rspec', '-f', 'p'] # Invoke within Bundler context
16
+ Prettier:
17
+ enabled: true
18
+ required_executable: './bin/prettirun'
16
19
  Rubocop:
17
20
  enabled: true
21
+ required_executable: './bin/ruborun'
@@ -0,0 +1 @@
1
+ vendor
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ trailingComma: "es5",
3
+ singleQuote: true
4
+ };
@@ -1,6 +1,9 @@
1
1
  inherit_from:
2
2
  - http://relaxed.ruby.style/rubocop.yml
3
3
 
4
+ inherit_gem:
5
+ prettier: rubocop.yml
6
+
4
7
  require:
5
8
  - rubocop-faker
6
9
  - rubocop-performance
@@ -9,211 +12,26 @@ AllCops:
9
12
  NewCops: enable
10
13
  DisplayStyleGuide: true
11
14
  DisplayCopNames: true
15
+ SuggestExtensions: false
12
16
  Exclude:
13
- - 'db/schema.rb'
14
17
  - 'bin/*'
15
18
  - 'node_modules/**/*'
16
-
17
- Naming/FileName:
18
- Enabled: false
19
+ - 'vendor/**/*'
19
20
 
20
21
  Gemspec/RequiredRubyVersion:
21
22
  Enabled: false
22
23
 
24
+ Lint/UnusedMethodArgument:
25
+ Exclude:
26
+ - 'lib/spg_client/fake/*.rb'
27
+
23
28
  Style/GlobalVars:
24
29
  Enabled: false
25
30
 
26
- Layout/DotPosition:
27
- Enabled: true
28
- EnforcedStyle: trailing
29
-
30
- Style/TrailingCommaInHashLiteral:
31
- Enabled: true
32
- EnforcedStyleForMultiline: comma
33
-
34
- Style/TrailingCommaInArrayLiteral:
35
- Enabled: true
36
- EnforcedStyleForMultiline: comma
37
-
38
- Naming/ConstantName:
31
+ Naming/FileName:
39
32
  Enabled: false
40
33
 
41
- Layout/MultilineArrayLineBreaks:
42
- Enabled: true
43
-
44
- Layout/MultilineHashKeyLineBreaks:
45
- Enabled: true
46
-
47
- Layout/MultilineMethodArgumentLineBreaks:
48
- Enabled: true
49
-
50
- Layout/FirstArrayElementLineBreak:
51
- Enabled: true
52
-
53
- Layout/FirstHashElementLineBreak:
54
- Enabled: true
55
-
56
- Layout/FirstMethodArgumentLineBreak:
57
- Enabled: true
58
-
59
- Layout/MultilineAssignmentLayout:
60
- Enabled: true
61
-
62
- Style/HashEachMethods:
63
- Enabled: true
64
-
65
- Style/HashTransformKeys:
66
- Enabled: true
67
-
68
- Style/HashTransformValues:
69
- Enabled: true
70
-
71
- Lint/RaiseException:
72
- Enabled: true
73
-
74
- Lint/StructNewOverride:
75
- Enabled: true
76
-
77
- Layout/SpaceAroundMethodCallOperator:
78
- Enabled: true
79
-
80
- Style/ExponentialNotation:
81
- Enabled: true
82
-
83
- # 0.83
84
- Layout/EmptyLinesAroundAttributeAccessor:
85
- Enabled: true
86
-
87
- # 0.84
88
- Lint/DeprecatedOpenSSLConstant:
89
- Enabled: true
90
-
91
- # 0.85
92
- Lint/MixedRegexpCaptureTypes:
93
- Enabled: true
94
-
95
- Style/RedundantRegexpEscape:
96
- Enabled: true
97
-
98
- Style/RedundantRegexpCharacterClass:
99
- Enabled: true
100
-
101
- Style/SlicingWithRange:
102
- Enabled: true
103
-
104
- # 0.86
105
- Style/RedundantFetchBlock:
106
- Enabled: true
107
-
108
- Style/BisectedAttrAccessor:
109
- Enabled: true
110
-
111
- Style/RedundantAssignment:
112
- Enabled: true
113
-
114
- # 0.87
115
- Style/AccessorGrouping:
116
- Enabled: true
117
-
118
- # 0.88
119
- Lint/DuplicateElsifCondition:
120
- Enabled: true
121
-
122
- Style/ArrayCoercion:
123
- Enabled: true
124
-
125
- Style/CaseLikeIf:
126
- Enabled: true
127
-
128
- Style/HashAsLastArrayItem:
129
- Enabled: true
130
-
131
- Style/HashLikeCase:
132
- Enabled: true
133
-
134
- Style/RedundantFileExtensionInRequire:
135
- Enabled: true
136
-
137
- # 0.89
138
- Lint/BinaryOperatorWithIdenticalOperands:
139
- Enabled: true
140
-
141
- Lint/DuplicateRescueException:
142
- Enabled: true
143
-
144
- Lint/EmptyConditionalBody:
145
- Enabled: true
146
-
147
- Lint/FloatComparison:
148
- Enabled: true
149
-
150
- Lint/MissingSuper:
151
- Enabled: true
152
-
153
- Lint/OutOfRangeRegexpRef:
154
- Enabled: true
155
-
156
- Lint/SelfAssignment:
157
- Enabled: true
158
-
159
- Lint/TopLevelReturnWithArgument:
160
- Enabled: true
161
-
162
- Lint/UnreachableLoop:
163
- Enabled: true
164
-
165
- Style/ExplicitBlockArgument:
166
- Enabled: true
167
-
168
- Style/GlobalStdStream:
169
- Enabled: true
170
-
171
- Style/OptionalBooleanParameter:
172
- Enabled: true
173
-
174
- Style/SingleArgumentDig:
175
- Enabled: true
176
-
177
- Style/StringConcatenation:
178
- Enabled: true
179
-
180
- # Perf 1.7
181
- Performance/AncestorsInclude:
182
- Enabled: true
183
-
184
- Performance/BigDecimalWithNumericArgument:
185
- Enabled: true
186
-
187
- Performance/RedundantSortBlock:
188
- Enabled: true
189
-
190
- Performance/RedundantStringChars:
191
- Enabled: true
192
-
193
- Performance/ReverseFirst:
194
- Enabled: true
195
-
196
- Performance/SortReverse:
197
- Enabled: true
198
-
199
- Performance/Squeeze:
200
- Enabled: true
201
-
202
- Performance/StringInclude:
203
- Enabled: true
204
-
205
- Layout/LineLength:
206
- Enabled: true
207
- Max: 120
208
- AutoCorrect: true
209
- IgnoredPatterns: ['^\s*#.*']
210
- Exclude:
211
- - Gemfile
212
- - Guardfile
213
-
214
34
  Metrics/BlockLength:
215
35
  Exclude:
216
36
  - 'spec/**/*.rb'
217
37
  - 'Guardfile'
218
- - 'config/routes.rb'
219
- - 'config/environments/*.rb'
@@ -0,0 +1,27 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.2.1] - 2021-01-20
10
+ ### Changed
11
+ - Forced Ominauth >= 2 to mitigate CVE-2015-9284
12
+
13
+ ## [0.2.0] - 2021-01-19
14
+ ### Added
15
+ - Using rubocop + prettier combo for linting
16
+ ### Changed
17
+ - Updated omniauth-rails_csrf_protection
18
+
19
+ ## [0.1.1] - 2020-12-14
20
+ ### Added
21
+ - First working version of the gem.
22
+ - Added proper documentation.
23
+
24
+ [Unreleased]: https://github.com/shotgunsoftware/omniauth-forge/compare/v0.2.1...HEAD
25
+ [0.2.0]: https://github.com/shotgunsoftware/omniauth-forge/releases/tag/v0.2.1
26
+ [0.2.0]: https://github.com/shotgunsoftware/omniauth-forge/releases/tag/v0.2.0
27
+ [0.1.1]: https://github.com/shotgunsoftware/omniauth-forge/releases/tag/v0.1.1
data/Gemfile CHANGED
@@ -4,6 +4,3 @@ source "https://rubygems.org"
4
4
 
5
5
  # Specify your gem's dependencies in omniauth-forge.gemspec
6
6
  gemspec
7
-
8
- gem "rake", "~> 12.0"
9
- gem "rspec", "~> 3.0"
data/README.md CHANGED
@@ -22,7 +22,7 @@ Or install it yourself as:
22
22
 
23
23
  ## CVE
24
24
 
25
- See [Omniauth Wiki][https://github.com/omniauth/omniauth/wiki/Resolving-CVE-2015-9284].
25
+ See [Omniauth Wiki](https://github.com/omniauth/omniauth/wiki/Resolving-CVE-2015-9284).
26
26
  There's an existing unfixed CVE on omniauth. This CVE is mitigated in Rails by using the gem [omniauth-rails_csrf_protection](https://github.com/cookpad/omniauth-rails_csrf_protection).
27
27
  This gem will depend on that gem in order to protect as many people as possible.
28
28
 
@@ -35,7 +35,26 @@ bundle audit check --ignore CVE-2015-9284
35
35
 
36
36
  ## Usage
37
37
 
38
- TODO: Write usage instructions here
38
+ This is a provider for [omniauth](https://github.com/omniauth/omniauth) based on oauth2 [3-legged forge authentication](https://forge.autodesk.com/en/docs/oauth/v2/tutorials/get-3-legged-token/). Basic usage is:
39
+
40
+ ```ruby
41
+ provider(
42
+ :forge,
43
+ 'FORGE_CLIENT_ID',
44
+ 'FORGE_CLIENT_SECRET',
45
+ {
46
+ callback_path: '/forge/callback' # default
47
+ }
48
+ )
49
+ ```
50
+
51
+ ### Configuration options
52
+
53
+ - **callback_path**: This is the path used for the callback from forge. Default will be '/forge/callback' but you can set it to anything defined on the forge side.
54
+
55
+ ### Examples
56
+
57
+ - [Basic Sinatra](./examples/sinatra.rb)
39
58
 
40
59
  ## Development
41
60
 
data/Rakefile CHANGED
@@ -1,8 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task default: :spec
@@ -0,0 +1 @@
1
+ yarn prettier -c './**/*.rb'
@@ -0,0 +1 @@
1
+ bundle exec rubocop -P
@@ -3,21 +3,23 @@
3
3
 
4
4
  require 'sinatra'
5
5
  require 'dotenv/load'
6
- require "bundler/setup"
7
- require "omniauth-forge"
6
+ require 'bundler/setup'
7
+ require 'omniauth-forge'
8
8
 
9
- use Rack::Session::Cookie
9
+ use Rack::Session::Cookie, secret: 'abc123'
10
+
11
+ OmniAuth.config.allowed_request_methods << :get
12
+ OmniAuth.config.silence_get_warning = true
10
13
 
11
14
  use OmniAuth::Builder do
12
15
  provider :forge,
13
16
  ENV['FORGE_CLIENT_ID'],
14
17
  ENV['FORGE_CLIENT_SECRET'],
15
- {
16
- client_options: { site: ENV['FORGE_API_BASE_URL'] },
17
- root_uri: ENV['ROOT_URI'],
18
- }
18
+ { client_options: { site: ENV['FORGE_API_BASE_URL'] } }
19
19
  end
20
20
 
21
21
  get '/forge/callback' do
22
- request.env["omniauth.auth"]["info"].to_json
22
+ request.env['omniauth.auth']['info'].to_json
23
23
  end
24
+
25
+ pp Sinatra::Application.routes
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "zeitwerk"
3
+ require 'zeitwerk'
4
4
 
5
5
  require 'omniauth'
6
6
  require 'omniauth-oauth2'
@@ -13,8 +13,10 @@ require 'omniauth-oauth2'
13
13
  loader = Zeitwerk::Loader.for_gem
14
14
 
15
15
  loader.inflector.inflect(
16
- "omniauth" => "OmniAuth",
17
- "omniauth-forge" => "OmniAuthForge"
16
+ 'omniauth' => 'OmniAuth',
17
+ 'omniauth-forge' => 'OmniAuthForge',
18
18
  )
19
19
 
20
20
  loader.setup # ready!
21
+
22
+ module OmniAuthForge; end
@@ -2,6 +2,7 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Forge
5
- VERSION = "0.1.0"
5
+ VERSION = '0.2.1.1'
6
+ Version = VERSION
6
7
  end
7
8
  end
@@ -11,15 +11,12 @@ module OmniAuth
11
11
  site: 'https://developer.api.autodesk.com',
12
12
  authorize_url: '/authentication/v1/authorize',
13
13
  token_url: '/authentication/v1/gettoken',
14
- }
14
+ },
15
15
  )
16
16
 
17
17
  option :callback_path, '/forge/callback'
18
- option :root_uri, 'https://localhost'
19
18
 
20
- uid do
21
- raw_info['userId']
22
- end
19
+ uid { raw_info['userId'] }
23
20
 
24
21
  info do
25
22
  {
@@ -30,26 +27,16 @@ module OmniAuth
30
27
  }
31
28
  end
32
29
 
33
- extra do
34
- {
35
- 'raw_info' => raw_info,
36
- }
30
+ extra { { 'raw_info' => raw_info } }
31
+
32
+ # Forge is expecting a callback_url without parameters
33
+ def callback_url
34
+ super.gsub(/\?.*$/, '')
37
35
  end
38
36
 
39
37
  def raw_info
40
38
  @raw_info ||= access_token.get('/userprofile/v1/users/@me').parsed
41
39
  end
42
-
43
- def initialize(app, *args, &block)
44
- super
45
- if @options&.[](:client_options)&.[](:redirect_uri) &&
46
- @options[:client_options][:redirect_uri] != self.class.default_options[:client_options][:redirect_uri]
47
- return
48
- end
49
-
50
- @options[:client_options][:redirect_uri] =
51
- "#{@options[:root_uri].to_s.gsub(%r{/+$}, '')}/#{options[:callback_path].to_s.gsub(%r{^/+}, '')}"
52
- end
53
40
  end
54
41
  end
55
42
  end
@@ -1,36 +1,39 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'lib/omniauth_forge/version'
3
+ require_relative 'lib/omniauth/forge/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = 'omniauth-forge'
7
- spec.version = OmniAuth::Forge::VERSION
8
- spec.authors = ['Denis <Zaratan> Pasin']
9
- spec.email = ['denis.pasin@autodesk.com']
6
+ spec.name = 'omniauth-forge'
7
+ spec.version = OmniAuth::Forge::VERSION
8
+ spec.authors = ['Denis <Zaratan> Pasin']
9
+ spec.email = ['denis.pasin@autodesk.com']
10
10
 
11
- spec.summary = "Connect to Autodesk's forge with omniauth strategy"
12
- spec.description = 'Omniauth oauth2 strategy to connect to https://forge.autodesk.com'
13
- spec.homepage = "https://github.com/shotgunsoftware/omniauth-forge"
14
- spec.license = 'MIT'
11
+ spec.summary = "Connect to Autodesk's forge with omniauth strategy"
12
+ spec.description =
13
+ 'Omniauth oauth2 strategy to connect to https://forge.autodesk.com'
14
+ spec.homepage = 'https://github.com/shotgunsoftware/omniauth-forge'
15
+ spec.license = 'MIT'
15
16
  spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
16
17
 
17
18
  spec.metadata['homepage_uri'] = spec.homepage
18
19
  spec.metadata['source_code_uri'] = spec.homepage
19
- spec.metadata['changelog_uri'] = "https://github.com/shotgunsoftware/omniauth-forge/blob/main/CHANGELOG.md"
20
+ spec.metadata['changelog_uri'] =
21
+ 'https://github.com/shotgunsoftware/omniauth-forge/blob/main/CHANGELOG.md'
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
25
  spec.files =
24
26
  Dir.chdir(File.expand_path(__dir__)) do
25
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
27
+ `git ls-files -z`.split("\x0").reject do |f|
28
+ f.match(%r{^(test|spec|features)/})
29
+ end
26
30
  end
27
- spec.bindir = 'exe'
28
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
+ spec.bindir = 'exe'
32
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
33
  spec.require_paths = ['lib']
30
34
 
31
- spec.add_dependency 'omniauth'
35
+ spec.add_dependency 'omniauth', '>= 2'
32
36
  spec.add_dependency 'omniauth-oauth2'
33
- spec.add_dependency 'omniauth-rails_csrf_protection', '~> 0.1' # No CVE-2015-9284
34
37
  spec.add_dependency 'zeitwerk', '~> 2'
35
38
 
36
39
  spec.add_development_dependency 'bundler'
@@ -39,6 +42,7 @@ Gem::Specification.new do |spec|
39
42
  spec.add_development_dependency 'dotenv'
40
43
  spec.add_development_dependency 'faker'
41
44
  spec.add_development_dependency 'overcommit'
45
+ spec.add_development_dependency 'prettier'
42
46
  spec.add_development_dependency 'pry-byebug'
43
47
  spec.add_development_dependency 'puma'
44
48
  spec.add_development_dependency 'rake'
@@ -0,0 +1,7 @@
1
+ {
2
+ "devDependencies": {
3
+ "@prettier/plugin-ruby": "^1.4.0",
4
+ "local-ssl-proxy": "^1.3.0",
5
+ "prettier": "^2.2.1"
6
+ }
7
+ }
@@ -0,0 +1,130 @@
1
+ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ # yarn lockfile v1
3
+
4
+
5
+ "@prettier/plugin-ruby@^1.4.0":
6
+ version "1.4.0"
7
+ resolved "https://registry.yarnpkg.com/@prettier/plugin-ruby/-/plugin-ruby-1.4.0.tgz#a455f63007774910cc8372c467c0f7bb19f1c997"
8
+ integrity sha512-aaWHlN1yOQ4jno1cxgvmW37kKniakfoxxtC/BiH9AehYOAMUghlTEIHxFQu4p0rR0pXC4FNRfI+U8dUNANtTVA==
9
+ dependencies:
10
+ prettier ">=1.10"
11
+
12
+ ansi-regex@^2.0.0:
13
+ version "2.1.1"
14
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
15
+ integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8=
16
+
17
+ ansi-styles@^2.2.1:
18
+ version "2.2.1"
19
+ resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
20
+ integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=
21
+
22
+ ansi-styles@~1.0.0:
23
+ version "1.0.0"
24
+ resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.0.0.tgz#cb102df1c56f5123eab8b67cd7b98027a0279178"
25
+ integrity sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=
26
+
27
+ chalk@^1.1.1:
28
+ version "1.1.3"
29
+ resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
30
+ integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=
31
+ dependencies:
32
+ ansi-styles "^2.2.1"
33
+ escape-string-regexp "^1.0.2"
34
+ has-ansi "^2.0.0"
35
+ strip-ansi "^3.0.0"
36
+ supports-color "^2.0.0"
37
+
38
+ chalk@~0.4.0:
39
+ version "0.4.0"
40
+ resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.4.0.tgz#5199a3ddcd0c1efe23bc08c1b027b06176e0c64f"
41
+ integrity sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=
42
+ dependencies:
43
+ ansi-styles "~1.0.0"
44
+ has-color "~0.1.0"
45
+ strip-ansi "~0.1.0"
46
+
47
+ escape-string-regexp@^1.0.2:
48
+ version "1.0.5"
49
+ resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
50
+ integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
51
+
52
+ eventemitter3@^4.0.0:
53
+ version "4.0.7"
54
+ resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f"
55
+ integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==
56
+
57
+ follow-redirects@^1.0.0:
58
+ version "1.13.1"
59
+ resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.1.tgz#5f69b813376cee4fd0474a3aba835df04ab763b7"
60
+ integrity sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==
61
+
62
+ has-ansi@^2.0.0:
63
+ version "2.0.0"
64
+ resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
65
+ integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=
66
+ dependencies:
67
+ ansi-regex "^2.0.0"
68
+
69
+ has-color@~0.1.0:
70
+ version "0.1.7"
71
+ resolved "https://registry.yarnpkg.com/has-color/-/has-color-0.1.7.tgz#67144a5260c34fc3cca677d041daf52fe7b78b2f"
72
+ integrity sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=
73
+
74
+ http-proxy@^1.13.1:
75
+ version "1.18.1"
76
+ resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549"
77
+ integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==
78
+ dependencies:
79
+ eventemitter3 "^4.0.0"
80
+ follow-redirects "^1.0.0"
81
+ requires-port "^1.0.0"
82
+
83
+ local-ssl-proxy@^1.3.0:
84
+ version "1.3.0"
85
+ resolved "https://registry.yarnpkg.com/local-ssl-proxy/-/local-ssl-proxy-1.3.0.tgz#f9bcd5d3039a27a775ffc81585294259e9d340a8"
86
+ integrity sha1-+bzV0wOaJ6d1/8gVhSlCWenTQKg=
87
+ dependencies:
88
+ chalk "^1.1.1"
89
+ http-proxy "^1.13.1"
90
+ nomnom "^1.8.1"
91
+
92
+ nomnom@^1.8.1:
93
+ version "1.8.1"
94
+ resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.8.1.tgz#2151f722472ba79e50a76fc125bb8c8f2e4dc2a7"
95
+ integrity sha1-IVH3Ikcrp55Qp2/BJbuMjy5Nwqc=
96
+ dependencies:
97
+ chalk "~0.4.0"
98
+ underscore "~1.6.0"
99
+
100
+ prettier@>=1.10, prettier@^2.2.1:
101
+ version "2.2.1"
102
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
103
+ integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==
104
+
105
+ requires-port@^1.0.0:
106
+ version "1.0.0"
107
+ resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
108
+ integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=
109
+
110
+ strip-ansi@^3.0.0:
111
+ version "3.0.1"
112
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
113
+ integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=
114
+ dependencies:
115
+ ansi-regex "^2.0.0"
116
+
117
+ strip-ansi@~0.1.0:
118
+ version "0.1.1"
119
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.1.1.tgz#39e8a98d044d150660abe4a6808acf70bb7bc991"
120
+ integrity sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=
121
+
122
+ supports-color@^2.0.0:
123
+ version "2.0.0"
124
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
125
+ integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=
126
+
127
+ underscore@~1.6.0:
128
+ version "1.6.0"
129
+ resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8"
130
+ integrity sha1-izixDKze9jM3uLJOT/htRa6lKag=
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-forge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis <Zaratan> Pasin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-14 00:00:00.000000000 Z
11
+ date: 2021-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: omniauth-oauth2
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: omniauth-rails_csrf_protection
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '0.1'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '0.1'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: zeitwerk
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +136,20 @@ dependencies:
150
136
  - - ">="
151
137
  - !ruby/object:Gem::Version
152
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: prettier
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: pry-byebug
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -353,27 +353,33 @@ executables: []
353
353
  extensions: []
354
354
  extra_rdoc_files: []
355
355
  files:
356
- - ".git-hooks/pre_push/rubocop.rb"
356
+ - ".github/workflows/test_and_publish.yml"
357
+ - ".github/workflows/test_only.yml"
358
+ - ".github/workflows/verify_version_change.yml"
357
359
  - ".gitignore"
358
360
  - ".overcommit.yml"
361
+ - ".prettierignore"
362
+ - ".prettierrc.js"
359
363
  - ".rspec"
360
364
  - ".rubocop-http---relaxed-ruby-style-rubocop-yml"
361
365
  - ".rubocop.yml"
362
- - ".travis.yml"
363
366
  - CHANGELOG.md
364
367
  - CODE_OF_CONDUCT.md
365
368
  - Gemfile
366
- - Gemfile.lock
367
369
  - LICENSE.txt
368
370
  - README.md
369
371
  - Rakefile
370
372
  - bin/console
373
+ - bin/prettirun
374
+ - bin/ruborun
371
375
  - bin/setup
372
376
  - examples/sinatra.rb
373
377
  - lib/omniauth-forge.rb
378
+ - lib/omniauth/forge/version.rb
374
379
  - lib/omniauth/strategies/forge.rb
375
- - lib/omniauth_forge/version.rb
376
380
  - omniauth_forge.gemspec
381
+ - package.json
382
+ - yarn.lock
377
383
  homepage: https://github.com/shotgunsoftware/omniauth-forge
378
384
  licenses:
379
385
  - MIT
@@ -381,7 +387,7 @@ metadata:
381
387
  homepage_uri: https://github.com/shotgunsoftware/omniauth-forge
382
388
  source_code_uri: https://github.com/shotgunsoftware/omniauth-forge
383
389
  changelog_uri: https://github.com/shotgunsoftware/omniauth-forge/blob/main/CHANGELOG.md
384
- post_install_message:
390
+ post_install_message:
385
391
  rdoc_options: []
386
392
  require_paths:
387
393
  - lib
@@ -396,8 +402,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
396
402
  - !ruby/object:Gem::Version
397
403
  version: '0'
398
404
  requirements: []
399
- rubygems_version: 3.1.4
400
- signing_key:
405
+ rubygems_version: 3.2.3
406
+ signing_key:
401
407
  specification_version: 4
402
408
  summary: Connect to Autodesk's forge with omniauth strategy
403
409
  test_files: []
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Overcommit
4
- module Hook
5
- module PrePush
6
- # Runs `rubocop` on every files.
7
- class Rubocop < Base
8
- def run
9
- result = execute(['rubocop', '-P'])
10
- return :pass if result.success?
11
-
12
- output = result.stdout + result.stderr
13
- [:fail, output]
14
- end
15
- end
16
- end
17
- end
18
- end
@@ -1,6 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.7.2
6
- before_install: gem install bundler -v 2.1.4
@@ -1,206 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- omniauth-forge (0.1.0)
5
- omniauth
6
- omniauth-oauth2
7
- omniauth-rails_csrf_protection (~> 0.1)
8
- zeitwerk (~> 2)
9
-
10
- GEM
11
- remote: https://rubygems.org/
12
- specs:
13
- actionpack (6.1.0)
14
- actionview (= 6.1.0)
15
- activesupport (= 6.1.0)
16
- rack (~> 2.0, >= 2.0.9)
17
- rack-test (>= 0.6.3)
18
- rails-dom-testing (~> 2.0)
19
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
20
- actionview (6.1.0)
21
- activesupport (= 6.1.0)
22
- builder (~> 3.1)
23
- erubi (~> 1.4)
24
- rails-dom-testing (~> 2.0)
25
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
26
- activesupport (6.1.0)
27
- concurrent-ruby (~> 1.0, >= 1.0.2)
28
- i18n (>= 1.6, < 2)
29
- minitest (>= 5.1)
30
- tzinfo (~> 2.0)
31
- zeitwerk (~> 2.3)
32
- addressable (2.7.0)
33
- public_suffix (>= 2.0.2, < 5.0)
34
- ast (2.4.1)
35
- builder (3.2.4)
36
- bundler-audit (0.7.0.1)
37
- bundler (>= 1.2.0, < 3)
38
- thor (>= 0.18, < 2)
39
- byebug (11.1.3)
40
- childprocess (4.0.0)
41
- coderay (1.1.3)
42
- concurrent-ruby (1.1.7)
43
- crack (0.4.4)
44
- crass (1.0.6)
45
- diff-lcs (1.4.4)
46
- dip (6.1.0)
47
- thor (>= 0.20, < 1.1)
48
- docile (1.3.2)
49
- dotenv (2.7.6)
50
- erubi (1.10.0)
51
- faker (2.15.1)
52
- i18n (>= 1.6, < 2)
53
- faraday (1.1.0)
54
- multipart-post (>= 1.2, < 3)
55
- ruby2_keywords
56
- hashdiff (1.0.1)
57
- hashie (4.1.0)
58
- i18n (1.8.5)
59
- concurrent-ruby (~> 1.0)
60
- iniparse (1.5.0)
61
- jwt (2.2.2)
62
- loofah (2.8.0)
63
- crass (~> 1.0.2)
64
- nokogiri (>= 1.5.9)
65
- method_source (1.0.0)
66
- mini_portile2 (2.4.0)
67
- minitest (5.14.2)
68
- multi_json (1.15.0)
69
- multi_xml (0.6.0)
70
- multipart-post (2.1.1)
71
- mustermann (1.1.1)
72
- ruby2_keywords (~> 0.0.1)
73
- nio4r (2.5.4)
74
- nokogiri (1.10.10)
75
- mini_portile2 (~> 2.4.0)
76
- oauth2 (1.4.4)
77
- faraday (>= 0.8, < 2.0)
78
- jwt (>= 1.0, < 3.0)
79
- multi_json (~> 1.3)
80
- multi_xml (~> 0.5)
81
- rack (>= 1.2, < 3)
82
- omniauth (1.9.1)
83
- hashie (>= 3.4.6)
84
- rack (>= 1.6.2, < 3)
85
- omniauth-oauth2 (1.7.0)
86
- oauth2 (~> 1.4)
87
- omniauth (~> 1.9)
88
- omniauth-rails_csrf_protection (0.1.2)
89
- actionpack (>= 4.2)
90
- omniauth (>= 1.3.1)
91
- overcommit (0.57.0)
92
- childprocess (>= 0.6.3, < 5)
93
- iniparse (~> 1.4)
94
- parallel (1.20.1)
95
- parser (2.7.2.0)
96
- ast (~> 2.4.1)
97
- pry (0.13.1)
98
- coderay (~> 1.1)
99
- method_source (~> 1.0)
100
- pry-byebug (3.9.0)
101
- byebug (~> 11.0)
102
- pry (~> 0.13.0)
103
- public_suffix (4.0.6)
104
- puma (5.1.1)
105
- nio4r (~> 2.0)
106
- rack (2.2.3)
107
- rack-protection (2.1.0)
108
- rack
109
- rack-test (1.1.0)
110
- rack (>= 1.0, < 3)
111
- rails-dom-testing (2.0.3)
112
- activesupport (>= 4.2.0)
113
- nokogiri (>= 1.6)
114
- rails-html-sanitizer (1.3.0)
115
- loofah (~> 2.3)
116
- rainbow (3.0.0)
117
- rake (12.3.3)
118
- regexp_parser (2.0.0)
119
- rexml (3.2.4)
120
- rspec (3.10.0)
121
- rspec-core (~> 3.10.0)
122
- rspec-expectations (~> 3.10.0)
123
- rspec-mocks (~> 3.10.0)
124
- rspec-core (3.10.0)
125
- rspec-support (~> 3.10.0)
126
- rspec-expectations (3.10.0)
127
- diff-lcs (>= 1.2.0, < 2.0)
128
- rspec-support (~> 3.10.0)
129
- rspec-mocks (3.10.0)
130
- diff-lcs (>= 1.2.0, < 2.0)
131
- rspec-support (~> 3.10.0)
132
- rspec-support (3.10.0)
133
- rubocop (1.6.1)
134
- parallel (~> 1.10)
135
- parser (>= 2.7.1.5)
136
- rainbow (>= 2.2.2, < 4.0)
137
- regexp_parser (>= 1.8, < 3.0)
138
- rexml
139
- rubocop-ast (>= 1.2.0, < 2.0)
140
- ruby-progressbar (~> 1.7)
141
- unicode-display_width (>= 1.4.0, < 2.0)
142
- rubocop-ast (1.3.0)
143
- parser (>= 2.7.1.5)
144
- rubocop-faker (1.1.0)
145
- faker (>= 2.12.0)
146
- rubocop (>= 0.82.0)
147
- rubocop-performance (1.9.1)
148
- rubocop (>= 0.90.0, < 2.0)
149
- rubocop-ast (>= 0.4.0)
150
- ruby-progressbar (1.10.1)
151
- ruby2_keywords (0.0.2)
152
- simplecov (0.20.0)
153
- docile (~> 1.1)
154
- simplecov-html (~> 0.11)
155
- simplecov_json_formatter (~> 0.1)
156
- simplecov-html (0.12.3)
157
- simplecov-rcov (0.2.3)
158
- simplecov (>= 0.4.1)
159
- simplecov_json_formatter (0.1.2)
160
- sinatra (2.1.0)
161
- mustermann (~> 1.0)
162
- rack (~> 2.2)
163
- rack-protection (= 2.1.0)
164
- tilt (~> 2.0)
165
- thor (1.0.1)
166
- tilt (2.0.10)
167
- timecop (0.9.2)
168
- tzinfo (2.0.3)
169
- concurrent-ruby (~> 1.0)
170
- unicode-display_width (1.7.0)
171
- vcr (6.0.0)
172
- webmock (3.10.0)
173
- addressable (>= 2.3.6)
174
- crack (>= 0.3.2)
175
- hashdiff (>= 0.4.0, < 2.0.0)
176
- yard (0.9.25)
177
- zeitwerk (2.4.2)
178
-
179
- PLATFORMS
180
- ruby
181
-
182
- DEPENDENCIES
183
- bundler
184
- bundler-audit
185
- dip
186
- dotenv
187
- faker
188
- omniauth-forge!
189
- overcommit
190
- pry-byebug
191
- puma
192
- rake (~> 12.0)
193
- rspec (~> 3.0)
194
- rubocop
195
- rubocop-faker
196
- rubocop-performance
197
- simplecov
198
- simplecov-rcov
199
- sinatra
200
- timecop
201
- vcr
202
- webmock
203
- yard
204
-
205
- BUNDLED WITH
206
- 2.1.4