feat(workbench): add runtime GIS and sample integrations
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
"""RFC 8785 canonical JSON hashing shared by persisted records."""
|
||||
|
||||
from hashlib import sha256
|
||||
|
||||
import rfc8785
|
||||
|
||||
from app.domain.domain_errors import DomainError
|
||||
|
||||
|
||||
def canonical(value: object) -> bytes:
|
||||
try:
|
||||
return rfc8785.dumps(value)
|
||||
except rfc8785.CanonicalizationError as exc:
|
||||
raise DomainError("SCHEMA_INVALID", "Content is not canonicalizable JSON") from exc
|
||||
|
||||
|
||||
def digest(value: object) -> str:
|
||||
return "sha256:" + sha256(canonical(value)).hexdigest()
|
||||
Reference in New Issue
Block a user