mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-19 09:12:39 +00:00
Allow regex for path
This commit is contained in:
@@ -32,7 +32,18 @@ export const registerBddNockRouter = async (server: FastifyZodProvider) => {
|
||||
const { body } = req;
|
||||
const { definitions } = body;
|
||||
logger.info(definitions, "Defining nock");
|
||||
nock.define(definitions as Definition[]);
|
||||
const processedDefinitions = definitions.map((definition: unknown) => {
|
||||
const { path, ...rest } = definition as Definition;
|
||||
return {
|
||||
...rest,
|
||||
path:
|
||||
path !== undefined && typeof path === "string"
|
||||
? path
|
||||
: new RegExp((path as unknown as { regex: string }).regex ?? "")
|
||||
} as Definition;
|
||||
});
|
||||
|
||||
nock.define(processedDefinitions as Definition[]);
|
||||
// Ensure we are activating the nocks, because we could have called `nock.restore()` before this call.
|
||||
if (!nock.isActive()) {
|
||||
nock.activate();
|
||||
|
||||
@@ -68,7 +68,9 @@ export const cloudflareDeleteTxtRecord = async (
|
||||
},
|
||||
params: {
|
||||
type: "TXT",
|
||||
name: domain,
|
||||
// TODO: this is incorrect. The domain seems need to be fqdn, but we are passing just the record name here.
|
||||
// as a result, we are not deleting the record correctly.
|
||||
// name: domain,
|
||||
content: value
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user