omniauth-vitsme 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a95f27003ba5e85db4705861d35ebbb62a8d4701a7494d01faec43144d4f4749
4
+ data.tar.gz: ab6049d8756893307f0076cc75c2f14f83042de57f292f1031ab052dfbec922e
5
+ SHA512:
6
+ metadata.gz: 0dcb9ba6a03dac71969ed404f4e41d47cc47d21b2ca710ea55b36720afdbe11e8750347141f8cc6abdfaebfb65c95154be52655181626b7ae8740aa944580d82
7
+ data.tar.gz: e0980bf755901669c8c3eb2ea70dc4ab79532a6ee4adad032f940ffaa7ed19a8035f479197002bab62bbb41c47e912be2bd6085a77e9bdf1bf5386f4450a1594
@@ -0,0 +1,27 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "WebSearch",
5
+ "WebFetch(domain:vits.me)",
6
+ "WebFetch(domain:github.com)",
7
+ "WebFetch(domain:rubygems.org)",
8
+ "WebFetch(domain:msuliq.medium.com)",
9
+ "Bash(gem contents:*)",
10
+ "Bash(gem list:*)",
11
+ "WebFetch(domain:raw.githubusercontent.com)",
12
+ "Bash(curl:*)",
13
+ "Bash(python3:*)",
14
+ "Bash(ruby --version:*)",
15
+ "Bash(git init:*)",
16
+ "Bash(git add:*)",
17
+ "Bash(git commit:*)",
18
+ "Bash(bundle install:*)",
19
+ "Bash(bundle exec rspec:*)",
20
+ "Bash(bundle show:*)",
21
+ "Bash(bundle exec rubocop:*)",
22
+ "Bash(bundle update:*)",
23
+ "Bash(gem build:*)",
24
+ "Bash(bundle exec rake:*)"
25
+ ]
26
+ }
27
+ }
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rspec_status ADDED
@@ -0,0 +1,29 @@
1
+ example_id | status | run_time |
2
+ ------------------------------------------------- | ------ | --------------- |
3
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:1:1] | passed | 0.00013 seconds |
4
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:1:2] | passed | 0.00034 seconds |
5
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:1:3] | passed | 0.00014 seconds |
6
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:1:4] | passed | 0.00013 seconds |
7
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:1:5] | passed | 0.00026 seconds |
8
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:1:6] | passed | 0.00014 seconds |
9
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:1:7] | passed | 0.00014 seconds |
10
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:2:1] | passed | 0.00014 seconds |
11
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:2:2] | passed | 0.00014 seconds |
12
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:2:3] | passed | 0.00014 seconds |
13
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:2:4] | passed | 0.00014 seconds |
14
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:2:5] | passed | 0.00014 seconds |
15
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:2:6] | passed | 0.00013 seconds |
16
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:2:7] | passed | 0.00014 seconds |
17
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:3:1] | passed | 0.00015 seconds |
18
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:3:2] | passed | 0.00056 seconds |
19
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:4:1] | passed | 0.00024 seconds |
20
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:4:2] | passed | 0.00031 seconds |
21
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:4:3] | passed | 0.0003 seconds |
22
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:4:4] | passed | 0.00031 seconds |
23
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:4:5] | passed | 0.00033 seconds |
24
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:4:6] | passed | 0.00031 seconds |
25
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:4:7] | passed | 0.00033 seconds |
26
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:4:8] | passed | 0.00042 seconds |
27
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:4:9] | passed | 0.00098 seconds |
28
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:4:10] | passed | 0.00022 seconds |
29
+ ./spec/omniauth/strategies/vitsme_spec.rb[1:5:1] | passed | 0.00266 seconds |
data/.rubocop.yml ADDED
@@ -0,0 +1,39 @@
1
+ plugins:
2
+ - rubocop-rspec
3
+
4
+ AllCops:
5
+ TargetRubyVersion: 3.0
6
+ NewCops: enable
7
+ SuggestExtensions: false
8
+
9
+ Style/Documentation:
10
+ Enabled: false
11
+
12
+ Style/OpenStructUse:
13
+ Exclude:
14
+ - "spec/**/*"
15
+
16
+ Naming/FileName:
17
+ Exclude:
18
+ - "lib/omniauth-vitsme.rb"
19
+
20
+ Naming/VariableNumber:
21
+ Enabled: false
22
+
23
+ Metrics/BlockLength:
24
+ Exclude:
25
+ - "spec/**/*"
26
+ - "*.gemspec"
27
+
28
+ Metrics/ModuleLength:
29
+ Exclude:
30
+ - "spec/**/*"
31
+
32
+ RSpec/ExampleLength:
33
+ Max: 10
34
+
35
+ RSpec/MultipleExpectations:
36
+ Max: 5
37
+
38
+ RSpec/NestedGroups:
39
+ Max: 4
data/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2026-02-11
9
+
10
+ ### Added
11
+
12
+ - Initial release
13
+ - OmniAuth strategy for vits.me OpenID Connect provider
14
+ - OIDC discovery enabled by default
15
+ - RS256 token signing
16
+ - Support for vits.me scopes: openid, name, nationality, age verification, birthday
17
+ - Convenience `client_id` / `client_secret` top-level options
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 omniauth-vitsme contributors
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 ADDED
@@ -0,0 +1,182 @@
1
+ # OmniAuth vits.me
2
+
3
+ OmniAuth strategy for [vits.me](https://vits.me) (itsme), global digital identity verification platform.
4
+
5
+ Wraps [omniauth_openid_connect](https://github.com/omniauth/omniauth_openid_connect) with vits.me-specific defaults so you only need to supply `client_id` and `client_secret`.
6
+
7
+ ## Installation
8
+
9
+ Add to your Gemfile:
10
+
11
+ ```ruby
12
+ gem "omniauth-vitsme", "~> 0.1"
13
+ ```
14
+
15
+ Then run:
16
+
17
+ ```
18
+ bundle install
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ### Rails (Rack middleware)
24
+
25
+ ```ruby
26
+ Rails.application.config.middleware.use OmniAuth::Builder do
27
+ provider :vitsme,
28
+ client_id: ENV["VITSME_CLIENT_ID"],
29
+ client_secret: ENV["VITSME_CLIENT_SECRET"]
30
+ end
31
+ ```
32
+
33
+ ### With additional scopes
34
+
35
+ ```ruby
36
+ Rails.application.config.middleware.use OmniAuth::Builder do
37
+ provider :vitsme,
38
+ client_id: ENV["VITSME_CLIENT_ID"],
39
+ client_secret: ENV["VITSME_CLIENT_SECRET"],
40
+ scope: [:openid, :name, :age__over_18, :nationality]
41
+ end
42
+ ```
43
+
44
+ ### Devise integration
45
+
46
+ ```ruby
47
+ Devise.setup do |config|
48
+ config.omniauth :vitsme,
49
+ client_id: ENV["VITSME_CLIENT_ID"],
50
+ client_secret: ENV["VITSME_CLIENT_SECRET"],
51
+ scope: [:openid, :name]
52
+ end
53
+ ```
54
+
55
+ ## Available Scopes
56
+
57
+ | Scope | Description |
58
+ |---|---|
59
+ | `openid` | Required. Returns the subject identifier (`sub`). |
60
+ | `name` | Given name and family name |
61
+ | `name__full` | Full name as a single string |
62
+ | `nationality` | ISO country code |
63
+ | `nationality__in_eu` | Whether the user is an EU national |
64
+ | `birthday` / `birthdate` | Date of birth |
65
+ | `birthyear` | Year of birth |
66
+ | `age__over_13` | Age verification (13+) |
67
+ | `age__over_18` | Age verification (18+) |
68
+ | `age__over_21` | Age verification (21+) |
69
+
70
+ ## Auth Hash
71
+
72
+ The auth hash returned in the callback looks like:
73
+
74
+ ```ruby
75
+ {
76
+ provider: "vitsme",
77
+ uid: "pairwise-subject-identifier",
78
+ info: {
79
+ name: "Jane Doe",
80
+ first_name: "Jane",
81
+ last_name: "Doe",
82
+ email: "jane@example.com",
83
+ birthday: "1990-01-15",
84
+ nationality: "IL",
85
+ age_over_13: true,
86
+ age_over_18: true,
87
+ age_over_21: true
88
+ },
89
+ credentials: {
90
+ id_token: "eyJ...",
91
+ token: "access_token_value",
92
+ refresh_token: "refresh_token_value",
93
+ expires_in: 3600,
94
+ scope: "openid name"
95
+ },
96
+ extra: {
97
+ raw_info: {
98
+ sub: "pairwise-subject-identifier",
99
+ name: "Jane Doe",
100
+ # ... all raw claims from the userinfo endpoint
101
+ }
102
+ }
103
+ }
104
+ ```
105
+
106
+ Only requested scopes will appear in `info`. Nil values are omitted via `.compact`.
107
+
108
+ Note: vits.me uses **pairwise subject identifiers** -- the same person will have a different `uid` for each registered client application.
109
+
110
+ ## Configuration
111
+
112
+ This gem is a wrapper for [omniauth_openid_connect](https://github.com/omniauth/omniauth_openid_connect). All configuration options available for `omniauth_openid_connect` can be used with `omniauth-vitsme`. The most common options are listed below.
113
+
114
+ | Option | Default | Description |
115
+ |---|---|---|
116
+ | `client_id` | *required* | Your vits.me client ID |
117
+ | `client_secret` | *required* | Your vits.me client secret |
118
+ | `scope` | `[:openid]` | OIDC scopes to request |
119
+ | `discovery` | `true` | Fetch endpoints from `.well-known/openid-configuration` |
120
+ | `issuer` | `https://vits.me` | OIDC issuer URL |
121
+ | `response_type` | `code` | OAuth response type (Authorization Code Flow) |
122
+
123
+ ## Environments
124
+
125
+ For development or staging environments, Vits.me may provide a separate set of endpoints. You can configure these by overriding the `client_options`.
126
+
127
+ ```ruby
128
+ Rails.application.config.middleware.use OmniAuth::Builder do
129
+ provider :vitsme,
130
+ name: 'vitsme_staging', # Give it a unique name
131
+ client_id: ENV["VITSME_STAGING_CLIENT_ID"],
132
+ client_secret: ENV["VITSME_STAGING_CLIENT_SECRET"],
133
+ client_options: {
134
+ site: 'https://staging.vits.me',
135
+ authorize_url: 'https://staging.vits.me/oauth/authorize',
136
+ token_url: 'https://staging.vits.me/oauth/token',
137
+ userinfo_endpoint: 'https://staging.vits.me/userinfo'
138
+ }
139
+ end
140
+ ```
141
+ **Note:** The URLs in the example above are placeholders. Please refer to the official Vits.me documentation for the correct staging URLs.
142
+
143
+ ## Authentication Failures
144
+
145
+ If the user denies the authentication request or if there's a misconfiguration, OmniAuth will redirect to the `/auth/failure` path in your application. The `omniauth.error` and `omniauth.error.type` variables will be set in the Rack environment.
146
+
147
+ You can catch these failures by creating a `FailureEndpoint` in your application, for example, by routing `/auth/failure` to a specific controller action.
148
+
149
+ In a Rails application, you can handle this in your `OmniAuth::FailureEndpoint`:
150
+
151
+ ```ruby
152
+ # config/initializers/omniauth.rb
153
+ OmniAuth.config.on_failure = Proc.new { |env|
154
+ OmniAuth::FailureEndpoint.new(env).redirect_to_failure
155
+ }
156
+ ```
157
+
158
+ ```ruby
159
+ # app/controllers/omniauth_callbacks_controller.rb
160
+ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
161
+ def failure
162
+ # Your custom failure logic here.
163
+ # For example, redirect to the root path with an error message.
164
+ redirect_to root_path, alert: "Authentication failed: #{params[:message]}"
165
+ end
166
+ end
167
+ ```
168
+
169
+ The `params[:message]` will contain a description of the error (e.g., `invalid_credentials`).
170
+
171
+ ## Development
172
+
173
+ ```
174
+ bundle install
175
+ bundle exec rspec
176
+ bundle exec rubocop
177
+ bundle exec rake # runs both
178
+ ```
179
+
180
+ ## License
181
+
182
+ MIT License. See [LICENSE.txt](LICENSE.txt).
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rspec/core/rake_task'
4
+ require 'rubocop/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+ RuboCop::RakeTask.new(:rubocop)
8
+
9
+ task default: %i[spec rubocop]
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'omniauth_openid_connect'
4
+
5
+ module OmniAuth
6
+ module Strategies
7
+ class Vitsme < OpenIDConnect
8
+ option :name, 'vitsme'
9
+
10
+ option :discovery, true
11
+ option :issuer, 'https://vits.me'
12
+ option :client_signing_alg, :RS256
13
+ option :scope, [:openid]
14
+ option :response_type, 'code'
15
+ option :response_mode, 'query'
16
+
17
+ option :client_options, {
18
+ identifier: nil,
19
+ secret: nil,
20
+ scheme: 'https',
21
+ host: 'vits.me',
22
+ port: 443,
23
+ authorization_endpoint: '/oauth/authorize',
24
+ token_endpoint: '/oauth/token',
25
+ userinfo_endpoint: '/oauth/userinfo',
26
+ jwks_uri: '/oauth/discovery/keys'
27
+ }
28
+
29
+ option :client_id, nil
30
+ option :client_secret, nil
31
+
32
+ def uid
33
+ raw_info['sub']
34
+ end
35
+
36
+ info do
37
+ {
38
+ name: raw_info['name'] || raw_info['name__full'],
39
+ first_name: raw_info['given_name'],
40
+ last_name: raw_info['family_name'],
41
+ email: raw_info['email'],
42
+ birthday: raw_info['birthdate'] || raw_info['birthday'],
43
+ nationality: raw_info['nationality'],
44
+ age_over_13: raw_info['age__over_13'],
45
+ age_over_18: raw_info['age__over_18'],
46
+ age_over_21: raw_info['age__over_21']
47
+ }.compact
48
+ end
49
+
50
+ extra do
51
+ { raw_info: raw_info }
52
+ end
53
+
54
+ def raw_info
55
+ @raw_info ||= user_info.raw_attributes
56
+ end
57
+
58
+ private
59
+
60
+ def client_options
61
+ opts = options.client_options
62
+ opts.identifier ||= options.client_id if options.client_id
63
+ opts.secret ||= options.client_secret if options.client_secret
64
+ opts
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OmniAuth
4
+ module Vitsme
5
+ VERSION = '0.1.0'
6
+ end
7
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'omniauth/vitsme/version'
4
+ require 'omniauth/strategies/vitsme'
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'omniauth/vitsme'
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/omniauth/vitsme/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'omniauth-vitsme'
7
+ spec.version = OmniAuth::Vitsme::VERSION
8
+ spec.authors = ['Yuval Tobias']
9
+ spec.email = ['yuval@mattyr.com']
10
+
11
+ spec.summary = 'OmniAuth strategy for vits.me identity verification'
12
+ spec.description = 'OmniAuth OpenID Connect strategy for vits.me, ' \
13
+ 'digital identity platform.'
14
+ spec.homepage = 'https://github.com/yuvaltobias/omniauth-vitsme'
15
+ spec.license = 'MIT'
16
+ spec.required_ruby_version = '>= 3.0.0'
17
+
18
+ spec.metadata['homepage_uri'] = spec.homepage
19
+ spec.metadata['source_code_uri'] = spec.homepage
20
+ spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/main/CHANGELOG.md"
21
+ spec.metadata['rubygems_mfa_required'] = 'true'
22
+
23
+ spec.files = Dir.chdir(__dir__) do
24
+ `git ls-files -z`.split("\x0").reject do |f|
25
+ (File.expand_path(f) == __FILE__) ||
26
+ f.start_with?('spec/', 'test/', '.git', '.github', 'Gemfile')
27
+ end
28
+ end
29
+ spec.require_paths = ['lib']
30
+
31
+ spec.add_dependency 'omniauth_openid_connect', '~> 0.8'
32
+ end
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-vitsme
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Yuval Tobias
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: omniauth_openid_connect
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '0.8'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '0.8'
26
+ description: OmniAuth OpenID Connect strategy for vits.me, digital identity platform.
27
+ email:
28
+ - yuval@mattyr.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - ".claude/settings.local.json"
34
+ - ".rspec"
35
+ - ".rspec_status"
36
+ - ".rubocop.yml"
37
+ - CHANGELOG.md
38
+ - LICENSE.txt
39
+ - README.md
40
+ - Rakefile
41
+ - lib/omniauth-vitsme.rb
42
+ - lib/omniauth/strategies/vitsme.rb
43
+ - lib/omniauth/vitsme.rb
44
+ - lib/omniauth/vitsme/version.rb
45
+ - omniauth-vitsme.gemspec
46
+ homepage: https://github.com/yuvaltobias/omniauth-vitsme
47
+ licenses:
48
+ - MIT
49
+ metadata:
50
+ homepage_uri: https://github.com/yuvaltobias/omniauth-vitsme
51
+ source_code_uri: https://github.com/yuvaltobias/omniauth-vitsme
52
+ changelog_uri: https://github.com/yuvaltobias/omniauth-vitsme/blob/main/CHANGELOG.md
53
+ rubygems_mfa_required: 'true'
54
+ rdoc_options: []
55
+ require_paths:
56
+ - lib
57
+ required_ruby_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 3.0.0
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ requirements: []
68
+ rubygems_version: 3.7.0
69
+ specification_version: 4
70
+ summary: OmniAuth strategy for vits.me identity verification
71
+ test_files: []