better_auth 0.1.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.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +110 -18
  4. data/lib/better_auth/adapters/base.rb +49 -0
  5. data/lib/better_auth/adapters/internal_adapter.rb +589 -0
  6. data/lib/better_auth/adapters/memory.rb +235 -0
  7. data/lib/better_auth/adapters/mongodb.rb +9 -0
  8. data/lib/better_auth/adapters/mssql.rb +42 -0
  9. data/lib/better_auth/adapters/mysql.rb +33 -0
  10. data/lib/better_auth/adapters/postgres.rb +17 -0
  11. data/lib/better_auth/adapters/sql.rb +441 -0
  12. data/lib/better_auth/adapters/sqlite.rb +20 -0
  13. data/lib/better_auth/api.rb +226 -0
  14. data/lib/better_auth/api_error.rb +53 -0
  15. data/lib/better_auth/auth.rb +42 -0
  16. data/lib/better_auth/configuration.rb +399 -0
  17. data/lib/better_auth/context.rb +211 -0
  18. data/lib/better_auth/cookies.rb +278 -0
  19. data/lib/better_auth/core.rb +37 -1
  20. data/lib/better_auth/crypto/jwe.rb +76 -0
  21. data/lib/better_auth/crypto.rb +191 -0
  22. data/lib/better_auth/database_hooks.rb +114 -0
  23. data/lib/better_auth/endpoint.rb +326 -0
  24. data/lib/better_auth/error.rb +52 -0
  25. data/lib/better_auth/middleware/origin_check.rb +128 -0
  26. data/lib/better_auth/password.rb +120 -0
  27. data/lib/better_auth/plugin.rb +142 -0
  28. data/lib/better_auth/plugin_context.rb +16 -0
  29. data/lib/better_auth/plugin_registry.rb +67 -0
  30. data/lib/better_auth/plugins/access.rb +87 -0
  31. data/lib/better_auth/plugins/additional_fields.rb +29 -0
  32. data/lib/better_auth/plugins/admin/schema.rb +28 -0
  33. data/lib/better_auth/plugins/admin.rb +518 -0
  34. data/lib/better_auth/plugins/anonymous.rb +198 -0
  35. data/lib/better_auth/plugins/api_key.rb +16 -0
  36. data/lib/better_auth/plugins/bearer.rb +128 -0
  37. data/lib/better_auth/plugins/captcha.rb +159 -0
  38. data/lib/better_auth/plugins/custom_session.rb +84 -0
  39. data/lib/better_auth/plugins/device_authorization.rb +302 -0
  40. data/lib/better_auth/plugins/email_otp.rb +536 -0
  41. data/lib/better_auth/plugins/expo.rb +88 -0
  42. data/lib/better_auth/plugins/generic_oauth.rb +780 -0
  43. data/lib/better_auth/plugins/have_i_been_pwned.rb +94 -0
  44. data/lib/better_auth/plugins/jwt.rb +482 -0
  45. data/lib/better_auth/plugins/last_login_method.rb +92 -0
  46. data/lib/better_auth/plugins/magic_link.rb +181 -0
  47. data/lib/better_auth/plugins/mcp.rb +342 -0
  48. data/lib/better_auth/plugins/multi_session.rb +173 -0
  49. data/lib/better_auth/plugins/oauth_protocol.rb +694 -0
  50. data/lib/better_auth/plugins/oauth_provider.rb +16 -0
  51. data/lib/better_auth/plugins/oauth_proxy.rb +257 -0
  52. data/lib/better_auth/plugins/oidc_provider.rb +597 -0
  53. data/lib/better_auth/plugins/one_tap.rb +154 -0
  54. data/lib/better_auth/plugins/one_time_token.rb +106 -0
  55. data/lib/better_auth/plugins/open_api.rb +489 -0
  56. data/lib/better_auth/plugins/organization/schema.rb +106 -0
  57. data/lib/better_auth/plugins/organization.rb +995 -0
  58. data/lib/better_auth/plugins/passkey.rb +16 -0
  59. data/lib/better_auth/plugins/phone_number.rb +321 -0
  60. data/lib/better_auth/plugins/scim.rb +16 -0
  61. data/lib/better_auth/plugins/siwe.rb +242 -0
  62. data/lib/better_auth/plugins/sso.rb +16 -0
  63. data/lib/better_auth/plugins/stripe.rb +16 -0
  64. data/lib/better_auth/plugins/two_factor.rb +514 -0
  65. data/lib/better_auth/plugins/username.rb +278 -0
  66. data/lib/better_auth/plugins.rb +46 -0
  67. data/lib/better_auth/rate_limiter.rb +232 -0
  68. data/lib/better_auth/request_ip.rb +70 -0
  69. data/lib/better_auth/router.rb +378 -0
  70. data/lib/better_auth/routes/account.rb +211 -0
  71. data/lib/better_auth/routes/email_verification.rb +111 -0
  72. data/lib/better_auth/routes/error.rb +102 -0
  73. data/lib/better_auth/routes/ok.rb +15 -0
  74. data/lib/better_auth/routes/password.rb +183 -0
  75. data/lib/better_auth/routes/session.rb +160 -0
  76. data/lib/better_auth/routes/sign_in.rb +90 -0
  77. data/lib/better_auth/routes/sign_out.rb +15 -0
  78. data/lib/better_auth/routes/sign_up.rb +196 -0
  79. data/lib/better_auth/routes/social.rb +367 -0
  80. data/lib/better_auth/routes/user.rb +205 -0
  81. data/lib/better_auth/schema/sql.rb +202 -0
  82. data/lib/better_auth/schema.rb +291 -0
  83. data/lib/better_auth/session.rb +122 -0
  84. data/lib/better_auth/session_store.rb +91 -0
  85. data/lib/better_auth/social_providers/apple.rb +91 -0
  86. data/lib/better_auth/social_providers/atlassian.rb +32 -0
  87. data/lib/better_auth/social_providers/base.rb +325 -0
  88. data/lib/better_auth/social_providers/cognito.rb +32 -0
  89. data/lib/better_auth/social_providers/discord.rb +81 -0
  90. data/lib/better_auth/social_providers/dropbox.rb +33 -0
  91. data/lib/better_auth/social_providers/facebook.rb +35 -0
  92. data/lib/better_auth/social_providers/figma.rb +31 -0
  93. data/lib/better_auth/social_providers/github.rb +74 -0
  94. data/lib/better_auth/social_providers/gitlab.rb +67 -0
  95. data/lib/better_auth/social_providers/google.rb +90 -0
  96. data/lib/better_auth/social_providers/huggingface.rb +31 -0
  97. data/lib/better_auth/social_providers/kakao.rb +32 -0
  98. data/lib/better_auth/social_providers/kick.rb +32 -0
  99. data/lib/better_auth/social_providers/line.rb +33 -0
  100. data/lib/better_auth/social_providers/linear.rb +44 -0
  101. data/lib/better_auth/social_providers/linkedin.rb +30 -0
  102. data/lib/better_auth/social_providers/microsoft_entra_id.rb +137 -0
  103. data/lib/better_auth/social_providers/naver.rb +31 -0
  104. data/lib/better_auth/social_providers/notion.rb +33 -0
  105. data/lib/better_auth/social_providers/paybin.rb +31 -0
  106. data/lib/better_auth/social_providers/paypal.rb +36 -0
  107. data/lib/better_auth/social_providers/polar.rb +31 -0
  108. data/lib/better_auth/social_providers/railway.rb +49 -0
  109. data/lib/better_auth/social_providers/reddit.rb +32 -0
  110. data/lib/better_auth/social_providers/roblox.rb +31 -0
  111. data/lib/better_auth/social_providers/salesforce.rb +38 -0
  112. data/lib/better_auth/social_providers/slack.rb +30 -0
  113. data/lib/better_auth/social_providers/spotify.rb +31 -0
  114. data/lib/better_auth/social_providers/tiktok.rb +35 -0
  115. data/lib/better_auth/social_providers/twitch.rb +39 -0
  116. data/lib/better_auth/social_providers/twitter.rb +32 -0
  117. data/lib/better_auth/social_providers/vercel.rb +47 -0
  118. data/lib/better_auth/social_providers/vk.rb +34 -0
  119. data/lib/better_auth/social_providers/wechat.rb +104 -0
  120. data/lib/better_auth/social_providers/zoom.rb +31 -0
  121. data/lib/better_auth/social_providers.rb +38 -0
  122. data/lib/better_auth/version.rb +1 -1
  123. data/lib/better_auth.rb +86 -2
  124. metadata +233 -21
  125. data/.ruby-version +0 -1
  126. data/.standard.yml +0 -12
  127. data/.vscode/settings.json +0 -22
  128. data/AGENTS.md +0 -50
  129. data/CLAUDE.md +0 -1
  130. data/CODE_OF_CONDUCT.md +0 -173
  131. data/CONTRIBUTING.md +0 -187
  132. data/Gemfile +0 -12
  133. data/Makefile +0 -207
  134. data/Rakefile +0 -25
  135. data/SECURITY.md +0 -28
  136. data/docker-compose.yml +0 -63
