omniauth-vitsme 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: aa0610f9d0d2e8dd9f3712a4f5b071a5fd680d2218e8b6155e3383d95c191da1
4
- data.tar.gz: cdf33cdcb3b192bd2ba1e05dd9836d4078fe9da5caa221b370746ebba2fd146a
3
+ metadata.gz: 8d349b546c14e9d6f7ec72ccd03a9aac7e8db44d711523c12d904a210cb65c1c
4
+ data.tar.gz: 839203e14305b75c1bdec348436be83745a9c582cf9dc37360d2421a6dbce54d
5
5
  SHA512:
6
- metadata.gz: f317e9bafb4ad03afcb8bbbe582e322c4d2da73f5adb9d30a11c44b04aa2b1913f0ff9350c1450bc5a7e48583339084e45c6248baecca57d27c1fed01379af87
7
- data.tar.gz: 1706fb04b709cc4577f76095c2416b58a767c24e2feab20341a2a78fe7c0a0cc41205e10448ea7aecd0ddfd18645f07337ea703b54057275f993088b366a3ce8
6
+ metadata.gz: 645645d4761352f621b88994d6d95d53a9d9ef882b5e878b68f137153cd95ed13a514507dbcc070ce4c352381aeb9fe19da415716678c5781030cb7793d99659
7
+ data.tar.gz: 90749983f5c6ba32121b08bebcf34d36fbeaf387d7fb5bd7268a3312fc589b9345300238f9b1e60f43a62211953de22c180a0b3fff998c06936918dfb1b81704
data/AGENTS.md CHANGED
@@ -38,10 +38,16 @@ person's verified details to another.
38
38
  end users.
