Documentation
¶
Overview ¶
Package canonical provides bounded, explicit request fingerprint policies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesFingerprint ¶
func BytesFingerprint(version string, input []byte, maxBytes int) (idempotency.Fingerprint, error)
BytesFingerprint hashes bounded bytes whose encoding is already canonical.
func JSONFingerprint ¶
func JSONFingerprint(version string, input []byte, limits Limits) (idempotency.Fingerprint, error)
JSONFingerprint canonicalizes JSON and hashes it under a policy version.
Types ¶
type Limits ¶
type Limits struct {
// MaxInputBytes is the largest encoded JSON input accepted.
MaxInputBytes int
// MaxOutputBytes is the largest canonical JSON result accepted.
MaxOutputBytes int
// MaxDepth is the largest object or array nesting depth accepted.
MaxDepth int
}
Limits bounds JSON canonicalization before parsing, encoding, and hashing.
Click to show internal directories.
Click to hide internal directories.