9 lines
549 B
JavaScript
9 lines
549 B
JavaScript
// This destructive fixture accepts only the runner's canonical disposable connection.
|
|
export function validateMariaDbBrowserConnection(connection, port) {
|
|
const match = /^Server=127\.0\.0\.1;Port=([0-9]{1,5});Database=(jt_it_[a-f0-9]{32});User ID=root;Password=jt-integration-only;SslMode=None;?$/.exec(connection);
|
|
if (!match || Number(match[1]) < 1 || Number(match[1]) > 65535 || match[1] !== port) {
|
|
throw new Error('MariaDB browser lane requires a canonical disposable loopback connection and matching port.');
|
|
}
|
|
return match[2];
|
|
}
|