Skip to main content
Version: 3.9

BackendVariable 后端全局变量

1. 结构声明

class BackendVariable extends BaseNode {
name: string = '';
description?: string;
typeAnnotation: TypeAnnotation;
defaultValue?: DefaultValue;
scope: 'request' | 'applicaion';
}

2. 节点示例

(1) 示例

AST 如下:

{
"concept": "BackendVariable",
"name": "httpRequest",
"description": "httpRequest对象,可在逻辑中使用,用于获取当前请求的属性,例如: cookie、header、ip等",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "generic",
"typeNamespace": "nasl.http",
"typeName": "HttpRequest",
"typeArguments": [
{
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "String",
"inferred": false,
"ruleMap": {}
}
],
"inferred": false,
"ruleMap": {}
},
"scope": "request"
}

对应的代码如下:

[编译方法未实现]