You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add asset_key_pattern to the s3 builders (#193)
Custom regex for deriving (name, version) from s3 object keys, so a
pre-release key like mybin-0.1.2-beta-x86_64-... parses as 0.1.2-beta
instead of the default matcher's lossy 0.1.2 (#61). The pattern must
define name and version named capture groups; it is compiled and
validated at build(), surfacing failures as the new
Error::InvalidAssetKeyPattern. A custom capture that does not parse as
semver skips the key, matching the forge backends' non-semver-tag skip.
Unset keeps the default matcher unchanged.
Copy file name to clipboardExpand all lines: specs/ref-errors.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,7 @@ code builds them via the public constructors (`http_status_error(404, ..)`,
51
51
|`InvalidAssetName { name: String }`| The server-supplied asset name is empty, `.`, `..`, contains a `/` or `\` path separator, or is an absolute path; the file is never created (`update.rs`). `#[non_exhaustive]`. | none | no (struct fields) |
52
52
|`SignatureNonUTF8`| Generated archive path contains non-UTF-8 characters so its signature cannot be verified. Unit variant. |`signatures`| no (unit) |
53
53
|`S3Auth(Box<dyn Error + Send + Sync>)`| S3 SigV4 request-signing failure, including the host-extraction case (a signed URL with no extractable host). Via `From<SystemTimeError>`, `From<hmac::digest::InvalidLength>`, `From<url::ParseError>`, `From<time::error::ComponentRange>`, and direct construction at the host-extraction sites (`s3.rs`). |`s3-auth`| yes (boxed) |
54
+
|`InvalidAssetKeyPattern { source: Box<dyn Error + Send + Sync> }`| A user-supplied `asset_key_pattern` on the s3 builders did not compile or lacks a required named capture group (`name` / `version`). Raised from `build()` via `compile_asset_key_pattern` (`s3.rs`); the source is the regex-compile error or a `MessageError` naming the missing group. `#[non_exhaustive]`. |`s3`| yes (boxed source) |
54
55
55
56
### Reclassification of construction sites
56
57
@@ -141,6 +142,7 @@ Each variant renders with a specific Display string:
141
142
-`Signature(e)` -> `"SignatureError: {e}"` (dereferences the box, `signatures`)
142
143
-`SignatureNonUTF8` -> `"SignatureError: cannot verify signature of a file with a non-UTF-8 name"` (`signatures`)
143
144
-`S3Auth(e)` -> `"S3AuthError: {e}"` (dereferences the box, `s3-auth`)
0 commit comments