Files
floci/src/main/java/io
Priamo Germosen 7fa1a506c7 fix(codeartifact): escape the namespace/package boundary in storage keys (#5408)
packageKey and packageVersionKey joined namespace and package name with a
plain "::", but namespace/package tokens only reject '#', '/', and
whitespace, so ':' is legal in either. Namespace "a::b" + package "c" and
namespace "a" + package "b::c" are two different, independently valid
packages that produced the identical storage key, letting one's origin
configuration or published version answer for the other's.

Escapes ':' and '\' in the namespace/package/version segments before they
go into the key, using '#' as the escape introducer rather than '\'
itself. '#' is one of the three characters namespace/package/version can
never legally contain (AWS's own PackageName/PackageNamespace wire
pattern forbids it, same as Floci's own validation), so an escaped
segment can never equal a pre-existing raw key that happened to contain a
literal backslash, closing the same cross-contamination risk at the
old/new boundary that escaping with '\' as the introducer would have
reopened there. For any package whose namespace, name, or version never
contains a backslash or colon, the overwhelming majority, the escaped
segment is identical to the raw one, so this produces the exact same key
as before: no migration of already-persisted data is needed for that
common case.

Follow-up from the PutPackageOriginConfiguration review on #5381.
2026-10-11 09:12:41 -05:00
..