@raybase/create 0.3.12 → 0.3.13

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raybase/create",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "Scaffold secure internal apps powered by Raybase.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -261,6 +261,48 @@ Two client paths, both Core-owned:
261
261
  Auth refuses before Core's hook is reached. The flag only asks — a public
262
262
  signup mode is still what decides.
263
263
 
264
+ ## Sign-Up Allowlist
265
+
266
+ Where sign-up is open (`auth.signupMode` `"public"` or `"provider-only"`), a
267
+ deploy limits it to named people with `RAYBASE_SIGNUP_ALLOWLIST`: exact
268
+ addresses and `@domain` entries, comma-separated, compared ignoring case
269
+ (`toby@example.com, @example.org`). Set it on the Worker, as a secret when the
270
+ addresses are private; no code change. The app may give a default in
271
+ `appConfig.auth.signupAllowlist: ["@example.com"]`, which the variable replaces
272
+ whenever it holds an entry. An entry that is neither an address nor `@domain`
273
+ matches nothing (doctor reports it); `@example.org` does not match subdomains,
274
+ and `toby+x@example.com` is not `toby@example.com`.
275
+
276
+ With a list set, password sign-up and an outside provider's new account are
277
+ refused for an unlisted address. The refusal never says who is listed: with
278
+ email verification on, an unlisted password sign-up gets the "check your email"
279
+ answer a new address gets, and no mail; without it, the answer an address with
280
+ an account gets. Existing accounts sign in as before, and invites (and owner
281
+ setup) still admit whoever they name: an operator's invite is an admission of
282
+ its own. Do not build an app-side sign-up gate instead; this is the gate.
283
+
284
+ ## Sign-In Rate Limits
285
+
286
+ Raybase limits, per address and per client (`cf-connecting-ip`), asking for
287
+ sign-in email (codes, magic links, password-reset links, verification links)
288
+ and wrong sign-in codes. The counters are rows in the app's Durable Object
289
+ (`_auth_rate_limits`, keys HMAC'd under the auth secret), so every isolate
290
+ shares them; Better Auth's own in-memory limiter stands aside on those paths.
291
+
292
+ | Limit | Per address | Per client |
293
+ |---|---|---|
294
+ | `emails` | 3 per 10 minutes | 20 per hour |
295
+ | `wrongCodes` | 10 per hour | 20 per hour |
296
+
297
+ A limited request gets `429`, `Retry-After`, and
298
+ `{ error, message, code: "rate_limited", retryAfter }`, the same for every
299
+ address whether or not it has an account or is listed. A code that signs in is
300
+ not counted. Better Auth's `allowedAttempts` (three tries per code) still ends
301
+ each code. Change numbers with `appConfig.auth.rateLimits` (for example
302
+ `{ emails: { perClient: { max: 50, windowSeconds: 3600 } } }`); every limit
303
+ stays on. Locally the limits hold too: `GET /api/auth/raybase/sign-in-limits`
304
+ shows the counters and `DELETE` clears them (local only).
305
+
264
306
  ## Runtime Sign-In Links
265
307
 
266
308
  Runtime sign-in links are a separate, email-free capability for moving the
@@ -143,7 +143,9 @@ triggers, vars and secrets. It needs none of those secrets on the machine: a
143
143
  fresh clone with no `.raybase/` or `.dev.vars` builds, since the host
144
144
  supplies them at upload; `raybase deploy` still needs them locally. Each
145
145
  secret in the list has a `kind` (`random-32`, `ec-p256-jwk`,
146
- `retained-keys`, `provider-api-key` or `app-defined`). `raybase secrets
146
+ `retained-keys`, `provider-api-key`, `app-defined` or `address-list`; the last
147
+ is the optional `RAYBASE_SIGNUP_ALLOWLIST` of an app anyone may sign up to,
148
+ which limits sign-up to the people it names). `raybase secrets
147
149
  list` explains each secret and `raybase secrets new` prints fresh values, by
148
150
  kind, as JSON for `wrangler deploy --secrets-file`. `wrangler deploy` of the
149
151
  build then works on any account.