CallInterface 调用接口
1. 结构声明
- TS Declaration
- JSON Schema
class CallInterface extends LogicItem {
calleeNamespace: string;
calleeName: string;
shortcut?: boolean;
arguments: Array<Argument>;
}
{
"type": "object",
"properties": {
"composedBy": {
"type": "array",
"items": {
"type": "string"
}
},
"label": {
"type": "string"
},
"description": {
"type": "string"
},
"folded": {
"type": "boolean"
},
"offsetX": {
"type": "number"
},
"offsetY": {
"type": "number"
},
"calleeNamespace": {
"type": "string"
},
"calleeName": {
"type": "string"
},
"shortcut": {
"type": "boolean"
},
"arguments": {
"type": "array",
"items": {
"$ref": "#/definitions/Argument"
}
}
},
"required": [
"calleeNamespace",
"calleeName",
"arguments"
],
"additionalProperties": false
}
2. 节点示例
(1) 示例
AST 如下:
- JSON
- YAML
{
"concept": "CallInterface",
"calleeNamespace": "apis.getPhoneFrom.interfaces",
"calleeName": "phone",
"arguments": [
{
"concept": "Argument",
"keyword": "phone",
"expression": {
"concept": "Identifier",
"namespace": "",
"name": "phone"
}
},
{
"concept": "Argument",
"keyword": "key"
},
{
"concept": "Argument",
"keyword": "type"
}
]
}
concept: CallInterface
calleeNamespace: apis.getPhoneFrom.interfaces
calleeName: phone
arguments:
- concept: Argument
keyword: phone
expression:
concept: Identifier
namespace: ""
name: phone
- concept: Argument
keyword: key
- concept: Argument
keyword: type
对应的代码如下:
- 文本化 NASL
apis::getPhoneFrom::interfaces::phone(
phone = phone,
key = __IDENTIFIER__,
type = __IDENTIFIER__,
)