linvest21's picture
download
raw
724 Bytes
from __future__ import annotations
def required_approvals(env: str, risk_tier: str) -> set[str]:
required: set[str] = set()
if env in {"stage", "prod"}:
required.add("engineering")
if env == "prod":
required.add("product_owner")
if risk_tier in {"regulated_internal", "external_facing"}:
required.add("compliance")
if risk_tier == "external_facing":
required.add("product_owner")
return required
def validate_approvals(approvals: dict[str, str], *, env: str, risk_tier: str) -> list[str]:
missing = [role for role in sorted(required_approvals(env, risk_tier)) if approvals.get(role) != "approved"]
return [f"missing approval: {role}" for role in missing]

Xet Storage Details

Size:
724 Bytes
·
Xet hash:
b9f02cdccbab26aacb7d5e1315ea59bd9469697d1a50987ed1a90728c5427c15

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.