scribase-cli/CHANGELOG.md
caelum0x 191bdaa273 fix(security): SCR-OPS never send a login or shell token to a project-file api_url it wasn't issued for (0.3.7)
Commands took the API origin from .scribase/project.json and the token from
scribase login / SCRIBASE_ACCESS_TOKEN separately, so a shipped folder with a
crafted api_url received the token. New authenticatedApiUrl(): explicit
SCRIBASE_API_URL wins, else only the origin saved with the token; any other
origin is refused before a request. Folder-scoped .env tokens unchanged.
Reported by kta1kri.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 23:56:13 +03:00

112 lines
6.1 KiB
Markdown

# Changelog
## 0.3.7 (2026-11-27)
- Security: commands that use a stored `scribase login` token or a shell
`SCRIBASE_ACCESS_TOKEN` (`sql`, `migrate`, `env`, `branch`, `add`, `ota`,
railyard capabilities) took the server address from the folder's
`.scribase/project.json` and sent the token there without checking that the
token was issued for that server. A shared template, zip or tarball with a
crafted `api_url` could receive the token. They now send it only to the
server saved with the token at `scribase login` (default
`https://api.scribase.com`) or to an explicit `SCRIBASE_API_URL`, and refuse
any other address before making a request (`api_url_mismatch`). Tokens kept
in the folder's own `.env.local`/`.env` still go to that folder's project.
Affected: 0.3.2 to 0.3.6. Reported by kta1kri (https://github.com/kta1kri),
thank you.
## 0.3.5 (2026-11-27)
- Docs fix: README and `AGENTS.md` said `add email --to <address>` works on an
unclaimed temporary project. It does not, on purpose: an unclaimed project
only mails its owner, so the control plane answers `email_recipient_refused`
(HTTP 403). Both files now say what needs an account (email) and what does
not (database, auth, storage, REST).
- `add email` on an unclaimed project: the `next` hint now points at the claim
link instead of `scribase login`.
## 0.3.4 (2026-11-27)
- `npx scribase init`: the next steps now include one copy-paste `curl` that
reads the first table back through the project's REST API with the public
(anon) key, right after the step that creates the table. A person or a
coding agent can prove the backend answers from any terminal before writing
app code. Also present in `next_steps` with `--json`.
- `package.json`: description and keywords now say what the package does
(database, auth, storage, realtime, transactional email, MCP, coding agents)
so npm search finds it for those. No API change.
## 0.3.3 (2026-11-27)
- README/`package.json` homepage: added `?ref=npm` to the scribase.com link so
npm-page and README clicks are attributable in analytics. No functional change.
## 0.3.2 (2026-11-26)
- `npx scribase add email --to <address>`: a project made with `init --temp`
has no account yet, so there was no address for the proof email to go to
and `add email` always refused with `no_caller_email`. `--to` gives it one
explicitly (a disposable inbox, e.g. mail.tm, is fine) — this is the
missing step in the fully agent-driven, no-human path: `init --temp` for
the database, `add email --to <inbox>` for transactional email, both
without a signup page, a CAPTCHA, or a browser. Ignored once the project
is claimed or signed in; a real account's proof still only goes to its own
address. (Needs the matching control-plane fix; see `plans/scribase.md`.)
- New `AGENTS.md`, shipped in the package, and a README section pointing a
coding agent straight at the two commands above.
## 0.3.0 (2026-11-16, not yet published)
- The claim line `init` prints, `init --help`, `doctor` and the README now
match the live sign-up: free for 14 days, no card, and one project stays
free after that. The old "sign up + card check" wording is gone.
- `init` prints the UTC time a temporary project is deleted next to its claim
link (`deleted_at_utc` and `keep` in `--json`).
- Fixed: an exported `SCRIBASE_ACCESS_TOKEN` no longer overrides the token in
this folder's env file. `sql`, `migrate`, `add`, `ota`, `env` and `branch`
act on this folder's project, so the token `init` wrote here wins, then the
exported one, then `scribase login`. Before, a token exported for another
project made `npx scribase sql` answer `403 access is denied`. When the two
differ, one line on stderr says which was used;
`SCRIBASE_TOKEN_SOURCE=shell|file|login` forces one; `--verbose` (any
command) always prints the source, never the token. A `401`/`403` now names
the source of the refused token.
- New in the npm package: `npx scribase env [list|get]` lists this project's
environments, and `npx scribase branch [list|create|url|reset|delete]`
manages database branches (they were only in the full CLI before). Both
read the project from `.scribase/project.json`, so no ids are typed.
`branch create|url` write the branch's public URL and publishable key to
`.scribase/branches/<branch>.env`. `branch reset|delete` ask first (or take
`--yes`) and refuse `production`.
- Fixed: `init --temp` no longer fails with `401` when the saved login has
expired; it creates the temporary project without it.
- `npx scribase connect [tool...]` writes the Scribase MCP server into every
AI coding tool this machine has (Claude Code via `claude mcp add`, Cursor,
VS Code, Codex, Windsurf, Zed) in one idempotent command. `--dry-run` shows
what would change; `--tool <id>` (repeatable) configures exactly those
tools regardless of detection. Never writes a token or secret — every
client's own MCP OAuth flow runs on first use instead.
## 0.2.0 (2026-11-11)
- `npx scribase init` is temporary-first: with no sign-in it creates a 72-hour
temporary project and prints a claim link; `--account`, `--watch` and
`scribase doctor` are new.
- `npx scribase init` prints the project URL and, for a temporary project, the
claim link as soon as the backend is live, before the Vercel push and the
client-library install.
- `scribase add <capability>` (analytics, deploy, flags, uptime, ai, billing,
consent, …) wires one capability into the project and prints proof JSON of
the first real event.
- `scribase ota deploy|rollback|status` for over-the-air updates, and
`scribase migrate` runs the real plan/lint/apply route.
- `init` detects SvelteKit and scaffolds its `$env/static/public` client; the
generated plain-Node client auto-loads `.env`.
- The default region id is `eu-frankfurt` (it names the city, not a hosting
provider). Projects created with the earlier `oci-eu-frankfurt-1` label keep
working unchanged.
- `prepublishOnly` runs `scripts/check-npm-tarball.mjs --gitleaks`: the publish
stops if the tarball holds an env file, a key file, a file outside the allow
list, or a secret-looking string.