Veripass Policy Evaluation
依据 Veripass 身份契约评估访问策略。
向 Veripass 请求针对某资源上某操作的策略决策,并根据响应中的 decision 路由到 allow、challenge 或 deny。
工作原理
- 解析配置;当
connection_id或action为空时从error输出。 - 在服务端解析凭据:其配置提供 Veripass 基础 URL(
url或baseUrl)和可选的额外headers,其密钥用于认证。 - 发送
POST <基础 URL>/api/identity/contract/evaluate,请求体为{ policy_set, resource, action, context }(context默认为{})。 - 从响应体读取
decision、reason和obligations。 allow路由到allow,challenge路由到challenge。其他任何值(包括缺失)都走deny,decision为"deny",reason默认为Policy denied。- 网络错误或非 2xx 响应会从
error输出,附带错误信息和响应体。
在工作流中
节点在工作流文件(draft_nodes[])中的写法,以及一次成功运行的 envelope。
{
"node_id": "node-authorize-approval",
"label": "Authorize invoice approval",
"operator_slug": "veripass.evaluate",
"operator_version": "1.0.0",
"config": {
"connection_id": "pi-credential-xxxx",
"policy_set": "finance-approvals",
"resource": "invoice:{{ $json.invoice_id }}",
"action": "approve",
"context": "{{ $json.request_context }}"
}
}{
"ok": true,
"port": "allow",
"data": {
"decision": "allow",
"reason": "Role approver may approve invoices",
"obligations": []
}
}配置
-
connection_idstring 必填 -
用于 Veripass 策略评估的凭据。接受 `api-key` 类型的凭据(Veripass API 密钥)。
-
policy_setstring 可选 -
策略集 ID 或名称
-
resourcestring 可选 -
资源标识符
-
actionstring 必填 -
操作(read、write 等)
-
contextobject 可选 -
附加上下文(user_id、IP 等)
代码中的行为
除 schema 描述之外,实现代码对这些键的实际处理。
-
connection_id - 凭据配置中必须以
url(或baseUrl)提供 Veripass 基础 URL;其中的headers会添加到请求中。认证来自密钥:包含token的对象会发送Authorization: Bearer <token>,包含apiKey的对象会发送x-api-key。纯字符串密钥不会添加认证头。 -
context - 原样发送。使用纯表达式(如
{{ $json.request_context }})传入对象;混合文本会以字符串形式发送。
输出端口
allow 默认 Veripass 返回 decision: "allow"。
{
"decision": "allow",
"reason": "Role approver may approve invoices",
"obligations": []
}challenge Veripass 返回 decision: "challenge"(例如需要升级认证)。
{
"decision": "challenge",
"reason": "Step-up authentication required",
"obligations": [
"mfa"
]
}deny Veripass 返回 deny、其他任何值,或未返回 decision。
{
"decision": "deny",
"reason": "Policy denied"
}error 缺少 connection_id 或 action、凭据无法解析,或 HTTP 调用失败。
{
"error": "Request failed with status code 401",
"response": {
"message": "Unauthorized"
}
}在表达式中
后续节点可通过 $("Veripass Policy Evaluation").item.json.<路径> 读取此节点输出中的内容(请把 Veripass Policy Evaluation 换成你的节点标签)。Editor 标记工作流编辑器在 Previous Nodes 中提示的路径(输出契约);Worker 标记 worker 实际通过 allow 返回的路径,依据“端口”一节所示的输出。
| 表达式 | Editor | Worker |
|---|---|---|
$("Veripass Policy Evaluation").item.json.decision | ||
$("Veripass Policy Evaluation").item.json.reason | ||
$("Veripass Policy Evaluation").item.json.obligations |
错误
| 消息 | 端口 | 原因与处理 |
|---|---|---|
connection_id is required | error | 未选择 Veripass 凭据。 |
action is required | error | action 为空,或其表达式未解析出任何值。 |
Request failed with status code <status> | error | Veripass 拒绝了调用:401/403 通常表示凭据密钥中没有可用的 token 或 apiKey;404 表示基础 URL 不正确。response 中是 Veripass 返回的响应体。 |
Failed to resolve connection <connection_id>: <detail> | error | 凭据 id 不存在,或该工作流无权使用。 |
输入契约
-
connection_idstring 必填 -
policy_setstring 可选 -
resourcestring 可选 -
actionstring 必填 -
contextobject 可选
输出契约
-
decisionstring 可选 -
reasonstring 可选 -
obligationsarray 可选
契约(JSON Schema)
与编排器声明完全一致的定义。All 是完整的 *.definition.js;可与上方各节对照,找出文档与 schema 之间的差异。发布前可用它校验节点。
{
"slug": "veripass.evaluate",
"name": "Veripass Policy Evaluation",
"category": "identity",
"version": "1.0.0",
"description": "Evaluates access policies against Veripass Identity Contract.",
"capabilities": [
"authz",
"policy",
"veripass",
"identity"
],
"config_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "Veripass Credential",
"description": "Credential for Veripass policy evaluation. Accepts credentials of type `api-key` (Veripass API key).",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"api-key"
],
"types": [
"veripass",
"http"
]
}
},
"policy_set": {
"type": "string",
"description": "Policy Set ID or Name"
},
"resource": {
"type": "string",
"description": "Resource identifier"
},
"action": {
"type": "string",
"description": "Action (read, write, etc.)"
},
"context": {
"type": "object",
"description": "Additional context (user_id, IP, etc.)"
}
},
"required": [
"connection_id",
"action"
]
},
"input_contract_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"policy_set": {
"type": "string"
},
"resource": {
"type": "string"
},
"action": {
"type": "string"
},
"context": {
"type": "object"
}
},
"required": [
"connection_id",
"action"
]
},
"output_contract_schema": {
"type": "object",
"properties": {
"decision": {
"type": "string",
"enum": [
"allow",
"deny",
"challenge"
]
},
"reason": {
"type": "string"
},
"obligations": {
"type": "array"
}
}
},
"ports": [
{
"port_id": "allow",
"label": "Allow",
"description": "Access granted",
"is_default": true,
"supports_condition": true
},
{
"port_id": "deny",
"label": "Deny",
"description": "Access denied",
"is_default": false,
"supports_condition": true
},
{
"port_id": "challenge",
"label": "Challenge",
"description": "MFA or step-up required",
"is_default": false,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Evaluation error",
"is_default": false,
"supports_condition": false
}
],
"execution_mode": "async",
"required_resources": [],
"compatible_worker_pools": [
"identity-worker",
"standard"
],
"tags": [
"veripass",
"security",
"policy"
],
"is_stateful": false,
"publisher": {
"identity": "org_veripass",
"profile": {
"name": "Veripass",
"verified": true,
"url": "https://me.veripass.com/veripass",
"logo_url": null
}
}
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "Veripass Credential",
"description": "Credential for Veripass policy evaluation. Accepts credentials of type `api-key` (Veripass API key).",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"api-key"
],
"types": [
"veripass",
"http"
]
}
},
"policy_set": {
"type": "string",
"description": "Policy Set ID or Name"
},
"resource": {
"type": "string",
"description": "Resource identifier"
},
"action": {
"type": "string",
"description": "Action (read, write, etc.)"
},
"context": {
"type": "object",
"description": "Additional context (user_id, IP, etc.)"
}
},
"required": [
"connection_id",
"action"
]
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"policy_set": {
"type": "string"
},
"resource": {
"type": "string"
},
"action": {
"type": "string"
},
"context": {
"type": "object"
}
},
"required": [
"connection_id",
"action"
]
}{
"type": "object",
"properties": {
"decision": {
"type": "string",
"enum": [
"allow",
"deny",
"challenge"
]
},
"reason": {
"type": "string"
},
"obligations": {
"type": "array"
}
}
}[
{
"port_id": "allow",
"label": "Allow",
"description": "Access granted",
"is_default": true,
"supports_condition": true
},
{
"port_id": "deny",
"label": "Deny",
"description": "Access denied",
"is_default": false,
"supports_condition": true
},
{
"port_id": "challenge",
"label": "Challenge",
"description": "MFA or step-up required",
"is_default": false,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Evaluation error",
"is_default": false,
"supports_condition": false
}
]执行
- 执行方式
async- 有状态
- 否
- 凭据
- 在服务器端根据
connection_id解析,密钥不会进入工作流。 - 能力
authzpolicyveripassidentity- 标签
veripasssecuritypolicy
说明与限制
- 未知或缺失的决策都走
deny,即默认拒绝。 - 返回的信封不包含
ok字段,且该调用未设置请求超时。 - 从
error端口输出不会使运行失败:引擎沿error上的连线继续;若没有连线,该分支直接结束。
已对照编排器代码核实 · 31e874b · 2026-11-26