Skip to content

Commit 072cd20

Browse files
committed
docs: public-hygiene pass — remove internal process references; fix copied-from-postgres SECURITY.md/CONTRIBUTING.md
Rewrites the five lines the public-hygiene gate flags on main so they state the behaviour instead of the process that produced it: the guard-number citations in next-version.sh and release-selftest.yml, and the audit/review narration in run_v2_backfill_if_needed's doc comment (the documented rolling- upgrade gap and its operational mitigation are unchanged). While here: SECURITY.md and CONTRIBUTING.md were still unedited store-postgres copies — security-advisory links pointed at the store-postgres repo, the scope section described a Postgres deployment, and the dev-setup instructions set BUSBAR_TEST_POSTGRES_URL (which this repo's tests never read, so the live-MySQL coverage silently skipped). Both files now describe store-mysql: correct repo links, MySQL-specific scope (ascii_bin identifier comparison, the CHECK/strict sql_mode boot probes), BUSBAR_TEST_MYSQL_URL, and the real crate layout (busbar-store-mysql lives in this repo, not the busbarAI monorepo).
1 parent a3fc006 commit 072cd20

5 files changed

Lines changed: 41 additions & 43 deletions

File tree

.github/scripts/next-version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# next-version.sh — compute THIS repo's next release tag for release-on-upstream.yml.
33
#
44
# Single source of truth for the version math, exercised in CI by release-selftest.yml so the
5-
# release automation can't silently rot (guard #135.8). Prints "v<MAJOR>.<MINOR>.<PATCH>" to stdout.
5+
# release automation cannot silently rot. Prints "v<MAJOR>.<MINOR>.<PATCH>" to stdout.
66
#
77
# Inputs (env, all optional):
88
# INPUT_VERSION explicit version to cut (leading "v" tolerated) -> used verbatim.

