cadrumo.application.operations.registry_schema_validation module¶
Closed-schema validation helpers for the operation registry.
The public registry keeps the model and registry classes in their historical module. These helpers own the recursive schema rules that those classes use, so the rules can evolve without turning the registry facade into one large validation unit.
- FORBIDDEN_CREDENTIAL_FREE_FIELD_PARTS¶
Field-name tokens a credential-free journal request may not carry.
A NAME tripwire, not the wall. What actually keeps a secret out of the journal is the storage policy plus the separate ephemeral-secret channel; this catches the case where a field is added whose name says plainly what it holds. Matching is on whole
_-separated tokens, so it never fires on a word that merely contains one of these.The second group are the words THIS codebase uses for credential material and that the first group missed: the certificate path spells its material
cert/certificate/pem/private, and the Cl@ve factors are apinand a one-time code.certificate_pem,clave_pinandotp_codeall split into tokens the original set did not hold, so each would have journalled its own name unchallenged.claveis deliberately ABSENT despite naming the Cl@ve authentication system, because it is a homonym: AEAT also spells an operation keyclave, andclave/clave_operacion/clave_declaradoare real fields on the detail rows an amendment journals. Adding it would refuse a lawful M184 or M347 amendment to catch a credential nothing names that way.
- is_hex64_shaped_schema(value, *, definitions=None, _seen_refs=frozenset({}))[source]¶
Report whether one field’s JSON-schema fragment matches Hex64 shape.
ContentDigestis a bare assignment toHex64Str(ContentDigest is Hex64Str), not a distinct type, andHex64Stris deliberately shared by several unrelated concepts (WorkUnitId,CalculationRevisionId,SnapshotId,TransactionId). There is therefore no runtime type-identity test forContentDigestspecifically - only a SHAPE test for64 lowercase hex characters. Recurses through local$defsreferences,anyOf(anX | Nonefield), anditems(atuple[X, ...]field) to reach the underlying string schema.
- is_hex64_string_schema(mapping)[source]¶
Recognize the direct JSON-schema shape of one lowercase Hex64 value.
- is_hex64_any_of_schema(mapping, *, definitions=None, _seen_refs=frozenset({}))[source]¶
Search non-null branches of an optional JSON-schema value for Hex64.
- is_hex64_items_schema(mapping, *, definitions=None, _seen_refs=frozenset({}))[source]¶
Search a homogeneous tuple/array item schema for Hex64.
- validate_credential_free_schema(schema, *, definitions=None)[source]¶
Reject request schemas capable of carrying credentials or transports.
A field name matching ONLY the
digestforbidden token (no other forbidden token also matches) is admitted when its schema shape is exactly Hex64 - a compare-and-swap content digest, never a bearer token or passphrase by shape. A field matching any OTHER forbidden token is refused regardless of shape, and regardless of whether it also matchesdigest; the exemption never widens any token butdigestand never overrides a second, independently-matched forbidden token on the same field.
- validate_credential_free_schema_items(items, *, definitions=None)[source]¶
Recursively inspect every branch in a JSON-schema list container.
- validate_credential_free_schema_format(mapping)[source]¶
Reject schema formats that can carry credentials in journal input.
- validate_credential_free_schema_properties(mapping, *, definitions=None)[source]¶
Reject forbidden names while admitting only digest-shaped exceptions.
- strict_model_json_schema(model_type)[source]¶
Return one exact closed schema after enforcing the public model baseline.
- validate_closed_json_schema(schema, *, path)[source]¶
Refuse every untyped or open branch of one generated public schema.
- reject_secret_capable_schema_branch(schema, *, path)[source]¶
Reject public schema branches that can carry opaque secrets.
- validate_schema_definitions(schema, *, path)[source]¶
Validate every named schema definition recursively.
- validate_schema_combinator(schema, *, path)[source]¶
Validate the first declared JSON-schema combinator and its branches.
- validate_closed_object_schema(schema, *, path)[source]¶
Require an object branch to enumerate and close every property.