استعلام_الأدلة
استعلام عن مزود الأدلة مع سياق التشغيل الكامل وسياسة الإفصاح.
ملاحظات رئيسية
- قد تقوم سياسة الإفصاح بحذف القيم الخام؛ لا تزال القيم التجزئة/المرتكزات مُرجعة.
- استخدم للتشخيصات أو فحوصات ما قبل الطيران؛ يستخدم وقت التشغيل نفس منطق المزود.
- يتطلب provider_id و check_id و EvidenceContext الكامل.
مدخلات
- سياق (مطلوب): سياق الأدلة المستخدمة للتقييم.
- استعلام (مطلوب): حمولة استعلام الأدلة.
مخطط الإدخال
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"context": {
"additionalProperties": false,
"description": "Evidence context used for evaluation.",
"properties": {
"correlation_id": {
"oneOf": [
{
"type": "null"
},
{
"description": "Correlation identifier.",
"type": "string"
}
]
},
"namespace_id": {
"description": "Namespace identifier.",
"minimum": 1,
"type": "integer"
},
"run_id": {
"description": "Run identifier.",
"type": "string"
},
"scenario_id": {
"description": "Scenario identifier.",
"type": "string"
},
"stage_id": {
"description": "Stage identifier.",
"type": "string"
},
"tenant_id": {
"description": "Tenant identifier.",
"minimum": 1,
"type": "integer"
},
"trigger_id": {
"description": "Trigger identifier.",
"type": "string"
},
"trigger_time": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"kind": {
"const": "unix_millis"
},
"value": {
"type": "integer"
}
},
"required": [
"kind",
"value"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"kind": {
"const": "logical"
},
"value": {
"minimum": 0,
"type": "integer"
}
},
"required": [
"kind",
"value"
],
"type": "object"
}
]
}
},
"required": [
"tenant_id",
"namespace_id",
"run_id",
"scenario_id",
"stage_id",
"trigger_id",
"trigger_time"
],
"type": "object"
},
"query": {
"additionalProperties": false,
"description": "Evidence query payload.",
"properties": {
"check_id": {
"description": "Provider check identifier.",
"type": "string"
},
"params": {
"description": "Provider-specific parameter payload.",
"type": [
"null",
"boolean",
"number",
"string",
"array",
"object"
]
},
"provider_id": {
"description": "Evidence provider identifier.",
"type": "string"
}
},
"required": [
"provider_id",
"check_id"
],
"type": "object"
}
},
"required": [
"query",
"context"
],
"type": "object"
}
المخرجات
- النتيجة (مطلوب): النوع: كائن.
مخطط الإخراج
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"result": {
"additionalProperties": false,
"properties": {
"content_type": {
"oneOf": [
{
"type": "null"
},
{
"description": "Evidence content type.",
"type": "string"
}
]
},
"error": {
"oneOf": [
{
"type": "null"
},
{
"additionalProperties": false,
"properties": {
"code": {
"description": "Stable error code.",
"type": "string"
},
"details": {
"oneOf": [
{
"type": "null"
},
{
"description": "Optional structured error details.",
"type": [
"null",
"boolean",
"number",
"string",
"array",
"object"
]
}
]
},
"message": {
"description": "Error message.",
"type": "string"
}
},
"required": [
"code",
"message",
"details"
],
"type": "object"
}
]
},
"evidence_anchor": {
"oneOf": [
{
"type": "null"
},
{
"additionalProperties": false,
"properties": {
"anchor_type": {
"description": "Anchor type identifier.",
"type": "string"
},
"anchor_value": {
"description": "Anchor value.",
"type": "string"
}
},
"required": [
"anchor_type",
"anchor_value"
],
"type": "object"
}
]
},
"evidence_hash": {
"oneOf": [
{
"type": "null"
},
{
"additionalProperties": false,
"properties": {
"algorithm": {
"enum": [
"sha256"
],
"type": "string"
},
"value": {
"description": "Lowercase hex digest.",
"type": "string"
}
},
"required": [
"algorithm",
"value"
],
"type": "object"
}
]
},
"evidence_ref": {
"oneOf": [
{
"type": "null"
},
{
"additionalProperties": false,
"properties": {
"uri": {
"description": "Evidence reference URI.",
"type": "string"
}
},
"required": [
"uri"
],
"type": "object"
}
]
},
"lane": {
"description": "Trust lane classification for evidence.",
"enum": [
"verified",
"asserted"
],
"type": "string"
},
"signature": {
"oneOf": [
{
"type": "null"
},
{
"additionalProperties": false,
"properties": {
"key_id": {
"description": "Signing key identifier.",
"type": "string"
},
"scheme": {
"description": "Signature scheme identifier.",
"type": "string"
},
"signature": {
"items": {
"maximum": 255,
"minimum": 0,
"type": "integer"
},
"type": "array"
}
},
"required": [
"scheme",
"key_id",
"signature"
],
"type": "object"
}
]
},
"value": {
"oneOf": [
{
"type": "null"
},
{
"oneOf": [
{
"additionalProperties": false,
"properties": {
"kind": {
"const": "json"
},
"value": {
"description": "Evidence JSON value.",
"type": [
"null",
"boolean",
"number",
"string",
"array",
"object"
]
}
},
"required": [
"kind",
"value"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"kind": {
"const": "bytes"
},
"value": {
"items": {
"maximum": 255,
"minimum": 0,
"type": "integer"
},
"type": "array"
}
},
"required": [
"kind",
"value"
],
"type": "object"
}
]
}
]
}
},
"required": [
"value",
"lane",
"error",
"evidence_hash",
"evidence_ref",
"evidence_anchor",
"signature",
"content_type"
],
"type": "object"
}
},
"required": [
"result"
],
"type": "object"
}
أمثلة
استعلام عن مزود الأدلة باستخدام سياق التشغيل.
مدخل:
{
"context": {
"correlation_id": null,
"namespace_id": 1,
"run_id": "run-0001",
"scenario_id": "example-scenario",
"stage_id": "main",
"tenant_id": 1,
"trigger_id": "trigger-0001",
"trigger_time": {
"kind": "unix_millis",
"value": 1710000000000
}
},
"query": {
"check_id": "get",
"params": {
"key": "DEPLOY_ENV"
},
"provider_id": "env"
}
}
Output:
{
"result": {
"content_type": "text/plain",
"error": null,
"evidence_anchor": {
"anchor_type": "env",
"anchor_value": "DEPLOY_ENV"
},
"evidence_hash": {
"algorithm": "sha256",
"value": "5c3a5b6bce0f4a2c9e22c4fa6a1e6d8d90b0f2dfed1b7f1e9b3d3b3d1f0c9b21"
},
"evidence_ref": null,
"lane": "verified",
"signature": null,
"value": {
"kind": "json",
"value": "production"
}
}
}