BackendVariable 后端全局变量
1. 结构声明
- TS Declaration
- JSON Schema
class BackendVariable extends BaseNode {
name: string = '';
description?: string;
typeAnnotation: TypeAnnotation;
defaultValue?: DefaultValue;
scope: 'request' | 'applicaion';
}
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"typeAnnotation": {
"$ref": "#/definitions/TypeAnnotation"
},
"defaultValue": {
"$ref": "#/definitions/DefaultValue"
},
"scope": {
"type": "string",
"enum": [
"request",
"applicaion"
]
}
},
"required": [
"name",
"typeAnnotation",
"scope"
],
"additionalProperties": false
}
2. 节点示例
(1) 示例
AST 如下:
- JSON
- YAML
{
"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"
}
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