@scrymore/scry-deployer 0.12.3-nightly.20261009034324 → 0.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/converter/cc-origin.js +11 -1
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* origin.item the item's display name (same rule)
|
|
7
7
|
* origin.stock boolean: an Adobe Stock preview (true) or the user's own item (false)
|
|
8
8
|
* origin.link a clean `https` adobe.com address, query and fragment stripped; anything else is DROPPED
|
|
9
|
+
* (a ':' survives only in the exact Creative Cloud item address, see ITEM_LINK_PATH_RE)
|
|
9
10
|
*
|
|
10
11
|
* Guarantee G2: no signed URL, token or credential reaches an origin field. `link` is the only URL-shaped field and it
|
|
11
12
|
* is rebuilt from the parsed host and path, never passed through; a value that is not a plain adobe.com page address
|
|
@@ -24,6 +25,14 @@ const MAX_ID_PART = 256;
|
|
|
24
25
|
/** `adobe.com` itself or a sub-domain of it, lower-case letters, digits and hyphens only. */
|
|
25
26
|
const ADOBE_HOST_RE = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*adobe\.com$/;
|
|
26
27
|
const SAFE_PATH_RE = /^\/[A-Za-z0-9._~/-]*$/;
|
|
28
|
+
/**
|
|
29
|
+
* The one place a ':' may appear (guarantee G-F17b): the item address of a Creative Cloud library,
|
|
30
|
+
* `/files/libraries/urn:aaid:sc:<REGION>:<uuid>[/<uuid>]` on `www.adobe.com`. Nothing else may follow, and the library
|
|
31
|
+
* segment must match whole; `%3A`, a lower-case region or a second colon is not this shape and stays refused.
|
|
32
|
+
*/
|
|
33
|
+
const ITEM_LINK_HOST = 'www.adobe.com';
|
|
34
|
+
const UUID_SOURCE = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}';
|
|
35
|
+
const ITEM_LINK_PATH_RE = new RegExp(`^/files/libraries/urn:aaid:sc:[A-Z0-9]{2,8}:${UUID_SOURCE}(?:/${UUID_SOURCE})?$`);
|
|
27
36
|
/** A path that names a credential is refused even when it is otherwise plain (`/x/token/abc`). */
|
|
28
37
|
const SECRET_WORD_RE = /token|signature|credential|secret|password|passwd|auth|session|cookie|apikey|api-key|x-amz|sig=|expires/i;
|
|
29
38
|
|
|
@@ -46,7 +55,8 @@ function cleanAdobeLink(raw) {
|
|
|
46
55
|
if (url.protocol !== 'https:' || url.username || url.password || url.port) return null;
|
|
47
56
|
if (!ADOBE_HOST_RE.test(url.hostname)) return null;
|
|
48
57
|
const pathname = url.pathname;
|
|
49
|
-
|
|
58
|
+
const itemLink = url.hostname === ITEM_LINK_HOST && ITEM_LINK_PATH_RE.test(pathname);
|
|
59
|
+
if (!(itemLink || SAFE_PATH_RE.test(pathname)) || SECRET_WORD_RE.test(pathname)) return null;
|
|
50
60
|
if (pathname.split('/').some((segment) => segment.length > MAX_PATH_SEGMENT)) return null;
|
|
51
61
|
const clean = `https://${url.hostname}${pathname === '/' ? '' : pathname}`;
|
|
52
62
|
return clean.length <= MAX_LINK_LENGTH ? clean : null;
|