metadata CHANGED
@@ -1,15 +1,34 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: better_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Sala
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2026-03-23 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
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
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '1.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '0.2'
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '1.0'
13
32
  - !ruby/object:Gem::Dependency
14
33
  name: rack
15
34
  requirement: !ruby/object:Gem::Requirement
@@ -53,19 +72,25 @@ dependencies:
53
72
  - !ruby/object:Gem::Version
54
73
  version: '2.8'
55
74
  - !ruby/object:Gem::Dependency
56
- name: bcrypt
75
+ name: jwe
57
76
  requirement: !ruby/object:Gem::Requirement
58
77
  requirements:
59
78
  - - "~>"
60
79
  - !ruby/object:Gem::Version
61
- version: '3.1'
80
+ version: '1.1'
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: 1.1.1
62
84
  type: :runtime
63
85
  prerelease: false
64
86
  version_requirements: !ruby/object:Gem::Requirement
65
87
  requirements:
66
88
  - - "~>"
67
89
  - !ruby/object:Gem::Version
68
- version: '3.1'
90
+ version: '1.1'
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: 1.1.1
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: bundler
71
96
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +105,20 @@ dependencies:
80
105
  - - "~>"
81
106
  - !ruby/object:Gem::Version
82
107
  version: '2.5'
108
+ - !ruby/object:Gem::Dependency
109
+ name: bcrypt
110
+ requirement: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - "~>"
113
+ - !ruby/object:Gem::Version
114
+ version: '3.1'
115
+ type: :development
116
+ prerelease: false
117
+ version_requirements: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - "~>"
120
+ - !ruby/object:Gem::Version
121
+ version: '3.1'
83
122
  - !ruby/object:Gem::Dependency