.github/workflows/release-selftest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CI self-test for the release-on-upstream version-compute logic (guard #135.8).
1+
# CI self-test for the release-on-upstream version-compute logic.
22
# Runs the REAL .github/scripts/next-version.sh against synthetic repos and asserts it produces a
33
# valid next version for BOTH the has-prior-tag and no-prior-tag cases — WITHOUT publishing anything.
44
# This is what keeps the release automation from silently rotting before the fleet fan-out is armed.

CONTRIBUTING.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Contributing to store-postgres
1+
# Contributing to store-mysql
22

3-
Thanks for your interest in improving `store-postgres`. This document covers
4-
how to build, test, and submit changes.
3+
Thanks for your interest in improving `store-mysql`. This document covers how
4+
to build, test, and submit changes.
55

66
## Ground rules
77

@@ -13,23 +13,22 @@ how to build, test, and submit changes.
1313

1414
## Development setup
1515

16-
`store-postgres` is a Rust `cdylib` plugin. You need a recent stable toolchain
16+
`store-mysql` is a Rust `cdylib` plugin. You need a recent stable toolchain
1717
(`rustup` recommended), and — until [busbarAI](https://github.com/GetBusbar/busbar)
1818
ships publicly — a sibling checkout of it at `../busbarAI`, since this crate's
19-
`Cargo.toml` points at busbar's crates as local path dependencies. See the
20-
README's [Dependencies](README.md#dependencies) section for the exact layout;
21-
CI checks out `GetBusbar/busbar` at the branch named in the reusable
22-
`plugin-ci.yml` workflow reference in [`ci.yml`](.github/workflows/ci.yml).
19+
`Cargo.toml` points at busbar's crates as local path dependencies. CI checks out
20+
`GetBusbar/busbar` at the branch named in the reusable `plugin-ci.yml` workflow
21+
reference in [`ci.yml`](.github/workflows/ci.yml).
2322

24-
The meaningful test coverage here needs a **live Postgres** — see the README's
25-
[Tests need a real Postgres](README.md#tests-need-a-real-postgres) section.
26-
Locally, `cargo test` skips that coverage cleanly if `BUSBAR_TEST_POSTGRES_URL`
27-
is unset; set it to point at a real Postgres 16+ database to exercise it:
23+
The meaningful test coverage here needs a **live MySQL** — see the README's
24+
[Testing](README.md#testing) section. Locally, `cargo test` skips that coverage
25+
cleanly if `BUSBAR_TEST_MYSQL_URL` is unset; set it to point at a real MySQL 8
26+
database to exercise it:
2827

2928
```bash
30-
export BUSBAR_TEST_POSTGRES_URL=postgres://busbar:busbar@localhost:5432/busbar_test
29+
export BUSBAR_TEST_MYSQL_URL=mysql://busbar:busbar@127.0.0.1:3306/busbar_test
3130
cargo build --release # cdylib
32-
cargo test # unit tests + the e2e dlopen/live-Postgres test
31+
cargo test # unit tests + the e2e dlopen/live-MySQL test
3332
cargo clippy --all-targets -- -D warnings # lints must be clean
3433
cargo fmt --all -- --check # format before committing
3534
```
@@ -38,20 +37,21 @@ cargo fmt --all -- --check # format before committing
3837

3938
1. **`cargo fmt --all`** — code must be rustfmt-clean.
4039
2. **`cargo clippy --all-targets -- -D warnings`** — no warnings.
41-
3. **`cargo build && cargo test`** — green, including the live-Postgres
40+
3. **`cargo build && cargo test`** — green, including the live-MySQL
4241
end-to-end test in `tests/e2e.rs` (it hard-fails under `CI=1` rather than
4342
silently skipping — never let that coverage quietly vanish).
4443
4. Add or update tests for any behavior change.
4544
5. Update documentation (`README.md`, doc comments) when you change behavior or config.
4645

4746
## Architecture
4847

49-
This repo is deliberately a thin adapter (`src/lib.rs`): it turns the engine's
50-
JSON `open` config into a `PostgresStore` and hands the trait object to
48+
The plugin crate (`store-mysql-plugin/`) is deliberately a thin adapter: it
49+
turns the engine's JSON `open` config into a `MysqlStore` and hands the trait
50+
object to
5151
[`busbar-plugin-sdk`](https://github.com/GetBusbar/busbar/tree/main/crates/plugin-sdk),
5252
which emits the C ABI symbols the loader resolves. All the SQL and schema logic
53-
lives in the `busbar-store-postgres` library crate this plugin wraps, in the
54-
`busbarAI` monorepo — most substantive changes belong there, not here.
53+
lives in the `busbar-store-mysql` library crate in the `store-mysql/` directory
54+
of THIS repository, so most substantive changes belong there.
5555

5656
## Commit & PR conventions
5757

SECURITY.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ requests, or discussions.**
88
Instead, report privately through either channel:
99

1010
- Email **security@getbusbar.com**, or
11-
- GitHub's [private vulnerability reporting](https://github.com/GetBusbar/store-postgres/security/advisories/new)
11+
- GitHub's [private vulnerability reporting](https://github.com/GetBusbar/store-mysql/security/advisories/new)
1212
(the **Security** tab on this repository).
1313

1414
Please include:
@@ -20,38 +20,37 @@ Please include:
2020

2121
We aim to **acknowledge your report within 48 hours**, work with you on a fix, and
2222
coordinate disclosure timing. Confirmed vulnerabilities are published as
23-
[GitHub Security Advisories](https://github.com/GetBusbar/store-postgres/security/advisories),
23+
[GitHub Security Advisories](https://github.com/GetBusbar/store-mysql/security/advisories),
2424
through which we request and issue **CVE** identifiers. We credit reporters who wish to be
2525
credited once a fix is released.
2626

2727
## Scope
2828

29-
`store-postgres` is a `kind: store` busbar plugin: it persists busbar's governance
30-
data — virtual keys, budgets, and usage — in a shared Postgres database behind a
31-
fleet of busbar nodes. Issues of particular interest include:
29+
`store-mysql` is a `kind: store` busbar plugin: it persists busbar's governance
30+
data — virtual keys, budgets, and usage — in a shared MySQL/MariaDB database
31+
behind a fleet of busbar nodes. Issues of particular interest include:
3232

3333
- SQL injection or any path where request-derived data reaches a query
3434
unparameterized.
3535
- Connection-string (`url`) handling that could leak credentials into logs or
3636
error strings.
37+
- Identifier-comparison gaps: opaque handles (credential lookup handles, key
38+
ids, group names) are stored with `ascii_bin` collation for byte-exact,
39+
case-sensitive comparison — anything that reintroduces MySQL's default
40+
case-insensitive matching on such a column is in scope.
3741
- Cross-node data races that corrupt shared governance state (budgets, usage
3842
ledgers) under concurrent writers.
43+
- A boot-probe bypass: the plugin refuses to start when `CHECK` constraints are
44+
unenforced or `sql_mode` is non-strict — anything that lets it run anyway and
45+
silently accept unvalidated data is in scope.
3946
- A load-time config error surfacing as a silent success instead of a clean
4047
`Err` across the plugin ABI.
4148

42-
**Known, documented limitation, not a vulnerability report:** this build
43-
connects `NoTls` (see the README's [Known limitations](README.md#known-limitations-documented-honestly-not-papered-over)
44-
section) — run it over a trusted network segment, a local socket, or a
45-
TLS-terminating proxy. This is a deployment consideration, not something we
46-
consider a defect in the plugin itself, but we're glad to hear if you think
47-
otherwise.
48-
4949
See busbar's own [threat model](https://github.com/GetBusbar/busbar/blob/main/THREAT_MODEL.md)
5050
for the trust boundaries this plugin operates inside.
5151

5252
## Supported versions
5353

54-
This plugin is versioned independently of busbar (see the README's
55-
[Versioning](README.md#versioning) section). Security fixes are applied to the
56-
latest `main` and the most recent tagged release of **this repository**. Pin to a
57-
tag for production use.
54+
This plugin is versioned independently of busbar. Security fixes are applied to
55+
the latest `main` and the most recent tagged release of **this repository**. Pin
56+
to a tag for production use.

store-mysql/src/lib.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,8 @@ impl MysqlStore {
279279
/// private scratch table instead of racing every other concurrently-running test's legitimate
280280
/// writes to the real, shared `usage_windows`.
281281
///
282-
/// KNOWN, DOCUMENTED, NOT-YET-CLOSED GAP (found in `/codeaudit`, confirmed by two independent
283-
/// adversarial design reviews — do not "fix" this with a lock; both reviews independently showed
284-
/// a lock here is the wrong tool, see below): this UPDATE is UNSCOPED and assumes "a one-time
282+
/// KNOWN, DOCUMENTED, NOT-YET-CLOSED GAP (a lock is the wrong tool here — see below for why
283+
/// a `GET_LOCK`-based approach cannot close it): this UPDATE is UNSCOPED and assumes "a one-time
285284
/// boot migration runs before any concurrent traffic exists" — true for a full-fleet restart, but
286285
/// this store's own target topology is a ROLLING upgrade (README: multiple busbar nodes sharing
287286
/// one MySQL server). In a rolling upgrade, some nodes are ALREADY LIVE on v2 — genuinely writing
@@ -290,13 +289,13 @@ impl MysqlStore {
290289
/// predicate (`billable_requests = 0 AND requests > 0`) no longer matches it, and that row's
291290
/// PRE-v2 historical `requests` are PERMANENTLY never reclassified as billable — a silent,
292291
/// unrepairable billing undercount, i.e. exactly the `hydrate_budgets` bug class this migration
293-
/// exists to close, reintroduced by a race in the migration itself. A `GET_LOCK`-based fix was
294-
/// designed and rejected in review: it can only serialize NODES STILL BOOTING against each
292+
/// exists to close, reintroduced by a race in the migration itself. A `GET_LOCK`-based fix
293+
/// does not work: it can only serialize NODES STILL BOOTING against each
295294
/// other (the backfill's own re-run is already idempotent, so that case was never actually
296295
/// unsafe) — it does nothing for a node that is ALREADY LIVE and never touches this function at
297296
/// all, which is the actual race. Closing this for real needs pre-v2 rows to be identifiable by
298297
/// something live traffic cannot change (a captured `window_start`/time cutoff, or a per-row
299-
/// provenance marker) — real redesign work, out of scope for this pass. OPERATIONAL MITIGATION
298+
/// provenance marker) — a schema redesign this store does not yet have. OPERATIONAL MITIGATION
300299
/// until that redesign lands: either pause the whole fleet briefly for a v1->v2 upgrade
301300
/// specifically (not required for any OTHER version bump), or re-run this same predicate as a
302301
/// manual reconciliation query after a rolling upgrade completes — safe to do since the

0 commit comments

Comments
 (0)