Skip to content

Modular logistics and supply chain operating system (LSOS)

release/v0.7.67 (#693)

Ronce00eda587ef
diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml
index 94455571..dfed1aab 100644
--- a/.github/workflows/performance.yml
+++ b/.github/workflows/performance.yml
@@ -44,8 +44,16 @@ on:
- main
workflow_dispatch:
inputs:
+ throughput_mode:
+ description: Throughput load model, vus (concurrent users, default) or rate (fixed arrival rate)
+ required: false
+ default: ''
+ throughput_peak_vus:
+ description: Peak concurrent virtual users for the throughput phase (vus mode)
+ required: false
+ default: ''
throughput_peak_rate:
- description: Peak arrival rate for the throughput phase (req/s)
+ description: Peak arrival rate for the throughput phase (req/s, rate mode)
required: false
default: ''
throughput_duration:
@@ -319,6 +327,8 @@ jobs:
GIT_REF: ${{ github.ref }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
SCENARIOS: ${{ inputs.scenarios || 'throughput,noisy_neighbour' }}
+ THROUGHPUT_MODE: ${{ inputs.throughput_mode }}
+ THROUGHPUT_PEAK_VUS: ${{ inputs.throughput_peak_vus }}
THROUGHPUT_PEAK_RATE: ${{ inputs.throughput_peak_rate }}
THROUGHPUT_DURATION: ${{ inputs.throughput_duration }}
NOISY_RATE: ${{ inputs.noisy_rate }}
diff --git a/RELEASE.md b/RELEASE.md
index dbde3dd1..122697d5 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -1,18 +1,16 @@
-> v0.7.66 ~ "One API consumer can no longer rate-limit the whole platform, plus admin rate-limit controls, API consumer visibility and release performance reports"
+> v0.7.67 ~ "API keys are generated randomly"
---
## Highlights
-Fleetbase `0.7.66` ships Core API `1.6.66` and Storefront `0.4.23`.
+Fleetbase `0.7.67` ships Core API `1.6.67`. It is a security release: upgrade promptly.
-- **Rate limiting is per API consumer.** One integration sending a burst of order requests with a single API key put the entire platform into `429 Too many requests` for every tenant, app and console user. Each API key or token now has its own limit, so only the busy consumer is throttled.
-- **Admins control rate limits from the console.** Admin › API Traffic › Rate Limits sets the per-consumer limit and window, and adds per-organization overrides (a custom limit, or unlimited) for high-volume integrations.
-- **Admins can see who is using the API.** Admin › API Traffic › API Consumers shows requests, 429s and a timeline for the last 5 minutes to 7 days, with a per-consumer table. A throttled consumer can be unblocked with one click.
-- **Every release gets an API performance report.** p50/p90/p95/p99 latency, throughput and error rate, overall and per endpoint, compared against the previous release, attached to the GitHub Release.
+- **API keys created in the same second were identical, across organizations.** API keys are now generated randomly.
+- **API requests are about twice as fast in the Docker images**: Xdebug was running in them.
---
## Component Versions
-- `console`: `0.7.66`
-- `core-api`: `1.6.66`
+- `console`: `0.7.67`
+- `core-api`: `1.6.67`
- `fleetops`: `0.6.70`
- `storefront`: `0.4.23`
- `ledger`: `0.0.11`
@@ -21,30 +19,24 @@ Fleetbase `0.7.66` ships Core API `1.6.66` and Storefront `0.4.23`.
- `customer-portal`: `0.0.15`
---
-## Fixes
-- **One API consumer could rate-limit the whole platform** (core-api #280, fleetbase #689). The rate limiter ran before the API key was authenticated, so it keyed every bucket on the client IP. Behind a load balancer that is the balancer's address, so every tenant, integration, driver app and console visitor shared one bucket of 120 requests a minute. A single customer creating orders over the API returned 429 to everyone, including people trying to sign in. The limiter now keys on the API key or token, and keeps the public API and the console's sign-in routes apart.
-- **One busy store could rate-limit every other store** (storefront #108). The Storefront API limiter had the same IP-keyed bucket, and its key collided with the core API's. It now keys on the store key plus the client IP, so each device of each store has its own limit.
-- **The API sees the real client IP behind proxies** (fleetbase #689). Proxies on private networks are trusted by default, so rate limiting and request logs see the caller's address instead of the load balancer's. Set `TRUSTED_PROXIES` for load balancers that connect from public addresses (e.g. Google Cloud: `35.191.0.0/16,130.211.0.0/22`).
-- **429 responses tell clients when to retry** (core-api #280). `Retry-After` and `X-RateLimit-*` headers were being dropped.
+## Security
+- **API keys created in the same second were identical, across organizations** (core-api #283). An API key was derived from the time it was created and its row id. The id was never loaded when the key was generated, so every key created in the same second, on any organization, got the same value. API authentication resolves a key to the first matching credential, so a key issued to one organization could authenticate as another's. Keys, including rolled keys, are now 32 random characters from a cryptographically secure generator.
---
-## Improvements
-- **Admin › API Traffic › Rate Limits** (core-api #281, fleetbase #690):
- - Turn rate limiting on or off, and set the requests per window and the window length.
- - Turn consumer tracking on or off.
- - Add per-organization overrides.
- - "Reset to Defaults" returns to the `THROTTLE_*` environment values.
-- **Admin › API Traffic › API Consumers** (core-api #281, fleetbase #690):
- - Totals for requests, 429s and active consumers, plus a request timeline.
- - The busiest or most throttled API keys, tokens and addresses, with their organization, request rate, peak and limit.
- - Counts are kept in Redis.
-- **API performance report on every release** (fleetbase #691). A k6 run exercises the public API: orders, places, contacts, drivers, vehicles, fleets and more. The report is published to the job summary and attached to the GitHub Release as `performance-report-<tag>.md/.html` and `performance-metrics-<tag>.json`.
+## Performance
+- **Xdebug no longer runs in the Docker images.** It was installed for test coverage and left in its default `develop` mode, which roughly doubled every API request's time and disabled the OPcache JIT, in production images too. The images now set `XDEBUG_MODE=off`; coverage runs still set their own mode.
---
## Upgrade Steps
-- **Check `TRUSTED_PROXIES` if your load balancer connects from a public address** (for example Google Cloud load balancers). The default trusts only private and loopback ranges.
-- **High-volume API integrations:** each API key now gets its own `THROTTLE_REQUESTS_PER_MINUTE` (default 120). Give heavy integrations an organization override under Admin › API Traffic › Rate Limits.
-- Consumer metrics need Redis, which the bundled stack provides. Set `THROTTLE_TRACK_CONSUMERS=false` to turn them off.
+- **Check for duplicate API keys and roll every credential that shares one.** Existing keys keep their values until they are rolled. Run this against both the live and the sandbox database:
+
+```sql
+SELECT `key`, COUNT(*) AS credentials, COUNT(DISTINCT company_uuid) AS orgs
+FROM api_credentials WHERE deleted_at IS NULL
+GROUP BY `key` HAVING COUNT(*) > 1;
+```
+
+Roll each affected key from Developers › API Keys, or tell the affected organizations to.
```bash
# Pull latest version
diff --git a/api/composer.json b/api/composer.json
index 8a933769..b9bf1704 100644
--- a/api/composer.json
+++ b/api/composer.json
@@ -20,7 +20,7 @@
"require": {
"php": ">=8.0 <8.3",
"appstract/laravel-opcache": "^4.0",
- "fleetbase/core-api": "^1.6.66",
+ "fleetbase/core-api": "^1.6.67",
"fleetbase/ai": "^0.0.5",
"fleetbase/fleetops-api": "^0.6.70",
"fleetbase/registry-bridge": "^0.1.10",
diff --git a/api/composer.lock b/api/composer.lock
index c8047629..76a234e2 100644
--- a/api/composer.lock
+++ b/api/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "75df3f80f6787d23dfa3903b6e452efe",
+ "content-hash": "2b3bb7b268c2871c773d2067216ff198",
"packages": [
{
"name": "appstract/laravel-opcache",
@@ -2310,16 +2310,16 @@
},
{
"name": "fleetbase/core-api",
- "version": "1.6.66",
+ "version": "1.6.67",
"source": {
"type": "git",
"url": "https://github.com/fleetbase/core-api.git",
- "reference": "74cc07ce7a1805405099dfda8a252451a4fbe0f0"
+ "reference": "a698292f8bf1f10c04af1ff8c030b705ef458274"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fleetbase/core-api/zipball/74cc07ce7a1805405099dfda8a252451a4fbe0f0",
- "reference": "74cc07ce7a1805405099dfda8a252451a4fbe0f0",
+ "url": "https://api.github.com/repos/fleetbase/core-api/zipball/a698292f8bf1f10c04af1ff8c030b705ef458274",
+ "reference": "a698292f8bf1f10c04af1ff8c030b705ef458274",
"shasum": ""
},
"require": {
@@ -2415,9 +2415,9 @@
],
"support": {
"issues": "https://github.com/fleetbase/core-api/issues",
- "source": "https://github.com/fleetbase/core-api/tree/v1.6.66"
+ "source": "https://github.com/fleetbase/core-api/tree/v1.6.67"
},
- "time": "2026-09-29T09:39:18+00:00"
+ "time": "2026-09-29T10:58:18+00:00"
},
{
"name": "fleetbase/countries",
diff --git a/console/package.json b/console/package.json
index 1b95953d..e8c12b87 100644
--- a/console/package.json
+++ b/console/package.json
@@ -1,6 +1,6 @@
{
"name": "@fleetbase/console",
- "version": "0.7.66",
+ "version": "0.7.67",
"private": true,
"description": "Modular logistics and supply chain operating system (LSOS)",
"repository": "https://github.com/fleetbase/fleetbase",
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 346966a4..36a1c9b9 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -76,7 +76,11 @@ ENV QUEUE_CONNECTION=redis
ENV CADDYFILE_PATH=/fleetbase/Caddyfile
ENV CONSOLE_PATH=/fleetbase/console
ENV OCTANE_SERVER=frankenphp
-ENV FLEETBASE_VERSION=0.7.66
+# Xdebug is installed for coverage runs, which set XDEBUG_MODE=coverage themselves. Left at
+# its "develop" default it roughly doubled every request's time and disabled the OPcache
+# JIT in every image built from here, production included.
+ENV XDEBUG_MODE=off
+ENV FLEETBASE_VERSION=0.7.67
# Set environment
ARG ENVIRONMENT=production
diff --git a/packages/core-api b/packages/core-api
index 74cc07ce..a698292f 160000
--- a/packages/core-api
+++ b/packages/core-api
@@ -1 +1 @@
-Subproject commit 74cc07ce7a1805405099dfda8a252451a4fbe0f0
+Subproject commit a698292f8bf1f10c04af1ff8c030b705ef458274
diff --git a/tests/k6/README.md b/tests/k6/README.md
index 87914885..771b4c8e 100644
--- a/tests/k6/README.md
+++ b/tests/k6/README.md
@@ -131,14 +131,16 @@ The Markdown report is also printed to stdout.
| `BASE_URL` | `http://localhost:8000` | API origin |
| `K6_LOAD_KEY` / `K6_NOISY_KEY` / `K6_VICTIM_KEY` | — | Keys from `mint-k6-keys.php`. NOISY and VICTIM must be different |
| `SCENARIOS` | `throughput,noisy_neighbour` | Phases to run |
-| `THROUGHPUT_PEAK_RATE` | `50` | Peak arrival rate (req/s). Ramp: 15% of the time to 20% of peak, 25% to peak, 50% at peak, 10% down |
+| `THROUGHPUT_MODE` | `vus` | `vus`: a fixed number of concurrent users, so latency is the API's and the rate is what it sustains. `rate`: a fixed arrival rate, which collapses into timeouts on a host slower than the rate |
+| `THROUGHPUT_PEAK_VUS` | `16` | Peak concurrent virtual users (`vus` mode). Ramp: 15% of the time to 20% of peak, 25% to peak, 50% at peak, 10% down |
+| `THROUGHPUT_PEAK_RATE` | `50` | Peak arrival rate in req/s (`rate` mode), same ramp |
| `THROUGHPUT_DURATION` | `3m30s` | Length of the throughput phase |
| `THROUGHPUT_VUS` / `THROUGHPUT_MAX_VUS` | `50` / `300` | Pre-allocated and maximum VUs |
| `EXCLUDE_ENDPOINTS` | – | Catalogue ops to leave out, e.g. `issues.list,fuel-reports.list` |
| `BASELINE_METRICS` | – | Absolute path to a previous `metrics.json`; adds p95/p99 change columns |
| `ENFORCE_BUDGETS` | `false` | `true` makes the read/write p95 budgets fail the run (CI: repo variable `K6_ENFORCE_BUDGETS`) |
| `SEED_ORDERS` | `10` | Orders `setup()` creates for the LOAD key so update/get have targets from the start |
-| `NOISY_RATE` | `10` | Flood rate (req/s); 600/min against the default 120/min limit |
+| `NOISY_RATE` | `4` | Flood rate (req/s); 240/min against the default 120/min limit |
| `NOISY_DURATION` | `90s` | Length of the flood |
| `NOISY_WARMUP` | `15s` | Delay before the victim and the probe start |
| `VICTIM_RATE` | `1` | Victim rate (req/s), rotating list, get, create, update and `GET /v1/places` |
diff --git a/tests/k6/api-release.js b/tests/k6/api-release.js
index 54333f9d..4a62b743 100644
--- a/tests/k6/api-release.js
+++ b/tests/k6/api-release.js
@@ -118,7 +118,13 @@ const CFG = {
baseUrl: BASE_URL,
requestTimeout: env('REQUEST_TIMEOUT', '30s'),
- // Throughput
+ // Throughput. "vus" (default) runs a fixed number of concurrent virtual users, each
+ // sending its next request when the last one returns: latency is the API's, and the
+ // request rate is whatever it sustains. "rate" sends at a fixed arrival rate whether
+ // or not earlier requests finished; on a runner slower than the rate the queue grows
+ // without bound and every request times out, so it only suits known-capacity hosts.
+ throughputMode: env('THROUGHPUT_MODE', 'vus') === 'rate' ? 'rate' : 'vus',
+ peakVUs: num('THROUGHPUT_PEAK_VUS', 16),
peakRate: num('THROUGHPUT_PEAK_RATE', 50),
throughputSec: seconds('THROUGHPUT_DURATION', '3m30s'),
throughputVUs: num('THROUGHPUT_VUS', 50),
@@ -130,7 +136,8 @@ const CFG = {
baselinePath: env('BASELINE_METRICS', ''),
// Noisy neighbour
- noisyRate: num('NOISY_RATE', 10),
+ // 4 req/s is 240/min: double the default 120/min limit, without swamping a CI runner.
+ noisyRate: num('NOISY_RATE', 4),
noisySec: seconds('NOISY_DURATION', '90s'),
noisyWarmupSec: seconds('NOISY_WARMUP', '15s'),
noisyMaxVUs: num('NOISY_MAX_VUS', 150),
@@ -258,12 +265,15 @@ const unexpectedStatus = new Rate('unexpected_status'); // non-2xx that is not a
| Scenarios + thresholds
* ------------------------------------------------------------------------- */
-const throughputStages = [
- { duration: `${Math.round(CFG.throughputSec * 0.15)}s`, target: Math.max(1, Math.round(CFG.peakRate * 0.2)) },
- { duration: `${Math.round(CFG.throughputSec * 0.25)}s`, target: CFG.peakRate },
- { duration: `${Math.round(CFG.throughputSec * 0.5)}s`, target: CFG.peakRate },
- { duration: `${Math.round(CFG.throughputSec * 0.1)}s`, target: 0 },
-];
+// Ramp: 15% of the time to 20% of peak, 25% up to peak, 50% at peak, 10% down.
+function rampTo(peak) {
+ return [
+ { duration: `${Math.round(CFG.throughputSec * 0.15)}s`, target: Math.max(1, Math.round(peak * 0.2)) },
+ { duration: `${Math.round(CFG.throughputSec * 0.25)}s`, target: peak },
+ { duration: `${Math.round(CFG.throughputSec * 0.5)}s`, target: peak },
+ { duration: `${Math.round(CFG.throughputSec * 0.1)}s`, target: 0 },
+ ];
+}
// constant-arrival-rate takes an integer rate per timeUnit; express fractional req/s
// (e.g. VICTIM_RATE=0.2 on a slow local stack) per minute instead.
@@ -278,16 +288,26 @@ const bystanderSec = Math.max(1, CFG.noisySec - CFG.noisyWarmupSec);
const scenarios = {};
if (RUN_THROUGHPUT) {
- scenarios.throughput = {
- executor: 'ramping-arrival-rate',
- exec: 'throughput',
- startRate: 1,
- timeUnit: '1s',
- preAllocatedVUs: CFG.throughputVUs,
- maxVUs: CFG.throughputMaxVUs,
- stages: throughputStages,
- tags: { role: 'load' },
- };
+ scenarios.throughput =
+ CFG.throughputMode === 'rate'
+ ? {
+ executor: 'ramping-arrival-rate',
+ exec: 'throughput',
+ startRate: 1,
+ timeUnit: '1s',
+ preAllocatedVUs: CFG.throughputVUs,
+ maxVUs: CFG.throughputMaxVUs,
+ stages: rampTo(CFG.peakRate),
+ tags: { role: 'load' },
+ }
+ : {
+ executor: 'ramping-vus',
+ exec: 'throughput',
+ startVUs: 1,
+ stages: rampTo(CFG.peakVUs),
+ gracefulRampDown: '30s',
+ tags: { role: 'load' },
+ };
}
if (RUN_NOISY) {
scenarios.noisy_flood = {
diff --git a/tests/k6/lib/report.js b/tests/k6/lib/report.js
index 3cabf928..b2339c01 100644
--- a/tests/k6/lib/report.js
+++ b/tests/k6/lib/report.js
@@ -291,7 +291,12 @@ function configRows(ctx) {
const { cfg } = ctx;
const rows = [['Base URL', cfg.baseUrl]];
if (ctx.runThroughput) {
- rows.push(['Throughput', `ramping arrival rate to ${cfg.peakRate} req/s over ${cfg.throughputSec}s (${cfg.throughputVUs}–${cfg.throughputMaxVUs} VUs)`]);
+ rows.push([
+ 'Throughput',
+ cfg.throughputMode === 'rate'
+ ? `ramping arrival rate to ${cfg.peakRate} req/s over ${cfg.throughputSec}s (${cfg.throughputVUs}–${cfg.throughputMaxVUs} VUs)`
+ : `ramping to ${cfg.peakVUs} concurrent virtual users over ${cfg.throughputSec}s (request rate is what the API sustains)`,
+ ]);
rows.push(['Endpoints', 'weighted catalogue across orders, places, contacts, drivers, vehicles, fleets, vendors, service areas/rates, issues and fuel reports']);
rows.push(['Latency budget (p95)', `reads < ${cfg.readP95} ms, writes < ${cfg.writeP95} ms`]);
} else {