Steward cut 5: remove fixed-window step-up rate limiter and simplify connection target check

This commit is contained in:
Meta Vens 2026-12-03 21:12:57 +01:00
commit 1b0546bd4c
5 changed files with 19 additions and 196 deletions

View file

@ -1440,15 +1440,8 @@ describe("Heimdall service", () => {
expect(urls).toEqual([]);
});
// Targets made only of whitespace, format characters, controls and the invisible fillers that render as nothing.
const BLANK_TARGETS = [
" ", "\t", "\n ", "\u200B", "\u00A0\uFEFF",
"\u2800", "\u3164", "\u115F", "\u1160", "\uFFA0", "\u034F", "\u0000", "\u0007", " \u2800\u3164 ",
// Marks, private-use, unassigned and lone-surrogate code points, and the symbols that read as nothing: none is a letter or a number.
"\u0300", "\uE000", "\u0378", "\uD800", "\u{16FE4}", "\u{1D159}", "\u{F0000}", "\u0300\uE000 ",
];
// A target is usable when it holds a letter or a number that is not an invisible filler.
const NAMING_TARGETS = ["creator-1", " creator-1 ", "Framgång", "42", "\u2800a\u3164", "\u3164\u0300x"];
const BLANK_TARGETS = ["", " ", "\t", "\n ", "\u00A0\uFEFF"];
const NAMING_TARGETS = ["creator-1", " creator-1 ", "Framgång", "42"];
describe("a connect start that names a connection target is the app backend's", () => {
// The target is app-backend authority: the StreamPixels backend proves the creator-manage session and states the
@ -1519,7 +1512,7 @@ describe("Heimdall service", () => {
apps.push(app);
for (const headers of [{}, { "x-heimdall-app-secret": "wrong" }]) {
for (const targetId of [" ", "\u2800"]) {
for (const targetId of [" ", "\t\n"]) {
const refused = await startFor(app, provider, { kind: "creator", targetId }, headers);
expect([refused.statusCode, refused.json()], JSON.stringify(targetId)).toEqual([401, { error: "app_auth_required" }]);
}
@ -1531,8 +1524,6 @@ describe("Heimdall service", () => {
for (const targetId of BLANK_TARGETS) {
expect(callbackMint(streampixels, "joystick", "connect", { kind: "creator", targetId }), JSON.stringify(targetId)).toBe("refused");
}
// A visible character among the blanks names a target.
expect(callbackMint(streampixels, "joystick", "connect", { kind: "creator", targetId: "\u2800a\u3164" })).toBe("custody_only");
for (const targetId of NAMING_TARGETS) {
expect(callbackMint(streampixels, "joystick", "connect", { kind: "creator", targetId }), JSON.stringify(targetId)).toBe("custody_only");
}