clavis 0.7.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 +7 -0
- data/.actrc +4 -0
- data/.cursor/rules/ruby-gem.mdc +49 -0
- data/.gemignore +6 -0
- data/.rspec +3 -0
- data/.rubocop.yml +88 -0
- data/.vscode/settings.json +22 -0
- data/CHANGELOG.md +127 -0
- data/CODE_OF_CONDUCT.md +3 -0
- data/LICENSE.txt +21 -0
- data/README.md +838 -0
- data/Rakefile +341 -0
- data/UPGRADE.md +57 -0
- data/app/assets/stylesheets/clavis.css +133 -0
- data/app/controllers/clavis/auth_controller.rb +133 -0
- data/config/database.yml +16 -0
- data/config/routes.rb +49 -0
- data/docs/SECURITY.md +340 -0
- data/docs/TESTING.md +78 -0
- data/docs/integration.md +272 -0
- data/error_handling.md +355 -0
- data/file_structure.md +221 -0
- data/gemfiles/rails_80.gemfile +17 -0
- data/gemfiles/rails_80.gemfile.lock +286 -0
- data/implementation_plan.md +523 -0
- data/lib/clavis/configuration.rb +196 -0
- data/lib/clavis/controllers/concerns/authentication.rb +232 -0
- data/lib/clavis/controllers/concerns/session_management.rb +117 -0
- data/lib/clavis/engine.rb +191 -0
- data/lib/clavis/errors.rb +205 -0
- data/lib/clavis/logging.rb +116 -0
- data/lib/clavis/models/concerns/oauth_authenticatable.rb +169 -0
- data/lib/clavis/oauth_identity.rb +174 -0
- data/lib/clavis/providers/apple.rb +135 -0
- data/lib/clavis/providers/base.rb +432 -0
- data/lib/clavis/providers/custom_provider_example.rb +57 -0
- data/lib/clavis/providers/facebook.rb +84 -0
- data/lib/clavis/providers/generic.rb +63 -0
- data/lib/clavis/providers/github.rb +87 -0
- data/lib/clavis/providers/google.rb +98 -0
- data/lib/clavis/providers/microsoft.rb +57 -0
- data/lib/clavis/security/csrf_protection.rb +79 -0
- data/lib/clavis/security/https_enforcer.rb +90 -0
- data/lib/clavis/security/input_validator.rb +192 -0
- data/lib/clavis/security/parameter_filter.rb +64 -0
- data/lib/clavis/security/rate_limiter.rb +109 -0
- data/lib/clavis/security/redirect_uri_validator.rb +124 -0
- data/lib/clavis/security/session_manager.rb +220 -0
- data/lib/clavis/security/token_storage.rb +114 -0
- data/lib/clavis/user_info_normalizer.rb +74 -0
- data/lib/clavis/utils/nonce_store.rb +14 -0
- data/lib/clavis/utils/secure_token.rb +17 -0
- data/lib/clavis/utils/state_store.rb +18 -0
- data/lib/clavis/version.rb +6 -0
- data/lib/clavis/view_helpers.rb +260 -0
- data/lib/clavis.rb +132 -0
- data/lib/generators/clavis/controller/controller_generator.rb +48 -0
- data/lib/generators/clavis/controller/templates/controller.rb.tt +137 -0
- data/lib/generators/clavis/controller/templates/views/login.html.erb.tt +145 -0
- data/lib/generators/clavis/install_generator.rb +182 -0
- data/lib/generators/clavis/templates/add_oauth_to_users.rb +28 -0
- data/lib/generators/clavis/templates/clavis.css +133 -0
- data/lib/generators/clavis/templates/initializer.rb +47 -0
- data/lib/generators/clavis/templates/initializer.rb.tt +76 -0
- data/lib/generators/clavis/templates/migration.rb +18 -0
- data/lib/generators/clavis/templates/migration.rb.tt +16 -0
- data/lib/generators/clavis/user_method/user_method_generator.rb +219 -0
- data/lib/tasks/provider_verification.rake +77 -0
- data/llms.md +487 -0
- data/log/development.log +20 -0
- data/log/test.log +0 -0
- data/sig/clavis.rbs +4 -0
- data/testing_plan.md +710 -0
- metadata +258 -0
data/llms.md
ADDED
@@ -0,0 +1,487 @@
|
|
1
|
+
# Clavis: Large Language Model Documentation
|
2
|
+
|
3
|
+
This document provides technical information about the Clavis gem for large language models.
|
4
|
+
|
5
|
+
## Quick Start Guide for Implementation
|
6
|
+
|
7
|
+
Implement Clavis in three steps:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
# Step 1: Add to Gemfile
|
11
|
+
gem 'clavis'
|
12
|
+
```
|
13
|
+
|
14
|
+
```bash
|
15
|
+
# Step 2: Run the installation generator
|
16
|
+
rails generate clavis:install
|
17
|
+
rails db:migrate
|
18
|
+
```
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
# Step 3: Configure a provider
|
22
|
+
Clavis.configure do |config|
|
23
|
+
config.providers = {
|
24
|
+
github: {
|
25
|
+
client_id: ENV["GITHUB_CLIENT_ID"],
|
26
|
+
client_secret: ENV["GITHUB_CLIENT_SECRET"]
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
# Optional: Customize the path (default is '/auth/:provider/callback')
|
31
|
+
# config.default_callback_path = '/oauth/:provider/callback'
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
### What the Generator Does
|
36
|
+
|
37
|
+
1. Creates migrations for OAuth identities
|
38
|
+
2. Mounts the engine at `/auth`
|
39
|
+
3. Creates configuration initializer
|
40
|
+
4. Adds `Clavis::Models::OauthAuthenticatable` to User model
|
41
|
+
|
42
|
+
Add a button to your view:
|
43
|
+
|
44
|
+
```erb
|
45
|
+
<%= clavis_oauth_button :github %>
|
46
|
+
```
|
47
|
+
|
48
|
+
### Important Notes
|
49
|
+
|
50
|
+
1. Use the standard ERB syntax with `<%= %>` for OAuth buttons - the helper returns html_safe content
|
51
|
+
2. The gem automatically handles route setup when mounted at `/auth` - no additional route configuration needed
|
52
|
+
3. Always use the complete callback URI in provider configuration (e.g., `https://your-app.com/auth/github/callback`)
|
53
|
+
4. If you customize the mount path, make sure to update the `default_callback_path` configuration accordingly
|
54
|
+
|
55
|
+
## Table of Contents
|
56
|
+
|
57
|
+
1. [Overview](#overview)
|
58
|
+
2. [Architecture](#architecture)
|
59
|
+
3. [Core Components](#core-components)
|
60
|
+
4. [Implementation Details](#implementation-details)
|
61
|
+
5. [Usage Examples](#usage-examples)
|
62
|
+
6. [Customization Guide](#customization-guide)
|
63
|
+
7. [Error Handling](#error-handling)
|
64
|
+
8. [Security Considerations](#security-considerations)
|
65
|
+
9. [API Reference](#api-reference)
|
66
|
+
10. [Rate Limiting](#rate-limiting)
|
67
|
+
|
68
|
+
## Overview
|
69
|
+
|
70
|
+
Clavis implements OAuth 2.0 and OpenID Connect (OIDC) for Rails. It focuses on "Sign in with ____" functionality while maintaining security standards.
|
71
|
+
|
72
|
+
### Key Assumptions
|
73
|
+
|
74
|
+
1. Rails 7+ application
|
75
|
+
2. Existing User model and authentication
|
76
|
+
3. Speed over detailed configuration
|
77
|
+
|
78
|
+
## Architecture
|
79
|
+
|
80
|
+
### Core Components
|
81
|
+
|
82
|
+
1. **Configuration System** - Stores provider settings and validates configuration
|
83
|
+
2. **Provider Framework** - Implements OAuth/OIDC flows with provider-specific logic
|
84
|
+
3. **Authentication Flow** - Handles requests and callbacks with CSRF protection
|
85
|
+
4. **User Management** - Maps OAuth responses to user records
|
86
|
+
5. **View Components** - Button helpers with provider-specific styling
|
87
|
+
6. **Rails Integration** - Routes, generators, and existing auth integration
|
88
|
+
|
89
|
+
## Implementation Details
|
90
|
+
|
91
|
+
### Callback URI Format
|
92
|
+
|
93
|
+
Always use the complete callback URI:
|
94
|
+
|
95
|
+
```
|
96
|
+
https://your-domain.com/auth/:provider/callback
|
97
|
+
```
|
98
|
+
|
99
|
+
Common mistake: Using just the domain without the full path.
|
100
|
+
|
101
|
+
### Route Structure
|
102
|
+
|
103
|
+
The Clavis engine is mounted at `/auth` by default, which creates these routes:
|
104
|
+
|
105
|
+
```
|
106
|
+
/auth/google - Start Google OAuth flow
|
107
|
+
/auth/google/callback - Handle Google OAuth callback
|
108
|
+
/auth/:provider - Generic provider route
|
109
|
+
/auth/:provider/callback - Generic callback route
|
110
|
+
```
|
111
|
+
|
112
|
+
These routes are automatically registered when you mount the engine:
|
113
|
+
|
114
|
+
```ruby
|
115
|
+
# config/routes.rb (added by generator)
|
116
|
+
mount Clavis::Engine => "/auth"
|
117
|
+
```
|
118
|
+
|
119
|
+
#### Customizing the Path
|
120
|
+
|
121
|
+
You can customize the path in two ways:
|
122
|
+
|
123
|
+
1. **Change the engine mount point**:
|
124
|
+
```ruby
|
125
|
+
# config/routes.rb
|
126
|
+
mount Clavis::Engine => "/oauth"
|
127
|
+
```
|
128
|
+
|
129
|
+
2. **Update the callback path configuration**:
|
130
|
+
```ruby
|
131
|
+
# config/initializers/clavis.rb
|
132
|
+
Clavis.configure do |config|
|
133
|
+
# This should match your engine mount point
|
134
|
+
config.default_callback_path = "/oauth/:provider/callback"
|
135
|
+
end
|
136
|
+
```
|
137
|
+
|
138
|
+
When customizing paths, make sure that:
|
139
|
+
1. The provider configuration's redirect URIs match your custom paths
|
140
|
+
2. Both the engine mount point and the `default_callback_path` are updated consistently
|
141
|
+
|
142
|
+
### OAuth Flow Implementation
|
143
|
+
|
144
|
+
1. **Authorization Request**
|
145
|
+
```ruby
|
146
|
+
def authorize_url(state:, nonce:, scope:)
|
147
|
+
params = {
|
148
|
+
response_type: "code",
|
149
|
+
client_id: client_id,
|
150
|
+
redirect_uri: redirect_uri,
|
151
|
+
scope: scope || default_scopes,
|
152
|
+
state: state
|
153
|
+
}
|
154
|
+
|
155
|
+
# Add nonce for OIDC
|
156
|
+
params[:nonce] = nonce if openid_scope?(scope)
|
157
|
+
|
158
|
+
"#{authorization_endpoint}?#{params.to_query}"
|
159
|
+
end
|
160
|
+
```
|
161
|
+
|
162
|
+
2. **Authorization Callback**
|
163
|
+
```ruby
|
164
|
+
def oauth_callback
|
165
|
+
validate_state!(params[:state])
|
166
|
+
auth_hash = provider.process_callback(params[:code], session.delete(:oauth_state))
|
167
|
+
user = find_or_create_user_from_oauth(auth_hash)
|
168
|
+
yield(user, auth_hash) if block_given?
|
169
|
+
end
|
170
|
+
```
|
171
|
+
|
172
|
+
3. **Token Exchange**
|
173
|
+
```ruby
|
174
|
+
def token_exchange(code:, expected_state: nil)
|
175
|
+
response = http_client.post(token_endpoint, {
|
176
|
+
grant_type: "authorization_code",
|
177
|
+
code: code,
|
178
|
+
redirect_uri: redirect_uri,
|
179
|
+
client_id: client_id,
|
180
|
+
client_secret: client_secret
|
181
|
+
})
|
182
|
+
|
183
|
+
handle_token_response(response)
|
184
|
+
end
|
185
|
+
```
|
186
|
+
|
187
|
+
### Provider Example: Google
|
188
|
+
|
189
|
+
```ruby
|
190
|
+
class Google < Base
|
191
|
+
def authorization_endpoint
|
192
|
+
"https://accounts.google.com/o/oauth2/v2/auth"
|
193
|
+
end
|
194
|
+
|
195
|
+
def token_endpoint
|
196
|
+
"https://oauth2.googleapis.com/token"
|
197
|
+
end
|
198
|
+
|
199
|
+
def userinfo_endpoint
|
200
|
+
"https://openidconnect.googleapis.com/v1/userinfo"
|
201
|
+
end
|
202
|
+
|
203
|
+
def default_scopes
|
204
|
+
"openid email profile"
|
205
|
+
end
|
206
|
+
|
207
|
+
def openid_provider?
|
208
|
+
true
|
209
|
+
end
|
210
|
+
|
211
|
+
protected
|
212
|
+
|
213
|
+
def process_userinfo_response(response)
|
214
|
+
data = JSON.parse(response.body)
|
215
|
+
|
216
|
+
# For OpenID Connect providers like Google, we use the sub claim
|
217
|
+
# as the stable identifier. This is guaranteed to be unique and
|
218
|
+
# consistent for each user, unlike other fields that might change.
|
219
|
+
{
|
220
|
+
provider: "google",
|
221
|
+
uid: data["sub"], # sub is the stable identifier
|
222
|
+
info: {
|
223
|
+
email: data["email"],
|
224
|
+
name: data["name"],
|
225
|
+
image: data["picture"]
|
226
|
+
}
|
227
|
+
}
|
228
|
+
end
|
229
|
+
end
|
230
|
+
```
|
231
|
+
|
232
|
+
### OpenID Connect vs OAuth2 Providers
|
233
|
+
|
234
|
+
Clavis handles two types of providers differently:
|
235
|
+
|
236
|
+
1. **OpenID Connect Providers** (e.g., Google)
|
237
|
+
- Uses the `sub` claim as the stable identifier
|
238
|
+
- This is guaranteed to be unique and consistent
|
239
|
+
- Found in the ID token claims or userinfo response
|
240
|
+
- Example: Google's `sub` is a stable numeric identifier
|
241
|
+
|
242
|
+
2. **OAuth2-only Providers** (e.g., GitHub)
|
243
|
+
- Uses the provider's `uid` field
|
244
|
+
- Identifier format varies by provider
|
245
|
+
- Example: GitHub uses the user's numeric ID
|
246
|
+
|
247
|
+
When implementing a custom provider, use `openid_provider?` to indicate if it's an OpenID Connect provider:
|
248
|
+
|
249
|
+
```ruby
|
250
|
+
def openid_provider?
|
251
|
+
true # for OIDC providers
|
252
|
+
false # for OAuth2-only providers
|
253
|
+
end
|
254
|
+
```
|
255
|
+
|
256
|
+
## Usage Examples
|
257
|
+
|
258
|
+
### Basic Setup
|
259
|
+
|
260
|
+
```ruby
|
261
|
+
# Gemfile
|
262
|
+
gem 'clavis'
|
263
|
+
|
264
|
+
# Terminal
|
265
|
+
bundle install
|
266
|
+
rails g clavis:install
|
267
|
+
|
268
|
+
# config/initializers/clavis.rb
|
269
|
+
Clavis.configure do |config|
|
270
|
+
config.providers = {
|
271
|
+
google: {
|
272
|
+
client_id: Rails.application.credentials.dig(:google, :client_id),
|
273
|
+
client_secret: Rails.application.credentials.dig(:google, :client_secret),
|
274
|
+
redirect_uri: "https://example.com/auth/google/callback"
|
275
|
+
}
|
276
|
+
}
|
277
|
+
end
|
278
|
+
|
279
|
+
# app/models/user.rb
|
280
|
+
class User < ApplicationRecord
|
281
|
+
include Clavis::Models::OauthAuthenticatable
|
282
|
+
end
|
283
|
+
```
|
284
|
+
|
285
|
+
### Accessing User Info
|
286
|
+
|
287
|
+
```ruby
|
288
|
+
# Get user info from most recent OAuth provider
|
289
|
+
user.oauth_email # => "user@example.com"
|
290
|
+
user.oauth_name # => "John Doe"
|
291
|
+
user.oauth_avatar_url # => "https://example.com/avatar.jpg"
|
292
|
+
|
293
|
+
# Get info from specific provider
|
294
|
+
user.oauth_email("google")
|
295
|
+
```
|
296
|
+
|
297
|
+
### Controller Integration
|
298
|
+
|
299
|
+
```ruby
|
300
|
+
class SessionsController < ApplicationController
|
301
|
+
include Clavis::Controllers::Concerns::Authentication
|
302
|
+
|
303
|
+
def create_from_oauth
|
304
|
+
oauth_callback do |user, auth_hash|
|
305
|
+
session[:user_id] = user.id
|
306
|
+
redirect_to dashboard_path
|
307
|
+
end
|
308
|
+
rescue Clavis::AuthenticationError => e
|
309
|
+
redirect_to login_path, alert: "Authentication failed"
|
310
|
+
end
|
311
|
+
end
|
312
|
+
```
|
313
|
+
|
314
|
+
### View Integration
|
315
|
+
|
316
|
+
```erb
|
317
|
+
<div class="oauth-providers">
|
318
|
+
<%= clavis_oauth_button :google %>
|
319
|
+
<%= clavis_oauth_button :github %>
|
320
|
+
<%= clavis_oauth_button :apple %>
|
321
|
+
</div>
|
322
|
+
```
|
323
|
+
|
324
|
+
Include view helpers:
|
325
|
+
|
326
|
+
```ruby
|
327
|
+
# app/helpers/oauth_helper.rb
|
328
|
+
module OauthHelper
|
329
|
+
include Clavis::ViewHelpers
|
330
|
+
end
|
331
|
+
```
|
332
|
+
|
333
|
+
### Customizing Button Display
|
334
|
+
|
335
|
+
Clavis OAuth buttons can be customized with several options:
|
336
|
+
|
337
|
+
```erb
|
338
|
+
<!-- Custom text -->
|
339
|
+
<%= clavis_oauth_button :google, text: "Continue with Google" %>
|
340
|
+
|
341
|
+
<!-- Custom CSS class -->
|
342
|
+
<%= clavis_oauth_button :github, class: "my-custom-button" %>
|
343
|
+
|
344
|
+
<!-- Custom HTML attributes -->
|
345
|
+
<%= clavis_oauth_button :apple, html: { data: { turbo: false } } %>
|
346
|
+
```
|
347
|
+
|
348
|
+
The buttons are rendered with HTML-safe content, so you can use the standard ERB output tag `<%= %>` without extra escaping.
|
349
|
+
|
350
|
+
## Customization Guide
|
351
|
+
|
352
|
+
### Adding a Custom Provider
|
353
|
+
|
354
|
+
```ruby
|
355
|
+
class CustomProvider < Base
|
356
|
+
def authorization_endpoint
|
357
|
+
"https://custom-provider.com/oauth/authorize"
|
358
|
+
end
|
359
|
+
|
360
|
+
def token_endpoint
|
361
|
+
"https://custom-provider.com/oauth/token"
|
362
|
+
end
|
363
|
+
|
364
|
+
def userinfo_endpoint
|
365
|
+
"https://custom-provider.com/api/user"
|
366
|
+
end
|
367
|
+
end
|
368
|
+
|
369
|
+
# Register the provider
|
370
|
+
Clavis.register_provider(:custom_provider, CustomProvider)
|
371
|
+
```
|
372
|
+
|
373
|
+
### Custom Claims Processing
|
374
|
+
|
375
|
+
```ruby
|
376
|
+
config.claims_processor = proc do |auth_hash, user|
|
377
|
+
# Set verified email if from Google
|
378
|
+
if auth_hash[:provider] == "google" && auth_hash[:info][:email_verified]
|
379
|
+
user.verified_email = true
|
380
|
+
end
|
381
|
+
|
382
|
+
# Add role based on email domain
|
383
|
+
if auth_hash[:info][:email].end_with?("@mycompany.com")
|
384
|
+
user.add_role(:employee)
|
385
|
+
end
|
386
|
+
end
|
387
|
+
```
|
388
|
+
|
389
|
+
## Security Considerations
|
390
|
+
|
391
|
+
Clavis implements several security features:
|
392
|
+
|
393
|
+
1. **State Parameter** - Prevents CSRF attacks
|
394
|
+
2. **Nonce Parameter** - Prevents replay attacks for OIDC
|
395
|
+
3. **HTTPS** - Required for OAuth operations
|
396
|
+
4. **Secure Token Storage** - Encrypted in database
|
397
|
+
5. **Error Logging** - Security events monitoring
|
398
|
+
|
399
|
+
### Rate Limiting
|
400
|
+
|
401
|
+
Clavis integrates with Rack::Attack to protect OAuth endpoints against DDoS and brute force attacks.
|
402
|
+
|
403
|
+
```ruby
|
404
|
+
# Rate limiting is enabled by default
|
405
|
+
Clavis.configure do |config|
|
406
|
+
config.rate_limiting_enabled = true
|
407
|
+
|
408
|
+
# Optional: Configure custom throttles
|
409
|
+
config.custom_throttles = {
|
410
|
+
"login_page": {
|
411
|
+
limit: 30,
|
412
|
+
period: 1.minute,
|
413
|
+
block: ->(req) { req.path == "/login" ? req.ip : nil }
|
414
|
+
}
|
415
|
+
}
|
416
|
+
end
|
417
|
+
```
|
418
|
+
|
419
|
+
#### Default Rate Limits
|
420
|
+
|
421
|
+
By default, Clavis applies these rate limits:
|
422
|
+
|
423
|
+
1. **Authorization Endpoints**: 20 requests per minute per IP address
|
424
|
+
2. **Callback Endpoints**: 15 requests per minute per IP address
|
425
|
+
3. **Login Attempts by Email**: 5 requests per 20 seconds per email address
|
426
|
+
|
427
|
+
#### Integration Details
|
428
|
+
|
429
|
+
1. Clavis uses Rack::Attack middleware
|
430
|
+
2. Rate limiting is automatically configured when the gem is loaded
|
431
|
+
3. No additional gem installation required (Rack::Attack is a dependency)
|
432
|
+
4. Uses Rails cache for throttle storage by default
|
433
|
+
|
434
|
+
#### Custom Configuration
|
435
|
+
|
436
|
+
For advanced customization, create a dedicated Rack::Attack configuration:
|
437
|
+
|
438
|
+
```ruby
|
439
|
+
# config/initializers/rack_attack.rb
|
440
|
+
Rack::Attack.throttle("custom/auth", limit: 10, period: 30.seconds) do |req|
|
441
|
+
req.ip if req.path =~ %r{/auth/}
|
442
|
+
end
|
443
|
+
|
444
|
+
# Dedicated cache store for rate limiting
|
445
|
+
Rack::Attack.cache.store = ActiveSupport::Cache::RedisCacheStore.new(
|
446
|
+
url: ENV["REDIS_RATE_LIMIT_URL"]
|
447
|
+
)
|
448
|
+
```
|
449
|
+
|
450
|
+
#### Implementation Notes
|
451
|
+
|
452
|
+
1. Rate limiting middleware installation happens in `Clavis::Engine`
|
453
|
+
2. Throttle rules are defined in `Clavis::Security::RateLimiter`
|
454
|
+
3. Configuration via `rate_limiting_enabled` and `custom_throttles` in Clavis config
|
455
|
+
4. When disabled, no middleware is added and there's zero performance impact
|
456
|
+
|
457
|
+
## API Reference
|
458
|
+
|
459
|
+
### Available Providers
|
460
|
+
|
461
|
+
| Provider | Key | Default Scopes | Notes |
|
462
|
+
|----------|-----|----------------|-------|
|
463
|
+
| Google | `:google` | `openid email profile` | Full OIDC support |
|
464
|
+
| GitHub | `:github` | `user:email` | Uses GitHub API |
|
465
|
+
| Apple | `:apple` | `name email` | JWT client secret |
|
466
|
+
| Facebook | `:facebook` | `email public_profile` | Uses Graph API |
|
467
|
+
| Microsoft | `:microsoft` | `openid email profile` | Multi-tenant |
|
468
|
+
|
469
|
+
### Auth Hash Structure
|
470
|
+
|
471
|
+
```ruby
|
472
|
+
{
|
473
|
+
provider: "google",
|
474
|
+
uid: "123456789",
|
475
|
+
info: {
|
476
|
+
email: "user@example.com",
|
477
|
+
email_verified: true,
|
478
|
+
name: "John Doe",
|
479
|
+
image: "https://example.com/photo.jpg"
|
480
|
+
},
|
481
|
+
credentials: {
|
482
|
+
token: "ACCESS_TOKEN",
|
483
|
+
refresh_token: "REFRESH_TOKEN",
|
484
|
+
expires_at: 1494520494
|
485
|
+
}
|
486
|
+
}
|
487
|
+
```
|
data/log/development.log
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
[Clavis] Authorization request initiated for provider: google
|
2
|
+
[Clavis] Authorization parameters: {response_type: "code", client_id: "test-client-id", redirect_uri: "https://example.com/auth/google/callback", scope: "openid email profile", state: "test-state", nonce: "test-nonce"}
|
3
|
+
[Clavis] Authorization request initiated for provider: google
|
4
|
+
[Clavis] Authorization parameters: {response_type: "code", client_id: "test-client-id", redirect_uri: "https://example.com/auth/google/callback", scope: "email", state: "test-state"}
|
5
|
+
[Clavis] Authorization request initiated for provider: github
|
6
|
+
[Clavis] Authorization parameters: {response_type: "code", client_id: "test-client-id", redirect_uri: "https://example.com/auth/github/callback", scope: "user:email", state: "test-state"}
|
7
|
+
[Clavis] Authorization request initiated for provider: apple
|
8
|
+
[Clavis] Authorization parameters: {response_type: "code", client_id: "test-client-id", redirect_uri: "https://example.com/auth/apple/callback", scope: "name email", state: "test-state"}
|
9
|
+
[Clavis] Authorization request initiated for provider: facebook
|
10
|
+
[Clavis] Authorization parameters: {response_type: "code", client_id: "test-client-id", redirect_uri: "https://example.com/auth/facebook/callback", scope: "email public_profile", state: "test-state"}
|
11
|
+
[Clavis] Authorization request initiated for provider: microsoft
|
12
|
+
[Clavis] Authorization parameters: {response_type: "code", client_id: "test-client-id", redirect_uri: "https://example.com/auth/microsoft/callback", scope: "openid email profile User.Read", state: "test-state", nonce: "test-nonce"}
|
13
|
+
[Clavis] Authorization request initiated for provider: github
|
14
|
+
[Clavis] Authorization parameters: {response_type: "code", client_id: "test-client-id", redirect_uri: "https://example.com/auth/github/callback", scope: "user:email", state: "test-state"}
|
15
|
+
[Clavis] Authorization request initiated for provider: apple
|
16
|
+
[Clavis] Authorization parameters: {response_type: "code", client_id: "test-client-id", redirect_uri: "https://example.com/auth/apple/callback", scope: "name email", state: "test-state"}
|
17
|
+
[Clavis] Authorization request initiated for provider: facebook
|
18
|
+
[Clavis] Authorization parameters: {response_type: "code", client_id: "test-client-id", redirect_uri: "https://example.com/auth/facebook/callback", scope: "email public_profile", state: "test-state"}
|
19
|
+
[Clavis] Authorization request initiated for provider: microsoft
|
20
|
+
[Clavis] Authorization parameters: {response_type: "code", client_id: "test-client-id", redirect_uri: "https://example.com/auth/microsoft/callback", scope: "openid email profile User.Read", state: "test-state", nonce: "test-nonce"}
|
data/log/test.log
ADDED
File without changes
|
data/sig/clavis.rbs
ADDED