Authenticate and scope migration operator approvals
ABSDEV Framework CI / framework-ci (push) Failing after 16s
ABSDEV Framework CI / framework-ci (push) Failing after 16s
This commit is contained in:
+7
-2
@@ -41,6 +41,9 @@ APPROVAL_FIELDS = {
|
||||
}
|
||||
|
||||
|
||||
SEALED_APPROVAL_FIELDS = APPROVAL_FIELDS | {"operator_seal"}
|
||||
|
||||
|
||||
def require(condition, message):
|
||||
|
||||
if not condition:
|
||||
@@ -232,13 +235,15 @@ def verify_approval(
|
||||
|
||||
require(
|
||||
isinstance(approval, dict)
|
||||
and set(approval) == APPROVAL_FIELDS,
|
||||
and set(approval) in (APPROVAL_FIELDS, SEALED_APPROVAL_FIELDS),
|
||||
"Invalid approval record",
|
||||
)
|
||||
|
||||
require(
|
||||
type(approval["format_version"]) is int
|
||||
and approval["format_version"] == 1,
|
||||
and (approval["format_version"], set(approval)) in (
|
||||
(1, APPROVAL_FIELDS), (2, SEALED_APPROVAL_FIELDS),
|
||||
),
|
||||
"Unsupported approval format",
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user