omniauth-skubana 0.2.0 → 0.2.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/CHANGELOG.md +20 -0
- data/README.md +34 -8
- data/VERSION +1 -0
- data/lib/omniauth/strategies/skubana.rb +27 -2
- data/lib/omniauth-skubana/version.rb +3 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80d19c6f5ab2fb372a01532cfb1814e2ae34efbf840323a89f8c425a399a780d
|
|
4
|
+
data.tar.gz: 19781d6be1140de429cb33a8580fcc37ac67a7eb9699c18b149f500323e25d8c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: da2d068c3a63273dba2e8449ca7b339c52385c57a1a4390a312b112a2a9f7eb79d8bf8e96fa4e8e1d9a69ef043da0541ee085e6f04c911c2ab59a1b2eb42cd58
|
|
7
|
+
data.tar.gz: 402082bfeb8a1716ac77c34eca629f1014928eec66202cae4e6d715297a8d4cf48052ad831e70dc202a82a5e81ec7a9024b994c91419398da566032670f8bd7d
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **Breaking:** the OAuth `state` check is enforced. The strategy no longer sets
|
|
10
|
+
`provider_ignores_state`, so a callback whose `state` is missing or doesn't match the
|
|
11
|
+
session fails with `csrf_detected`. App Store installs need `app_store_install`.
|
|
12
|
+
- The gem version now comes from the release tag. `lib/omniauth-skubana/version.rb` reads
|
|
13
|
+
a top-level `VERSION` file, committed as a `0.0.0` placeholder, which the release
|
|
14
|
+
workflow writes from the tag with its leading `v` stripped.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- `app_store_install` option, for a provider registered with its callback at the URI
|
|
19
|
+
registered for the app with Skubana. An App Store install arrives there with `cid` and
|
|
20
|
+
`code` but no `state`: such callbacks skip the state check and exchange the code with
|
|
21
|
+
`redirect_uri=<callback URL>?cid=<cid>`, as Skubana requires. Previously such codes
|
|
22
|
+
failed with `invalid_grant`.
|
|
23
|
+
|
|
5
24
|
## [0.2.0] - 2026-10-19
|
|
6
25
|
|
|
7
26
|
### Changed
|
|
@@ -47,6 +66,7 @@ All notable changes to this project are documented in this file.
|
|
|
47
66
|
|
|
48
67
|
- Initial published strategy.
|
|
49
68
|
|
|
69
|
+
[Unreleased]: https://github.com/dropstream/omniauth-skubana/compare/v0.2.0...master
|
|
50
70
|
[0.2.0]: https://github.com/dropstream/omniauth-skubana/releases/tag/v0.2.0
|
|
51
71
|
[0.1.2]: https://rubygems.org/gems/omniauth-skubana/versions/0.1.2
|
|
52
72
|
[0.1.0]: https://rubygems.org/gems/omniauth-skubana/versions/0.1.0
|
data/README.md
CHANGED
|
@@ -64,6 +64,31 @@ otherwise append, because Skubana rejects a `redirect_uri` that does not match t
|
|
|
64
64
|
registered one exactly. Pass `callback_url` to override it outright; otherwise it is
|
|
65
65
|
derived from the request, including the mount prefix.
|
|
66
66
|
|
|
67
|
+
### App Store installs
|
|
68
|
+
|
|
69
|
+
An install from Skubana's App Store doesn't go through the request phase: Skubana
|
|
70
|
+
redirects straight to the callback URI registered for the app with `?cid=...&code=...`,
|
|
71
|
+
and no `state`. The code is bound to that registered URI, and must be exchanged with
|
|
72
|
+
`redirect_uri=<registered URI>?cid=<cid>`.
|
|
73
|
+
|
|
74
|
+
To accept App Store installs, register the strategy a second time, under its own name,
|
|
75
|
+
with its callback at the registered URI and `app_store_install` set:
|
|
76
|
+
|
|
77
|
+
```ruby
|
|
78
|
+
provider :skubana, 'app_key', 'app_secret',
|
|
79
|
+
:name => 'skubana_app_store',
|
|
80
|
+
:callback_path => '/apps/skubana/install',
|
|
81
|
+
:callback_url => 'https://www.example.com/apps/skubana/install',
|
|
82
|
+
:request_path => ->(_env) { false },
|
|
83
|
+
:app_store_install => true
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
On that provider, a callback that carries a `cid` and no `state` skips OmniAuth's CSRF
|
|
87
|
+
state check and is exchanged with the `cid` appended. Any other callback is checked as
|
|
88
|
+
usual. Note what accepting installs gives up: anyone can send a signed-in user to that
|
|
89
|
+
URI with a `cid` and `code` of their own, and the user's account gets connected to that
|
|
90
|
+
Skubana account.
|
|
91
|
+
|
|
67
92
|
### Client credentials in the token request
|
|
68
93
|
|
|
69
94
|
`client_options[:auth_scheme]` is pinned to `:basic_auth`, because Skubana expects the
|
|
@@ -85,20 +110,21 @@ GitHub Actions builds and publishes the gem to [rubygems.org](https://rubygems.o
|
|
|
85
110
|
[RubyGems trusted publishing](https://guides.rubygems.org/trusted-publishing/), so no API
|
|
86
111
|
key is stored in the repo and the gemspec can keep `rubygems_mfa_required`.
|
|
87
112
|
|
|
88
|
-
1.
|
|
89
|
-
|
|
90
|
-
|
|
113
|
+
1. Add a `CHANGELOG.md` section for the new version, along with a link definition for the
|
|
114
|
+
new heading at the bottom of that file, and merge it to `master`. There is no version
|
|
115
|
+
to bump: the committed `VERSION` file is a `0.0.0` placeholder.
|
|
91
116
|
2. Draft a new release with the target set to `master` and the tag set to the version
|
|
92
|
-
prefixed with `v` — `v0.
|
|
93
|
-
|
|
117
|
+
prefixed with `v` — `v0.3.0`, not `0.3.0`. The workflow strips the `v` and uses the
|
|
118
|
+
rest as the gem version.
|
|
94
119
|
3. Click **Generate release notes** — the preferred method — then publish. The generated
|
|
95
120
|
notes list the merged pull requests; `CHANGELOG.md` carries the curated prose and
|
|
96
121
|
links back to each release.
|
|
97
122
|
|
|
98
123
|
Publishing creates the tag, which fires the `Release` workflow: it reruns the full test
|
|
99
|
-
matrix, refuses to continue
|
|
100
|
-
|
|
101
|
-
|
|
124
|
+
matrix, refuses to continue unless the tag looks like `vX.Y.Z`, writes the version into
|
|
125
|
+
`VERSION` (and `Gemfile.lock`) in its own checkout, and pushes the gem. That change is
|
|
126
|
+
never pushed back to the repo. Note that RubyGems versions are immutable — a bad release
|
|
127
|
+
can be yanked, never replaced, so double-check the tag before publishing.
|
|
102
128
|
|
|
103
129
|
### One-time RubyGems setup
|
|
104
130
|
|
data/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.2.1
|
|
@@ -18,15 +18,40 @@ module OmniAuth
|
|
|
18
18
|
|
|
19
19
|
option :callback_url
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
# Set on a provider registered for App Store installs, with its
|
|
22
|
+
# callback_path at the callback URI registered for the app with Skubana.
|
|
23
|
+
# An install is started by Skubana, not by us: it redirects there with
|
|
24
|
+
# `?cid=...&code=...` and no state to check. Accepting that means anyone
|
|
25
|
+
# can deliver a code of their choosing to a signed-in user's callback, so
|
|
26
|
+
# installs are only handled when the host app sets this.
|
|
27
|
+
option :app_store_install, false
|
|
28
|
+
|
|
29
|
+
def callback_phase
|
|
30
|
+
# Safe to change: OmniAuth dups the options for every request.
|
|
31
|
+
options.provider_ignores_state = true if app_store_install?
|
|
32
|
+
super
|
|
33
|
+
end
|
|
22
34
|
|
|
23
35
|
# OmniAuth::Strategy#callback_url appends the callback request's own query
|
|
24
36
|
# string, which would send those params to Skubana as part of redirect_uri.
|
|
25
37
|
# Skubana requires redirect_uri to exactly match the URI registered for the
|
|
26
38
|
# app. Note that omniauth 2's `callback_path` already carries SCRIPT_NAME,
|
|
27
39
|
# so mount prefixes must not be added again.
|
|
40
|
+
#
|
|
41
|
+
# An App Store install's code must be exchanged with
|
|
42
|
+
# `redirect_uri=<registered URI>?cid=<cid>`.
|
|
28
43
|
def callback_url
|
|
29
|
-
options[:callback_url] || (full_host + callback_path)
|
|
44
|
+
url = options[:callback_url] || (full_host + callback_path)
|
|
45
|
+
app_store_install? ? "#{url}?cid=#{request.params["cid"]}" : url
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
def app_store_install?
|
|
51
|
+
return false unless options.app_store_install && @env
|
|
52
|
+
|
|
53
|
+
cid = request.params["cid"]
|
|
54
|
+
cid.is_a?(String) && !cid.empty? && request.params["state"].to_s.empty?
|
|
30
55
|
end
|
|
31
56
|
end
|
|
32
57
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-skubana
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Karl Falconer
|
|
@@ -53,6 +53,7 @@ files:
|
|
|
53
53
|
- CHANGELOG.md
|
|
54
54
|
- LICENSE.txt
|
|
55
55
|
- README.md
|
|
56
|
+
- VERSION
|
|
56
57
|
- lib/omniauth-skubana.rb
|
|
57
58
|
- lib/omniauth-skubana/version.rb
|
|
58
59
|
- lib/omniauth/strategies/skubana.rb
|