84
123
  name: minitest
85
124
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +175,76 @@ dependencies:
136
175
  - - "~>"
137
176
  - !ruby/object:Gem::Version
138
177
  version: '0.22'
178
+ - !ruby/object:Gem::Dependency
179
+ name: pg
180
+ requirement: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - "~>"
183
+ - !ruby/object:Gem::Version
184
+ version: '1.5'
185
+ type: :development
186
+ prerelease: false
187
+ version_requirements: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - "~>"
190
+ - !ruby/object:Gem::Version
191
+ version: '1.5'
192
+ - !ruby/object:Gem::Dependency
193
+ name: mysql2
194
+ requirement: !ruby/object:Gem::Requirement
195
+ requirements:
196
+ - - "~>"
197
+ - !ruby/object:Gem::Version
198
+ version: '0.5'
199
+ type: :development
200
+ prerelease: false
201
+ version_requirements: !ruby/object:Gem::Requirement
202
+ requirements:
203
+ - - "~>"
204
+ - !ruby/object:Gem::Version
205
+ version: '0.5'
206
+ - !ruby/object:Gem::Dependency
207
+ name: sqlite3
208
+ requirement: !ruby/object:Gem::Requirement
209
+ requirements:
210
+ - - "~>"
211
+ - !ruby/object:Gem::Version
212
+ version: '2.0'
213
+ type: :development
214
+ prerelease: false
215
+ version_requirements: !ruby/object:Gem::Requirement
216
+ requirements:
217
+ - - "~>"
218
+ - !ruby/object:Gem::Version
219
+ version: '2.0'
220
+ - !ruby/object:Gem::Dependency
221
+ name: sequel
222
+ requirement: !ruby/object:Gem::Requirement
223
+ requirements:
224
+ - - "~>"
225
+ - !ruby/object:Gem::Version
226
+ version: '5.83'
227
+ type: :development
228
+ prerelease: false
229
+ version_requirements: !ruby/object:Gem::Requirement
230
+ requirements:
231
+ - - "~>"
232
+ - !ruby/object:Gem::Version
233
+ version: '5.83'
234
+ - !ruby/object:Gem::Dependency
235
+ name: tiny_tds
236
+ requirement: !ruby/object:Gem::Requirement
237
+ requirements:
238
+ - - "~>"
239
+ - !ruby/object:Gem::Version
240
+ version: '2.1'
241
+ type: :development
242
+ prerelease: false
243
+ version_requirements: !ruby/object:Gem::Requirement
244
+ requirements:
245
+ - - "~>"
246
+ - !ruby/object:Gem::Version
247
+ version: '2.1'
139
248
  description: Better Auth is a comprehensive, framework-agnostic authentication library
