Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions capiscio_mcp/_proto/capiscio/v1/mcp_pb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,75 @@ class HealthResponse:
core_version: str = ""
proto_version: str = ""
version_compatible: bool = True


# =============================================================================
# RFC-005: Policy Decision Messages
# =============================================================================

@dataclass
class PolicySubject:
"""Subject attributes for policy evaluation."""
did: str = ""
badge_jti: str = ""
ial: str = ""
trust_level: str = ""
badge_exp: int = 0


@dataclass
class PolicyAction:
"""Action attributes for policy evaluation."""
operation: str = ""
capability_class: str = ""


@dataclass
class PolicyResource:
"""Resource attributes for policy evaluation."""
identifier: str = ""


@dataclass
class PolicyConfig:
"""PEP-level configuration for the policy decision."""
pdp_endpoint: str = ""
pdp_timeout_ms: int = 0
enforcement_mode: str = ""
pep_id: str = ""
workspace: str = ""
breakglass_public_key: bytes = b""


@dataclass
class PolicyDecisionRequest:
"""Request message for EvaluatePolicyDecision RPC."""
subject: Optional[PolicySubject] = None
action: Optional[PolicyAction] = None
resource: Optional[PolicyResource] = None
config: Optional[PolicyConfig] = None
breakglass_token: str = ""


@dataclass
class MCPObligation:
"""Obligation from policy decision."""
type: str = ""
params_json: str = ""


@dataclass
class PolicyDecisionResponse:
"""Response from centralized policy decision."""
decision: str = ""
decision_id: str = ""
reason: str = ""
ttl: int = 0
obligations: List["MCPObligation"] = field(default_factory=list)
enforcement_mode: str = ""
cache_hit: bool = False
breakglass_override: bool = False
breakglass_jti: str = ""
error_code: str = ""
pdp_latency_ms: int = 0
txn_id: str = ""
20 changes: 20 additions & 0 deletions capiscio_mcp/_proto/capiscio/v1/mcp_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ async def EvaluateToolAccess(
"""
raise NotImplementedError("Stub - replace with generated code")

async def EvaluatePolicyDecision(
self,
request: "mcp_pb2.PolicyDecisionRequest",
) -> "mcp_pb2.PolicyDecisionResponse":
"""
Evaluate policy decision (RFC-005).

Centralized PDP decision logic. Returns policy outcome
including obligations — never raises gRPC errors for PDP issues.
"""
raise NotImplementedError("Stub - replace with generated code")

async def VerifyServerIdentity(
self,
request: "mcp_pb2.VerifyServerIdentityRequest",
Expand Down Expand Up @@ -87,6 +99,14 @@ async def EvaluateToolAccess(
"""Evaluate tool access (RFC-006)."""
raise NotImplementedError("Method not implemented!")

async def EvaluatePolicyDecision(
self,
request: "mcp_pb2.PolicyDecisionRequest",
context: "grpc.aio.ServicerContext",
) -> "mcp_pb2.PolicyDecisionResponse":
"""Evaluate policy decision (RFC-005)."""
raise NotImplementedError("Method not implemented!")

async def VerifyServerIdentity(
self,
request: "mcp_pb2.VerifyServerIdentityRequest",
Expand Down
Loading
Loading