Skip to main content

Module object_key

Module object_key 

Source
Expand description

Object-storage key normalization helpers.

These helpers keep object keys relative, slash-separated, and safe to join with storage prefixes. They reject path escape attempts while preserving existing prefix placement rules that may matter for S3 bucket policies or migrated objects.

Functionsยง

join_key_prefix
Join a storage prefix and object key without producing duplicate separators.
normalize_object_key
Normalizes an object key and rejects the storage namespace root.
normalize_object_prefix
Normalizes a storage prefix.
normalize_relative_key
Normalize an external object key into a slash-separated relative key.
strip_key_prefix
Strip prefix from key only when the prefix matches a complete slash-separated segment.