test(protocol): real byte-oracle for ocr_image request wire
Adversarial Wave 3 pass: the prior 'round-trip locks pb tags' test was a fake lock — symmetric encode/decode via the same proto would not catch a tag swap. Replace with a fixed hex byte-oracle (hand-decoded in the comment) that goes red on any tag change, plus an empty-ocr-body deserialize test. Note in the action that a passed-in URL is used verbatim (not rkey re-signed).
This commit is contained in:
2 files changed
+17
-6
No files matched your search
@@ -1258,6 +1258,9 @@ export const actions = [
|
||||
readOnly: true,
|
||||
params: { image: f.string({ allowEmpty: false }) },
|
||||
run: async (p, ctx) => {
|
||||
// A passed-in http(s) URL is used verbatim (NOT re-signed) — if it is a
|
||||
// stale CDN URL with an expired rkey the server fetch fails and surfaces
|
||||
// the server's retCode. The file_id path below re-signs via getImageInfo.
|
||||
let url = /^https?:\/\//i.test(p.image) ? p.image : '';
|
||||
if (!url) {
|
||||
const info = await ctx.getImageInfo(p.image);
|
||||
|
||||
Reference in new issue
Block a user