140
249
  for Ruby. It provides a complete set of features out of the box with a plugin ecosystem.
141
250
  email:
@@ -144,23 +253,128 @@ executables: []
144
253
  extensions: []
145
254
  extra_rdoc_files: []
146
255
  files:
147
- - ".ruby-version"
148
- - ".standard.yml"
149
- - ".vscode/settings.json"
150
- - AGENTS.md
151
256
  - CHANGELOG.md
152
- - CLAUDE.md
153
- - CODE_OF_CONDUCT.md
154
- - CONTRIBUTING.md
155
- - Gemfile
156
257
  - LICENSE.md
157
- - Makefile
158
258
  - README.md
159
- - Rakefile
160
- - SECURITY.md
161
- - docker-compose.yml
162
259
  - lib/better_auth.rb
260
+ - lib/better_auth/adapters/base.rb
261
+ - lib/better_auth/adapters/internal_adapter.rb
262
+ - lib/better_auth/adapters/memory.rb
263
+ - lib/better_auth/adapters/mongodb.rb
264
+ - lib/better_auth/adapters/mssql.rb
265
+ - lib/better_auth/adapters/mysql.rb
266
+ - lib/better_auth/adapters/postgres.rb
267
+ - lib/better_auth/adapters/sql.rb
268
+ - lib/better_auth/adapters/sqlite.rb
269
+ - lib/better_auth/api.rb
270
+ - lib/better_auth/api_error.rb
271
+ - lib/better_auth/auth.rb
272
+ - lib/better_auth/configuration.rb
273
+ - lib/better_auth/context.rb
274
+ - lib/better_auth/cookies.rb
163
275
  - lib/better_auth/core.rb
