cap-sdk-python 2.10.0__py3-none-any.whl → 2.13.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cap/pb/cordum/agent/v1/buspacket_pb2.py +2 -2
- cap/pb/cordum/agent/v1/policy_pb2.py +82 -0
- cap/pb/cordum/agent/v1/policy_pb2_grpc.py +100 -0
- cap/pb/cordum/agent/v1/safety_pb2.py +4 -4
- {cap_sdk_python-2.10.0.dist-info → cap_sdk_python-2.13.0.dist-info}/METADATA +1 -1
- {cap_sdk_python-2.10.0.dist-info → cap_sdk_python-2.13.0.dist-info}/RECORD +8 -6
- {cap_sdk_python-2.10.0.dist-info → cap_sdk_python-2.13.0.dist-info}/WHEEL +0 -0
- {cap_sdk_python-2.10.0.dist-info → cap_sdk_python-2.13.0.dist-info}/top_level.txt +0 -0
|
@@ -29,7 +29,7 @@ from cordum.agent.v1 import alert_pb2 as cordum_dot_agent_dot_v1_dot_alert__pb2
|
|
|
29
29
|
from cordum.agent.v1 import handshake_pb2 as cordum_dot_agent_dot_v1_dot_handshake__pb2
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1f\x63ordum/agent/v1/buspacket.proto\x12\x0f\x63ordum.agent.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19\x63ordum/agent/v1/job.proto\x1a\x1f\x63ordum/agent/v1/heartbeat.proto\x1a\x1b\x63ordum/agent/v1/alert.proto\x1a\x1f\x63ordum/agent/v1/handshake.proto\"\
|
|
32
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1f\x63ordum/agent/v1/buspacket.proto\x12\x0f\x63ordum.agent.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19\x63ordum/agent/v1/job.proto\x1a\x1f\x63ordum/agent/v1/heartbeat.proto\x1a\x1b\x63ordum/agent/v1/alert.proto\x1a\x1f\x63ordum/agent/v1/handshake.proto\"\x8b\x04\n\tBusPacket\x12\x10\n\x08trace_id\x18\x01 \x01(\t\x12\x11\n\tsender_id\x18\x02 \x01(\t\x12.\n\ncreated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x18\n\x10protocol_version\x18\x04 \x01(\x05\x12\x32\n\x0bjob_request\x18\n \x01(\x0b\x32\x1b.cordum.agent.v1.JobRequestH\x00\x12\x30\n\njob_result\x18\x0b \x01(\x0b\x32\x1a.cordum.agent.v1.JobResultH\x00\x12/\n\theartbeat\x18\x0c \x01(\x0b\x32\x1a.cordum.agent.v1.HeartbeatH\x00\x12-\n\x05\x61lert\x18\r \x01(\x0b\x32\x1c.cordum.agent.v1.SystemAlertH\x00\x12\x34\n\x0cjob_progress\x18\x0f \x01(\x0b\x32\x1c.cordum.agent.v1.JobProgressH\x00\x12\x30\n\njob_cancel\x18\x10 \x01(\x0b\x32\x1a.cordum.agent.v1.JobCancelH\x00\x12/\n\thandshake\x18\x11 \x01(\x0b\x32\x1a.cordum.agent.v1.HandshakeH\x00\x12\x11\n\tsignature\x18\x0e \x01(\x0c\x12\x12\n\nauth_token\x18\x12 \x01(\tB\t\n\x07payloadB\x7f\n\x16io.cordum.cap.agent.v1P\x01Z+github.com/cordum-io/cap/v2/cordum/agent/v1\xaa\x02\x0f\x43ordum.Agent.V1\xca\x02\x0f\x63ordum\\Agent\\V1\xea\x02\x11\x43ordum::Agent::V1b\x06proto3')
|
|
33
33
|
|
|
34
34
|
_globals = globals()
|
|
35
35
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
@@ -38,5 +38,5 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
|
38
38
|
_globals['DESCRIPTOR']._loaded_options = None
|
|
39
39
|
_globals['DESCRIPTOR']._serialized_options = b'\n\026io.cordum.cap.agent.v1P\001Z+github.com/cordum-io/cap/v2/cordum/agent/v1\252\002\017Cordum.Agent.V1\312\002\017cordum\\Agent\\V1\352\002\021Cordum::Agent::V1'
|
|
40
40
|
_globals['_BUSPACKET']._serialized_start=208
|
|
41
|
-
_globals['_BUSPACKET']._serialized_end=
|
|
41
|
+
_globals['_BUSPACKET']._serialized_end=731
|
|
42
42
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: cordum/agent/v1/policy.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'cordum/agent/v1/policy.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
|
|
26
|
+
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
|
|
27
|
+
from cordum.agent.v1 import safety_pb2 as cordum_dot_agent_dot_v1_dot_safety__pb2
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x63ordum/agent/v1/policy.proto\x12\x0f\x63ordum.agent.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1c\x63ordum/agent/v1/safety.proto\"H\n\tRuleScope\x12,\n\x04kind\x18\x01 \x01(\x0e\x32\x1e.cordum.agent.v1.RuleScopeKind\x12\r\n\x05value\x18\x02 \x01(\t\"\x97\x01\n\rAuditMetadata\x12.\n\ncreated_at\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\ncreated_by\x18\x02 \x01(\t\x12.\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\nupdated_by\x18\x04 \x01(\t\"\xc7\x02\n\x04Rule\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\'\n\x04type\x18\x03 \x01(\x0e\x32\x19.cordum.agent.v1.RuleType\x12)\n\x05scope\x18\x04 \x01(\x0b\x32\x1a.cordum.agent.v1.RuleScope\x12+\n\x06status\x18\x05 \x01(\x0e\x32\x1b.cordum.agent.v1.RuleStatus\x12\x0f\n\x07version\x18\x06 \x01(\t\x12-\n\x05\x61udit\x18\x07 \x01(\x0b\x32\x1e.cordum.agent.v1.AuditMetadata\x12&\n\x05match\x18\x08 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\'\n\x06\x64\x65\x63ide\x18\t \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x13\n\x0b\x64\x65scription\x18\n \x01(\t\"\xd2\x01\n\tTraceStep\x12\x0f\n\x07rule_id\x18\x01 \x01(\t\x12\x11\n\tbundle_id\x18\x02 \x01(\t\x12\x34\n\rdecision_type\x18\x03 \x01(\x0e\x32\x1d.cordum.agent.v1.DecisionType\x12\x0e\n\x06reason\x18\x04 \x01(\t\x12-\n\ttimestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x0b\x63onstraints\x18\x06 \x01(\x0b\x32\x17.google.protobuf.Struct\"\xb9\x02\n\x08\x44\x65\x63ision\x12/\n\x06source\x18\x01 \x01(\x0e\x32\x1f.cordum.agent.v1.DecisionSource\x12\x0f\n\x07rule_id\x18\x02 \x01(\t\x12\x11\n\tbundle_id\x18\x03 \x01(\t\x12\x16\n\x0e\x62undle_version\x18\x04 \x01(\t\x12+\n\x04type\x18\x05 \x01(\x0e\x32\x1d.cordum.agent.v1.DecisionType\x12)\n\x05trace\x18\x06 \x03(\x0b\x32\x1a.cordum.agent.v1.TraceStep\x12\x11\n\tinput_ref\x18\x07 \x01(\t\x12\x12\n\noutput_ref\x18\x08 \x01(\t\x12\x12\n\naudit_hash\x18\t \x01(\t\x12-\n\ttimestamp\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\">\n\x0e\x42undleMetadata\x12,\n\tedge_mode\x18\x01 \x01(\x0e\x32\x19.cordum.agent.v1.EdgeMode\"\x93\x01\n\rBundleVersion\x12\x0f\n\x07version\x18\x01 \x01(\t\x12,\n\rrule_snapshot\x18\x02 \x03(\x0b\x32\x15.cordum.agent.v1.Rule\x12/\n\x0b\x64\x65ployed_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\naudit_hash\x18\x04 \x01(\t\"\xcc\x01\n\x06\x42undle\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x10\n\x08rule_ids\x18\x03 \x03(\t\x12\x31\n\rscope_binding\x18\x04 \x01(\x0b\x32\x1a.cordum.agent.v1.RuleScope\x12\x30\n\x08versions\x18\x05 \x03(\x0b\x32\x1e.cordum.agent.v1.BundleVersion\x12\x31\n\x08metadata\x18\x06 \x01(\x0b\x32\x1f.cordum.agent.v1.BundleMetadata\"\xec\x02\n\x14JobEvaluationContext\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x03 \x01(\t\x12\r\n\x05topic\x18\x04 \x01(\t\x12\x14\n\x0cprincipal_id\x18\x05 \x01(\t\x12\x41\n\x06labels\x18\x06 \x03(\x0b\x32\x31.cordum.agent.v1.JobEvaluationContext.LabelsEntry\x12\x11\n\tmemory_id\x18\x07 \x01(\t\x12\x12\n\ncapability\x18\x08 \x01(\t\x12\x11\n\trisk_tags\x18\t \x03(\t\x12\x15\n\rinput_content\x18\x14 \x01(\x0c\x12\x1a\n\x12input_content_type\x18\x15 \x01(\t\x12\x18\n\x10input_size_bytes\x18\x16 \x01(\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xfd\x02\n\x15\x45\x64geEvaluationContext\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x14\n\x0cprincipal_id\x18\x02 \x01(\t\x12\x12\n\nsession_id\x18\x03 \x01(\t\x12\x14\n\x0c\x65xecution_id\x18\x04 \x01(\t\x12\x15\n\ragent_product\x18\x05 \x01(\t\x12\x11\n\ttool_name\x18\x06 \x01(\t\x12\x34\n\x13tool_input_redacted\x18\x07 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x12\n\ninput_hash\x18\x08 \x01(\t\x12\x17\n\x0ftool_input_hash\x18\t \x01(\t\x12\x42\n\x06labels\x18\n \x03(\x0b\x32\x32.cordum.agent.v1.EdgeEvaluationContext.LabelsEntry\x12\x11\n\trisk_tags\x18\x0b \x03(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xf4\x01\n\x15PolicyEvaluateRequest\x12#\n\x04rule\x18\x01 \x01(\x0b\x32\x15.cordum.agent.v1.Rule\x12\x11\n\tbundle_id\x18\x02 \x01(\t\x12)\n\x05scope\x18\x03 \x01(\x0b\x32\x1a.cordum.agent.v1.RuleScope\x12:\n\x0bjob_context\x18\n \x01(\x0b\x32%.cordum.agent.v1.JobEvaluationContext\x12<\n\x0c\x65\x64ge_context\x18\x0b \x01(\x0b\x32&.cordum.agent.v1.EdgeEvaluationContext\"E\n\x16PolicyEvaluateResponse\x12+\n\x08\x64\x65\x63ision\x18\x01 \x01(\x0b\x32\x19.cordum.agent.v1.Decision*|\n\x08RuleType\x12\x19\n\x15RULE_TYPE_UNSPECIFIED\x10\x00\x12\x13\n\x0fRULE_TYPE_INPUT\x10\x01\x12\x14\n\x10RULE_TYPE_OUTPUT\x10\x02\x12\x16\n\x12RULE_TYPE_VELOCITY\x10\x03\x12\x12\n\x0eRULE_TYPE_EDGE\x10\x04*w\n\nRuleStatus\x12\x1b\n\x17RULE_STATUS_UNSPECIFIED\x10\x00\x12\x15\n\x11RULE_STATUS_DRAFT\x10\x01\x12\x19\n\x15RULE_STATUS_PUBLISHED\x10\x02\x12\x1a\n\x16RULE_STATUS_DEPRECATED\x10\x03*d\n\x0e\x44\x65\x63isionSource\x12\x1f\n\x1b\x44\x45\x43ISION_SOURCE_UNSPECIFIED\x10\x00\x12\x17\n\x13\x44\x45\x43ISION_SOURCE_JOB\x10\x01\x12\x18\n\x14\x44\x45\x43ISION_SOURCE_EDGE\x10\x02*\xc5\x01\n\rRuleScopeKind\x12\x1f\n\x1bRULE_SCOPE_KIND_UNSPECIFIED\x10\x00\x12\x1a\n\x16RULE_SCOPE_KIND_GLOBAL\x10\x01\x12\x1a\n\x16RULE_SCOPE_KIND_TENANT\x10\x02\x12\x1c\n\x18RULE_SCOPE_KIND_WORKFLOW\x10\x03\x12\x1e\n\x1aRULE_SCOPE_KIND_EDGE_FLEET\x10\x04\x12\x1d\n\x19RULE_SCOPE_KIND_EDGE_USER\x10\x05*t\n\x08\x45\x64geMode\x12\x19\n\x15\x45\x44GE_MODE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x45\x44GE_MODE_OBSERVE\x10\x01\x12\x15\n\x11\x45\x44GE_MODE_ENFORCE\x10\x02\x12\x1f\n\x1b\x45\x44GE_MODE_ENTERPRISE_STRICT\x10\x03\x32u\n\x0fPolicyEvaluator\x12\x62\n\x0f\x45valuateUnified\x12&.cordum.agent.v1.PolicyEvaluateRequest\x1a\'.cordum.agent.v1.PolicyEvaluateResponseB\x7f\n\x16io.cordum.cap.agent.v1P\x01Z+github.com/cordum-io/cap/v2/cordum/agent/v1\xaa\x02\x0f\x43ordum.Agent.V1\xca\x02\x0f\x63ordum\\Agent\\V1\xea\x02\x11\x43ordum::Agent::V1b\x06proto3')
|
|
31
|
+
|
|
32
|
+
_globals = globals()
|
|
33
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
34
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'cordum.agent.v1.policy_pb2', _globals)
|
|
35
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
36
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
37
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n\026io.cordum.cap.agent.v1P\001Z+github.com/cordum-io/cap/v2/cordum/agent/v1\252\002\017Cordum.Agent.V1\312\002\017cordum\\Agent\\V1\352\002\021Cordum::Agent::V1'
|
|
38
|
+
_globals['_JOBEVALUATIONCONTEXT_LABELSENTRY']._loaded_options = None
|
|
39
|
+
_globals['_JOBEVALUATIONCONTEXT_LABELSENTRY']._serialized_options = b'8\001'
|
|
40
|
+
_globals['_EDGEEVALUATIONCONTEXT_LABELSENTRY']._loaded_options = None
|
|
41
|
+
_globals['_EDGEEVALUATIONCONTEXT_LABELSENTRY']._serialized_options = b'8\001'
|
|
42
|
+
_globals['_RULETYPE']._serialized_start=2719
|
|
43
|
+
_globals['_RULETYPE']._serialized_end=2843
|
|
44
|
+
_globals['_RULESTATUS']._serialized_start=2845
|
|
45
|
+
_globals['_RULESTATUS']._serialized_end=2964
|
|
46
|
+
_globals['_DECISIONSOURCE']._serialized_start=2966
|
|
47
|
+
_globals['_DECISIONSOURCE']._serialized_end=3066
|
|
48
|
+
_globals['_RULESCOPEKIND']._serialized_start=3069
|
|
49
|
+
_globals['_RULESCOPEKIND']._serialized_end=3266
|
|
50
|
+
_globals['_EDGEMODE']._serialized_start=3268
|
|
51
|
+
_globals['_EDGEMODE']._serialized_end=3384
|
|
52
|
+
_globals['_RULESCOPE']._serialized_start=142
|
|
53
|
+
_globals['_RULESCOPE']._serialized_end=214
|
|
54
|
+
_globals['_AUDITMETADATA']._serialized_start=217
|
|
55
|
+
_globals['_AUDITMETADATA']._serialized_end=368
|
|
56
|
+
_globals['_RULE']._serialized_start=371
|
|
57
|
+
_globals['_RULE']._serialized_end=698
|
|
58
|
+
_globals['_TRACESTEP']._serialized_start=701
|
|
59
|
+
_globals['_TRACESTEP']._serialized_end=911
|
|
60
|
+
_globals['_DECISION']._serialized_start=914
|
|
61
|
+
_globals['_DECISION']._serialized_end=1227
|
|
62
|
+
_globals['_BUNDLEMETADATA']._serialized_start=1229
|
|
63
|
+
_globals['_BUNDLEMETADATA']._serialized_end=1291
|
|
64
|
+
_globals['_BUNDLEVERSION']._serialized_start=1294
|
|
65
|
+
_globals['_BUNDLEVERSION']._serialized_end=1441
|
|
66
|
+
_globals['_BUNDLE']._serialized_start=1444
|
|
67
|
+
_globals['_BUNDLE']._serialized_end=1648
|
|
68
|
+
_globals['_JOBEVALUATIONCONTEXT']._serialized_start=1651
|
|
69
|
+
_globals['_JOBEVALUATIONCONTEXT']._serialized_end=2015
|
|
70
|
+
_globals['_JOBEVALUATIONCONTEXT_LABELSENTRY']._serialized_start=1970
|
|
71
|
+
_globals['_JOBEVALUATIONCONTEXT_LABELSENTRY']._serialized_end=2015
|
|
72
|
+
_globals['_EDGEEVALUATIONCONTEXT']._serialized_start=2018
|
|
73
|
+
_globals['_EDGEEVALUATIONCONTEXT']._serialized_end=2399
|
|
74
|
+
_globals['_EDGEEVALUATIONCONTEXT_LABELSENTRY']._serialized_start=1970
|
|
75
|
+
_globals['_EDGEEVALUATIONCONTEXT_LABELSENTRY']._serialized_end=2015
|
|
76
|
+
_globals['_POLICYEVALUATEREQUEST']._serialized_start=2402
|
|
77
|
+
_globals['_POLICYEVALUATEREQUEST']._serialized_end=2646
|
|
78
|
+
_globals['_POLICYEVALUATERESPONSE']._serialized_start=2648
|
|
79
|
+
_globals['_POLICYEVALUATERESPONSE']._serialized_end=2717
|
|
80
|
+
_globals['_POLICYEVALUATOR']._serialized_start=3386
|
|
81
|
+
_globals['_POLICYEVALUATOR']._serialized_end=3503
|
|
82
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
from cordum.agent.v1 import policy_pb2 as cordum_dot_agent_dot_v1_dot_policy__pb2
|
|
7
|
+
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.80.0'
|
|
9
|
+
GRPC_VERSION = grpc.__version__
|
|
10
|
+
_version_not_supported = False
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
from grpc._utilities import first_version_is_lower
|
|
14
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
15
|
+
except ImportError:
|
|
16
|
+
_version_not_supported = True
|
|
17
|
+
|
|
18
|
+
if _version_not_supported:
|
|
19
|
+
raise RuntimeError(
|
|
20
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
21
|
+
+ ' but the generated code in cordum/agent/v1/policy_pb2_grpc.py depends on'
|
|
22
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
23
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
24
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class PolicyEvaluatorStub(object):
|
|
29
|
+
"""PolicyEvaluator exposes the unified job + edge policy entry-point over gRPC.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
def __init__(self, channel):
|
|
33
|
+
"""Constructor.
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
channel: A grpc.Channel.
|
|
37
|
+
"""
|
|
38
|
+
self.EvaluateUnified = channel.unary_unary(
|
|
39
|
+
'/cordum.agent.v1.PolicyEvaluator/EvaluateUnified',
|
|
40
|
+
request_serializer=cordum_dot_agent_dot_v1_dot_policy__pb2.PolicyEvaluateRequest.SerializeToString,
|
|
41
|
+
response_deserializer=cordum_dot_agent_dot_v1_dot_policy__pb2.PolicyEvaluateResponse.FromString,
|
|
42
|
+
_registered_method=True)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class PolicyEvaluatorServicer(object):
|
|
46
|
+
"""PolicyEvaluator exposes the unified job + edge policy entry-point over gRPC.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
def EvaluateUnified(self, request, context):
|
|
50
|
+
"""Missing associated documentation comment in .proto file."""
|
|
51
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
52
|
+
context.set_details('Method not implemented!')
|
|
53
|
+
raise NotImplementedError('Method not implemented!')
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def add_PolicyEvaluatorServicer_to_server(servicer, server):
|
|
57
|
+
rpc_method_handlers = {
|
|
58
|
+
'EvaluateUnified': grpc.unary_unary_rpc_method_handler(
|
|
59
|
+
servicer.EvaluateUnified,
|
|
60
|
+
request_deserializer=cordum_dot_agent_dot_v1_dot_policy__pb2.PolicyEvaluateRequest.FromString,
|
|
61
|
+
response_serializer=cordum_dot_agent_dot_v1_dot_policy__pb2.PolicyEvaluateResponse.SerializeToString,
|
|
62
|
+
),
|
|
63
|
+
}
|
|
64
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
65
|
+
'cordum.agent.v1.PolicyEvaluator', rpc_method_handlers)
|
|
66
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
67
|
+
server.add_registered_method_handlers('cordum.agent.v1.PolicyEvaluator', rpc_method_handlers)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
# This class is part of an EXPERIMENTAL API.
|
|
71
|
+
class PolicyEvaluator(object):
|
|
72
|
+
"""PolicyEvaluator exposes the unified job + edge policy entry-point over gRPC.
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
@staticmethod
|
|
76
|
+
def EvaluateUnified(request,
|
|
77
|
+
target,
|
|
78
|
+
options=(),
|
|
79
|
+
channel_credentials=None,
|
|
80
|
+
call_credentials=None,
|
|
81
|
+
insecure=False,
|
|
82
|
+
compression=None,
|
|
83
|
+
wait_for_ready=None,
|
|
84
|
+
timeout=None,
|
|
85
|
+
metadata=None):
|
|
86
|
+
return grpc.experimental.unary_unary(
|
|
87
|
+
request,
|
|
88
|
+
target,
|
|
89
|
+
'/cordum.agent.v1.PolicyEvaluator/EvaluateUnified',
|
|
90
|
+
cordum_dot_agent_dot_v1_dot_policy__pb2.PolicyEvaluateRequest.SerializeToString,
|
|
91
|
+
cordum_dot_agent_dot_v1_dot_policy__pb2.PolicyEvaluateResponse.FromString,
|
|
92
|
+
options,
|
|
93
|
+
channel_credentials,
|
|
94
|
+
insecure,
|
|
95
|
+
call_credentials,
|
|
96
|
+
compression,
|
|
97
|
+
wait_for_ready,
|
|
98
|
+
timeout,
|
|
99
|
+
metadata,
|
|
100
|
+
_registered_method=True)
|
|
@@ -25,7 +25,7 @@ _sym_db = _symbol_database.Default()
|
|
|
25
25
|
from cordum.agent.v1 import job_pb2 as cordum_dot_agent_dot_v1_dot_job__pb2
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x63ordum/agent/v1/safety.proto\x12\x0f\x63ordum.agent.v1\x1a\x19\x63ordum/agent/v1/job.proto\"\xe0\x03\n\x12PolicyCheckRequest\x12\x0e\n\x06job_id\x18\x01 \x01(\t\x12\r\n\x05topic\x18\x02 \x01(\t\x12\x0e\n\x06tenant\x18\x03 \x01(\t\x12.\n\x08priority\x18\x04 \x01(\x0e\x32\x1c.cordum.agent.v1.JobPriority\x12\x16\n\x0e\x65stimated_cost\x18\x05 \x01(\x01\x12\'\n\x06\x62udget\x18\x06 \x01(\x0b\x32\x17.cordum.agent.v1.Budget\x12\x14\n\x0cprincipal_id\x18\x07 \x01(\t\x12?\n\x06labels\x18\x08 \x03(\x0b\x32/.cordum.agent.v1.PolicyCheckRequest.LabelsEntry\x12\x11\n\tmemory_id\x18\t \x01(\t\x12\x18\n\x10\x65\x66\x66\x65\x63tive_config\x18\n \x01(\x0c\x12*\n\x04meta\x18\x0b \x01(\x0b\x32\x1c.cordum.agent.v1.JobMetadata\x12\x15\n\rinput_content\x18\x14 \x01(\x0c\x12\x1a\n\x12input_content_type\x18\x15 \x01(\t\x12\x18\n\x10input_size_bytes\x18\x16 \x01(\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"y\n\x11\x42udgetConstraints\x12\x16\n\x0emax_runtime_ms\x18\x01 \x01(\x03\x12\x13\n\x0bmax_retries\x18\x02 \x01(\x05\x12\x1a\n\x12max_artifact_bytes\x18\x03 \x01(\x03\x12\x1b\n\x13max_concurrent_jobs\x18\x04 \x01(\x05\"j\n\x0eSandboxProfile\x12\x10\n\x08isolated\x18\x01 \x01(\x08\x12\x19\n\x11network_allowlist\x18\x02 \x03(\t\x12\x14\n\x0c\x66s_read_only\x18\x03 \x03(\t\x12\x15\n\rfs_read_write\x18\x04 \x03(\t\"G\n\x14ToolchainConstraints\x12\x15\n\rallowed_tools\x18\x01 \x03(\t\x12\x18\n\x10\x61llowed_commands\x18\x02 \x03(\t\"P\n\x0f\x44iffConstraints\x12\x11\n\tmax_files\x18\x01 \x01(\x05\x12\x11\n\tmax_lines\x18\x02 \x01(\x05\x12\x17\n\x0f\x64\x65ny_path_globs\x18\x03 \x03(\t\"\xfd\x01\n\x11PolicyConstraints\x12\x33\n\x07\x62udgets\x18\x01 \x01(\x0b\x32\".cordum.agent.v1.BudgetConstraints\x12\x30\n\x07sandbox\x18\x02 \x01(\x0b\x32\x1f.cordum.agent.v1.SandboxProfile\x12\x38\n\ttoolchain\x18\x03 \x01(\x0b\x32%.cordum.agent.v1.ToolchainConstraints\x12.\n\x04\x64iff\x18\x04 \x01(\x0b\x32 .cordum.agent.v1.DiffConstraints\x12\x17\n\x0fredaction_level\x18\x05 \x01(\t\"\x8a\x02\n\x11PolicyRemediation\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12\x0f\n\x07summary\x18\x03 \x01(\t\x12\x19\n\x11replacement_topic\x18\x04 \x01(\t\x12\x1e\n\x16replacement_capability\x18\x05 \x01(\t\x12\x45\n\nadd_labels\x18\x06 \x03(\x0b\x32\x31.cordum.agent.v1.PolicyRemediation.AddLabelsEntry\x12\x15\n\rremove_labels\x18\x07 \x03(\t\x1a\x30\n\x0e\x41\x64\x64LabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xc2\x02\n\x13PolicyCheckResponse\x12/\n\x08\x64\x65\x63ision\x18\x01 \x01(\x0e\x32\x1d.cordum.agent.v1.DecisionType\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\x1c\n\x14redacted_context_ptr\x18\x03 \x01(\t\x12\x17\n\x0fpolicy_snapshot\x18\x04 \x01(\t\x12\x0f\n\x07rule_id\x18\x05 \x01(\t\x12\x37\n\x0b\x63onstraints\x18\x06 \x01(\x0b\x32\".cordum.agent.v1.PolicyConstraints\x12\x19\n\x11\x61pproval_required\x18\x07 \x01(\x08\x12\x14\n\x0c\x61pproval_ref\x18\x08 \x01(\t\x12\x38\n\x0cremediations\x18\t \x03(\x0b\x32\".cordum.agent.v1.PolicyRemediation\"\x16\n\x14ListSnapshotsRequest\"*\n\x15ListSnapshotsResponse\x12\x11\n\tsnapshots\x18\x01 \x03(\t*\
|
|
28
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x63ordum/agent/v1/safety.proto\x12\x0f\x63ordum.agent.v1\x1a\x19\x63ordum/agent/v1/job.proto\"\xe0\x03\n\x12PolicyCheckRequest\x12\x0e\n\x06job_id\x18\x01 \x01(\t\x12\r\n\x05topic\x18\x02 \x01(\t\x12\x0e\n\x06tenant\x18\x03 \x01(\t\x12.\n\x08priority\x18\x04 \x01(\x0e\x32\x1c.cordum.agent.v1.JobPriority\x12\x16\n\x0e\x65stimated_cost\x18\x05 \x01(\x01\x12\'\n\x06\x62udget\x18\x06 \x01(\x0b\x32\x17.cordum.agent.v1.Budget\x12\x14\n\x0cprincipal_id\x18\x07 \x01(\t\x12?\n\x06labels\x18\x08 \x03(\x0b\x32/.cordum.agent.v1.PolicyCheckRequest.LabelsEntry\x12\x11\n\tmemory_id\x18\t \x01(\t\x12\x18\n\x10\x65\x66\x66\x65\x63tive_config\x18\n \x01(\x0c\x12*\n\x04meta\x18\x0b \x01(\x0b\x32\x1c.cordum.agent.v1.JobMetadata\x12\x15\n\rinput_content\x18\x14 \x01(\x0c\x12\x1a\n\x12input_content_type\x18\x15 \x01(\t\x12\x18\n\x10input_size_bytes\x18\x16 \x01(\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"y\n\x11\x42udgetConstraints\x12\x16\n\x0emax_runtime_ms\x18\x01 \x01(\x03\x12\x13\n\x0bmax_retries\x18\x02 \x01(\x05\x12\x1a\n\x12max_artifact_bytes\x18\x03 \x01(\x03\x12\x1b\n\x13max_concurrent_jobs\x18\x04 \x01(\x05\"j\n\x0eSandboxProfile\x12\x10\n\x08isolated\x18\x01 \x01(\x08\x12\x19\n\x11network_allowlist\x18\x02 \x03(\t\x12\x14\n\x0c\x66s_read_only\x18\x03 \x03(\t\x12\x15\n\rfs_read_write\x18\x04 \x03(\t\"G\n\x14ToolchainConstraints\x12\x15\n\rallowed_tools\x18\x01 \x03(\t\x12\x18\n\x10\x61llowed_commands\x18\x02 \x03(\t\"P\n\x0f\x44iffConstraints\x12\x11\n\tmax_files\x18\x01 \x01(\x05\x12\x11\n\tmax_lines\x18\x02 \x01(\x05\x12\x17\n\x0f\x64\x65ny_path_globs\x18\x03 \x03(\t\"\xfd\x01\n\x11PolicyConstraints\x12\x33\n\x07\x62udgets\x18\x01 \x01(\x0b\x32\".cordum.agent.v1.BudgetConstraints\x12\x30\n\x07sandbox\x18\x02 \x01(\x0b\x32\x1f.cordum.agent.v1.SandboxProfile\x12\x38\n\ttoolchain\x18\x03 \x01(\x0b\x32%.cordum.agent.v1.ToolchainConstraints\x12.\n\x04\x64iff\x18\x04 \x01(\x0b\x32 .cordum.agent.v1.DiffConstraints\x12\x17\n\x0fredaction_level\x18\x05 \x01(\t\"\x8a\x02\n\x11PolicyRemediation\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12\x0f\n\x07summary\x18\x03 \x01(\t\x12\x19\n\x11replacement_topic\x18\x04 \x01(\t\x12\x1e\n\x16replacement_capability\x18\x05 \x01(\t\x12\x45\n\nadd_labels\x18\x06 \x03(\x0b\x32\x31.cordum.agent.v1.PolicyRemediation.AddLabelsEntry\x12\x15\n\rremove_labels\x18\x07 \x03(\t\x1a\x30\n\x0e\x41\x64\x64LabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xc2\x02\n\x13PolicyCheckResponse\x12/\n\x08\x64\x65\x63ision\x18\x01 \x01(\x0e\x32\x1d.cordum.agent.v1.DecisionType\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\x1c\n\x14redacted_context_ptr\x18\x03 \x01(\t\x12\x17\n\x0fpolicy_snapshot\x18\x04 \x01(\t\x12\x0f\n\x07rule_id\x18\x05 \x01(\t\x12\x37\n\x0b\x63onstraints\x18\x06 \x01(\x0b\x32\".cordum.agent.v1.PolicyConstraints\x12\x19\n\x11\x61pproval_required\x18\x07 \x01(\x08\x12\x14\n\x0c\x61pproval_ref\x18\x08 \x01(\t\x12\x38\n\x0cremediations\x18\t \x03(\x0b\x32\".cordum.agent.v1.PolicyRemediation\"\x16\n\x14ListSnapshotsRequest\"*\n\x15ListSnapshotsResponse\x12\x11\n\tsnapshots\x18\x01 \x03(\t*\xfd\x01\n\x0c\x44\x65\x63isionType\x12\x1d\n\x19\x44\x45\x43ISION_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13\x44\x45\x43ISION_TYPE_ALLOW\x10\x01\x12\x16\n\x12\x44\x45\x43ISION_TYPE_DENY\x10\x02\x12\x1f\n\x1b\x44\x45\x43ISION_TYPE_REQUIRE_HUMAN\x10\x03\x12\x1a\n\x16\x44\x45\x43ISION_TYPE_THROTTLE\x10\x04\x12(\n$DECISION_TYPE_ALLOW_WITH_CONSTRAINTS\x10\x05\x12\x1c\n\x18\x44\x45\x43ISION_TYPE_QUARANTINE\x10\x06\x12\x18\n\x14\x44\x45\x43ISION_TYPE_REDACT\x10\x07\x32\xc6\x03\n\x0cSafetyKernel\x12R\n\x05\x43heck\x12#.cordum.agent.v1.PolicyCheckRequest\x1a$.cordum.agent.v1.PolicyCheckResponse\x12U\n\x08\x45valuate\x12#.cordum.agent.v1.PolicyCheckRequest\x1a$.cordum.agent.v1.PolicyCheckResponse\x12T\n\x07\x45xplain\x12#.cordum.agent.v1.PolicyCheckRequest\x1a$.cordum.agent.v1.PolicyCheckResponse\x12U\n\x08Simulate\x12#.cordum.agent.v1.PolicyCheckRequest\x1a$.cordum.agent.v1.PolicyCheckResponse\x12^\n\rListSnapshots\x12%.cordum.agent.v1.ListSnapshotsRequest\x1a&.cordum.agent.v1.ListSnapshotsResponseB\x7f\n\x16io.cordum.cap.agent.v1P\x01Z+github.com/cordum-io/cap/v2/cordum/agent/v1\xaa\x02\x0f\x43ordum.Agent.V1\xca\x02\x0f\x63ordum\\Agent\\V1\xea\x02\x11\x43ordum::Agent::V1b\x06proto3')
|
|
29
29
|
|
|
30
30
|
_globals = globals()
|
|
31
31
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
@@ -38,7 +38,7 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
|
38
38
|
_globals['_POLICYREMEDIATION_ADDLABELSENTRY']._loaded_options = None
|
|
39
39
|
_globals['_POLICYREMEDIATION_ADDLABELSENTRY']._serialized_options = b'8\001'
|
|
40
40
|
_globals['_DECISIONTYPE']._serialized_start=1864
|
|
41
|
-
_globals['_DECISIONTYPE']._serialized_end=
|
|
41
|
+
_globals['_DECISIONTYPE']._serialized_end=2117
|
|
42
42
|
_globals['_POLICYCHECKREQUEST']._serialized_start=77
|
|
43
43
|
_globals['_POLICYCHECKREQUEST']._serialized_end=557
|
|
44
44
|
_globals['_POLICYCHECKREQUEST_LABELSENTRY']._serialized_start=512
|
|
@@ -63,6 +63,6 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
|
63
63
|
_globals['_LISTSNAPSHOTSREQUEST']._serialized_end=1817
|
|
64
64
|
_globals['_LISTSNAPSHOTSRESPONSE']._serialized_start=1819
|
|
65
65
|
_globals['_LISTSNAPSHOTSRESPONSE']._serialized_end=1861
|
|
66
|
-
_globals['_SAFETYKERNEL']._serialized_start=
|
|
67
|
-
_globals['_SAFETYKERNEL']._serialized_end=
|
|
66
|
+
_globals['_SAFETYKERNEL']._serialized_start=2120
|
|
67
|
+
_globals['_SAFETYKERNEL']._serialized_end=2574
|
|
68
68
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -19,7 +19,7 @@ cap/pb/cordum/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
|
|
|
19
19
|
cap/pb/cordum/agent/v1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
cap/pb/cordum/agent/v1/alert_pb2.py,sha256=rVdd8NDRhIKNSs_HsRCs96R2d4rOyZFdpZX8g9qXPfc,3550
|
|
21
21
|
cap/pb/cordum/agent/v1/alert_pb2_grpc.py,sha256=k5aPyAkM4W2m4kqQrd8tTlT_gl_VsNVn10k0Y6XC7Ew,901
|
|
22
|
-
cap/pb/cordum/agent/v1/buspacket_pb2.py,sha256=
|
|
22
|
+
cap/pb/cordum/agent/v1/buspacket_pb2.py,sha256=La7yE14KsMQb7QIdSubJsdu6LcSbzpNnbhUVsHPgVWg,3169
|
|
23
23
|
cap/pb/cordum/agent/v1/buspacket_pb2_grpc.py,sha256=b8yI7sNSbTaSyhGdDUdSoXewtViErfILMzWURNUlv0Q,905
|
|
24
24
|
cap/pb/cordum/agent/v1/handshake_pb2.py,sha256=zdnGzQ3Wl2K8_IigDJ8LarzydXY3EJGv5eIV2kSXKFQ,2876
|
|
25
25
|
cap/pb/cordum/agent/v1/handshake_pb2_grpc.py,sha256=vo5nzMI2n3cWd5gh7R65lNdaJ0WUK1uanaIupE9NaXg,905
|
|
@@ -27,9 +27,11 @@ cap/pb/cordum/agent/v1/heartbeat_pb2.py,sha256=_kmh16YtZgn4vvvF7inSx2tGCWIZ1dqjQ
|
|
|
27
27
|
cap/pb/cordum/agent/v1/heartbeat_pb2_grpc.py,sha256=Mld4ye3WV90wXpmP4oXOU0UXywlmWkO5pD_Re7JmsYc,905
|
|
28
28
|
cap/pb/cordum/agent/v1/job_pb2.py,sha256=1kYQHM1iJRzJwm15yZr7hVm8bfFhRDD9U6mBLkScVfg,9816
|
|
29
29
|
cap/pb/cordum/agent/v1/job_pb2_grpc.py,sha256=3UGZ867NvpGOhKjy7eKy1sDMiNtF7tU_ZNjfWed3Z_U,899
|
|
30
|
-
cap/pb/cordum/agent/v1/
|
|
30
|
+
cap/pb/cordum/agent/v1/policy_pb2.py,sha256=NC_8kxr3TNYcIrX2vZKmAx3Nf84P9XKuJI29qcnXSF0,9993
|
|
31
|
+
cap/pb/cordum/agent/v1/policy_pb2_grpc.py,sha256=mx4qmdxPCVp86jCBR0-W9tLDXBYy9Q9tzO9UMFitCCU,3851
|
|
32
|
+
cap/pb/cordum/agent/v1/safety_pb2.py,sha256=dcdEYgVmaNDWlr-mSgb0-90MWdiRqQ9YfoKF22zDdX0,7663
|
|
31
33
|
cap/pb/cordum/agent/v1/safety_pb2_grpc.py,sha256=8q183aSTqxMpL9tUsIPno7Dd5hsUxCnZODyAsybwLN0,11138
|
|
32
|
-
cap_sdk_python-2.
|
|
33
|
-
cap_sdk_python-2.
|
|
34
|
-
cap_sdk_python-2.
|
|
35
|
-
cap_sdk_python-2.
|
|
34
|
+
cap_sdk_python-2.13.0.dist-info/METADATA,sha256=K2kxtHH4FDpm1j7mgNM9a_c85sDxwpDMgw3Un_BTrsg,7468
|
|
35
|
+
cap_sdk_python-2.13.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
36
|
+
cap_sdk_python-2.13.0.dist-info/top_level.txt,sha256=qxhYc8OLN_S4weP5JNZZS6AcItv-ROB6MP45aCYx5qE,4
|
|
37
|
+
cap_sdk_python-2.13.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|