Documentation
¶
Overview ¶
Package shared owns wire-adapter helper code that is family-neutral.
It holds only mechanical glue that is reused across wire families without carrying family-specific grammar or semantics.
Index ¶
- Variables
- func DecodeBase64Limited(encoded string, maxDecodedBytes int) ([]byte, error)
- func DecodeExtensibleRequestObject(raw []byte, out any, surface string) error
- func NormalizeImageMediaType(raw string) (canonical.ImageMediaType, error)
- func ValidateImageDecodeLimits(items []canonical.CanonicalItem, limits ImageDecodeLimitPolicy) error
- type ImageDecodeLimitPolicy
Constants ¶
This section is empty.
Variables ¶
var ErrBase64DecodedLimit = errors.New("base64 decoded value exceeds limit")
ErrBase64DecodedLimit reports that decoding would exceed an ingress-owned allocation bound. The check happens against encoded length before DecodeString allocates its destination buffer.
Functions ¶
func DecodeBase64Limited ¶
DecodeBase64Limited decodes standard padded base64 after proving its decoded allocation cannot exceed maxDecodedBytes.
func DecodeExtensibleRequestObject ¶
DecodeExtensibleRequestObject applies the public unknown-member contract at a typed protocol request envelope and maps shape failures to wire truth.
func NormalizeImageMediaType ¶
func NormalizeImageMediaType(raw string) (canonical.ImageMediaType, error)
NormalizeImageMediaType maps recognized wire aliases into the closed canonical portable media vocabulary. swobu:lint ignore string-switch because=image media type is a provider-wire boundary value.
func ValidateImageDecodeLimits ¶
func ValidateImageDecodeLimits(items []canonical.CanonicalItem, limits ImageDecodeLimitPolicy) error
ValidateImageDecodeLimits applies request-scoped operational policy after individual inline payloads have already been decoded with a pre-allocation bound. Non-positive aggregate limits are left unspecified for callers that only need the per-image bound.
Types ¶
type ImageDecodeLimitPolicy ¶
ImageDecodeLimitPolicy is ingress-owned allocation policy supplied to image wire decoders. Canonical image construction has no operational byte limit.