39
39
  10. **Handle every failure type** in [README.md#failure-types](README.md#failure-types):
40
40
  `not_signed_in`, `identity_mismatch`, `unverified_identity`, `nationality_gate_refused`,
41
- `access_denied`.
41
+ `site_suspended`, `access_denied`.
42
+ 11. **Ask only for scopes the site registered.** Its page at vits.me/developer sets which it may ask
43
+ for, and vits.me refuses a request for any other. `il_government_id_number` is enabled by vits.me
44
+ on request, per site.
42
45
 
43
46
  ## Doing the work
44
47
 
48
+ - Credentials: the person registers the site at [vits.me/developer](https://vits.me/developer) with
49
+ their verified account. You can't do it for them: it takes their pincode, and the secret is shown
50
+ to them once.
45
51
  - Rails: `bin/rails g omniauth_vitsme:install` (see `--help`) writes the initializer, controller,
46
52
  locales, button and migration correctly. Prefer it to hand-writing.
47
53
  - Tests: `require "omniauth/vitsme/test"`, then `OmniAuth::Vitsme::Test.mock_auth(...)` /
data/CHANGELOG.md CHANGED
@@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ## [0.3.0] - 2026-11-05
11
+
12
+ ### Added
13
+
14
+ - vits.me can suspend a site. Its sign-ins come back as the new failure type `:site_suspended`
15
+ (`vitsme_error=application_suspended`, in `data/claims.json`'s refusals), and the generator's
16
+ locales carry a message for it that doesn't name vits.me.
17
+
18
+ ### Changed
19
+
20
+ - Credentials no longer come from the vits.me team: any verified person registers a site at
21
+ vits.me/developer. The README, AGENTS.md and the skill say how, including the testing and public
22
+ states, loopback redirect URIs for local development, and the secret shown once. AGENTS.md adds that
23
+ a site may ask only for the scopes it registered; vits.me now sends such a request back as
24
+ `:invalid_scope`, listed in the README's failure types.
25
+
8
26
  ## [0.2.1] - 2026-11-02
9
27
 
10
28
  ### Fixed
data/README.md CHANGED
@@ -26,7 +26,7 @@ rules built in.
26
26
 
27
27
  ```ruby
28
28
  # Gemfile
29
- gem "omniauth-vitsme", "~> 0.2"
29
+ gem "omniauth-vitsme", "~> 0.3"
30
30
  gem "omniauth-rails_csrf_protection" # OmniAuth 2 starts sign-in by POST only
31
31
  ```
32
32
 
@@ -52,8 +52,12 @@ end
52
52
  <%= button_to "Sign in", "/auth/vitsme", method: :post, data: { turbo: false } %>
53
53
  ```
54
54
 
55
- Client credentials come from the vits.me team: there is no self-service registration yet. Register
56
- `https://<your host>/auth/vitsme/callback` (and one callback per extra provider) as redirect URIs.
55
+ Register your site at [vits.me/developer](https://vits.me/developer): any verified person can, after
56
+ accepting the developer terms. Add `https://<your host>/auth/vitsme/callback` (and one callback per
57
+ extra provider) as redirect URIs, plus `http://127.0.0.1:<port>/auth/vitsme/callback` for local
58
+ development. The client secret is shown once, when it is created or rotated. A new site starts in
59
+ testing: it works end to end, and the sign-in screen tells people it is still being tested until you
60
+ add a privacy policy URL and a contact and make it public.
57
61
 
58
62
  ## Environments
59
63
 
@@ -178,6 +182,8 @@ OmniAuth sends failures to `OmniAuth.config.on_failure` (in Rails, `/auth/failur
178
182
  | `:identity_mismatch` | The answer was about someone other than `expected_uid`, whether caught by vits.me or by the callback. |
179
183
  | `:unverified_identity` | A pending (`fluid_`) identity, refused by `require_verified`. |
180
184
  | `:nationality_gate_refused` | The person doesn't hold a nationality the gate requires (or is unverified). |
185
+ | `:site_suspended` | vits.me has suspended your site; nobody can sign in until it is lifted. Your site's page in the developer area says why. |
186
+ | `:invalid_scope` | The app asked for a scope its registration doesn't include. Tick it on your site's page at vits.me/developer (the Israeli ID number needs vits.me to enable it). |
181
187
  | `:access_denied` | Any other refusal, e.g. the person cancelled. |
182
188
  | others | From omniauth_openid_connect: `:csrf_detected`, `:invalid_grant`, `:timeout`, … |
183
189
 
@@ -241,7 +247,7 @@ still run on the mock. A verify provider's `expected_uid` and `require_verified`
241
247
  answer exactly as they would a real one: mock the signed-in person's uid to pass, or someone else's
242
248
  to see `:identity_mismatch`. A mocked earlier uid (`defunct_uids:`) matches as it does in
243
249
  production. `mock_failure` simulates refusals that only vits.me can make, such as
244
- `:nationality_gate_refused` or `:access_denied`.
250
+ `:nationality_gate_refused`, `:site_suspended` or `:access_denied`.
245
251
 
246
252
  [examples/rails/app.rb](examples/rails/app.rb) is a one-file Rails app using sign-in, a gate and
247
253
  verification. The test suite boots it against a stubbed vits.me.
@@ -250,7 +256,7 @@ verification. The test suite boots it against a stubbed vits.me.
250
256
 
251
257
  | Option | Default | |
252
258
  |---|---|---|
253
- | `client_id`, `client_secret` | required | From the vits.me team |
259
+ | `client_id`, `client_secret` | required | From your site's page at [vits.me/developer](https://vits.me/developer) |
254
260
  | `environment` | `:production` | `:production`, `:staging`, `:development` |
255
261
  | `issuer` | from `environment` | |
256
262
  | `scope` | `[:openid]` | Validated against [data/claims.json](data/claims.json) |
data/data/claims.json CHANGED
@@ -164,6 +164,11 @@
164
164
  "error": "access_denied",
165
165
  "omniauth_failure": "identity_mismatch",
166
166
  "description": "The site said whom it expected (claims sub value) and a different person is signed in at vits.me."
167
+ },
168
+ "application_suspended": {
169
+ "error": "access_denied",
170
+ "omniauth_failure": "site_suspended",
171
+ "description": "vits.me has suspended this site. Nobody can sign in to it until the suspension is lifted; its owner sees why on the site's page in the developer area."
167
172
  }
168
173
  },
169
174
  "lifetimes_seconds": {
@@ -11,3 +11,4 @@ en:
11
11
  identity_mismatch: "That answer was about a different account than the one signed in here."
12
12
  unverified_identity: "This needs a verified account. Finish verifying, then try again."
13
13
  nationality_gate_refused: "Only verified nationals of the required countries can join."
14
+ site_suspended: "Signing in is unavailable right now. Please try again later."
@@ -11,3 +11,4 @@ he:
11
11
  identity_mismatch: "התשובה התייחסה לחשבון אחר מזה שמחובר כאן."
12
12
  unverified_identity: "נדרש חשבון מאומת. אפשר להשלים את האימות ולנסות שוב."
13
13
  nationality_gate_refused: "רק אזרחים מאומתים של המדינות הנדרשות יכולים להצטרף."
14
+ site_suspended: "ההתחברות לא זמינה כרגע. אפשר לנסות שוב מאוחר יותר."
@@ -62,7 +62,7 @@ module OmniAuth
62
62
  # others. The callback checks either way.
63
63
  option :send_expected_uid, true
64
64
 
65
- FAILURES = %i[identity_mismatch not_signed_in unverified_identity nationality_gate_refused].freeze
65
+ FAILURES = %i[identity_mismatch not_signed_in unverified_identity nationality_gate_refused site_suspended].freeze
66
66
 
67
67
  def initialize(app, *args, &)
68
68
  super
@@ -18,7 +18,7 @@ module OmniAuth
18
18
  # and the typed claims look exactly as they will in production. Test mode skips the trip to vits.me
19
19
  # but still runs the strategy's identity checks (expected_uid, require_verified) on the mock: mock
20
20
  # someone other than the signed-in person to see :identity_mismatch. mock_failure is for refusals
21
- # only vits.me makes (:nationality_gate_refused, :access_denied).
21
+ # only vits.me makes (:nationality_gate_refused, :site_suspended, :access_denied).
22
22
  module Test
23
23
  module_function
24
24
 
@@ -58,7 +58,7 @@ module OmniAuth
58
58
  end
59
59
 
60
60
  # Makes the next callback for `provider` fail with `type` (e.g. :identity_mismatch, :not_signed_in,
61
- # :unverified_identity, :nationality_gate_refused, :access_denied).
61
+ # :unverified_identity, :nationality_gate_refused, :site_suspended, :access_denied).
62
62
  def mock_failure(provider = :vitsme, type = :access_denied)
63
63
  OmniAuth.config.mock_auth[provider.to_sym] = type.to_sym
64
64
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Vitsme
5
- VERSION = '0.2.1'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-vitsme
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
  - Yuval Tobias