Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
b8c4c28
feat(mongo): add a MongoDB store
vxnsin Oct 19, 2026
c7725d0
feat(mysql): add a MySQL store
vxnsin Oct 19, 2026
99cf1f4
chore: lock the store dev dependencies
vxnsin Oct 19, 2026
e540d37
ci: test the stores against MongoDB and MySQL
vxnsin Oct 19, 2026
02b7951
docs: list the mongo and mysql stores
vxnsin Oct 19, 2026
c4e171f
feat(redis): add the Redis store
vxnsin Oct 19, 2026
a9fc55b
chore: develop against the local inkan 0.8 core
vxnsin Oct 19, 2026
09830f3
feat(auth)!: keep state in the core Store, TTLs in ms
vxnsin Oct 19, 2026
4a64a67
feat(session)!: keep sessions in the core Store, TTLs in ms
vxnsin Oct 19, 2026
b981c89
feat(idempotency)!: keep answers in the core Store
vxnsin Oct 19, 2026
3241d9b
fix(secure-headers): tell HTTPS by ctx.secure
vxnsin Oct 19, 2026
085ce73
chore(secure-headers): name inkan 0.8 as the versions it works with
vxnsin Oct 19, 2026
e0af758
chore(circuit-breaker): name inkan 0.8 as the versions it works with
vxnsin Oct 19, 2026
3afa58a
chore(etag): name inkan 0.8 as the versions it works with
vxnsin Oct 19, 2026
022d485
chore(otel): name inkan 0.8 as the versions it works with
vxnsin Oct 19, 2026
bf6d0bb
chore(proxy): name inkan 0.8 as the versions it works with
vxnsin Oct 19, 2026
dbfa543
chore: sync lockfile
vxnsin Oct 19, 2026
aa625fb
feat(postgres): add the PostgreSQL store
vxnsin Oct 19, 2026
681ee62
fix(redis): one SUBSCRIBE per channel under concurrent subscribes
vxnsin Oct 19, 2026
94ed60f
ci: run the redis and postgres stores against service containers
vxnsin Oct 19, 2026
3eac5af
merge: redis and postgres stores
vxnsin Oct 19, 2026
9a9c1a5
merge: mongo and mysql stores
vxnsin Oct 19, 2026
5caf417
fix(mysql): send values as prepared statement parameters
vxnsin Oct 19, 2026
f4520d3
fix(mysql): sweep in batches until nothing expired is left
vxnsin Oct 19, 2026
a17bae3
fix(postgres): sweep in batches, and once at startup
vxnsin Oct 19, 2026
db3e240
fix(mysql): ignore messages dated past the server's clock
vxnsin Oct 19, 2026
220d991
fix(mongo): ignore messages dated past the server's clock
vxnsin Oct 19, 2026
e1d653d
fix(postgres): release the listening connection when LISTEN fails
vxnsin Oct 19, 2026
e224f4b
fix(mysql): refuse a step or TTL that is not a sane number
vxnsin Oct 19, 2026
b73ee8f
fix(mongo): refuse a step or TTL that is not a sane number
vxnsin Oct 19, 2026
7b5ec14
fix(redis): refuse a TTL that is not finite, positive and at most ten…
vxnsin Oct 19, 2026
b91e7ef
fix(postgres): refuse a TTL that is not finite, positive and at most …
vxnsin Oct 19, 2026
a4008ca
fix(postgres): increment on a value that is not a number throws a Typ…
vxnsin Oct 19, 2026
ef2bb95
fix(mysql): increment on a value that is not a number throws a TypeError
vxnsin Oct 19, 2026
79b16df
fix(mongo): increment on a value that is not a number throws a TypeError
vxnsin Oct 19, 2026
ee1354c
fix(redis): increment on a value that is not a number throws a TypeError
vxnsin Oct 19, 2026
f392bbf
fix(mongo): refuse a collection that already holds documents of the user
vxnsin Oct 19, 2026
54f19c3
fix(mysql): end the prefix in ':' and refuse keys with NUL or lone su…
vxnsin Oct 19, 2026
0724ed3
fix(mongo): end the prefix in ':' and refuse keys with NUL or lone su…
vxnsin Oct 19, 2026
2b05d79
fix(redis): end the prefix in ':' and refuse keys with NUL or lone su…
vxnsin Oct 19, 2026
9a95033
fix(postgres): end the prefix in ':', refuse NUL and lone surrogates,…
vxnsin Oct 19, 2026
5608ee3
fix(mysql): rethrow database errors without keys, values or SQL
vxnsin Oct 19, 2026
ca46687
fix(postgres): rethrow database errors without keys, values or the query
vxnsin Oct 19, 2026
f7b3449
fix(mongo): rethrow server errors without keys or values
vxnsin Oct 19, 2026
809d807
fix(redis): rethrow server errors without the command and its arguments
vxnsin Oct 19, 2026
6040ffd
fix(auth): keep the lockout escalation across fixed count windows
vxnsin Oct 19, 2026
08b8e19
docs: a Security section for each store
vxnsin Oct 19, 2026
9a451c0
test: fail a test file that makes inkan print a deprecation warning
vxnsin Oct 19, 2026
8ed5c22
refactor(auth): use the inkan 0.8.0 names
vxnsin Oct 19, 2026
a2062a5
refactor(circuit-breaker): use problem() with options
vxnsin Oct 19, 2026
8dcc75b
refactor(idempotency): use the inkan 0.8.0 names and stateKey
vxnsin Oct 19, 2026
b686e59
feat(otel): make the span active around the handler
vxnsin Oct 19, 2026
a31573b
refactor(proxy): use app.all and joinPath
vxnsin Oct 19, 2026
df2d55f
test: check the other packages for deprecation warnings too
vxnsin Oct 19, 2026
ac4a396
chore: release 0.8: depend on inkan 0.8.0 from npm, versions
vxnsin Oct 20, 2026
27d37cb
ci: no Redis build on install in the test matrix; skip messages survi…
vxnsin Oct 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
# redis-memory-server would build Redis from source on install, which breaks on new macOS
# SDKs; the stores job below runs the stores against real servers instead
env:
REDISMS_DISABLE_POSTINSTALL: "1"
strategy:
fail-fast: false
matrix:
Expand All @@ -30,3 +34,67 @@ jobs:
- run: npm install --no-audit --no-fund
- run: npm run typecheck
- run: npm test