276
+ - lib/better_auth/crypto.rb
277
+ - lib/better_auth/crypto/jwe.rb
278
+ - lib/better_auth/database_hooks.rb
279
+ - lib/better_auth/endpoint.rb
280
+ - lib/better_auth/error.rb
281
+ - lib/better_auth/middleware/origin_check.rb
282
+ - lib/better_auth/password.rb
283
+ - lib/better_auth/plugin.rb
284
+ - lib/better_auth/plugin_context.rb
285
+ - lib/better_auth/plugin_registry.rb
286
+ - lib/better_auth/plugins.rb
287
+ - lib/better_auth/plugins/access.rb
288
+ - lib/better_auth/plugins/additional_fields.rb
289
+ - lib/better_auth/plugins/admin.rb
290
+ - lib/better_auth/plugins/admin/schema.rb
291
+ - lib/better_auth/plugins/anonymous.rb
292
+ - lib/better_auth/plugins/api_key.rb
293
+ - lib/better_auth/plugins/bearer.rb
294
+ - lib/better_auth/plugins/captcha.rb
295
+ - lib/better_auth/plugins/custom_session.rb
296
+ - lib/better_auth/plugins/device_authorization.rb
297
+ - lib/better_auth/plugins/email_otp.rb
298
+ - lib/better_auth/plugins/expo.rb
299
+ - lib/better_auth/plugins/generic_oauth.rb
300
+ - lib/better_auth/plugins/have_i_been_pwned.rb
301
+ - lib/better_auth/plugins/jwt.rb
302
+ - lib/better_auth/plugins/last_login_method.rb
303
+ - lib/better_auth/plugins/magic_link.rb
304
+ - lib/better_auth/plugins/mcp.rb
305
+ - lib/better_auth/plugins/multi_session.rb
306
+ - lib/better_auth/plugins/oauth_protocol.rb
307
+ - lib/better_auth/plugins/oauth_provider.rb
308
+ - lib/better_auth/plugins/oauth_proxy.rb
309
+ - lib/better_auth/plugins/oidc_provider.rb
310
+ - lib/better_auth/plugins/one_tap.rb
311
+ - lib/better_auth/plugins/one_time_token.rb
312
+ - lib/better_auth/plugins/open_api.rb
313
+ - lib/better_auth/plugins/organization.rb
314
+ - lib/better_auth/plugins/organization/schema.rb
315
+ - lib/better_auth/plugins/passkey.rb
316
+ - lib/better_auth/plugins/phone_number.rb
317
+ - lib/better_auth/plugins/scim.rb
318
+ - lib/better_auth/plugins/siwe.rb
319
+ - lib/better_auth/plugins/sso.rb
320
+ - lib/better_auth/plugins/stripe.rb
321
+ - lib/better_auth/plugins/two_factor.rb
322
+ - lib/better_auth/plugins/username.rb
323
+ - lib/better_auth/rate_limiter.rb
324
+ - lib/better_auth/request_ip.rb
325
+ - lib/better_auth/router.rb
326
+ - lib/better_auth/routes/account.rb
327
+ - lib/better_auth/routes/email_verification.rb
328
+ - lib/better_auth/routes/error.rb
329
+ - lib/better_auth/routes/ok.rb
330
+ - lib/better_auth/routes/password.rb
331
+ - lib/better_auth/routes/session.rb
332
+ - lib/better_auth/routes/sign_in.rb
333
+ - lib/better_auth/routes/sign_out.rb
334
+ - lib/better_auth/routes/sign_up.rb
335
+ - lib/better_auth/routes/social.rb
336
+ - lib/better_auth/routes/user.rb
337
+ - lib/better_auth/schema.rb
338
+ - lib/better_auth/schema/sql.rb
339
+ - lib/better_auth/session.rb
340
+ - lib/better_auth/session_store.rb
341
+ - lib/better_auth/social_providers.rb
342
+ - lib/better_auth/social_providers/apple.rb
343
+ - lib/better_auth/social_providers/atlassian.rb
344
+ - lib/better_auth/social_providers/base.rb
345
+ - lib/better_auth/social_providers/cognito.rb
346
+ - lib/better_auth/social_providers/discord.rb
347
+ - lib/better_auth/social_providers/dropbox.rb
348
+ - lib/better_auth/social_providers/facebook.rb
349
+ - lib/better_auth/social_providers/figma.rb
350
+ - lib/better_auth/social_providers/github.rb
351
+ - lib/better_auth/social_providers/gitlab.rb
352
+ - lib/better_auth/social_providers/google.rb
353
+ - lib/better_auth/social_providers/huggingface.rb
354
+ - lib/better_auth/social_providers/kakao.rb
355
+ - lib/better_auth/social_providers/kick.rb
356
+ - lib/better_auth/social_providers/line.rb
357
+ - lib/better_auth/social_providers/linear.rb
358
+ - lib/better_auth/social_providers/linkedin.rb
359
+ - lib/better_auth/social_providers/microsoft_entra_id.rb
360
+ - lib/better_auth/social_providers/naver.rb
361
+ - lib/better_auth/social_providers/notion.rb
362
+ - lib/better_auth/social_providers/paybin.rb
363
+ - lib/better_auth/social_providers/paypal.rb
364
+ - lib/better_auth/social_providers/polar.rb
365
+ - lib/better_auth/social_providers/railway.rb
366
+ - lib/better_auth/social_providers/reddit.rb
367
+ - lib/better_auth/social_providers/roblox.rb
368
+ - lib/better_auth/social_providers/salesforce.rb
369
+ - lib/better_auth/social_providers/slack.rb
370
+ - lib/better_auth/social_providers/spotify.rb
371
+ - lib/better_auth/social_providers/tiktok.rb
372
+ - lib/better_auth/social_providers/twitch.rb
373
+ - lib/better_auth/social_providers/twitter.rb
374
+ - lib/better_auth/social_providers/vercel.rb
375
+ - lib/better_auth/social_providers/vk.rb
376
+ - lib/better_auth/social_providers/wechat.rb
377
+ - lib/better_auth/social_providers/zoom.rb
164
378
  - lib/better_auth/version.rb
