Bundle: redb-route / tests/docker (tests.docker.txt), 37 files Snapshot: development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Index: https://redbase.app/src/dev-2026-12-06/redb-route/_index.txt ==== Path: redb-route/tests/docker/README.md Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/README.md ---- # Test services for the redb.Route suites `redb.Route/docker-compose.tests.yml` holds every service the integration and interop suites under `redb.Route/tests` talk to. This folder holds their configuration files, the Dockerfiles of the small images built for them, and `gen-certs.sh`. ## Setup, once ```bash cd redb.Route bash tests/docker/gen-certs.sh ``` The script needs bash, openssl 3.2 or newer and docker. It writes the test keys, certificates and keystores into `tests/docker/.generated/` (git-ignored) and creates the folders some interop tests share with their containers. All of it is throwaway test material; `--force` regenerates it. Add these names to the hosts file of the machine that runs the tests: ``` 127.0.0.1 kafka-k1 kafka-k2 kafka-k3 127.0.0.1 pgdb msdb ``` The Kafka TLS listeners advertise `kafka-k1..3`, the only names the broker certificate carries. Some SQL and Quartz tests connect to `pgdb` and `msdb` by name. ## Run a suite Every service has a profile; a plain `docker compose up` starts nothing. Start the profile of a suite, run the suite, then remove everything. No service keeps data between runs. ```bash docker compose -f docker-compose.tests.yml --profile kafka up -d --wait dotnet test tests/redb.Route.Tests.Kafka docker compose -f docker-compose.tests.yml --profile all --profile pgdb --profile msdb down -v --remove-orphans ``` The first `up` of `firebase`, `grpc`, `soap` and `as2` builds a small image (dependencies baked in, nothing is installed when a container starts). ## Suites and profiles | Suite | Profiles | Variables the tests read | |---|---|---| | redb.Route.Tests.Amqp | `amqp` | | | redb.Route.Tests.As2 (interop) | `as2` | `AS2_INTEROP_CERTS=/redb.Route/tests/docker/.generated/as2/certs`, `REDB_AS2_INTEROP=1` to require the stand | | redb.Route.Tests.AzureServiceBus | `servicebus` | | | redb.Route.Tests.Cache | `redis` | | | redb.Route.Tests.Core | `pgdb`, `msdb` | | | redb.Route.Tests.Elasticsearch | `elasticsearch` | | | redb.Route.Tests.Firebase | `firebase` | the tests set `FIRESTORE_EMULATOR_HOST` and `STORAGE_EMULATOR_HOST` themselves | | redb.Route.Tests.Ftp | `ftp` | | | redb.Route.Tests.Grpc (interop) | `grpc` | `REDB_GRPC_CERTS=/redb.Route/tests/docker/.generated/grpc` | | redb.Route.Tests.IbmMq | `ibmmq` | | | redb.Route.Tests.Kafka | `kafka` | `REDB_KAFKA_TLS_DIR=/redb.Route/tests/docker/.generated/kafka` | | redb.Route.Tests.Ldap | `ldap` | | | redb.Route.Tests.Llm | `pgdb`, `msdb` | | | redb.Route.Tests.Mail | `mail` | | | redb.Route.Tests.MqttNet | `mqtt` | | | redb.Route.Tests.Quartz | `pgdb` | | | redb.Route.Tests.RabbitMQ | `rabbitmq`, `rabbitmq-tls` | `REDB_RABBIT_TLS_CERTS=/redb.Route/tests/docker/.generated/rabbit-tls` | | redb.Route.Tests.Redis | `redis` | | | redb.Route.Tests.S3 | `s3` | | | redb.Route.Tests.Sftp | `sftp` | | | redb.Route.Tests.SignalR | `redis` | | | redb.Route.Tests.Soap (interop) | `soap` | `SOAP_INTEROP_DIR=/redb.Route/tests/docker/.generated/soap` | | redb.Route.Tests.Sql | `pgdb`, `msdb`, `sql-tier2` (or `firebird`, `mysql`, `mariadb`, `oracle`) | | | redb.Route.Tests.Sqs | `sqs` | | | redb.Identity federation tests | `oauth2` | | | redb.Identity SMTP tests | `mail` | | `all` starts every service except `pgdb` and `msdb`, which have only their own profiles, so a machine that already serves Postgres on 5432 and SQL Server on 1433 never starts them. `ui` adds the optional web consoles. The RabbitMQ, Kafka and Redis suites also start containers of their own through Testcontainers, so the test process needs access to the Docker socket; the gRPC and SOAP interop tests call `docker exec`. Interop suites that do not find their service skip those tests (`REDB_AS2_INTEROP=1` turns the AS2 skip into a failure). ## Broker faults Some tests break the broker on purpose: they restart its container or pause it, and check that the connector reconnects (`tests/Shared/Conformance`: `BrokerFault`, `IConnectorStand`). They run only where a variable names the broker's container (`REDB_TEST_IBMMQ_CONTAINER` for IBM MQ, `REDB_TEST_RABBITMQ_CONTAINER` for RabbitMQ, `REDB_TEST_AMQP_CONTAINER` for Artemis, `REDB_TEST_MQTT_CONTAINER` for Mosquitto, `REDB_TEST_KAFKA_CONTAINER` for Kafka, `REDB_TEST_ASB_CONTAINER` for the Service Bus emulator) and skip everywhere else, the release gate included. The restart case of the shared connector tests (`ConnectorConformance`, which a suite inherits) also needs `REDB_TEST_BROKER_FAULTS`; the script sets both. Run them by hand on a docker host, from a copy of the repository: ```bash bash redb.Route/tests/docker/run-fault-suite.sh --image --broker ibmmq \ --project redb.Route.Tests.IbmMq --wait 300 \ --filter 'FullyQualifiedName~IbmMqReconnectTests|FullyQualifiedName~IbmMqConformanceTests' bash redb.Route/tests/docker/run-fault-suite.sh --image --broker rabbitmq \ --project redb.Route.Tests.RabbitMQ \ --filter 'FullyQualifiedName~RabbitMQReconnectTests|FullyQualifiedName~RabbitMQConformanceTests' bash redb.Route/tests/docker/run-fault-suite.sh --image --broker artemis \ --project redb.Route.Tests.Amqp --filter AmqpReconnectTests bash redb.Route/tests/docker/run-fault-suite.sh --image --broker mosquitto \ --project redb.Route.Tests.MqttNet --filter MqttReconnectTests bash redb.Route/tests/docker/run-fault-suite.sh --image --broker kafka \ --project redb.Route.Tests.Kafka --filter 'FullyQualifiedName~KafkaReconnectTests|FullyQualifiedName~KafkaConformanceTests' bash redb.Route/tests/docker/run-fault-suite.sh --image --broker servicebus --test-minutes 35 \ --project redb.Route.Tests.AzureServiceBus \ --filter 'FullyQualifiedName~AsbReconnectTests|FullyQualifiedName~AsbConformanceTests|FullyQualifiedName~AsbSessionConformanceTests' ``` The Kafka set runs against one KRaft node at localhost:39092, not the compose file's three: stopping one node of three tests a leader change, not a lost connection. The Service Bus set starts the emulator with its own SQL Edge container (SQL at 14330, AMQP at 5672) and the entities of `servicebus/Config.json`; only the emulator is stopped by the tests. Each emulator restart takes one and a half to two minutes, so the Service Bus set runs past the default 20 minutes. The Kafka and Service Bus conformance classes need these stands, so they are built only when the script sets `RedbBrokerFaultRun`; the release gate does not see them. The other sets are run by hand before a release that touches the connector's connection handling. Before every release the IBM MQ and RabbitMQ sets are run by hand: IBM MQ with the filter above, RabbitMQ with the whole suite but its TLS tests (`--filter 'FullyQualifiedName!~RabbitMQTlsBrokerTests'`). `RabbitMQTlsBrokerTests` stay with the release gate, which brings up the TLS and OAuth2 brokers (`rabbitmq-tls`, `rabbitmq-oauth2`); the fault runner starts only the plain broker. The script builds the suite in its own short-lived container and runs the tests with `--no-build` in a second one (build servers left in a test container kept it alive after the last test), starts the broker with host networking, waits for the broker's own health command (RabbitMQ: its "Server startup complete" log line, because its CLI run early stops it), and fails the run when the test host does not exit within 60 s of the summary, printing its processes and thread names. Each stage has a time limit (`--build-minutes`, `--test-minutes`): the build in the SDK test image hangs now and then, cause not found, and the limit is the guard; the run then fails and cleans up. `--wait` raises the tests' waits for a slow host. Everything it starts is removed when it ends. ## Host ports | Port | Service | | Port | Service | |---|---|---|---|---| | 21, 21000-21010 | ftp | | 9000, 9001 | s3 | | 389, 636 | openldap | | 9099, 8086, 4000 | firebase-emulators | | 1414, 9443 | ibmmq | | 9199 | mock-oauth2 | | 1433 | msdb | | 9200 | elasticsearch | | 1521 | oracle | | 9299 | rabbitmq-oauth2 | | 1883, 5673, 8161 | activemq | | 11883 | mosquitto | | 2222 | sftp | | 14080, 14081 | openas2 | | 3025, 3110, 3143, 3465, 3993, 3995, 8080 | greenmail | | 15672 | rabbitmq console | | 3050 | firebird | | 15674 | rabbitmq-tls console | | 3306 | mysql | | 18060 | soap-echo | | 3307 | mariadb | | 18100 | grpc-echo | | 4443 | fake-gcs | | 18200 | fcm-echo | | 4566 | localstack | | 29092, 29094, 29096 | kafka-k1..3 plain | | 5300 | servicebus | | 29192, 29194, 29196 | kafka-k1..3 SASL_SSL | | 5432 | pgdb | | 29292, 29294, 29296 | kafka-k1..3 mTLS | | 5671, 5674 | rabbitmq-tls | | 5540, 8389, 8888 | consoles (`ui`) | | 5672 | rabbitmq | | 6379 | redis | The tests also open listeners of their own on the host, which the containers reach as `host.docker.internal`: 15081 and 15082 (AS2 MDN), 15083-15086 (AS2 MIC profiles), 18110-18159 (gRPC), 18160-18199 (SOAP). Keep them free. ## Test credentials Fixed throwaway values, the same the tests use: RabbitMQ, ActiveMQ, IBM MQ, LDAP and GreenMail `admin`/`admin`; S3 `minioadmin`/`minioadmin`; SFTP and FTP `testuser`/`secret`; Postgres `postgres` (trust); SQL Server `sa`/`1`; Firebird `SYSDBA`/`1`; MySQL and MariaDB `root`/`1`; Oracle `rsql`/`Rsql2026`; Kafka SCRAM `redb`/`redb-secret`. ## Not part of this file The AS4 interop stand (Holodeck B2B, `redb.Route.Tests.As4` live and reference tests) needs partner keystores that cannot be generated here, so it is not published; those tests skip without it. Path: redb-route/tests/docker/as2/Dockerfile Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/as2/Dockerfile ---- # OpenAS2 with the interop configuration baked in. The keystores (.generated/as2/keystore) are mounted as files, # the message folders (.generated/as2/data) as a folder the As2 interop tests share with the container. FROM greicodex/openas2@sha256:6dcf8331aabdf02e0cbbeb6cca482795bea9a0fdd21992722fbe16e51d3d43ff COPY config/ /opt/openas2/config/ Path: redb-route/tests/docker/as2/README.md Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/as2/README.md ---- # AS2 interop: OpenAS2 A real OpenAS2 server (greicodex/openas2, BouncyCastle) for `redb.Route.Tests.As2` `As2InteropTests`: signed and encrypted AS2 messages in both directions, with synchronous and asynchronous signed MDNs. An implementation that shares no code with `redb.Route.As2` accepting our wire format and MIC is what loopback tests cannot prove. Profile `as2` of `redb.Route/docker-compose.tests.yml` (see `../README.md`). The image bakes in `config/`; `gen-certs.sh` writes the keys: - `.generated/as2/certs/`: `redb.p12` (password `testpass`) and `redb.crt` for our side, `openas2.crt` for the partner; `AS2_INTEROP_CERTS` points here. - `.generated/as2/keystore/as2_certs.p12` (password `testas2`): OpenAS2's key (alias `openas2`) and our certificate (alias `redb`, trusted); mounted into the container with `ssl_certs.jks`. - `.generated/as2/data/`: OpenAS2's message folders, shared with the tests (they drop files into `data/outbox/redb-async` and watch `data/pendinginfoMDN3`). Partnerships (`config/partnerships.xml`): OpenAS2 receives on 10080 inside the container (host 14080) and its async MDN receiver on 10081 (host 14081); it posts to our receivers at `host.docker.internal:15081` and `:15082`. The tests skip without the stand; `REDB_AS2_INTEROP=1` makes that a failure. Path: redb-route/tests/docker/as2/config/commands.xml Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/as2/config/commands.xml ---- Path: redb-route/tests/docker/as2/config/config.xml Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/as2/config/config.xml ---- Path: redb-route/tests/docker/as2/config/db_ddl.sql Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/as2/config/db_ddl.sql ---- -- ----------------------------------------------------------------------- -- msg_metadata -- ----------------------------------------------------------------------- -- This DDL must stay aligned with the authoritative schema in -- Server/src/resources/db/openas2-schema.xml. If you add/remove a column -- here, mirror the change in the XML (and vice versa). DROP TABLE msg_metadata IF EXISTS; -- ----------------------------------------------------------------------- -- msg_metadata -- ----------------------------------------------------------------------- CREATE TABLE msg_metadata ( ID INTEGER NOT NULL AUTO_INCREMENT, MSG_ID LONGVARCHAR NOT NULL, PRIOR_MSG_ID LONGVARCHAR, MDN_ID LONGVARCHAR, DIRECTION VARCHAR(25), IS_RESEND VARCHAR(1) DEFAULT 'N', RESEND_COUNT INTEGER DEFAULT 0, SENDER_ID VARCHAR(255) NOT NULL, RECEIVER_ID VARCHAR(255) NOT NULL, STATUS VARCHAR(255), STATE VARCHAR(255), SIGNATURE_ALGORITHM VARCHAR(255), ENCRYPTION_ALGORITHM VARCHAR(255), COMPRESSION VARCHAR(255), FILE_NAME VARCHAR(255), SENT_FILE_NAME VARCHAR(255), CONTENT_TYPE VARCHAR(255), CONTENT_TRANSFER_ENCODING VARCHAR(255), MDN_MODE VARCHAR(255), MDN_RESPONSE LONGVARCHAR, MDN_FILE_PATH LONGVARCHAR, STATE_MSG LONGVARCHAR, CREATE_DT TIMESTAMP DEFAULT CURRENT_TIMESTAMP, UPDATE_DT TIMESTAMP, PRIMARY KEY (ID) ); CREATE UNIQUE INDEX MSG_ID_UNIQUE ON msg_metadata (MSG_ID); -- ----------------------------------------------------------------------- -- partner / partnership tables used by org.openas2.partner.DbPartnershipFactory -- to load partnerships from a database instead of the partnerships XML file. -- partnership_attribute.CATEGORY is 'attribute' for regular partnership -- attributes, 'sender'/'receiver' for per-partnership overrides applied on -- top of the linked partner's attributes or 'pollerConfig' for the attributes -- of a partnership specific directory poller. -- ----------------------------------------------------------------------- DROP TABLE partnership_attribute IF EXISTS; DROP TABLE partnership IF EXISTS; DROP TABLE partner_attribute IF EXISTS; DROP TABLE partner IF EXISTS; CREATE TABLE partner ( ID INTEGER NOT NULL AUTO_INCREMENT, NAME VARCHAR(255) NOT NULL, PRIMARY KEY (ID) ); CREATE UNIQUE INDEX PARTNER_NAME_UNIQUE ON partner (NAME); CREATE TABLE partner_attribute ( ID INTEGER NOT NULL AUTO_INCREMENT, PARTNER_ID INTEGER NOT NULL, ATTRIBUTE_NAME VARCHAR(255) NOT NULL, ATTRIBUTE_VALUE VARCHAR(4000), PRIMARY KEY (ID), FOREIGN KEY (PARTNER_ID) REFERENCES partner (ID) ); CREATE UNIQUE INDEX PARTNER_ATTRIBUTE_UNIQUE ON partner_attribute (PARTNER_ID, ATTRIBUTE_NAME); CREATE TABLE partnership ( ID INTEGER NOT NULL AUTO_INCREMENT, NAME VARCHAR(255) NOT NULL, SENDER_PARTNER_ID INTEGER NOT NULL, RECEIVER_PARTNER_ID INTEGER NOT NULL, PRIMARY KEY (ID), FOREIGN KEY (SENDER_PARTNER_ID) REFERENCES partner (ID), FOREIGN KEY (RECEIVER_PARTNER_ID) REFERENCES partner (ID) ); CREATE UNIQUE INDEX PARTNERSHIP_NAME_UNIQUE ON partnership (NAME); CREATE TABLE partnership_attribute ( ID INTEGER NOT NULL AUTO_INCREMENT, PARTNERSHIP_ID INTEGER NOT NULL, CATEGORY VARCHAR(20) DEFAULT 'attribute' NOT NULL, ATTRIBUTE_NAME VARCHAR(255) NOT NULL, ATTRIBUTE_VALUE VARCHAR(4000), PRIMARY KEY (ID), FOREIGN KEY (PARTNERSHIP_ID) REFERENCES partnership (ID) ); CREATE UNIQUE INDEX PARTNERSHIP_ATTRIBUTE_UNIQUE ON partnership_attribute (PARTNERSHIP_ID, CATEGORY, ATTRIBUTE_NAME); Path: redb-route/tests/docker/as2/config/emailtemplate.txt Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/as2/config/emailtemplate.txt ---- senderid=$message.sender.as2_id$ receiverid=$message.receiver.as2_id$ exception=$exception.name$ description=$exception.message$ trace: $exception.trace$ Path: redb-route/tests/docker/as2/config/logback.xml Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/as2/config/logback.xml ---- ${OPENAS2_LOG_DIR}/log-${byDay}.txt %d{HH:mm:ss.SSS} [%thread] %-5level %logger{60} -%kvp- %msg%n %d{HH:mm:ss.SSS} [%thread] %-5level %logger{60} - %msg%n Path: redb-route/tests/docker/as2/config/messages.xml Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/as2/config/messages.xml ---- Path: redb-route/tests/docker/as2/config/partnerships.xml Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/as2/config/partnerships.xml ---- Path: redb-route/tests/docker/fcm-echo/Dockerfile Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/fcm-echo/Dockerfile ---- # FCM HTTP v1 API echo (Google ships no FCM emulator). No npm dependencies. FROM node:22-slim WORKDIR /app COPY server.js ./ EXPOSE 18200 CMD ["node", "server.js"] Path: redb-route/tests/docker/fcm-echo/server.js Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/fcm-echo/server.js ---- // FCM HTTP v1 API mock for redb.Route.Firebase e2e tests (no npm deps). // The FirebaseAdmin SDK is pointed here via AppOptions.HttpClientFactory in the tests. // // POST /v1/projects/{project}/messages:send -> {"name":"projects/{project}/messages/{id}"} // ?validate_only=true (dryRun) is accepted and recorded. // POST/DELETE /v1/projects/{project}/registrations/{token}/topicSubscriptions[...] -> {} (topic management) // GET /messages -> JSON array of every recorded send (envelope + received dryRun flag) // DELETE /messages -> clear the store (test isolation) // GET /healthz -> ok const http = require('http'); const PORT = 18200; let messages = []; let counter = 0; const server = http.createServer((req, res) => { const sendMatch = req.url.match(/^\/v1\/projects\/([^/]+)\/messages:send/); if (req.method === 'POST' && sendMatch) { let body = ''; req.on('data', (chunk) => { body += chunk; }); req.on('end', () => { let parsed; try { parsed = JSON.parse(body); } catch (e) { res.writeHead(400, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ error: { code: 400, message: 'invalid JSON: ' + e.message } })); return; } const project = sendMatch[1]; const id = 'msg-' + (++counter); messages.push({ project, envelope: parsed, receivedAt: new Date().toISOString() }); res.writeHead(200, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ name: `projects/${project}/messages/${id}` })); }); return; } // Topic management (FirebaseAdmin 3.7+ SubscribeToTopic/UnsubscribeFromTopic → FCM v1, one request per token): // POST /v1/projects/{project}/registrations/{token}/topicSubscriptions?topic_name={topic} body {} // DELETE /v1/projects/{project}/registrations/{token}/topicSubscriptions/{topic}?allow_missing=true // Response: {} = success for that token. Each call is recorded as {project, envelope:{topicOp, topic, token}}. const url = new URL(req.url, 'http://localhost'); const subscribeMatch = url.pathname.match(/^\/v1\/projects\/([^/]+)\/registrations\/([^/]+)\/topicSubscriptions$/); const unsubscribeMatch = url.pathname.match(/^\/v1\/projects\/([^/]+)\/registrations\/([^/]+)\/topicSubscriptions\/([^/]+)$/); const topicMatch = req.method === 'POST' ? subscribeMatch : req.method === 'DELETE' ? unsubscribeMatch : null; if (topicMatch) { req.resume(); req.on('end', () => { const topic = req.method === 'POST' ? url.searchParams.get('topic_name') : decodeURIComponent(topicMatch[3]); messages.push({ project: topicMatch[1], envelope: { topicOp: req.method === 'POST' ? 'add' : 'remove', topic, token: decodeURIComponent(topicMatch[2]), }, receivedAt: new Date().toISOString(), }); res.writeHead(200, { 'Content-Type': 'application/json' }); res.end('{}'); }); return; } if (req.method === 'GET' && req.url === '/messages') { res.writeHead(200, { 'Content-Type': 'application/json' }); res.end(JSON.stringify(messages)); return; } if (req.method === 'DELETE' && req.url === '/messages') { messages = []; res.writeHead(204); res.end(); return; } if (req.method === 'GET' && req.url === '/healthz') { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('ok'); return; } res.writeHead(404, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ error: { code: 404, message: 'not found: ' + req.method + ' ' + req.url } })); }); server.listen(PORT, '0.0.0.0', () => console.log(`fcm-echo listening on :${PORT}`)); Path: redb-route/tests/docker/firebase/Dockerfile Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/firebase/Dockerfile ---- # Firebase emulators (Firestore + Auth + UI) with the Java runtime, firebase-tools and the emulator jars baked in, # so a start downloads nothing. FROM eclipse-temurin:21-jre AS jre FROM node:22-slim COPY --from=jre /opt/java/openjdk /opt/java ENV JAVA_HOME=/opt/java PATH=/opt/java/bin:$PATH RUN npm install -g --no-audit --no-fund firebase-tools@15.35.0 \ && firebase setup:emulators:firestore \ && firebase setup:emulators:ui WORKDIR /app COPY firebase.json ./ EXPOSE 8086 9099 4000 CMD ["firebase", "emulators:start", "--project", "demo-redb", "--only", "firestore,auth"] Path: redb-route/tests/docker/firebase/firebase.json Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/firebase/firebase.json ---- { "emulators": { "firestore": { "host": "0.0.0.0", "port": 8086 }, "auth": { "host": "0.0.0.0", "port": 9099 }, "ui": { "enabled": true, "host": "0.0.0.0", "port": 4000 } } } Path: redb-route/tests/docker/ftp/vsftpd.conf Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/ftp/vsftpd.conf ---- anonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES vsftpd_log_file=/proc/1/fd/1 listen=YES seccomp_sandbox=NO background=YES # Chroot users into their home directory chroot_local_user=YES allow_writeable_chroot=YES # Passive mode pasv_enable=YES pasv_addr_resolve=YES pasv_address=127.0.0.1 pasv_min_port=21000 pasv_max_port=21010 Path: redb-route/tests/docker/gen-certs.sh Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/gen-certs.sh ---- #!/usr/bin/env bash # Generates every key, certificate and keystore the stand of redb.Route/docker-compose.tests.yml needs, into # redb.Route/tests/docker/.generated/ (git-ignored). Run it once before the first `docker compose up`; it is # idempotent: a part whose files already exist is left alone. --force regenerates everything. # # Needs: bash, openssl 3.2 or newer, docker (one node:22-slim run for the OAuth2 signing key). # All material here is throwaway test PKI with fixed test passwords; nothing of it is a secret. # # kafka/ CA, broker key + chain (PEM keystore), client key + cert (mTLS), a rogue CA. The broker certificate # names kafka-k1..3 only: KafkaTlsTests rely on hostname verification failing for localhost. # rabbit-tls/ CA, broker cert (localhost), client cert (CN=redb-client, EXTERNAL login, client.pfx password # "test"), an unrelated CA, and the OAuth2 signing key: oauth2-config.json for mock-oauth2-server # (private JWK) and oauth-signing.pub.pem for the broker. # grpc/ CA, server cert (localhost, host.docker.internal, 127.0.0.1; server.pfx password "redb"), # client cert for the mTLS interop test. # as2/certs/ redb.p12 (password "testpass") + redb.crt, openas2.crt (+ keys), read by As2InteropTests. # as2/keystore/ as2_certs.p12 (password "testas2": openas2 key, redb trusted) and ssl_certs.jks for OpenAS2. # as2/data/, soap/ empty folders the interop tests and the containers share. set -euo pipefail export MSYS_NO_PATHCONV=1 here="$(cd "$(dirname "$0")" && pwd)" out="$here/.generated" days=3650 if [ "${1:-}" = "--force" ]; then rm -rf "$out/kafka" "$out/rabbit-tls" "$out/grpc" "$out/as2/certs" "$out/as2/keystore" fi # Shared folders, writable for the containers (root) and the test user. OpenAS2 would create its outboxes as root, # so the ones the As2 interop tests drop files into exist beforehand. ob="$out/as2/data/outbox" mkdir -p "$ob/redb" "$ob/redb-async" "$ob/redb-enc" "$ob/redb-zip" "$ob/redb-zipenc" "$ob/redb-signzip" "$out/soap" chmod 0777 "$out/as2/data" "$ob" "$ob/redb" "$ob/redb-async" "$ob/redb-enc" "$ob/redb-zip" "$ob/redb-zipenc" "$ob/redb-signzip" "$out/soap" ver=$(openssl version | awk '{print $2}') case "$ver" in 1.*|3.0.*|3.1.*) echo "openssl 3.2 or newer is needed (found $ver)" >&2; exit 1 ;; esac ca() { # name subject openssl req -x509 -newkey rsa:2048 -sha256 -nodes -days $days -subj "$2" -keyout "$1.key" -out "$1.pem" 2>/dev/null } leaf() { # name subject ca-name extensions openssl req -newkey rsa:2048 -nodes -subj "$2" -keyout "$1.key" -out "$1.csr" 2>/dev/null printf '%b' "$4" > "$1.ext" openssl x509 -req -sha256 -in "$1.csr" -CA "$3.pem" -CAkey "$3.key" -CAcreateserial -days $days \ -extfile "$1.ext" -out "$1.pem" 2>/dev/null rm -f "$1.csr" "$1.ext" "$3.srl" } # ---------- Kafka ------------------------------------------------------------------------------------------------ if [ ! -f "$out/kafka/broker.pem" ]; then mkdir -p "$out/kafka" && cd "$out/kafka" ca ca "/CN=redb-test-kafka-ca" leaf broker "/CN=kafka-broker" ca 'subjectAltName=DNS:kafka-k1,DNS:kafka-k2,DNS:kafka-k3\nextendedKeyUsage=serverAuth,clientAuth\n' mv broker.pem broker.crt # PEM keystore: unencrypted PKCS#8 key followed by the chain. openssl pkcs8 -topk8 -nocrypt -in broker.key -out broker.pk8 cat broker.pk8 broker.crt ca.pem > broker.pem rm -f broker.pk8 leaf client "/CN=redb-client" ca 'extendedKeyUsage=clientAuth\n' ca rogue-ca "/CN=rogue-ca" chmod 0644 ./* echo "kafka: $(ls | tr '\n' ' ')" fi # ---------- RabbitMQ TLS ----------------------------------------------------------------------------------------- if [ ! -f "$out/rabbit-tls/oauth2-config.json" ]; then mkdir -p "$out/rabbit-tls" && cd "$out/rabbit-tls" ca ca "/CN=redb-route-test-ca" ca other-ca "/CN=redb-route-other-ca" leaf server "/CN=localhost" ca 'subjectAltName=DNS:localhost,IP:127.0.0.1\nextendedKeyUsage=serverAuth\n' leaf client "/CN=redb-client" ca 'extendedKeyUsage=clientAuth\n' openssl pkcs12 -export -in client.pem -inkey client.key -passout pass:test -out client.pfx # The OAuth2 signing key: mock-oauth2-server signs with the private JWK, the broker verifies with the public PEM. docker run --rm node:22-slim node -e ' const { generateKeyPairSync } = require("crypto"); const { publicKey, privateKey } = generateKeyPairSync("rsa", { modulusLength: 2048 }); const jwk = { ...privateKey.export({ format: "jwk" }), kid: "redb-test", use: "sig", alg: "RS256" }; const config = { interactiveLogin: false, httpServer: "NettyWrapper", tokenProvider: { keyProvider: { initialKeys: JSON.stringify(jwk), algorithm: "RS256" } }, tokenCallbacks: [{ issuerId: "default", tokenExpiry: 60, requestMappings: [{ requestParam: "grant_type", match: "client_credentials", claims: { sub: "redb-oauth-client", aud: ["rabbitmq"], scope: "rabbitmq.configure:*/* rabbitmq.read:*/* rabbitmq.write:*/*" } }] }] }; process.stdout.write(JSON.stringify(config, null, 2) + "\n=====\n" + publicKey.export({ type: "spki", format: "pem" })); ' > oauth.out sed -n '1,/^=====$/p' oauth.out | sed '$d' > oauth2-config.tmp sed -n '/^=====$/,$p' oauth.out | sed '1d' > oauth-signing.pub.pem rm -f oauth.out [ -s oauth-signing.pub.pem ] && [ -s oauth2-config.tmp ] || { echo "OAuth2 key generation failed" >&2; exit 1; } chmod 0644 ./* mv oauth2-config.tmp oauth2-config.json echo "rabbit-tls: $(ls | tr '\n' ' ')" fi # ---------- gRPC ------------------------------------------------------------------------------------------------- if [ ! -f "$out/grpc/server.pfx" ]; then mkdir -p "$out/grpc" && cd "$out/grpc" ca ca "/CN=redb-interop-ca" leaf server "/CN=localhost" ca 'subjectAltName=DNS:localhost,DNS:host.docker.internal,IP:127.0.0.1\nextendedKeyUsage=serverAuth\n' leaf client "/CN=redb-interop-client" ca 'extendedKeyUsage=clientAuth\n' for n in ca server client; do mv "$n.pem" "$n.crt"; done openssl pkcs12 -export -out server.pfx -inkey server.key -in server.crt -certfile ca.crt -passout pass:redb chmod 0644 ./* echo "grpc: $(ls | tr '\n' ' ')" fi # ---------- AS2 (OpenAS2 interop) -------------------------------------------------------------------------------- if [ ! -f "$out/as2/keystore/as2_certs.p12" ]; then mkdir -p "$out/as2/certs" "$out/as2/keystore" && cd "$out/as2/certs" openssl req -x509 -newkey rsa:2048 -sha256 -nodes -days $days -subj "/CN=redb-as2" -keyout redb.key -out redb.crt 2>/dev/null openssl req -x509 -newkey rsa:2048 -sha256 -nodes -days $days -subj "/CN=openas2" -keyout openas2.key -out openas2.crt 2>/dev/null openssl pkcs12 -export -inkey redb.key -in redb.crt -name redb -out redb.p12 -passout pass:testpass # OpenAS2 keystore: its own key (alias openas2) and redb's certificate as a trusted entry (alias redb), which only # keytool writes in the form Java reads; ssl_certs.jks is opened as JKS, and Java reads a PKCS#12 file that way too. openssl pkcs12 -export -inkey openas2.key -in openas2.crt -name openas2 -out ../keystore/as2_certs.p12 -passout pass:testas2 cp ../keystore/as2_certs.p12 ../keystore/ssl_certs.jks dir="$(cd .. && (pwd -W 2>/dev/null || pwd))" docker run --rm -v "$dir:/as2" eclipse-temurin:17-jre keytool -importcert -noprompt -alias redb \ -file /as2/certs/redb.crt -keystore /as2/keystore/as2_certs.p12 -storetype PKCS12 -storepass testas2 >/dev/null chmod 0644 ./* ../keystore/* echo "as2: $(ls | tr '\n' ' ')$(cd ../keystore && ls | tr '\n' ' ')" fi echo "keys in $out" Path: redb-route/tests/docker/grpc/Dockerfile Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/grpc/Dockerfile ---- # gRPC echo server and the grpc-js clients GrpcInteropTests runs through `docker exec grpc-echo`. # Dependencies are baked in; the mTLS client reads /app/certs, mounted from .generated/grpc. FROM node:22-slim WORKDIR /app RUN npm install --no-save --no-audit --no-fund @grpc/grpc-js@1.14.7 @grpc/proto-loader@0.8.1 COPY *.js *.proto ./ EXPOSE 18100 CMD ["node", "server.js"] Path: redb-route/tests/docker/grpc/README.md Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/grpc/README.md ---- # gRPC interop fixture for `redb.Route.Grpc` An independent gRPC stack — Node.js [`@grpc/grpc-js`](https://github.com/grpc/grpc-node) — in a container. It shares no code with our connector, which is the point: `redb.Route.Grpc` implements the gRPC wire protocol itself (framing, trailers, statuses, deadlines, gzip) instead of taking `Grpc.AspNetCore`, so the only real proof is a foreign implementation accepting our bytes and us accepting its. This is also the only **cross-process** coverage: the client runs inside the container and reaches the host through `host.docker.internal`. ## Run Profile `grpc` of `redb.Route/docker-compose.tests.yml` (see `../README.md`); the image has the gRPC packages baked in, and the mTLS certificates come from `gen-certs.sh` (`.generated/grpc`, mounted as `/app/certs`; `REDB_GRPC_CERTS` points there for the tests). ```bash dotnet test tests/redb.Route.Tests.Grpc --filter Category=Interop ``` The tests are **gated**: each one no-ops unless the container answers on `127.0.0.1:18100`, so the normal suite stays green without Docker. ## What is covered | Direction | Test | Proves | |---|---|---| | redb producer → grpc-js server | `Redb_producer_to_grpcjs_server_echoes` | a foreign server parses our request frame and metadata | | redb producer → grpc-js server | `Redb_producer_reads_a_grpcjs_server_stream` | we read a foreign server-stream as `IAsyncEnumerable` | | grpc-js client → redb consumer | `Grpcjs_client_to_redb_consumer_echoes` | a foreign client accepts our reply frame and trailers | | grpc-js client → redb consumer | `Grpcjs_client_gets_a_real_status_from_our_consumer` | `status.code=403` arrives as `PERMISSION_DENIED` with detail | | grpc-js client → redb consumer | `Grpcjs_client_reads_our_server_stream` | our per-yield frames read as a stream by a foreign client | | grpc-js client → redb consumer | `Grpcjs_client_over_mtls_is_authenticated_by_thumbprint` | real TLS handshake with a client certificate, pinned by thumbprint | | grpc-js client → redb consumer | `Grpcjs_client_may_gzip_its_request` | we inflate a foreign client's gzipped request | The contract is a **typed** `.proto` (`interop.Echo`), not our generic `RedbService` — so the same tests double as proof that a client generated from a real `.proto` can call a redb route with no server stubs on our side. ## Files | File | Role | |---|---| | `echo.proto` | the interop contract: `Say` (unary) and `SayMany` (server-streaming) | | `server.js` | grpc-js server on `18100`, the target for direction A | | `client.js` | grpc-js client used via `docker exec`, the caller for direction B; prints a JSON verdict | | `.generated/grpc` | CA, server (`server.pfx`, password `redb`) and client certificates for the mTLS test, from `gen-certs.sh` | | `Dockerfile` | `node:22-slim` with the gRPC packages baked in | | `identity.v1.proto` | copy of redb.Identity's published contract - see the section below | | `identity-client.js` | grpc-js client for that contract; reads its request JSON from stdin | ## Ports | Port | Who | |---|---| | `18100` | grpc-js server (published to the host) | | `18110+`, `18120+`, `18130+`, `18140+` | our consumers, offset by .NET major so parallel test hosts of each target framework never collide | ## Second consumer: the redb.Identity gRPC facade The same container also carries a client for redb.Identity's published contract, so the facade is proven the way the connector is - by a stack that shares no code with it. ```bash dotnet test redb.Identity/tests/redb.Identity.Tests --filter Category=Interop ``` | File | Role | |---|---| | `identity.v1.proto` | a copy of the published contract from `redb.Identity.Contracts/Protos`, copied into the image | | `identity-client.js` | `@grpc/grpc-js` client generated from it at load time, exactly as a consumer would | The test boots Core plus the facade in-process on an ephemeral port, binds `0.0.0.0` so the container can reach it through `host.docker.internal`, and drives the client through `docker exec -i`. The request JSON goes in on **stdin**: `docker exec` passes argv straight through with no shell, and Windows argument splitting eats the quotes out of a JSON literal long before the container sees it. | Test | Proves | |---|---| | `A_foreign_client_gets_a_token_from_the_published_contract` | a client generated from the `.proto` we publish gets a real token from `client_credentials` | | `A_foreign_client_reads_the_refusal_as_a_status_and_a_trailer` | a wrong secret arrives as `UNAUTHENTICATED` with `invalid_client` in a trailer, the only place a non-OK reply can carry it | | `A_foreign_client_reads_the_discovery_document` | a `google.protobuf.Struct` - nested maps and lists - decoded by a runtime that never saw our codec | Same gate as above: no container, no run. When the contract changes, copy it again and rebuild the image (`docker compose ... build grpc-echo`); the file here is a copy, not a link: ```bash cp redb.Identity/src/redb.Identity.Contracts/Protos/identity.v1.proto redb.Route/tests/docker/grpc/identity.v1.proto ``` Path: redb-route/tests/docker/grpc/client.js Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/grpc/client.js ---- // Independent gRPC client (@grpc/grpc-js). Direction B: calls a redb consumer through host-gateway, // proving a foreign client accepts our replies, trailers and statuses. // // node client.js [--tls] [--gzip] [--msg=text] // method: say | saymany | fail const grpc = require('@grpc/grpc-js'); const loader = require('@grpc/proto-loader'); const fs = require('fs'); const [target, method] = process.argv.slice(2); const flags = process.argv.slice(4); const useTls = flags.includes('--tls'); const useGzip = flags.includes('--gzip'); const msgArg = (flags.find(f => f.startsWith('--msg=')) || '--msg=hello-redb').slice(6); const pkg = grpc.loadPackageDefinition(loader.loadSync('/app/echo.proto', { keepCase: true })); const creds = useTls ? grpc.credentials.createSsl( fs.readFileSync('/app/certs/ca.crt'), fs.readFileSync('/app/certs/client.key'), fs.readFileSync('/app/certs/client.crt')) : grpc.credentials.createInsecure(); const options = { 'grpc.ssl_target_name_override': 'localhost' }; if (useGzip) options['grpc.default_compression_algorithm'] = 2; // 2 = gzip const client = new pkg.interop.Echo(target, creds, options); function done(err, value) { if (err) { // Print the gRPC status so the test can assert on it. console.log(JSON.stringify({ ok: false, code: err.code, details: err.details })); process.exit(0); } console.log(JSON.stringify({ ok: true, value })); process.exit(0); } if (method === 'saymany') { const items = []; const call = client.SayMany({ msg: msgArg }); call.on('data', r => items.push(r.result)); call.on('end', () => done(null, items)); call.on('error', e => done(e)); } else { client.Say({ msg: msgArg }, (err, reply) => done(err, err ? null : reply.result)); } Path: redb-route/tests/docker/grpc/echo.proto Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/grpc/echo.proto ---- // Interop contract for redb.Route.Grpc. Deliberately a *typed* service, not the generic RedbService: // that is what proves a foreign, generated client can talk to a redb route directly. syntax = "proto3"; package interop; service Echo { rpc Say (EchoRequest) returns (EchoReply); rpc SayMany (EchoRequest) returns (stream EchoReply); } message EchoRequest { string msg = 1; } message EchoReply { string result = 1; } Path: redb-route/tests/docker/grpc/identity-client.js Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/grpc/identity-client.js ---- // Independent client for redb.Identity's published gRPC contract (identity.v1.proto). // // The point is that it is foreign: @grpc/grpc-js generates its stubs from the .proto file the way any // consumer would, shares no code with the facade, and runs in another process. What loopback tests cannot // show is exactly this — that the contract we publish is the contract we serve. // // node identity-client.js [--meta k=v] [--tls] [--gzip] // // The request JSON arrives on stdin, not as an argument: `docker exec` passes argv straight through with // no shell, and Windows argument splitting mangles embedded quotes long before the container sees them. // // Prints one JSON line: {"ok":true,"value":{…}} or {"ok":false,"code":N,"status":"…","details":"…", // "trailers":{…}}. Trailers matter: a non-OK gRPC reply discards its payload, so the OAuth error code // travels there and nowhere else. const grpc = require('@grpc/grpc-js'); const loader = require('@grpc/proto-loader'); const fs = require('fs'); const [, , target, method, ...flags] = process.argv; if (!target || !method) { console.error("usage: identity-client.js '' [--meta k=v] [--tls] [--gzip]"); process.exit(2); } const def = loader.loadSync('/app/identity.v1.proto', { keepCase: true, longs: String, enums: String, defaults: true, oneofs: true, }); const Identity = grpc.loadPackageDefinition(def).identity.v1.Identity; const useTls = flags.includes('--tls'); const credentials = useTls ? grpc.credentials.createSsl(fs.readFileSync('/app/certs/ca.crt')) : grpc.credentials.createInsecure(); const options = {}; if (flags.includes('--gzip')) options['grpc.default_compression_algorithm'] = 2; const client = new Identity(target, credentials, options); const metadata = new grpc.Metadata(); for (const flag of flags) { if (!flag.startsWith('--meta=')) continue; const pair = flag.slice('--meta='.length); const eq = pair.indexOf('='); metadata.add(pair.slice(0, eq), pair.slice(eq + 1)); } const stdin = fs.readFileSync(0, "utf8").trim(); const request = stdin ? JSON.parse(stdin) : {}; const deadline = new Date(Date.now() + 30_000); client[method](request, metadata, { deadline }, (err, value) => { if (err) { // Everything a caller can act on: the status, the detail, and the trailers the facade put the // machine-readable OAuth code into. const trailers = {}; if (err.metadata) { for (const [key, values] of Object.entries(err.metadata.getMap())) trailers[key] = values; } console.log(JSON.stringify({ ok: false, code: err.code, status: grpc.status[err.code], details: err.details, trailers, })); process.exit(0); } console.log(JSON.stringify({ ok: true, value })); }); Path: redb-route/tests/docker/grpc/identity-health-client.js Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/grpc/identity-health-client.js ---- // Standard gRPC health probe (grpc.health.v1.Health/Check) against a redb.Route gRPC listener. // // node identity-health-client.js // // No .proto: the request is empty and HealthCheckResponse{ status = 1 } is two bytes, so raw marshallers // keep this free of generated code. Prints {"ok":true,"serving":true} or the failure status. const grpc = require('@grpc/grpc-js'); const [, , target] = process.argv; if (!target) { console.error('usage: identity-health-client.js '); process.exit(2); } const identity = x => x; const client = new grpc.Client(target, grpc.credentials.createInsecure()); client.makeUnaryRequest( '/grpc.health.v1.Health/Check', identity, identity, Buffer.alloc(0), new grpc.Metadata(), {}, (err, value) => { if (err) { console.log(JSON.stringify({ ok: false, code: err.code, status: grpc.status[err.code], details: err.details })); process.exit(0); } // field 1 (varint) = SERVING(1) → 0x08 0x01 const serving = value && value.length >= 2 && value[0] === 0x08 && value[1] === 0x01; console.log(JSON.stringify({ ok: true, serving, bytes: [...value] })); process.exit(0); }); Path: redb-route/tests/docker/grpc/identity-mgmt-client.js Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/grpc/identity-mgmt-client.js ---- // Client for redb.Identity's management contract (identity.management.v1.proto). // // Separate from identity-client.js on purpose: that one is loaded by the interop tests and pinned to the // protocol contract. This one speaks the admin surface, whose payloads are google.protobuf.Struct. // // node identity-mgmt-client.js [--token=] // // Request JSON arrives on stdin (the arguments Struct). Prints one JSON line: // {"ok":true,"value":{...}} | {"ok":false,"code":N,"status":"...","details":"...","trailers":{...}} const grpc = require('@grpc/grpc-js'); const loader = require('@grpc/proto-loader'); const fs = require('fs'); const [, , target, service, method, ...flags] = process.argv; if (!target || !service || !method) { console.error('usage: identity-mgmt-client.js [--token=]'); process.exit(2); } const def = loader.loadSync('/app/identity.management.v1.proto', { keepCase: true, longs: String, enums: String, defaults: true, oneofs: true, }); const pkg = grpc.loadPackageDefinition(def).identity.management.v1; const Service = pkg[service]; if (!Service) { console.error(`unknown service '${service}'. Known: ${Object.keys(pkg).join(', ')}`); process.exit(2); } const client = new Service(target, grpc.credentials.createInsecure()); const metadata = new grpc.Metadata(); const token = (flags.find(f => f.startsWith('--token=')) || '').slice('--token='.length); if (token) metadata.add('authorization', 'Bearer ' + token); const stdin = fs.readFileSync(0, 'utf8').trim(); const args = stdin ? JSON.parse(stdin) : {}; // The wire message is ManagementRequest { google.protobuf.Struct arguments = 1 }. proto-loader accepts a // plain object for a Struct field, so the arguments go in as-is. const request = { arguments: args }; const deadline = new Date(Date.now() + 30_000); client[method](request, metadata, { deadline }, (err, value) => { if (err) { const trailers = {}; if (err.metadata) for (const [k, v] of Object.entries(err.metadata.getMap())) trailers[k] = v; console.log(JSON.stringify({ ok: false, code: err.code, status: grpc.status[err.code], details: err.details, trailers, })); process.exit(0); } console.log(JSON.stringify({ ok: true, value })); }); Path: redb-route/tests/docker/grpc/identity.management.v1.proto Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/grpc/identity.management.v1.proto ---- // redb.Identity — management gRPC contract. // // The admin surface, for tooling rather than for relying parties. It sits on its own port // (`ManagementPort`), behind bearer authentication and the same granular scope table the HTTP management // API is checked against — one table in Core, so the same token yields the same verdict on both. // // Shape rule, and it differs from identity.v1.proto on purpose. There the messages are the RFC's own // fields, fixed by standards that do not move. Here there are 159 operations over an admin surface that // still grows, and typing every request and response would freeze it: every new field would be a contract // change in a file consumers have to regenerate. So the *addresses* are the contract — one rpc per // operation, named and stable — and the payloads are `google.protobuf.Struct` / `Value`, which carry // arbitrary JSON while remaining real protobuf on the wire. A generated client works; the payload is // documented by the REST API of the same name. // // Requests are always an object of named arguments. The names are the controller parameter names, the // same ones the REST route and query parameters use — `id`, `offset`, `count` — and a body-shaped // argument is simply the object itself. syntax = "proto3"; package identity.management.v1; option csharp_namespace = "redb.Identity.Grpc.Management.V1"; import "google/protobuf/struct.proto"; // ── shared envelopes ───────────────────────────────────── message ManagementRequest { // Named arguments for the operation. An operation that takes a request body puts that body's fields // here directly; one that takes an id puts `id` here. Unknown keys are ignored. google.protobuf.Struct arguments = 1; } message ManagementResponse { // Whatever the operation returned: an object, a list, or nothing at all. `Value` rather than `Struct` // because list endpoints answer with arrays and a Struct cannot hold one. google.protobuf.Value result = 1; } // ── users ──────────────────────────────────────────────── service Users { rpc List (ManagementRequest) returns (ManagementResponse); rpc Search (ManagementRequest) returns (ManagementResponse); rpc Get (ManagementRequest) returns (ManagementResponse); rpc Create (ManagementRequest) returns (ManagementResponse); rpc Update (ManagementRequest) returns (ManagementResponse); rpc Delete (ManagementRequest) returns (ManagementResponse); rpc ChangePassword (ManagementRequest) returns (ManagementResponse); rpc AdminResetPassword (ManagementRequest) returns (ManagementResponse); } // ── applications ───────────────────────────────────────── service Applications { rpc List (ManagementRequest) returns (ManagementResponse); rpc Get (ManagementRequest) returns (ManagementResponse); rpc Create (ManagementRequest) returns (ManagementResponse); rpc Update (ManagementRequest) returns (ManagementResponse); rpc RotateSecret (ManagementRequest) returns (ManagementResponse); rpc Delete (ManagementRequest) returns (ManagementResponse); } // ── groups ─────────────────────────────────────────────── service Groups { rpc List (ManagementRequest) returns (ManagementResponse); rpc Search (ManagementRequest) returns (ManagementResponse); rpc Get (ManagementRequest) returns (ManagementResponse); rpc Create (ManagementRequest) returns (ManagementResponse); rpc CreateChild (ManagementRequest) returns (ManagementResponse); rpc Update (ManagementRequest) returns (ManagementResponse); rpc Delete (ManagementRequest) returns (ManagementResponse); rpc Move (ManagementRequest) returns (ManagementResponse); // Hierarchy reads. The group tree is the one place this API is not flat. rpc Tree (ManagementRequest) returns (ManagementResponse); rpc Path (ManagementRequest) returns (ManagementResponse); rpc Children (ManagementRequest) returns (ManagementResponse); // Membership. rpc ListMembers (ManagementRequest) returns (ManagementResponse); rpc AddMember (ManagementRequest) returns (ManagementResponse); rpc UpdateMember (ManagementRequest) returns (ManagementResponse); rpc RemoveMember (ManagementRequest) returns (ManagementResponse); rpc UserGroups (ManagementRequest) returns (ManagementResponse); rpc IsMember (ManagementRequest) returns (ManagementResponse); } // ── scopes ─────────────────────────────────────────────── service Scopes { rpc List (ManagementRequest) returns (ManagementResponse); rpc Get (ManagementRequest) returns (ManagementResponse); rpc Create (ManagementRequest) returns (ManagementResponse); rpc Update (ManagementRequest) returns (ManagementResponse); rpc Delete (ManagementRequest) returns (ManagementResponse); } // ── tokens ─────────────────────────────────────────────── service Tokens { rpc List (ManagementRequest) returns (ManagementResponse); rpc Revoke (ManagementRequest) returns (ManagementResponse); rpc RevokeBySubject (ManagementRequest) returns (ManagementResponse); rpc Prune (ManagementRequest) returns (ManagementResponse); } Path: redb-route/tests/docker/grpc/identity.v1.proto Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/grpc/identity.v1.proto ---- // redb.Identity — service-to-service gRPC contract. // // Scope: the non-browser subset of OpenID Connect / OAuth 2.0. Browser flows (authorize, login, consent, // MFA pages, device verification) are not here and never will be — they need a browser, redirects and a // cookie session. DPoP (RFC 9449) is likewise absent: its proof is bound to an HTTP method and URL. // // This file is the published contract. It lives in redb.Identity.Contracts so consumers can take it // without referencing any server-side package, and it is deliberately NOT compiled into that assembly — // Contracts stays a dependency-free DTO package. Generate your own stubs from this file; the facade // compiles it privately for its own message types. // // Shape rule: every request carries the parameters RFC 6749 / 7009 / 7662 / OIDC Core define as named // fields, plus a string map for extensions. The wire form of these endpoints has always been // form-encoded key/value, so a map is not a shortcut — it is the protocol. Responses type the fields the // RFCs fix and carry everything else in a Struct, because userinfo claims and introspection extensions // are open by design. syntax = "proto3"; package identity.v1; option csharp_namespace = "redb.Identity.Grpc.V1"; import "google/protobuf/struct.proto"; service Identity { // RFC 6749 §3.2 — token endpoint. Client authentication is client_id/client_secret, either as fields // here or as `authorization: Basic` metadata. rpc Token (TokenRequest) returns (TokenResponse); // RFC 7662 — token introspection. rpc Introspect (IntrospectRequest) returns (IntrospectResponse); // RFC 7009 — token revocation. A successful revocation carries no payload, per the RFC. rpc Revoke (RevokeRequest) returns (RevokeResponse); // OIDC Core §5.3 — userinfo. Bearer token in `authorization` metadata or in the field below. rpc UserInfo (UserInfoRequest) returns (UserInfoResponse); // OIDC Discovery 1.0. The document advertises the server's HTTP addresses — those are the real ones, // and this facade does not rewrite them. rpc Discovery (DiscoveryRequest) returns (DiscoveryResponse); // The JSON Web Key Set backing token signatures. rpc Jwks (JwksRequest) returns (JwksResponse); } // ── token ──────────────────────────────────────────────── message TokenRequest { string grant_type = 1; string client_id = 2; string client_secret = 3; string scope = 4; // authorization_code string code = 5; string redirect_uri = 6; string code_verifier = 7; // refresh_token string refresh_token = 8; // password (ROPC) string username = 9; string password = 10; // urn:ietf:params:oauth:grant-type:device_code string device_code = 11; // Any parameter this contract does not name — extension grants, vendor parameters, future RFCs. map additional = 20; } message TokenResponse { string access_token = 1; string token_type = 2; int64 expires_in = 3; string refresh_token = 4; string id_token = 5; string scope = 6; // Anything the server returned beyond the fields above. google.protobuf.Struct extra = 20; } // ── introspection ──────────────────────────────────────── message IntrospectRequest { string token = 1; string token_type_hint = 2; string client_id = 3; string client_secret = 4; map additional = 20; } message IntrospectResponse { bool active = 1; string scope = 2; string client_id = 3; string username = 4; string token_type = 5; int64 exp = 6; int64 iat = 7; int64 nbf = 8; string sub = 9; repeated string aud = 10; string iss = 11; string jti = 12; // RFC 7662 §2.2 explicitly allows additional members. google.protobuf.Struct extra = 20; } // ── revocation ─────────────────────────────────────────── message RevokeRequest { string token = 1; string token_type_hint = 2; string client_id = 3; string client_secret = 4; map additional = 20; } // RFC 7009 §2.2: a successful revocation returns no content. Kept as a message because gRPC has no void. message RevokeResponse {} // ── userinfo ───────────────────────────────────────────── message UserInfoRequest { // Optional: the token normally travels as `authorization: Bearer ` metadata. This field exists // for callers that prefer to carry it in the message, mirroring RFC 6750 §2.2. string access_token = 1; } message UserInfoResponse { string sub = 1; // Every other claim. Which ones appear depends on the granted scopes and the server's claim mappers, // so typing them here would be a lie. google.protobuf.Struct claims = 20; } // ── discovery / jwks ───────────────────────────────────── message DiscoveryRequest {} message DiscoveryResponse { // The discovery document verbatim, including the HTTP endpoint URLs it advertises. google.protobuf.Struct document = 1; } message JwksRequest {} message JwksResponse { // The JWKS document verbatim: { "keys": [ … ] }. google.protobuf.Struct document = 1; } Path: redb-route/tests/docker/grpc/server.js Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/grpc/server.js ---- // Independent gRPC server (@grpc/grpc-js — no shared code with redb.Route.Grpc). // Direction A target: a redb producer calls this, proving a foreign stack accepts our wire framing. const grpc = require('@grpc/grpc-js'); const loader = require('@grpc/proto-loader'); const pkg = grpc.loadPackageDefinition(loader.loadSync('/app/echo.proto', { keepCase: true })); const server = new grpc.Server(); server.addService(pkg.interop.Echo.service, { Say: (call, cb) => cb(null, { result: 'echo:' + (call.request.msg || '') }), SayMany: (call) => { for (let i = 1; i <= 3; i++) call.write({ result: `page-${i}` }); call.end(); }, }); server.bindAsync('0.0.0.0:18100', grpc.ServerCredentials.createInsecure(), (err, port) => { if (err) { console.error(err); process.exit(1); } console.log('gRPC echo (@grpc/grpc-js) listening on ' + port); }); Path: redb-route/tests/docker/rabbit-tls/definitions.json Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/rabbit-tls/definitions.json ---- { "users": [ { "name": "admin", "password": "admin", "tags": ["administrator"] }, { "name": "redb-client", "password_hash": "", "tags": [] } ], "vhosts": [ { "name": "/" } ], "permissions": [ { "user": "admin", "vhost": "/", "configure": ".*", "write": ".*", "read": ".*" }, { "user": "redb-client", "vhost": "/", "configure": ".*", "write": ".*", "read": ".*" } ] } Path: redb-route/tests/docker/rabbit-tls/rabbitmq.conf Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/rabbit-tls/rabbitmq.conf ---- # RabbitMQ TLS / EXTERNAL / OAuth2 stand for redb.Route RabbitMQ tests. listeners.tcp.default = 5672 listeners.ssl.default = 5671 ssl_options.cacertfile = /certs/ca.pem ssl_options.certfile = /certs/server.pem ssl_options.keyfile = /certs/server.key ssl_options.verify = verify_peer ssl_options.fail_if_no_peer_cert = false auth_mechanisms.1 = PLAIN auth_mechanisms.2 = AMQPLAIN auth_mechanisms.3 = EXTERNAL ssl_cert_login_from = common_name auth_backends.1 = rabbit_auth_backend_oauth2 auth_backends.2 = rabbit_auth_backend_internal auth_oauth2.resource_server_id = rabbitmq auth_oauth2.signing_keys.default = /certs/oauth-signing.pub.pem auth_oauth2.default_key = default auth_oauth2.verify_aud = false auth_oauth2.preferred_username_claims.1 = sub loopback_users = none load_definitions = /etc/rabbitmq/definitions.json Path: redb-route/tests/docker/run-fault-suite.sh Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/run-fault-suite.sh ---- #!/usr/bin/env bash # Runs the broker-fault tests of one connector suite on a docker host: the tests restart or pause the broker's container # (tests/Shared/Conformance/BrokerFault.cs), so they are not run by the release gate. # # bash redb.Route/tests/docker/run-fault-suite.sh --image --broker ibmmq \ # --project redb.Route.Tests.IbmMq --filter IbmMqReconnectTests [--framework net10.0] [--wait 300] # # The shape of the run is fixed, because each part of it was paid for: # 1. The suite is built in its own short-lived container, and the tests run in a second one with # --no-build. Build and test in one container left MSBuild and compiler servers behind that kept the test # container alive after the last test. # 2. The broker runs with host networking: behind docker's published-port proxy a client connect made while the # broker starts can hang for minutes. # 3. The broker is ready when its own health command passes (or, where running its CLI early breaks it, when it logs # that it started), not when a client connects. # 4. After the summary the test host must exit within 60 s. If it does not, its processes and their thread names are # printed and the run fails: a host that stays is a defect, not a slow machine. # # Run it from a copy of the repository on the docker host (git archive, nothing of the private key material). The # sources are mounted into the containers; bin and obj are written into the copy. Everything the run starts is # removed when it ends, the work folder with the NuGet cache included. # # --image SDK image that builds the solution and runs --framework (the solution targets net10.0 and net11.0, so # the image needs SDK 11 and the .NET 10 runtime for a net10.0 run). # --broker the broker to start: ibmmq, rabbitmq, artemis (AMQP 1.0), mosquitto (MQTT), kafka (one KRaft node) or # servicebus (the Service Bus emulator with its own SQL container). # --project test project under redb.Route/tests. # --filter dotnet test filter; FullyQualifiedName~ when it has no operator. # --framework target framework of the test run, net10.0 by default. # --wait seconds a test waits for the broker or the route (REDB_TEST_BROKER_WAIT_SECONDS); 120 when not given. # --work folder for the NuGet cache, the home of the run and the logs; ${TMPDIR:-/tmp}/redb-route-fault by default. # --prefix prefix of the container names, route-fault by default. # --memory memory cap of the build and test containers, 4g by default. # --build-minutes the build is stopped and the run fails after this many minutes, 15 by default. # --test-minutes the tests are stopped and the run fails after this many minutes, 20 by default. # # One run per host: a second start is refused while a lock (flock on /tmp/redb-route-fault.lock) is held or a container # labelled org.redbase.route-fault exists; foreign containers are only read, never touched. On any exit, the timeouts # included, the run removes its containers by exact name and its work folder (the summary and the end of the test # log are printed before). set -euo pipefail IMAGE=""; BROKER=""; PROJECT=""; FILTER=""; FRAMEWORK=net10.0; WAIT=""; PREFIX=route-fault; MEMORY=4g; BUILD_MINUTES=15; TEST_MINUTES=20 WORK="${TMPDIR:-/tmp}/redb-route-fault" while [ $# -gt 0 ]; do case "$1" in --image) IMAGE=$2; shift 2 ;; --broker) BROKER=$2; shift 2 ;; --project) PROJECT=$2; shift 2 ;; --filter) FILTER=$2; shift 2 ;; --framework) FRAMEWORK=$2; shift 2 ;; --wait) WAIT=$2; shift 2 ;; --work) WORK=$2; shift 2 ;; --prefix) PREFIX=$2; shift 2 ;; --memory) MEMORY=$2; shift 2 ;; --build-minutes) BUILD_MINUTES=$2; shift 2 ;; --test-minutes) TEST_MINUTES=$2; shift 2 ;; *) echo "unknown argument: $1" >&2; exit 64 ;; esac done [ -n "$IMAGE" ] && [ -n "$BROKER" ] && [ -n "$PROJECT" ] || { echo "--image, --broker and --project are required" >&2; exit 64; } case "$FILTER" in *[=~!]*) ;; "") ;; *) FILTER="FullyQualifiedName~$FILTER" ;; esac # The repository root: three levels above this file (redb.Route/tests/docker). ROOT=$(cd "$(dirname "$0")/../../.." && pwd) SUITE=$ROOT/redb.Route/tests/$PROJECT [ -d "$SUITE" ] || { echo "no test project $SUITE" >&2; exit 64; } # ---- brokers: image, start arguments, readiness (health command or log line), the variables that name the container # for the tests --------------------------------------------------------------------------------------------------------- MQ_NAME=$PREFIX-$BROKER BROKER_COMMAND=() # A container the broker needs beside it (the emulator's SQL), started first and never broken by the tests. SIDE_NAME=""; SIDE_IMAGE=""; SIDE_ARGS=(); SIDE_READY_LOG="" case "$BROKER" in ibmmq) # Same image as docker-compose.tests.yml; a new tag is a deliberate bump in both places. BROKER_IMAGE=icr.io/ibm-messaging/mq:9.4.5.0-r2 BROKER_ARGS=(--memory 2g -e LICENSE=accept -e MQ_QMGR_NAME=QM1 -e MQ_APP_PASSWORD=admin -e MQ_ADMIN_PASSWORD=admin -e MQ_DEV=true -v "$ROOT/redb.Route/tests/docker/ibmmq/redb-tests.mqsc:/etc/mqm/90-redb-tests.mqsc:ro") BROKER_HEALTH=(chkmqhealthy) BROKER_READY_LOG="" BROKER_VARIABLES=(REDB_TEST_IBMMQ_CONTAINER) ;; rabbitmq) # Same image and data folder as docker-compose.tests.yml. Ready by its log line, not by its CLI: a CLI run as root # before the broker writes its Erlang cookie writes it first, the broker cannot read it and stops with eacces. # REDB_RABBITMQ_CONTAINER is the name RabbitMQBlockedBrokerTests runs rabbitmqctl in. BROKER_IMAGE=rabbitmq:4.3-management-alpine BROKER_ARGS=(--memory 1g -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=admin --tmpfs /var/lib/rabbitmq:mode=1777) BROKER_HEALTH=() BROKER_READY_LOG="Server startup complete" BROKER_VARIABLES=(REDB_TEST_RABBITMQ_CONTAINER REDB_RABBITMQ_CONTAINER) ;; artemis) # Same image as docker-compose.tests.yml. With host networking the AMQP acceptor would take 5672 (RabbitMQ's port # in the compose file); --port-offset 1 moves every acceptor by one, so AMQP is at 5673 as the tests expect. BROKER_IMAGE=apache/activemq-artemis:latest-alpine BROKER_ARGS=(--memory 1g -e ARTEMIS_USER=admin -e ARTEMIS_PASSWORD=admin -e ARTEMIS_MIN_MEMORY=512M -e ARTEMIS_MAX_MEMORY=768M -e "EXTRA_ARGS=--http-host 0.0.0.0 --relax-jolokia --port-offset 1") BROKER_HEALTH=() BROKER_READY_LOG="AMQ221007: Server is now active" BROKER_VARIABLES=(REDB_TEST_AMQP_CONTAINER) ;; mosquitto) # Same image and settings as docker-compose.tests.yml (anonymous, no persistence); with host networking the # listener itself takes 11883, the port the tests expect. BROKER_IMAGE=eclipse-mosquitto:2 BROKER_ARGS=(--memory 256m) BROKER_COMMAND=(sh -c "printf 'listener 11883\nallow_anonymous true\npersistence false\n' > /mosquitto/config/mosquitto.conf && exec /usr/sbin/mosquitto -c /mosquitto/config/mosquitto.conf") BROKER_HEALTH=(mosquitto_sub -h localhost -p 11883 -t '$SYS/broker/uptime' -C 1 -W 3) BROKER_READY_LOG="" BROKER_VARIABLES=(REDB_TEST_MQTT_CONTAINER) ;; kafka) # The image of docker-compose.tests.yml, but one node (controller and broker): stopping one node of the compose # file's three tests a leader change, not a lost connection. Port 39092 (39093 for the controller), away from the # compose file's ports; the data stays in the container, so topics and offsets outlive a stop and a start. BROKER_IMAGE=apache/kafka:3.7.0 BROKER_ARGS=(--memory 1g -e KAFKA_NODE_ID=1 -e KAFKA_PROCESS_ROLES=broker,controller -e KAFKA_LISTENERS=PLAINTEXT://:39092,CONTROLLER://:39093 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:39092 -e KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER -e KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT -e KAFKA_CONTROLLER_QUORUM_VOTERS=1@localhost:39093 -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 -e KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1 -e KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1 -e KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0 -e KAFKA_NUM_PARTITIONS=1 -e KAFKA_HEAP_OPTS=-Xmx512m) BROKER_HEALTH=(/opt/kafka/bin/kafka-broker-api-versions.sh --bootstrap-server localhost:39092) BROKER_READY_LOG="" BROKER_VARIABLES=(REDB_TEST_KAFKA_CONTAINER) ;; servicebus) # The emulator keeps its entities and messages in SQL: its own SQL Edge container beside it, at 14330 (a host may # run its SQL Server on 1433). The entities are those of servicebus/Config.json; the emulator creates none on # request. AMQP at 5672, its HTTP port moved to 15300. Its image has no shell: ready by its log line. SIDE_NAME=$PREFIX-servicebus-sql SIDE_IMAGE=mcr.microsoft.com/azure-sql-edge:2.0.0 SIDE_ARGS=(--memory 2g -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD=Fault-Run-Only-1 -e MSSQL_TCP_PORT=14330) SIDE_READY_LOG="SQL Server is now ready for client connections" BROKER_IMAGE=mcr.microsoft.com/azure-messaging/servicebus-emulator:2.0.1 BROKER_ARGS=(--memory 1g -e ACCEPT_EULA=Y -e SQL_SERVER=localhost:14330 -e MSSQL_SA_PASSWORD=Fault-Run-Only-1 -e EMULATOR_HTTP_PORT=15300 -v "$ROOT/redb.Route/tests/docker/servicebus/Config.json:/ServiceBus_Emulator/ConfigFiles/Config.json:ro") BROKER_HEALTH=() BROKER_READY_LOG="Emulator Service is Successfully Up!" BROKER_VARIABLES=(REDB_TEST_ASB_CONTAINER) ;; *) echo "unknown broker: $BROKER (known: ibmmq, rabbitmq, artemis, mosquitto, kafka, servicebus)" >&2; exit 64 ;; esac TESTS=$PREFIX-tests BUILD=$PREFIX-build LABEL=org.redbase.route-fault # ---- one run per host ------------------------------------------------------------------------------------------------ exec 9>/tmp/redb-route-fault.lock flock -n 9 || { echo "another fault run holds /tmp/redb-route-fault.lock on this host; not started" >&2; exit 75; } others=$(docker ps -a --filter "label=$LABEL" --format "{{.Names}}") [ -z "$others" ] || { echo "containers of another fault run exist: $others; not started" >&2; exit 75; } [ ! -e "$WORK" ] || { echo "$WORK exists (another run, or one that was killed); not started" >&2; exit 75; } mkdir -p "$WORK/nuget" "$WORK/home" LOG=$WORK/$PROJECT.tests.log FOLLOW="" remove_containers() { docker rm -f "$BUILD" "$MQ_NAME" "$TESTS" ${SIDE_NAME:+"$SIDE_NAME"} >/dev/null 2>&1 || true; } cleanup() { remove_containers [ -z "$FOLLOW" ] || wait "$FOLLOW" 2>/dev/null || true # The run wrote as the caller (-u), so the folder is the caller's to remove. rm -rf "$WORK" } trap cleanup EXIT DOCKER_CLI=$(command -v docker) SOCKET_GID=$(stat -c %g /var/run/docker.sock) COMMON=(--label "$LABEL" --network host --memory "$MEMORY" -u "$(id -u):$(id -g)" --group-add "$SOCKET_GID" -v /var/run/docker.sock:/var/run/docker.sock -v "$DOCKER_CLI:/usr/bin/docker:ro" -v "$ROOT:/src" -v "$WORK/nuget:/nuget" -v "$WORK/home:/home/run" -e NUGET_PACKAGES=/nuget -e HOME=/home/run -e DOTNET_CLI_HOME=/home/run -e DOTNET_NOLOGO=1 -e REDB_TEST_BROKER_FAULTS=1 -w "/src/redb.Route/tests/$PROJECT") for variable in "${BROKER_VARIABLES[@]}"; do COMMON+=(-e "$variable=$MQ_NAME"); done [ -n "$WAIT" ] && COMMON+=(-e "REDB_TEST_BROKER_WAIT_SECONDS=$WAIT") stamp() { echo "== $* $(date -u +%T)"; } stamp "build $PROJECT ($FRAMEWORK) in its own container" # A build that hangs (a restore that never ends was seen) is stopped by name and fails the run, so it never runs into # the time of whoever shares the host. The build in the SDK test image hangs now and then (MSBuild idle after a finished # restore, with and without --disable-build-servers; cause not found): this limit is the guard. # RedbBrokerFaultRun builds the classes that need a fault stand (the Kafka and Service Bus conformance sets); the release # gate builds without them. docker run -d --name "$BUILD" "${COMMON[@]}" "$IMAGE" \ dotnet build -f "$FRAMEWORK" -p:RedbBrokerFaultRun=true -v q -clp:ErrorsOnly >/dev/null build_code=$(timeout "${BUILD_MINUTES}m" docker wait "$BUILD" || echo timeout) docker logs --tail 40 "$BUILD" 2>&1 | grep -v "warning " || true if [ "$build_code" = timeout ]; then stamp "BUILD DID NOT FINISH within $BUILD_MINUTES min; processes, then the NuGet cache size" docker top "$BUILD" -eo pid,etime,args 2>/dev/null | cut -c1-200 || true echo "packages: $(ls "$WORK/nuget" | wc -l), $(du -sh "$WORK/nuget" | cut -f1)" exit 3 fi docker rm -f "$BUILD" >/dev/null 2>&1 || true [ "$build_code" = 0 ] || { stamp "build failed, code $build_code"; exit 1; } if [ -n "$SIDE_NAME" ]; then stamp "start $SIDE_NAME" docker run -d --name "$SIDE_NAME" --label "$LABEL" --network host "${SIDE_ARGS[@]}" "$SIDE_IMAGE" >/dev/null ready=no for _ in $(seq 1 100); do if docker logs "$SIDE_NAME" 2>&1 | grep -qF "$SIDE_READY_LOG"; then ready=yes; break; fi sleep 3 done [ "$ready" = yes ] || { echo "$SIDE_NAME is not ready after 300 s"; docker logs --tail 40 "$SIDE_NAME"; exit 1; } fi stamp "start $BROKER as $MQ_NAME" docker run -d --name "$MQ_NAME" --label "$LABEL" --network host "${BROKER_ARGS[@]}" "$BROKER_IMAGE" "${BROKER_COMMAND[@]}" >/dev/null ready=no for _ in $(seq 1 200); do if [ -n "$BROKER_READY_LOG" ]; then if docker logs "$MQ_NAME" 2>&1 | grep -qF "$BROKER_READY_LOG"; then ready=yes; break; fi elif docker exec "$MQ_NAME" "${BROKER_HEALTH[@]}" >/dev/null 2>&1; then ready=yes; break; fi sleep 3 done [ "$ready" = yes ] || { echo "$BROKER is not ready after 600 s"; docker logs --tail 40 "$MQ_NAME"; exit 1; } stamp "$BROKER ready" stamp "tests (--no-build)" TEST_ARGS=(dotnet test -f "$FRAMEWORK" --no-build --logger "console;verbosity=normal") [ -n "$FILTER" ] && TEST_ARGS+=(--filter "$FILTER") docker run -d --name "$TESTS" "${COMMON[@]}" "$IMAGE" "${TEST_ARGS[@]}" >/dev/null docker logs -f "$TESTS" > "$LOG" 2>&1 & FOLLOW=$! running() { [ "$(docker inspect -f '{{.State.Running}}' "$TESTS" 2>/dev/null)" = true ]; } deadline=$(( $(date +%s) + TEST_MINUTES * 60 )) while running && ! grep -q "Total tests:" "$LOG" && [ "$(date +%s)" -lt "$deadline" ]; do sleep 2; done if running && ! grep -q "Total tests:" "$LOG"; then stamp "TESTS DID NOT FINISH within $TEST_MINUTES min; processes and thread names" docker exec "$TESTS" sh -c 'for p in /proc/[0-9]*; do [ -r $p/cmdline ] || continue; echo "-- pid ${p#/proc/}: $(tr "\0" " " < $p/cmdline | cut -c1-200)"; for t in $p/task/*; do cat $t/comm; done | sort | uniq -c; done' || true tail -n 60 "$LOG" exit 4 fi for _ in $(seq 1 30); do running || break; sleep 2; done if running; then stamp "TEST HOST DID NOT EXIT within 60 s after the summary; processes and thread names" docker exec "$TESTS" sh -c 'for p in /proc/[0-9]*; do [ -r $p/cmdline ] || continue; echo "-- pid ${p#/proc/}: $(tr "\0" " " < $p/cmdline | cut -c1-200)"; for t in $p/task/*; do cat $t/comm; done | sort | uniq -c; done' || true code=2 else code=$(docker inspect -f '{{.State.ExitCode}}' "$TESTS") stamp "test host exited, code $code" fi if [ "$code" != 0 ]; then # The broker the tests stopped and started may be what failed: its state and the end of its log, before it is removed. stamp "broker $MQ_NAME: $(docker inspect -f '{{.State.Status}} exit {{.State.ExitCode}} oom {{.State.OOMKilled}}' "$MQ_NAME" 2>&1)" docker logs --tail 40 "$MQ_NAME" 2>&1 | cut -c1-300 || true fi remove_containers # ends the log follower too wait "$FOLLOW" 2>/dev/null || true FOLLOW="" if [ "$code" != 0 ]; then tail -n 60 "$LOG" stamp "error messages of the failed tests" grep -A12 "Error Message:" "$LOG" | head -n 600 || true fi grep -E "^\s+(Passed|Failed|Skipped) |^Total tests:|^\s+(Passed|Failed|Skipped):|Total time:" "$LOG" || true exit "$code" Path: redb-route/tests/docker/servicebus/Config.json Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/servicebus/Config.json ---- { "UserConfig": { "Namespaces": [ { "Name": "sbemulatorns", "Queues": [ { "Name": "queue.fault.single", "Properties": { "DeadLetteringOnMessageExpiration": false, "DefaultMessageTimeToLive": "PT1H", "DuplicateDetectionHistoryTimeWindow": "PT20S", "ForwardDeadLetteredMessagesTo": "", "ForwardTo": "", "LockDuration": "PT30S", "MaxDeliveryCount": 3, "RequiresDuplicateDetection": false, "RequiresSession": false } }, { "Name": "queue.fault.session", "Properties": { "DeadLetteringOnMessageExpiration": false, "DefaultMessageTimeToLive": "PT1H", "DuplicateDetectionHistoryTimeWindow": "PT20S", "ForwardDeadLetteredMessagesTo": "", "ForwardTo": "", "LockDuration": "PT30S", "MaxDeliveryCount": 3, "RequiresDuplicateDetection": false, "RequiresSession": true } }, { "Name": "queue.fault.batch", "Properties": { "DeadLetteringOnMessageExpiration": false, "DefaultMessageTimeToLive": "PT1H", "DuplicateDetectionHistoryTimeWindow": "PT20S", "ForwardDeadLetteredMessagesTo": "", "ForwardTo": "", "LockDuration": "PT30S", "MaxDeliveryCount": 3, "RequiresDuplicateDetection": false, "RequiresSession": false } }, { "Name": "queue.conformance", "Properties": { "DeadLetteringOnMessageExpiration": false, "DefaultMessageTimeToLive": "PT1H", "DuplicateDetectionHistoryTimeWindow": "PT20S", "ForwardDeadLetteredMessagesTo": "", "ForwardTo": "", "LockDuration": "PT30S", "MaxDeliveryCount": 3, "RequiresDuplicateDetection": false, "RequiresSession": false } }, { "Name": "queue.conformance.2", "Properties": { "DeadLetteringOnMessageExpiration": false, "DefaultMessageTimeToLive": "PT1H", "DuplicateDetectionHistoryTimeWindow": "PT20S", "ForwardDeadLetteredMessagesTo": "", "ForwardTo": "", "LockDuration": "PT30S", "MaxDeliveryCount": 2, "RequiresDuplicateDetection": false, "RequiresSession": false } }, { "Name": "queue.conformance.session", "Properties": { "DeadLetteringOnMessageExpiration": false, "DefaultMessageTimeToLive": "PT1H", "DuplicateDetectionHistoryTimeWindow": "PT20S", "ForwardDeadLetteredMessagesTo": "", "ForwardTo": "", "LockDuration": "PT30S", "MaxDeliveryCount": 3, "RequiresDuplicateDetection": false, "RequiresSession": true } }, { "Name": "queue.conformance.session.2", "Properties": { "DeadLetteringOnMessageExpiration": false, "DefaultMessageTimeToLive": "PT1H", "DuplicateDetectionHistoryTimeWindow": "PT20S", "ForwardDeadLetteredMessagesTo": "", "ForwardTo": "", "LockDuration": "PT30S", "MaxDeliveryCount": 2, "RequiresDuplicateDetection": false, "RequiresSession": true } } ], "Topics": [] } ], "Logging": { "Type": "Console" } } } Path: redb-route/tests/docker/soap/Dockerfile Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/soap/Dockerfile ---- # SOAP echo server and the node-soap clients the Soap interop tests run through `docker exec soap-echo`. # Dependencies are baked in; /work is the folder the tests share with the container (.generated/soap). FROM node:22-slim WORKDIR /app RUN npm install --no-save --no-audit --no-fund soap@1.14.0 COPY *.js echo.wsdl ./ EXPOSE 18060 CMD ["node", "server.js"] Path: redb-route/tests/docker/soap/README.md Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/soap/README.md ---- # SOAP interop: node-soap An independent SOAP stack (Node.js [`soap`](https://www.npmjs.com/package/soap)) for the `redb.Route.Tests.Soap` interop tests. It shares no code with `redb.Route.Soap`, so it proves interop that loopback tests cannot. Profile `soap` of `redb.Route/docker-compose.tests.yml` (see `../README.md`); the image has the `soap` package baked in. - `echo.wsdl`: one `Echo` operation (`urn:soaptest`), `msg` in, `result` out. - `server.js`: SOAP server on 18060 (`/echo`), returns `echo:`; our producer calls it. - `client.js`, `mtom-client.js`: clients the tests run through `docker exec soap-echo`, calling our consumer on the host (`host.docker.internal`, ports 18160+ and 18180+ offset by the .NET major version). - `xmlenc-verify.js`: an independent XML-Encryption decryptor (Node `crypto`) for the WSS encryption test, which hands over its envelope and key through `SOAP_INTEROP_DIR` (`.generated/soap`, mounted as `/work`). Readiness: `curl http://localhost:18060/echo?wsdl` answers 200. The tests skip when nothing answers on 18060. Path: redb-route/tests/docker/soap/client.js Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/soap/client.js ---- // Independent SOAP client (Node `soap`) → drives redb.Route.Soap consumer for reverse-direction interop. // TARGET env = our consumer URL; the WSDL is the shared contract, endpoint overridden to TARGET. const soap = require('soap'); const target = process.env.TARGET; const msg = process.argv[2] || 'hi'; soap.createClient('/app/echo.wsdl', { endpoint: target }, (err, client) => { if (err) { console.error('CLIENT_ERR ' + err.message); process.exit(2); } client.Echo({ msg }, (err, result) => { if (err) { console.error('CALL_ERR ' + err.message); process.exit(3); } console.log('RESULT:' + (result && result.result)); }); }); Path: redb-route/tests/docker/soap/echo.wsdl Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/soap/echo.wsdl ---- Path: redb-route/tests/docker/soap/mtom-client.js Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/soap/mtom-client.js ---- // Independent MTOM SOAP client (Node `soap`, forceMTOM) → drives redb.Route.Soap consumer. // Sends a binary attachment; prints the result and any response attachments the connector returned. // mtomResponseAttachments is an object { parts: [{ body, headers }] } (soap's own shape), not an array. const soap = require('soap'); const target = process.env.TARGET; const msg = process.argv[2] || 'hi'; const attBody = process.argv[3] || 'node-mtom-bytes'; soap.createClient('/app/echo.wsdl', { endpoint: target, parseReponseAttachments: true }, (err, client) => { if (err) { console.error('CLIENT_ERR ' + err.message); process.exit(2); } const options = { forceMTOM: true, attachments: [{ mimetype: 'application/octet-stream', contentId: 'up-1', name: 'up-1', body: Buffer.from(attBody) }], }; client.Echo({ msg }, (err, result, rawResponse, soapHeader, rawRequest, mtomAtts) => { if (err) { console.error('CALL_ERR ' + err.message); process.exit(3); } console.log('RESULT:' + (result && result.result)); const parts = (mtomAtts && mtomAtts.parts) || []; const atts = parts.length ? parts.map(p => (p.body ? p.body.toString() : '')).join(',') : 'none'; console.log('RESPATT:' + atts); }, options); }); Path: redb-route/tests/docker/soap/server.js Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/soap/server.js ---- const soap = require('soap'); const http = require('http'); const fs = require('fs'); const wsdl = fs.readFileSync('/app/echo.wsdl', 'utf8'); const service = { EchoService: { EchoPort: { Echo: (args) => ({ result: 'echo:' + (args && args.msg ? args.msg : '') }) } } }; const server = http.createServer((req, res) => { res.statusCode = 404; res.end(); }); server.listen(18060, () => { soap.listen(server, '/echo', service, wsdl); console.log('SOAP echo (node soap) listening on 18060'); }); Path: redb-route/tests/docker/soap/xmlenc-verify.js Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/docker/soap/xmlenc-verify.js ---- // Independent XML-Encryption validator (Node built-in crypto = OpenSSL, zero shared code with the connector). // Decrypts a redb.Route.Soap WSS-encrypted envelope with the recipient RSA private key (PEM): // CipherValue[0] = RSA-OAEP-wrapped AES session key (EncryptedKey, in wsse:Security) // CipherValue[1] = AES-256-CBC ciphertext of the body (EncryptedData, in soap:Body; IV = first 16 bytes) // XML-Encryption mandates its own CBC padding (arbitrary bytes, LAST byte = pad length) — not PKCS7 — so // auto-padding is disabled and the padding is stripped by the trailing length byte. const fs = require('fs'); const crypto = require('crypto'); const xmlPath = process.env.ENC_XML || '/app/enc-envelope.xml'; const pemPath = process.env.ENC_PEM || '/app/enc-key.pem'; const xml = fs.readFileSync(xmlPath, 'utf8'); const pem = fs.readFileSync(pemPath, 'utf8'); const re = /<(?:\w+:)?CipherValue>([\s\S]*?)<\/(?:\w+:)?CipherValue>/g; const blobs = []; let m; while ((m = re.exec(xml)) !== null) blobs.push(Buffer.from(m[1].replace(/\s+/g, ''), 'base64')); if (blobs.length < 2) { console.error('NEED_TWO_CIPHERVALUES got ' + blobs.length); process.exit(2); } let sessionKey; try { sessionKey = crypto.privateDecrypt( { key: pem, padding: crypto.constants.RSA_PKCS1_OAEP_PADDING, oaepHash: 'sha1' }, blobs[0]); } catch (e) { console.error('RSA_UNWRAP_FAIL ' + e.message); process.exit(3); } try { const iv = blobs[1].subarray(0, 16); const data = blobs[1].subarray(16); const d = crypto.createDecipheriv('aes-256-cbc', sessionKey, iv); d.setAutoPadding(false); const raw = Buffer.concat([d.update(data), d.final()]); const padLen = raw[raw.length - 1]; // XML-Enc: last byte = number of padding bytes const plain = raw.subarray(0, raw.length - padLen).toString('utf8'); console.log('PLAIN:' + plain); } catch (e) { console.error('AES_FAIL ' + e.message); process.exit(4); }