omniauth-skubana 0.1.0 → 0.2.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
- SHA1:
3
- metadata.gz: 9cf036ae19f6d3d5b24a4f0bc7d64a84e754ed7c
4
- data.tar.gz: 001c844592b32d93df32836d4ee2f4517c69529f
2
+ SHA256:
3
+ metadata.gz: cf465c6f804232f21358d25a1ec37d8b19d21f45b1809152ba04d6fed6cc1a37
4
+ data.tar.gz: d0f3400463df8476a185831e61edd0812f82a8b83c84e3851ef69ab5f866adc4
5
5
  SHA512:
6
- metadata.gz: 7a907ac03ca8fc356b9703f97e911945164b83a466ca7baf918adde30a06b5f3e7a12e7cf1bdf05556193bce69275dce72c11868f7fe57b0e5b15ce38a9b1097
7
- data.tar.gz: 13b172b80fd2d0de7a335169a26dd4c40073b73d762bb78ddedd1c3ec7d5d1172dc72641a3dc6c073c71a7f28836a22f7541f9d15cfee4f2abae7f54b95ad7e5
6
+ metadata.gz: 5c4439c2a44cb8da6d4b3b472a1d95c0f548558ac71d15778d026256d0a78ed907bf0122e8afbc0a977bbbcce265995de9da1d07338a2123686c8277eff2ca30
7
+ data.tar.gz: c2e35dc901b768e97b991c5496781bff14e95784cc1111aaad73995ad9dd8bfc394cb7f4d81179ba7f059c056aef1001c2929eb4239aae018866d8ec3a90c35c
data/CHANGELOG.md ADDED
@@ -0,0 +1,52 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ ## [0.2.0] - 2026-10-19
6
+
7
+ ### Changed
8
+
9
+ - **Breaking:** requires `omniauth ~> 2.0` and `omniauth-oauth2 >= 1.8, < 2` (previously an
10
+ unpinned `omniauth-oauth2`). Host applications must be on OmniAuth 2.x; Rails apps also
11
+ need [`omniauth-rails_csrf_protection`](https://github.com/cookpad/omniauth-rails_csrf_protection)
12
+ because OmniAuth 2 only accepts `POST` for the request phase.
13
+ - Requires Ruby >= 3.2.
14
+ - The token request now authenticates through `client_options[:auth_scheme] = :basic_auth`
15
+ instead of a hand-built `Authorization` header. On `oauth2` 2.x this sends the same
16
+ request as before; on `oauth2` 1.x it also stops sending `client_id`/`client_secret` in
17
+ the token request body. This removes the `base64` require, which is no longer a default
18
+ gem as of Ruby 3.4.
19
+ - Development toolchain: Bundler 4.x, `rake ~> 13.0`, `rspec ~> 3.13`.
20
+ - Replaced Travis CI with GitHub Actions, testing Ruby 3.2 through 3.4.
21
+ - Releases are now cut from the GitHub Releases UI: publishing a `vX.Y.Z` release reruns
22
+ the matrix, checks the tag against `version.rb`, and publishes to RubyGems.org via
23
+ trusted publishing (OIDC, no stored API key).
24
+
25
+ ### Added
26
+
27
+ - `LICENSE.txt` (MIT), now declared in the gemspec.
28
+ - Integration specs covering the request phase, the token exchange, the `redirect_uri`
29
+ and the auth hash.
30
+ - A weekly `bundle-audit` run, so a new advisory against the locked `oauth2`/`rack`
31
+ chain surfaces here rather than in a consuming app.
32
+
33
+ ### Fixed
34
+
35
+ - `callback_url` drops the request's query string, so `/auth/skubana?type=shopping` no
36
+ longer sends a `redirect_uri` that does not match the one registered with Skubana, and
37
+ a mount prefix is included only once. (This was tagged as `v0.1.3` but never published
38
+ to RubyGems.)
39
+ - `bin/console` required a non-existent `omniauth/skubana` file.
40
+ - Development scripts in `bin/` and other scaffolding are no longer packaged in the gem.
41
+
42
+ ## [0.1.2] - 2020-05-21
43
+
44
+ - Upgraded `omniauth-oauth2` and removed its version constraint.
45
+
46
+ ## [0.1.0] - 2016-08-25
47
+
48
+ - Initial published strategy.
49
+
50
+ [0.2.0]: https://github.com/dropstream/omniauth-skubana/releases/tag/v0.2.0
51
+ [0.1.2]: https://rubygems.org/gems/omniauth-skubana/versions/0.1.2
52
+ [0.1.0]: https://rubygems.org/gems/omniauth-skubana/versions/0.1.0
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016-2026 Dropstream
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # OmniAuth Skubana
2
2
 
3
- This is an OmniAuth strategy for authenticating to Skubana. To use it, you'll need to sign up as an App Developer with
3
+ This is an OmniAuth strategy for authenticating to Skubana. To use it, you'll need to sign up as an App Developer with
4
4
  Skubana to receive an AppKey and AppSecret.
5
5
 
6
+ Requires Ruby >= 3.2, OmniAuth 2.x and `omniauth-oauth2` 1.8 or later.
7
+
6
8
  ## Installation
7
9
 
8
10
  Add this line to your application's Gemfile:
@@ -21,21 +23,94 @@ Or install it yourself as:
21
23
 
22
24
  ## Usage
23
25
 
24
- ````ruby
25
- OmniAuth::Builder do
26
- provider :skubana,
27
- 'app_key', 'app_secret',
28
- :callback_url => "http://www.example.com/auth/skubana/callback",
29
- :scope => 'read_inventory+write_inventory'
26
+ OmniAuth 2 only accepts `POST` for the request phase. In a Rails app, add
27
+ [`omniauth-rails_csrf_protection`](https://github.com/cookpad/omniauth-rails_csrf_protection)
28
+ to your Gemfile and link to the provider with `button_to` or `link_to ..., method: :post`.
30
29
 
30
+ ```ruby
31
+ Rails.application.config.middleware.use OmniAuth::Builder do
32
+ provider :skubana,
33
+ 'app_key', 'app_secret',
34
+ :callback_url => "http://www.example.com/auth/skubana/callback",
35
+ :scope => 'read_inventory write_inventory'
31
36
  end
32
- ````
37
+ ```
38
+
39
+ Scopes are space-separated. Don't join them with `+`: it is sent encoded as `%2B`, and
40
+ Skubana rejects it with `invalid_scope`.
41
+
42
+ The auth hash carries the token under `credentials`:
43
+
44
+ ```ruby
45
+ auth = request.env['omniauth.auth']
46
+ auth['credentials']['token']
47
+ ```
48
+
49
+ ## Configuring
50
+
51
+ ### Configure the site
52
+
53
+ `client_options[:site]` defaults to `https://app.skubana.com`. Point it elsewhere to
54
+ authenticate against Skubana's demo environment:
55
+
56
+ ```ruby
57
+ :client_options => { :site => 'https://demo.skubana.com' }
58
+ ```
59
+
60
+ ### Configure the callback URL
61
+
62
+ The strategy overrides `callback_url` to drop the query string that OmniAuth would
63
+ otherwise append, because Skubana rejects a `redirect_uri` that does not match the
64
+ registered one exactly. Pass `callback_url` to override it outright; otherwise it is
65
+ derived from the request, including the mount prefix.
66
+
67
+ ### Client credentials in the token request
68
+
69
+ `client_options[:auth_scheme]` is pinned to `:basic_auth`, because Skubana expects the
70
+ AppKey and AppSecret as HTTP Basic auth on the token request.
33
71
 
34
72
  ## Development
35
73
 
36
- 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.
74
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
75
+
76
+ To install this gem onto your local machine, run `bundle exec rake install`.
77
+
78
+ Run `bundle exec bundle-audit check --update` to check the locked dependency tree against
79
+ the advisory database; CI runs the same check weekly.
80
+
81
+ ## Releasing
82
+
83
+ Releases are cut from the [GitHub Releases UI](https://github.com/dropstream/omniauth-skubana/releases/new);
84
+ GitHub Actions builds and publishes the gem to [rubygems.org](https://rubygems.org) via
85
+ [RubyGems trusted publishing](https://guides.rubygems.org/trusted-publishing/), so no API
86
+ key is stored in the repo and the gemspec can keep `rubygems_mfa_required`.
87
+
88
+ 1. Bump `VERSION` in `lib/omniauth-skubana/version.rb` and add a `CHANGELOG.md` section
89
+ for it, along with a link definition for the new heading at the bottom of that file.
90
+ Commit both on `master`.
91
+ 2. Draft a new release with the target set to `master` and the tag set to the version
92
+ prefixed with `v` — `v0.2.0`, not `0.2.0`. The prefix is stripped before comparing
93
+ against `version.rb`; the gem version itself carries no `v`.
94
+ 3. Click **Generate release notes** — the preferred method — then publish. The generated
95
+ notes list the merged pull requests; `CHANGELOG.md` carries the curated prose and
96
+ links back to each release.
97
+
98
+ Publishing creates the tag, which fires the `Release` workflow: it reruns the full test
99
+ matrix, refuses to continue if the tag and `version.rb` disagree, and pushes the gem.
100
+ Note that RubyGems versions are immutable — a bad release can be yanked, never replaced,
101
+ so the version bump has to be committed before the release is published.
102
+
103
+ ### One-time RubyGems setup
104
+
105
+ Needed before the first release from CI, and again only if the gem is renamed or moved:
106
+ on rubygems.org open the gem -> **Trusted publishers** -> **Create**, with owner
107
+ `dropstream`, repository `omniauth-skubana`, workflow `release.yml`, and environment
108
+ `release`. The repo also needs an environment named `release`.
37
109
 
38
110
  ## Contributing
39
111
 
40
112
  Bug reports and pull requests are welcome on GitHub at https://github.com/dropstream/omniauth-skubana.
41
113
 
114
+ ## License
115
+
116
+ Available as open source under the terms of the [MIT License](LICENSE.txt).
@@ -1,5 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'omniauth-oauth2'
2
- require 'base64'
3
4
 
4
5
  module OmniAuth
5
6
  module Strategies
@@ -8,25 +9,25 @@ module OmniAuth
8
9
  option :client_options, {
9
10
  :authorize_url => '/oauth/authorize',
10
11
  :token_url => '/oauth/token',
11
- :site => 'https://app.skubana.com'
12
+ :site => 'https://app.skubana.com',
13
+ # Skubana expects the client credentials as HTTP Basic auth on the token
14
+ # request. Pinned so it doesn't depend on the oauth2 version's default
15
+ # (oauth2 1.x defaulted to :request_body).
16
+ :auth_scheme => :basic_auth
12
17
  }
13
18
 
14
19
  option :callback_url
15
-
20
+
16
21
  option :provider_ignores_state, true
17
-
18
- protected
19
22
 
20
- def build_access_token
21
- options.token_params.merge!(:headers => {'Authorization' => basic_auth_header })
22
- super
23
+ # OmniAuth::Strategy#callback_url appends the callback request's own query
24
+ # string, which would send those params to Skubana as part of redirect_uri.
25
+ # Skubana requires redirect_uri to exactly match the URI registered for the
26
+ # app. Note that omniauth 2's `callback_path` already carries SCRIPT_NAME,
27
+ # so mount prefixes must not be added again.
28
+ def callback_url
29
+ options[:callback_url] || (full_host + callback_path)
23
30
  end
24
-
25
- private
26
-
27
- def basic_auth_header
28
- "Basic " + Base64.strict_encode64("#{options[:client_id]}:#{options[:client_secret]}")
29
- end
30
31
  end
31
32
  end
32
33
  end
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OmniAuth
2
4
  module Skubana
3
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
4
6
  end
5
7
  end
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'omniauth-skubana/version'
2
4
  require 'omniauth/strategies/skubana'
@@ -1,34 +1,37 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path("lib", __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'omniauth-skubana/version'
5
+ require "omniauth-skubana/version"
5
6
 
6
7
  Gem::Specification.new do |spec|
7
8
  spec.name = "omniauth-skubana"
8
9
  spec.version = OmniAuth::Skubana::VERSION
9
10
  spec.authors = ["Karl Falconer"]
10
- spec.email = ["karl.falconer@falconerdevelopment.com"]
11
+ spec.email = ["karl.falconer@getdropstream.com"]
11
12
 
12
- spec.summary = %q{OmniAuth strategy for Skubana}
13
- spec.description = %q{In this gem you will find an OmniAuth Skubana strategy.}
13
+ spec.summary = "OmniAuth strategy for Skubana"
14
+ spec.description = "In this gem you will find an OmniAuth Skubana strategy."
14
15
  spec.homepage = "https://github.com/dropstream/omniauth-skubana"
16
+ spec.license = "MIT"
15
17
 
16
- # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
17
- # delete this section to allow pushing this gem to any host.
18
- if spec.respond_to?(:metadata)
19
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
20
- else
21
- raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22
- end
18
+ spec.required_ruby_version = ">= 3.2"
23
19
 
24
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
- spec.bindir = "exe"
26
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
- spec.require_paths = ["lib"]
20
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
21
+ spec.metadata["homepage_uri"] = spec.homepage
22
+ spec.metadata["source_code_uri"] = spec.homepage
23
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
24
+ spec.metadata["rubygems_mfa_required"] = "true"
28
25
 
29
- spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.1.0'
26
+ # Ship only the library itself; development scaffolding stays out of the gem.
27
+ spec.files = Dir.chdir(__dir__) do
28
+ `git ls-files -z`.split("\x0").reject do |f|
29
+ f.match(%r{\A(?:spec|bin|pkg|\.github)/}) ||
30
+ f.match(%r{\A(?:\.gitignore|\.rspec|\.ruby-version|\.ruby-gemset|Gemfile|Gemfile\.lock|Rakefile)\z})
31
+ end
32
+ end
33
+ spec.require_paths = ["lib"]
30
34
 
31
- spec.add_development_dependency "bundler", "~> 1.10"
32
- spec.add_development_dependency "rake", "~> 10.0"
33
- spec.add_development_dependency "rspec"
35
+ spec.add_dependency "omniauth", "~> 2.0"
36
+ spec.add_dependency "omniauth-oauth2", ">= 1.8", "< 2"
34
37
  end
metadata CHANGED
@@ -1,97 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-skubana
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Falconer
8
- autorequire:
9
- bindir: exe
8
+ bindir: bin
10
9
  cert_chain: []
11
- date: 2016-08-25 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
- name: omniauth-oauth2
13
+ name: omniauth
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: 1.1.0
18
+ version: '2.0'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: 1.1.0
25
+ version: '2.0'
27
26
  - !ruby/object:Gem::Dependency
28
- name: bundler
27
+ name: omniauth-oauth2
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '1.10'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
30
+ - - ">="
39
31
  - !ruby/object:Gem::Version
40
- version: '1.10'
41
- - !ruby/object:Gem::Dependency
42
- name: rake
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
32
+ version: '1.8'
33
+ - - "<"
46
34
  - !ruby/object:Gem::Version
47
- version: '10.0'
48
- type: :development
35
+ version: '2'
36
+ type: :runtime
49
37
  prerelease: false
50
38
  version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '10.0'
55
- - !ruby/object:Gem::Dependency
56
- name: rspec
57
- requirement: !ruby/object:Gem::Requirement
58
39
  requirements:
59
40
  - - ">="
60
41
  - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
42
+ version: '1.8'
43
+ - - "<"
67
44
  - !ruby/object:Gem::Version
68
- version: '0'
45
+ version: '2'
69
46
  description: In this gem you will find an OmniAuth Skubana strategy.
70
47
  email:
71
- - karl.falconer@falconerdevelopment.com
48
+ - karl.falconer@getdropstream.com
72
49
  executables: []
73
50
  extensions: []
74
51
  extra_rdoc_files: []
75
52
  files:
76
- - ".gitignore"
77
- - ".rspec"
78
- - ".ruby-gemset"
79
- - ".ruby-version"
80
- - ".travis.yml"
81
- - Gemfile
53
+ - CHANGELOG.md
54
+ - LICENSE.txt
82
55
  - README.md
83
- - Rakefile
84
- - bin/console
85
- - bin/setup
86
56
  - lib/omniauth-skubana.rb
87
57
  - lib/omniauth-skubana/version.rb
88
58
  - lib/omniauth/strategies/skubana.rb
89
59
  - omniauth-skubana.gemspec
90
60
  homepage: https://github.com/dropstream/omniauth-skubana
91
- licenses: []
61
+ licenses:
62
+ - MIT
92
63
  metadata:
93
64
  allowed_push_host: https://rubygems.org
94
- post_install_message:
65
+ homepage_uri: https://github.com/dropstream/omniauth-skubana
66
+ source_code_uri: https://github.com/dropstream/omniauth-skubana
67
+ changelog_uri: https://github.com/dropstream/omniauth-skubana/blob/master/CHANGELOG.md
68
+ rubygems_mfa_required: 'true'
95
69
  rdoc_options: []
96
70
  require_paths:
97
71
  - lib
@@ -99,16 +73,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
73
  requirements:
100
74
  - - ">="
101
75
  - !ruby/object:Gem::Version
102
- version: '0'
76
+ version: '3.2'
103
77
  required_rubygems_version: !ruby/object:Gem::Requirement
104
78
  requirements:
105
79
  - - ">="
106
80
  - !ruby/object:Gem::Version
107
81
  version: '0'
108
82
  requirements: []
109
- rubyforge_project:
110
- rubygems_version: 2.4.5.1
111
- signing_key:
83
+ rubygems_version: 3.6.9
112
84
  specification_version: 4
113
85
  summary: OmniAuth strategy for Skubana
114
86
  test_files: []
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- omniauth-skubana
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- ruby-2.2.3
data/.travis.yml DELETED
@@ -1,4 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.1.2
4
- before_install: gem install bundler -v 1.10.6
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in omniauth-skubana.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "omniauth/skubana"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
-
5
- bundle install
6
-
7
- # Do any other automated setup that you need to do here