omniauth-authify 0.1.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.
@@ -0,0 +1,78 @@
1
+ # Signatures for the Authify OmniAuth strategy
2
+ #
3
+ # The strategy inherits the bulk of its behavior (options machine, request/
4
+ # callback phase plumbing, credentials, token management) from
5
+ # OmniAuth::Strategies::OAuth2, whose definitions live in the
6
+ # omniauth-oauth2 gem's own signatures. Only the public surface added or
7
+ # overridden by this gem is described here.
8
+
9
+ module OmniAuth
10
+ module Strategies
11
+ # OmniAuth strategy for Authify, a self-hosted, multi-tenant identity
12
+ # provider implementing OpenID Connect on top of OAuth 2.0
13
+ class Authify < OmniAuth::Strategies::OAuth2
14
+ # Scopes requested when the user does not configure any
15
+ DEFAULT_SCOPE: String
16
+
17
+ # Returns the strategy name used in URLs (+/auth/authify+).
18
+ # Actually provided by the +option :name+ mechanism at runtime.
19
+ #
20
+ # Builds and memoizes the underlying OAuth2 client, raising
21
+ # ConfigurationError unless both +:site+ and +:organization+ options
22
+ # are present.
23
+ def client: () -> ::OAuth2::Client
24
+
25
+ # The +uid+ block is configured at class definition time and reads
26
+ # +raw_info["sub"]+; not a normal method override.
27
+
28
+ # Authorize-phase parameters: OAuth2 defaults plus scope/state handling,
29
+ # a freshly generated +nonce+, the configured +leeway+, and a
30
+ # request-provided +prompt+ forwarded to Authify when present.
31
+ def authorize_params: () -> Hash[Symbol, untyped]
32
+
33
+ # Initiates the authorization redirect after validating configuration
34
+ def request_phase: () -> rack_response
35
+
36
+ # Completes the callback: validates the OAuth2 state, exchanges the
37
+ # code for tokens, and (unless +verify_id_token+ is disabled) verifies
38
+ # the ID token signature and claims while the auth hash is assembled
39
+ def callback_phase: () -> rack_response
40
+
41
+ private
42
+
43
+ # Persists per-login parameters (nonce, leeway, max_age) in the session
44
+ def store_authorize_params: (Hash[Symbol, untyped] params) -> void
45
+
46
+ # Session-stored authorize parameters, symbolized; consumed once
47
+ def stored_authorize_params: () -> Hash[Symbol, untyped]
48
+
49
+ # True when either +:site+ or +:organization+ is blank
50
+ def missing_configuration?: () -> bool
51
+
52
+ # The ID token from the token endpoint response, or nil
53
+ def id_token: () -> String?
54
+
55
+ # A validator bound to this organization's issuer and JWKS
56
+ def jwt_validator: () -> ::OmniAuth::Authify::JwtValidator
57
+
58
+ # +site+ joined with +organization+, trailing slashes normalized
59
+ def org_base: () -> String
60
+
61
+ # Raises ConfigurationError when +missing_configuration?+
62
+ def validate_configuration!: () -> void
63
+
64
+ # +org_base+ (kept as a separate name for overriding in subclasses)
65
+ def normalized_base: () -> String
66
+
67
+ # Normalized (nil when blank) ID token value from the access token
68
+ def normalized_id_token: () -> String?
69
+
70
+ # Verified ID token claims (signature-verified), or the userinfo
71
+ # response when verification is disabled
72
+ def raw_info: () -> Hash[String, untyped]
73
+
74
+ # Organization-scoped userinfo endpoint URL
75
+ def userinfo_url: () -> String
76
+ end
77
+ end
78
+ end
data/sig/shims.rbs ADDED
@@ -0,0 +1,67 @@
1
+ # Shims for types referenced by our signatures but not shipped with RBS
2
+ # definitions by their gems (omniauth / omniauth-oauth2 / oauth2 / jwt).
3
+ #
4
+ # These aren't meant to be complete — they define just enough for the
5
+ # OmniAuth::Authify signatures to validate. If upstream gems publish
6
+ # signatures, these should be dropped in favor of theirs.
7
+
8
+ module OmniAuth
9
+ def self.config: () -> untyped
10
+
11
+ class Strategy
12
+ class Options
13
+ def []: (Symbol | String key) -> untyped
14
+
15
+ def []=: (Symbol | String key, untyped value) -> untyped
16
+
17
+ def deep_merge!: (Hash[Symbol | String, untyped] other) -> untyped
18
+ end
19
+ end
20
+
21
+ module Strategies
22
+ # Stub for OmniAuth::Strategies::OAuth2 from the omniauth-oauth2 gem
23
+ class OAuth2
24
+ # Rack response triple: [status, headers, body]
25
+ def call!: (Hash[String, untyped] env) -> untyped
26
+
27
+ def options: () -> OmniAuth::Strategy::Options
28
+
29
+ def client: () -> ::OAuth2::Client
30
+
31
+ def session: () -> untyped
32
+
33
+ def request: () -> untyped
34
+
35
+ def fail!: (Symbol message_key, ?untyped exception) -> rack_response
36
+ end
37
+ end
38
+
39
+ class Config
40
+ end
41
+ end
42
+
43
+ module OAuth2
44
+ class Client
45
+ end
46
+
47
+ class AccessToken
48
+ def token: () -> String
49
+
50
+ def expires?: () -> bool
51
+
52
+ def expires_at: () -> Integer
53
+
54
+ def refresh_token: () -> String?
55
+
56
+ def params: () -> Hash[String, untyped]
57
+
58
+ def []: (String | Symbol key) -> untyped
59
+ end
60
+ end
61
+
62
+ module JWT
63
+ VERSION: String
64
+ end
65
+
66
+ # Rack response triple: [status, headers, body]
67
+ type rack_response = [Integer, Hash[String | Symbol, untyped], untyped]
metadata ADDED
@@ -0,0 +1,262 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-authify
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Jonathan Gnagy
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: base64
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '0.2'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '0.2'
26
+ - !ruby/object:Gem::Dependency
27
+ name: jwt
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '2.8'
33
+ - - "<"
34
+ - !ruby/object:Gem::Version
35
+ version: '4'
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '2.8'
43
+ - - "<"
44
+ - !ruby/object:Gem::Version
45
+ version: '4'
46
+ - !ruby/object:Gem::Dependency
47
+ name: omniauth
48
+ requirement: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '2.1'
53
+ type: :runtime
54
+ prerelease: false
55
+ version_requirements: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '2.1'
60
+ - !ruby/object:Gem::Dependency
61
+ name: omniauth-oauth2
62
+ requirement: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '1.8'
67
+ - - "<"
68
+ - !ruby/object:Gem::Version
69
+ version: '3'
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '1.8'
77
+ - - "<"
78
+ - !ruby/object:Gem::Version
79
+ version: '3'
80
+ - !ruby/object:Gem::Dependency
81
+ name: rack-test
82
+ requirement: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - "~>"
85
+ - !ruby/object:Gem::Version
86
+ version: '2.1'
87
+ type: :development
88
+ prerelease: false
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - "~>"
92
+ - !ruby/object:Gem::Version
93
+ version: '2.1'
94
+ - !ruby/object:Gem::Dependency
95
+ name: rake
96
+ requirement: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - "~>"
99
+ - !ruby/object:Gem::Version
100
+ version: '13.0'
101
+ type: :development
102
+ prerelease: false
103
+ version_requirements: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - "~>"
106
+ - !ruby/object:Gem::Version
107
+ version: '13.0'
108
+ - !ruby/object:Gem::Dependency
109
+ name: rspec
110
+ requirement: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - "~>"
113
+ - !ruby/object:Gem::Version
114
+ version: '3.12'
115
+ type: :development
116
+ prerelease: false
117
+ version_requirements: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - "~>"
120
+ - !ruby/object:Gem::Version
121
+ version: '3.12'
122
+ - !ruby/object:Gem::Dependency
123
+ name: rubocop
124
+ requirement: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - "~>"
127
+ - !ruby/object:Gem::Version
128
+ version: '1.75'
129
+ type: :development
130
+ prerelease: false
131
+ version_requirements: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - "~>"
134
+ - !ruby/object:Gem::Version
135
+ version: '1.75'
136
+ - !ruby/object:Gem::Dependency
137
+ name: rubocop-rake
138
+ requirement: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - "~>"
141
+ - !ruby/object:Gem::Version
142
+ version: '0.7'
143
+ type: :development
144
+ prerelease: false
145
+ version_requirements: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - "~>"
148
+ - !ruby/object:Gem::Version
149
+ version: '0.7'
150
+ - !ruby/object:Gem::Dependency
151
+ name: rubocop-rspec
152
+ requirement: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - "~>"
155
+ - !ruby/object:Gem::Version
156
+ version: '3.5'
157
+ type: :development
158
+ prerelease: false
159
+ version_requirements: !ruby/object:Gem::Requirement
160
+ requirements:
161
+ - - "~>"
162
+ - !ruby/object:Gem::Version
163
+ version: '3.5'
164
+ - !ruby/object:Gem::Dependency
165
+ name: simplecov
166
+ requirement: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - "~>"
169
+ - !ruby/object:Gem::Version
170
+ version: '0.22'
171
+ type: :development
172
+ prerelease: false
173
+ version_requirements: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - "~>"
176
+ - !ruby/object:Gem::Version
177
+ version: '0.22'
178
+ - !ruby/object:Gem::Dependency
179
+ name: webmock
180
+ requirement: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - "~>"
183
+ - !ruby/object:Gem::Version
184
+ version: '3.24'
185
+ type: :development
186
+ prerelease: false
187
+ version_requirements: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - "~>"
190
+ - !ruby/object:Gem::Version
191
+ version: '3.24'
192
+ - !ruby/object:Gem::Dependency
193
+ name: yard
194
+ requirement: !ruby/object:Gem::Requirement
195
+ requirements:
196
+ - - "~>"
197
+ - !ruby/object:Gem::Version
198
+ version: '0.9'
199
+ type: :development
200
+ prerelease: false
201
+ version_requirements: !ruby/object:Gem::Requirement
202
+ requirements:
203
+ - - "~>"
204
+ - !ruby/object:Gem::Version
205
+ version: '0.9'
206
+ description: An OmniAuth strategy that authenticates against Authify, a self-hosted,
207
+ multi-tenant identity provider, using the OpenID Connect authorization code flow
208
+ with PKCE, verifying ID tokens against the organization's JWKS.
209
+ email:
210
+ - jonathan.gnagy@gmail.com
211
+ executables: []
212
+ extensions: []
213
+ extra_rdoc_files: []
214
+ files:
215
+ - ".release-please-manifest.json"
216
+ - ".rspec"
217
+ - ".rubocop.yml"
218
+ - ".ruby-version"
219
+ - ".tool-versions"
220
+ - ".yardopts"
221
+ - AGENTS.md
222
+ - CHANGELOG.md
223
+ - CODE_OF_CONDUCT.md
224
+ - CONTRIBUTING.md
225
+ - LICENSE.txt
226
+ - README.md
227
+ - Rakefile
228
+ - lib/omniauth-authify.rb
229
+ - lib/omniauth/authify.rb
230
+ - lib/omniauth/authify/errors.rb
231
+ - lib/omniauth/authify/jwt_validator.rb
232
+ - lib/omniauth/authify/version.rb
233
+ - lib/omniauth/strategies/authify.rb
234
+ - release-please-config.json
235
+ - sig/omniauth/authify.rbs
236
+ - sig/omniauth/strategies/authify.rbs
237
+ - sig/shims.rbs
238
+ homepage: https://github.com/authify/omniauth-authify
239
+ licenses:
240
+ - MIT
241
+ metadata:
242
+ homepage_uri: https://github.com/authify/omniauth-authify
243
+ source_code_uri: https://github.com/authify/omniauth-authify
244
+ changelog_uri: https://github.com/authify/omniauth-authify/blob/main/CHANGELOG.md
245
+ rdoc_options: []
246
+ require_paths:
247
+ - lib
248
+ required_ruby_version: !ruby/object:Gem::Requirement
249
+ requirements:
250
+ - - ">="
251
+ - !ruby/object:Gem::Version
252
+ version: '3.4'
253
+ required_rubygems_version: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ requirements: []
259
+ rubygems_version: 3.6.9
260
+ specification_version: 4
261
+ summary: OmniAuth strategy for Authify, a self-hosted, multi-tenant identity provider
262
+ test_files: []