test(e2e): set a user password and revoke a delegation from the web ui

- test(e2e): set a user password and revoke a delegation from the web ui
- test(e2e): switch a dynamic soa serial to a managed one through the ui
- test(e2e): match audit ledger routes on the decoded api path
- test(e2e): fuzz injection payloads in paths, filters and record data
This commit is contained in:
bryanpedini committed 2026-11-19 15:46:12 +01:00
1 parent 2a773e740f
commit 1cafcc759e
7 files changed
+433 -28

No files matched your search

+7 -7
View File
@@ -81,11 +81,12 @@ export interface RouteMatch {
targetUser: string | null;
}
function decode(segment: string): string | null {
export function decodedApiPath(path: string): string {
const raw = path.slice('/api/v1'.length).split('?')[0];
try {
return decodeURIComponent(segment);
return decodeURIComponent(raw);
} catch {
return null;
return raw;
}
}
@@ -102,11 +103,11 @@ export function matchRoute(method: string, apiPath: string): RouteMatch | null {
if (m !== method.toUpperCase()) continue;
const match = re.exec(apiPath);
if (!match) continue;
const groups = match.slice(1).map((s) => decode(s));
const groups = match.slice(1);
const out: RouteMatch = { operation, zone: null, recordId: null, targetUser: null };
targets.forEach((t, i) => {
const v = groups[i];
if (v === null || v === undefined) return;
if (v === undefined) return;
if (t === 'zone') out.zone = normalizeZoneParam(v);
if (t === 'record' && /^\+?[0-9]+$/.test(v)) {
const id = Number(v);
@@ -204,8 +205,7 @@ export class AuditLedger {
api(x: ApiExchange): void {
if (!x.path.startsWith('/api/v1/') && x.path !== '/api/v1') return;
const apiPath = x.path.slice('/api/v1'.length).split('?')[0];
const route = matchRoute(x.method, apiPath);
const route = matchRoute(x.method, decodedApiPath(x.path));
if (!x.sessionValid || x.status === 401 || x.crossOrigin) {
this.skipped++;
return;