Add Tuple type
This commit is contained in:
@@ -12,13 +12,15 @@ export type ExternalApiUsageByType = {
|
|||||||
|
|
||||||
export type ExtensiblePredicateDefinition = {
|
export type ExtensiblePredicateDefinition = {
|
||||||
extensiblePredicate: string;
|
extensiblePredicate: string;
|
||||||
generateMethodDefinition: (method: ExternalApiUsageByType) => any[];
|
generateMethodDefinition: (method: ExternalApiUsageByType) => Tuple[];
|
||||||
readModeledMethod: (row: any[]) => ModeledMethodWithSignature;
|
readModeledMethod: (row: Tuple[]) => ModeledMethodWithSignature;
|
||||||
|
|
||||||
supportedKinds?: string[];
|
supportedKinds?: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
function readRowToMethod(row: any[]): string {
|
type Tuple = boolean | number | string;
|
||||||
|
|
||||||
|
function readRowToMethod(row: Tuple[]): string {
|
||||||
return `${row[0]}.${row[1]}#${row[3]}${row[4]}`;
|
return `${row[0]}.${row[1]}#${row[3]}${row[4]}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,8 +50,8 @@ export const extensiblePredicateDefinitions: Record<
|
|||||||
modeledMethod: {
|
modeledMethod: {
|
||||||
type: "source",
|
type: "source",
|
||||||
input: "",
|
input: "",
|
||||||
output: row[6],
|
output: row[6] as string,
|
||||||
kind: row[7],
|
kind: row[7] as string,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
supportedKinds: ["remote"],
|
supportedKinds: ["remote"],
|
||||||
@@ -75,9 +77,9 @@ export const extensiblePredicateDefinitions: Record<
|
|||||||
signature: readRowToMethod(row),
|
signature: readRowToMethod(row),
|
||||||
modeledMethod: {
|
modeledMethod: {
|
||||||
type: "sink",
|
type: "sink",
|
||||||
input: row[6],
|
input: row[6] as string,
|
||||||
output: "",
|
output: "",
|
||||||
kind: row[7],
|
kind: row[7] as string,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
supportedKinds: ["sql", "xss", "logging"],
|
supportedKinds: ["sql", "xss", "logging"],
|
||||||
@@ -104,9 +106,9 @@ export const extensiblePredicateDefinitions: Record<
|
|||||||
signature: readRowToMethod(row),
|
signature: readRowToMethod(row),
|
||||||
modeledMethod: {
|
modeledMethod: {
|
||||||
type: "summary",
|
type: "summary",
|
||||||
input: row[6],
|
input: row[6] as string,
|
||||||
output: row[7],
|
output: row[7] as string,
|
||||||
kind: row[8],
|
kind: row[8] as string,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
supportedKinds: ["taint", "value"],
|
supportedKinds: ["taint", "value"],
|
||||||
|
|||||||
Reference in New Issue
Block a user