# the stores against real servers: redis, postgres and mysql as service containers, mongo
# as a single-node replica set (change streams need one). The test job above runs redis and
# postgres on servers they download and skips mongo and mysql.
stores:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
node: [22, 26]
services:
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 10
postgres:
image: postgres:17
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 3s
--health-retries 10
mysql:
image: mysql:8.4
env:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_DATABASE: inkan_test
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1"
--health-interval 2s
--health-timeout 5s
--health-retries 30
env:
REDIS_URL: redis://localhost:6379
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
REDISMS_DISABLE_POSTINSTALL: "1"
MONGO_URL: mongodb://127.0.0.1:27017/?replicaSet=rs0&directConnection=true
MONGO_REPLSET: "1"
MYSQL_URL: mysql://root@127.0.0.1:3306/inkan_test
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node }}
- name: Start MongoDB 7 as a single-node replica set
run: |
docker run -d --name mongo -p 27017:27017 mongo:7 --replSet rs0 --bind_ip_all
for i in $(seq 1 30); do docker exec mongo mongosh --quiet --eval 'db.runCommand({ ping: 1 }).ok' && break; sleep 1; done
docker exec mongo mongosh --quiet --eval 'rs.initiate({ _id: "rs0", members: [{ _id: 0, host: "127.0.0.1:27017" }] })'
for i in $(seq 1 30); do [ "$(docker exec mongo mongosh --quiet --eval 'db.hello().isWritablePrimary')" = "true" ] && break; sleep 1; done
- run: npm install --no-audit --no-fund
- run: npm test -w packages/redis -w packages/postgres -w packages/mongo -w packages/mysql
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ itself, every package keeps no dependencies, but `@inkanjs/otel`, which needs
| [`@inkanjs/proxy`](packages/proxy) | A streaming reverse proxy: a prefix or one route handed on to an upstream. |
| [`@inkanjs/circuit-breaker`](packages/circuit-breaker) | Circuit breakers for outgoing calls and for routes: fail fast while something is down. |
| [`@inkanjs/otel`](packages/otel) | OpenTelemetry tracing: a server span per request, with the HTTP semantic conventions. |
| [`@inkanjs/mongo`](packages/mongo) | A `Store` on MongoDB, on your own client: jobs, rate limits and sessions shared by every process. |
| [`@inkanjs/mysql`](packages/mysql) | A `Store` on MySQL 8, on your own `mysql2` pool: jobs, rate limits and sessions shared by every process. |
| [`@inkanjs/redis`](packages/redis) | A `Store` on Redis, on your own `redis` or `ioredis` client: jobs, rate limits and sessions shared by every process, with pub/sub. |
| [`@inkanjs/postgres`](packages/postgres) | A `Store` on PostgreSQL, on your own `pg` pool or postgres.js: jobs, rate limits and sessions shared by every process, with LISTEN/NOTIFY. |

Every package is tested in CI on Node 22, 24 and 26:
Every package is tested in CI on Node 22, 24 and 26; the stores against MongoDB 7 and
MySQL 8.4 (locally they download a server once, or use `MONGO_URL` and `MYSQL_URL`):

```sh
npm install
Expand Down
Loading
Loading