~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.17.0 Latest 2 packages, 1 image

1
10

A test server's OAuth client ID is never one an earlier server had

Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:gateway/flaky-client-assertion
crates/knotless/tests/common/mod.rs+8−1
@@ -235,9 +235,16 @@ impl Drop for TlsProxy {
}
}
/// An https front for a server on `port`, at a hostname of its own under
/// the harness's gateway hostname. A PDS keeps what it fetched of an OAuth
/// client, its keys too, for ten minutes, by its client ID, a URL at the
/// front: under one hostname for all, a server whose front came to a port
/// an earlier one's had would be taken for that one, and what it signed
/// refused, its key not the one kept.
pub fn tls_proxy(port: u16) -> TlsProxy {
let tls = &net().gateway;
tls_front(&tls.cert, &tls.key, &tls.host, port)
let host = format!("{}.{}", knotless::keys::tid(), tls.host);
tls_front(&tls.cert, &tls.key, &host, port)
}
/// An https front for a server on `port`, at `host`, with the certificate
harness/pds.mjs+8−5
@@ -11,9 +11,11 @@
// here each database is migrated the first time it is opened only.
//
// A gateway is an OAuth client, which the PDS reaches only over https at a
// hostname. So the harness makes a certificate for GATEWAY_HOST, trusts
// it, and resolves that name to 127.0.0.1; tests put harness/tls-proxy.mjs
// in front of a gateway with it.
// hostname. So the harness makes a certificate for GATEWAY_HOST and each
// name one label under it, trusts it, and resolves those names to
// 127.0.0.1; tests put harness/tls-proxy.mjs in front of a gateway with it,
// each front at a name of its own (`tls_proxy` in
// crates/knotless/tests/common/mod.rs says why).
import { fileURLToPath, pathToFileURL } from 'node:url'
import { dirname, join, resolve } from 'node:path'
@@ -114,7 +116,7 @@ execFileSync(
'-subj',
`/CN=${GATEWAY_HOST}`,
'-addext',
`subjectAltName=DNS:${GATEWAY_HOST}`,
`subjectAltName=DNS:${GATEWAY_HOST},DNS:*.${GATEWAY_HOST}`,
],
{ stdio: 'ignore' },
)
@@ -122,7 +124,8 @@ tls.setDefaultCACertificates([...tls.getCACertificates('default'), readFileSync(
const lookup = dns.lookup
dns.lookup = (hostname, options, callback) => {
if (typeof options === 'function') [callback, options] = [options, {}]
if (hostname !== GATEWAY_HOST) return lookup(hostname, options, callback)
const ours = hostname === GATEWAY_HOST || hostname.endsWith(`.${GATEWAY_HOST}`)
if (!ours) return lookup(hostname, options, callback)
return options?.all
? callback(null, [{ address: '127.0.0.1', family: 4 }])
: callback(null, '127.0.0.1', 4)
harness/quarantine.json+0−6
@@ -34,11 +34,5 @@
"binary": "gateway (test)",
"test": "accounts::switching_between_accounts_on_the_pages",
"until": "2026-11-14"
},
{
"net": "spaces",
"binary": "gateway (test)",
"test": "racing_gateways_rebuild_on_the_moved_branch",
"until": "2026-11-14"
}
]