165
379
  homepage: https://github.com/sebasxsala/better-auth
166
380
  licenses:
@@ -170,7 +384,6 @@ metadata:
170
384
  source_code_uri: https://github.com/sebasxsala/better-auth
171
385
  changelog_uri: https://github.com/sebasxsala/better-auth/blob/main/packages/better_auth/CHANGELOG.md
172
386
  bug_tracker_uri: https://github.com/sebasxsala/better-auth/issues
173
- post_install_message:
174
387
  rdoc_options: []
175
388
  require_paths:
176
389
  - lib
@@ -185,8 +398,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
398
  - !ruby/object:Gem::Version
186
399
  version: '0'
187
400
  requirements: []
188
- rubygems_version: 3.5.22
189
- signing_key:
401
+ rubygems_version: 3.6.9
190
402
  specification_version: 4
191
403
  summary: Comprehensive authentication framework for Ruby/Rack
192
404
  test_files: []
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 3.3.10
data/.standard.yml DELETED
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # StandardRB Configuration
4
- # https://github.com/standardrb/standard
5
-
6
- ignore:
7
- - 'vendor/**/*'
8
- - 'node_modules/**/*'
9
- - 'tmp/**/*'
10
- - 'coverage/**/*'
11
- - 'doc/**/*'
12
- - 'pkg/**/*'
@@ -1,22 +0,0 @@
1
- {
2
- "rubyLsp.enabled": true,
3
- "rubyLsp.formatter": "standard",
4
- "rubyLsp.linters": ["standard"],
5
- "editor.formatOnSave": true,
6
- "editor.insertSpaces": true,
7
- "editor.tabSize": 2,
8
- "files.insertFinalNewline": true,
9
- "files.trimTrailingWhitespace": true,
10
- "[ruby]": {
11
- "editor.defaultFormatter": "Shopify.ruby-lsp",
12
- "editor.formatOnSave": true,
13
- "editor.rulers": [120]
14
- },
15
- "search.exclude": {
16
- "**/.bundle": true,
17
- "**/vendor": true,
18
- "**/coverage": true,
19
- "**/doc": true,
20
- "**/*.gem": true
21
- }
22
- }
data/AGENTS.md DELETED
@@ -1,50 +0,0 @@
1
- # AGENTS.md - Better Auth Core Package
2
-
3
- **⚠️ CRITICAL: Always read this file when editing files in packages/better_auth/**
4
-
5
- ## What is this package?
6
-
7
- This is the **core gem** of Better Auth Ruby - a Ruby port of the TypeScript [better-auth](https://github.com/better-auth/better-auth) library. It contains framework-agnostic authentication logic built on Rack.
8
-
9
- ## Upstream Reference
10
-
11
- **Always check `upstream/` before implementing or modifying features.**
12
-
13
- The TypeScript implementation in `upstream/packages/better-auth/` is the source of truth. Your workflow should be:
14
-
15
- 1. **Find the feature** in `upstream/packages/better-auth/src/`
16
- 2. **Understand how it works** in TypeScript
17
- 3. **Translate to Ruby** following Ruby/Rails best practices
18
- 4. **Adapt idiomatically** - don't do a literal translation, make it feel native to Ruby
19
-
20
- Key upstream directories:
21
- - `upstream/packages/better-auth/src/` - Core auth logic
22
- - `upstream/packages/better-auth/src/plugins/` - Plugin implementations
23
-
24
- ## Development Commands
25
-
26
- ```bash
27
- bundle install # Install dependencies
28
- bundle exec rake test # Run tests (Minitest)
29
- bundle exec standardrb # Run linter
30
- bundle exec standardrb --fix # Fix linting issues
31
- ```
32
-
33
- ## Directory Structure
34
-
35
- * `lib/better_auth.rb` - Main entry point
36
- * `lib/better_auth/core/` - Core authentication logic
37
- * `test/` - Tests (Minitest)
38
-
39
- ## Code Style
40
-
41
- * StandardRB for linting
42
- * `frozen_string_literal: true` in all files
43
- * snake_case for files/methods, CamelCase for classes
44
-
45
- ## After Everything is Done
46
-
47
- **Unless the user asked for it, DO NOT COMMIT**
48
-
49
- * Make sure `bundle exec standardrb` passes
50
- * Make sure `bundle exec rake test` passes
data/CLAUDE.md DELETED
@@ -1 +0,0 @@
1
- AGENTS.md
data/CODE_OF_CONDUCT.md DELETED
@@ -1,173 +0,0 @@
1
- # Contributor Covenant 3.0
2
-
3
- ## Our Pledge
4
-
5
- We pledge to make our community welcoming, safe, and equitable for all.
6
-
7
- We are committed to fostering an environment that respects and promotes the
8
- dignity, rights, and contributions of all individuals, regardless of
9
- characteristics including race, ethnicity, caste, color, age, physical
10
- characteristics, neurodiversity, disability, sex or gender, gender identity or
11
- expression, sexual orientation, language, philosophy or religion, national or
12
- social origin, socio-economic position, level of education, or other status.
13
- The same privileges of participation are extended to everyone who participates
14
- in good faith and in accordance with this Covenant.
15
-
16
- ## Encouraged Behaviors
17
-
18
- While acknowledging differences in social norms, we all strive to meet our
19
- community's expectations for positive behavior.
20
- We also understand that our words and actions may be interpreted differently
21
- than we intend based on culture, background, or native language.
22
-
23
- With these considerations in mind, we agree to behave mindfully toward each
24
- other and act in ways that center our shared values, including:
25
-
26
- 1. Respecting the **purpose of our community**, our activities, and our ways of
27
- gathering.
28
- 2. Engaging **kindly and honestly** with others.
29
- 3. Respecting **different viewpoints** and experiences.
30
- 4. **Taking responsibility** for our actions and contributions.
31
- 5. Gracefully giving and accepting **constructive feedback**.
32
- 6. Committing to **repairing harm** when it occurs.
33
- 7. Behaving in other ways that promote and sustain the **well-being of our
34
- community**.
35
-
36
- ## Restricted Behaviors
37
-
38
- We agree to restrict the following behaviors in our community.
39
- Instances, threats, and promotion of these behaviors are violations of this Code
40
- of Conduct.
41
-
42
- 1. **Harassment.** Violating explicitly expressed boundaries or engaging in
43
- unnecessary personal attention after any clear request to stop.
44
- 2. **Character attacks.** Making insulting, demeaning, or pejorative comments
45
- directed at a community member or group of people.
46
- 3. **Stereotyping or discrimination.** Characterizing anyone's personality or
47
- behavior on the basis of immutable identities or traits.
48
- 4. **Sexualization.** Behaving in a way that would generally be considered
49
- inappropriately intimate in the context or purpose of the community.
50
- 5. **Violating confidentiality**. Sharing or acting on someone's personal or
51
- private information without their permission.
52
- 6. **Endangerment.** Causing, encouraging, or threatening violence or other harm
53
- toward any person or group.
54
- 7. Behaving in other ways that **threaten the well-being** of our community.
55
-
56
- ### Other Restrictions
57
-
58
- 1. **Misleading identity.** Impersonating someone else for any reason, or
59
- pretending to be someone else to evade enforcement actions.
60
- 2. **Failing to credit sources.** Not properly crediting the sources of content
61
- you contribute.
62
- 3. **Promotional materials**. Sharing marketing or other commercial content in a
63
- way that is outside the norms of the community.
64
- 4. **Irresponsible communication.** Failing to responsibly present content which
65
- includes, links or describes any other restricted behaviors.
66
-
67
- ## Reporting an Issue
68
-
69
- Tensions can occur between community members even when they are trying their
70
- best to collaborate.
71
-
72
- Not every conflict represents a code of conduct violation, and this Code of
73
- Conduct reinforces encouraged behaviors and norms that can help avoid conflicts
74
- and minimize harm.
75
-
76
- When an incident does occur, it is important to report it promptly.
77
- To report a possible violation, **email [community@better-auth.com](mailto:community@better-auth.com)**
78
-
79
- Community Moderators take reports of violations seriously and will make every
80
- effort to respond in a timely manner.
81
-
82
- They will investigate all reports of code of conduct violations, reviewing
83
- messages, logs, and recordings, or interviewing witnesses and other
84
- participants.
85
-
86
- Community Moderators will keep investigation and enforcement actions as
87
- transparent as possible while prioritizing safety and confidentiality.
88
-
89
- In order to honor these values, enforcement actions are carried out in private
90
- with the involved parties, but communicating to the whole community may be part
91
- of a mutually agreed upon resolution.
92
-
93
- ## Addressing and Repairing Harm
94
-
95
- If an investigation by the Community Moderators finds that this Code of Conduct
96
- has been violated, the following enforcement ladder may be used to determine how
97
- best to repair harm, based on the incident's impact on the individuals involved
98
- and the community as a whole.
99
- Depending on the severity of a violation, lower rungs on the ladder may be
100
- skipped.
101
-
102
- 1. Warning
103
- 1. Event: A violation involving a single incident or series of incidents.
104
- 2. Consequence: A private, written warning from the Community Moderators.
105
- 3. Repair: Examples of repair include a private written apology,
106
- acknowledgement of responsibility, and seeking clarification on
107
- expectations.
108
- 2. Temporarily Limited Activities
109
- 1. Event: A repeated incidence of a violation that previously resulted in a
110
- warning, or the first incidence of a more serious violation.
111
- 2. Consequence: A private, written warning with a time-limited cooldown
112
- period designed to underscore the seriousness of the situation and give
113
- the community members involved time to process the incident.
114
- The cooldown period may be limited to particular communication channels or
115
- interactions with particular community members.
116
- 3. Repair: Examples of repair may include making an apology, using the
117
- cooldown period to reflect on actions and impact, and being thoughtful
118
- about re-entering community spaces after the period is over.
119
- 3. Temporary Suspension
120
- 1. Event: A pattern of repeated violation which the Community Moderators have
121
- tried to address with warnings, or a single serious violation.
122
- 2. Consequence: A private written warning with conditions for return from
123
- suspension.
124
- In general, temporary suspensions give the person being suspended time to
125
- reflect upon their behavior and possible corrective actions.
126
- 3. Repair: Examples of repair include respecting the spirit of the
127
- suspension, meeting the specified conditions for return, and being
128
- thoughtful about how to reintegrate with the community when the suspension
129
- is lifted.
130
- 4. Permanent Ban
131
- 1. Event: A pattern of repeated code of conduct violations that other steps
132
- on the ladder have failed to resolve, or a violation so serious that the
133
- Community Moderators determine there is no way to keep the community safe
134
- with this person as a member.
135
- 2. Consequence: Access to all community spaces, tools, and communication
136
- channels is removed.
137
- In general, permanent bans should be rarely used, should have strong
138
- reasoning behind them, and should only be resorted to if working through
139
- other remedies has failed to change the behavior.
140
- 3. Repair: There is no possible repair in cases of this severity.
141
-
142
- This enforcement ladder is intended as a guideline.
143
- It does not limit the ability of Community Managers to use their discretion and
144
- judgment, in keeping with the best interests of our community.
145
-
146
- ## Scope
147
-
148
- This Code of Conduct applies within all community spaces, and also applies when
149
- an individual is officially representing the community in public or other
150
- spaces.
151
- Examples of representing our community include using an official email address,
152
- posting via an official social media account, or acting as an appointed
153
- representative at an online or offline event.
154
-
155
- ## Attribution
156
-
157
- This Code of Conduct is adapted from the Contributor Covenant, version 3.0,
158
- permanently available at
159
- [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/).
160
-
161
- Contributor Covenant is stewarded by the Organization for Ethical Source and
162
- licensed under CC BY-SA 4.0.
163
- To view a copy of this license, visit
164
- [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/)
165
-
166
- For answers to common questions about Contributor Covenant, see the FAQ at
167
- [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq).
168
- Translations are provided at
169
- [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).
170
- Additional enforcement and community guideline resources can be found at
171
- [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources).
172
- The enforcement ladder was inspired by the work of
173
- [Mozilla's code of conduct team](https://github.com/mozilla/inclusion).