| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -220,7 +220,7 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr | |||
| 220 | 220 | }; | |
| 221 | 221 | const response = yield twirpClient.GetCacheEntryDownloadURL(request); | |
| 222 | 222 | if (!response.ok) { | |
| 223 | - core.debug(`Cache not found for keys: ${keys.join(', ')}`); | ||
| 223 | + core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`); | ||
| 224 | 224 | return undefined; | |
| 225 | 225 | } | |
| 226 | 226 | core.info(`Cache hit for: ${request.key}`); | |
@@ -2204,6 +2204,7 @@ const cacheUtils_1 = __nccwpck_require__(1518); | |||
| 2204 | 2204 | const auth_1 = __nccwpck_require__(5526); | |
| 2205 | 2205 | const http_client_1 = __nccwpck_require__(6255); | |
| 2206 | 2206 | const cache_twirp_client_1 = __nccwpck_require__(2655); | |
| 2207 | + const util_1 = __nccwpck_require__(1953); | ||
| 2207 | 2208 | /** | |
| 2208 | 2209 | * This class is a wrapper around the CacheServiceClientJSON class generated by Twirp. | |
| 2209 | 2210 | * | |
@@ -2263,6 +2264,7 @@ class CacheServiceClient { | |||
| 2263 | 2264 | (0, core_1.debug)(`[Response] - ${response.message.statusCode}`); | |
| 2264 | 2265 | (0, core_1.debug)(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`); | |
| 2265 | 2266 | const body = JSON.parse(rawBody); | |
| 2267 | + (0, util_1.maskSecretUrls)(body); | ||
| 2266 | 2268 | (0, core_1.debug)(`Body: ${JSON.stringify(body, null, 2)}`); | |
| 2267 | 2269 | if (this.isSuccessStatusCode(statusCode)) { | |
| 2268 | 2270 | return { response, body }; | |
@@ -2444,6 +2446,87 @@ exports.getUserAgentString = getUserAgentString; | |||
| 2444 | 2446 | ||
| 2445 | 2447 | /***/ }), | |
| 2446 | 2448 | ||
| 2449 | + /***/ 1953: | ||
| 2450 | + /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { | ||
| 2451 | + | ||
| 2452 | + "use strict"; | ||
| 2453 | + | ||
| 2454 | + Object.defineProperty(exports, "__esModule", ({ value: true })); | ||
| 2455 | + exports.maskSecretUrls = exports.maskSigUrl = void 0; | ||
| 2456 | + const core_1 = __nccwpck_require__(2186); | ||
| 2457 | + /** | ||
| 2458 | + * Masks the `sig` parameter in a URL and sets it as a secret. | ||
| 2459 | + * | ||
| 2460 | + * @param url - The URL containing the signature parameter to mask | ||
| 2461 | + * @remarks | ||
| 2462 | + * This function attempts to parse the provided URL and identify the 'sig' query parameter. | ||
| 2463 | + * If found, it registers both the raw and URL-encoded signature values as secrets using | ||
| 2464 | + * the Actions `setSecret` API, which prevents them from being displayed in logs. | ||
| 2465 | + * | ||
| 2466 | + * The function handles errors gracefully if URL parsing fails, logging them as debug messages. | ||
| 2467 | + * | ||
| 2468 | + * @example | ||
| 2469 | + * ```typescript | ||
| 2470 | + * // Mask a signature in an Azure SAS token URL | ||
| 2471 | + * maskSigUrl('https://example.blob.core.windows.net/container/file.txt?sig=abc123&se=2023-01-01'); | ||
| 2472 | + * ``` | ||
| 2473 | + */ | ||
| 2474 | + function maskSigUrl(url) { | ||
| 2475 | + if (!url) | ||
| 2476 | + return; | ||
| 2477 | + try { | ||
| 2478 | + const parsedUrl = new URL(url); | ||
| 2479 | + const signature = parsedUrl.searchParams.get('sig'); | ||
| 2480 | + if (signature) { | ||
| 2481 | + (0, core_1.setSecret)(signature); | ||
| 2482 | + (0, core_1.setSecret)(encodeURIComponent(signature)); | ||
| 2483 | + } | ||
| 2484 | + } | ||
| 2485 | + catch (error) { | ||
| 2486 | + (0, core_1.debug)(`Failed to parse URL: ${url} ${error instanceof Error ? error.message : String(error)}`); | ||
| 2487 | + } | ||
| 2488 | + } | ||
| 2489 | + exports.maskSigUrl = maskSigUrl; | ||
| 2490 | + /** | ||
| 2491 | + * Masks sensitive information in URLs containing signature parameters. | ||
| 2492 | + * Currently supports masking 'sig' parameters in the 'signed_upload_url' | ||
| 2493 | + * and 'signed_download_url' properties of the provided object. | ||
| 2494 | + * | ||
| 2495 | + * @param body - The object should contain a signature | ||
| 2496 | + * @remarks | ||
| 2497 | + * This function extracts URLs from the object properties and calls maskSigUrl | ||
| 2498 | + * on each one to redact sensitive signature information. The function doesn't | ||
| 2499 | + * modify the original object; it only marks the signatures as secrets for | ||
| 2500 | + * logging purposes. | ||
| 2501 | + * | ||
| 2502 | + * @example | ||
| 2503 | + * ```typescript | ||
| 2504 | + * const responseBody = { | ||
| 2505 | + * signed_upload_url: 'https://blob.core.windows.net/?sig=abc123', | ||
| 2506 | + * signed_download_url: 'https://blob.core/windows.net/?sig=def456' | ||
| 2507 | + * }; | ||
| 2508 | + * maskSecretUrls(responseBody); | ||
| 2509 | + * ``` | ||
| 2510 | + */ | ||
| 2511 | + function maskSecretUrls(body) { | ||
| 2512 | + if (typeof body !== 'object' || body === null) { | ||
| 2513 | + (0, core_1.debug)('body is not an object or is null'); | ||
| 2514 | + return; | ||
| 2515 | + } | ||
| 2516 | + if ('signed_upload_url' in body && | ||
| 2517 | + typeof body.signed_upload_url === 'string') { | ||
| 2518 | + maskSigUrl(body.signed_upload_url); | ||
| 2519 | + } | ||
| 2520 | + if ('signed_download_url' in body && | ||
| 2521 | + typeof body.signed_download_url === 'string') { | ||
| 2522 | + maskSigUrl(body.signed_download_url); | ||
| 2523 | + } | ||
| 2524 | + } | ||
| 2525 | + exports.maskSecretUrls = maskSecretUrls; | ||
| 2526 | + //# sourceMappingURL=util.js.map | ||
| 2527 | + | ||
| 2528 | + /***/ }), | ||
| 2529 | + | ||
| 2447 | 2530 | /***/ 6490: | |
| 2448 | 2531 | /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { | |
| 2449 | 2532 | ||
@@ -95507,7 +95590,7 @@ module.exports = parseParams | |||
| 95507 | 95590 | /***/ ((module) => { | |
| 95508 | 95591 | ||
| 95509 | 95592 | "use strict"; | |
| 95510 | - module.exports = JSON.parse('{"name":"@actions/cache","version":"4.0.2","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/semver":"^6.0.0","typescript":"^5.2.2"}}'); | ||
| 95593 | + module.exports = JSON.parse('{"name":"@actions/cache","version":"4.0.3","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/node":"^22.13.9","@types/semver":"^6.0.0","typescript":"^5.2.2"}}'); | ||
| 95511 | 95594 | ||
| 95512 | 95595 | /***/ }), | |
| 95513 | 95596 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -220,7 +220,7 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr | |||
| 220 | 220 | }; | |
| 221 | 221 | const response = yield twirpClient.GetCacheEntryDownloadURL(request); | |
| 222 | 222 | if (!response.ok) { | |
| 223 | - core.debug(`Cache not found for keys: ${keys.join(', ')}`); | ||
| 223 | + core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`); | ||
| 224 | 224 | return undefined; | |
| 225 | 225 | } | |
| 226 | 226 | core.info(`Cache hit for: ${request.key}`); | |
@@ -2204,6 +2204,7 @@ const cacheUtils_1 = __nccwpck_require__(91518); | |||
| 2204 | 2204 | const auth_1 = __nccwpck_require__(35526); | |
| 2205 | 2205 | const http_client_1 = __nccwpck_require__(96255); | |
| 2206 | 2206 | const cache_twirp_client_1 = __nccwpck_require__(42655); | |
| 2207 | + const util_1 = __nccwpck_require__(61953); | ||
| 2207 | 2208 | /** | |
| 2208 | 2209 | * This class is a wrapper around the CacheServiceClientJSON class generated by Twirp. | |
| 2209 | 2210 | * | |
@@ -2263,6 +2264,7 @@ class CacheServiceClient { | |||
| 2263 | 2264 | (0, core_1.debug)(`[Response] - ${response.message.statusCode}`); | |
| 2264 | 2265 | (0, core_1.debug)(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`); | |
| 2265 | 2266 | const body = JSON.parse(rawBody); | |
| 2267 | + (0, util_1.maskSecretUrls)(body); | ||
| 2266 | 2268 | (0, core_1.debug)(`Body: ${JSON.stringify(body, null, 2)}`); | |
| 2267 | 2269 | if (this.isSuccessStatusCode(statusCode)) { | |
| 2268 | 2270 | return { response, body }; | |
@@ -2444,6 +2446,87 @@ exports.getUserAgentString = getUserAgentString; | |||
| 2444 | 2446 | ||
| 2445 | 2447 | /***/ }), | |
| 2446 | 2448 | ||
| 2449 | + /***/ 61953: | ||
| 2450 | + /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { | ||
| 2451 | + | ||
| 2452 | + "use strict"; | ||
| 2453 | + | ||
| 2454 | + Object.defineProperty(exports, "__esModule", ({ value: true })); | ||
| 2455 | + exports.maskSecretUrls = exports.maskSigUrl = void 0; | ||
| 2456 | + const core_1 = __nccwpck_require__(42186); | ||
| 2457 | + /** | ||
| 2458 | + * Masks the `sig` parameter in a URL and sets it as a secret. | ||
| 2459 | + * | ||
| 2460 | + * @param url - The URL containing the signature parameter to mask | ||
| 2461 | + * @remarks | ||
| 2462 | + * This function attempts to parse the provided URL and identify the 'sig' query parameter. | ||
| 2463 | + * If found, it registers both the raw and URL-encoded signature values as secrets using | ||
| 2464 | + * the Actions `setSecret` API, which prevents them from being displayed in logs. | ||
| 2465 | + * | ||
| 2466 | + * The function handles errors gracefully if URL parsing fails, logging them as debug messages. | ||
| 2467 | + * | ||
| 2468 | + * @example | ||
| 2469 | + * ```typescript | ||
| 2470 | + * // Mask a signature in an Azure SAS token URL | ||
| 2471 | + * maskSigUrl('https://example.blob.core.windows.net/container/file.txt?sig=abc123&se=2023-01-01'); | ||
| 2472 | + * ``` | ||
| 2473 | + */ | ||
| 2474 | + function maskSigUrl(url) { | ||
| 2475 | + if (!url) | ||
| 2476 | + return; | ||
| 2477 | + try { | ||
| 2478 | + const parsedUrl = new URL(url); | ||
| 2479 | + const signature = parsedUrl.searchParams.get('sig'); | ||
| 2480 | + if (signature) { | ||
| 2481 | + (0, core_1.setSecret)(signature); | ||
| 2482 | + (0, core_1.setSecret)(encodeURIComponent(signature)); | ||
| 2483 | + } | ||
| 2484 | + } | ||
| 2485 | + catch (error) { | ||
| 2486 | + (0, core_1.debug)(`Failed to parse URL: ${url} ${error instanceof Error ? error.message : String(error)}`); | ||
| 2487 | + } | ||
| 2488 | + } | ||
| 2489 | + exports.maskSigUrl = maskSigUrl; | ||
| 2490 | + /** | ||
| 2491 | + * Masks sensitive information in URLs containing signature parameters. | ||
| 2492 | + * Currently supports masking 'sig' parameters in the 'signed_upload_url' | ||
| 2493 | + * and 'signed_download_url' properties of the provided object. | ||
| 2494 | + * | ||
| 2495 | + * @param body - The object should contain a signature | ||
| 2496 | + * @remarks | ||
| 2497 | + * This function extracts URLs from the object properties and calls maskSigUrl | ||
| 2498 | + * on each one to redact sensitive signature information. The function doesn't | ||
| 2499 | + * modify the original object; it only marks the signatures as secrets for | ||
| 2500 | + * logging purposes. | ||
| 2501 | + * | ||
| 2502 | + * @example | ||
| 2503 | + * ```typescript | ||
| 2504 | + * const responseBody = { | ||
| 2505 | + * signed_upload_url: 'https://blob.core.windows.net/?sig=abc123', | ||
| 2506 | + * signed_download_url: 'https://blob.core/windows.net/?sig=def456' | ||
| 2507 | + * }; | ||
| 2508 | + * maskSecretUrls(responseBody); | ||
| 2509 | + * ``` | ||
| 2510 | + */ | ||
| 2511 | + function maskSecretUrls(body) { | ||
| 2512 | + if (typeof body !== 'object' || body === null) { | ||
| 2513 | + (0, core_1.debug)('body is not an object or is null'); | ||
| 2514 | + return; | ||
| 2515 | + } | ||
| 2516 | + if ('signed_upload_url' in body && | ||
| 2517 | + typeof body.signed_upload_url === 'string') { | ||
| 2518 | + maskSigUrl(body.signed_upload_url); | ||
| 2519 | + } | ||
| 2520 | + if ('signed_download_url' in body && | ||
| 2521 | + typeof body.signed_download_url === 'string') { | ||
| 2522 | + maskSigUrl(body.signed_download_url); | ||
| 2523 | + } | ||
| 2524 | + } | ||
| 2525 | + exports.maskSecretUrls = maskSecretUrls; | ||
| 2526 | + //# sourceMappingURL=util.js.map | ||
| 2527 | + | ||
| 2528 | + /***/ }), | ||
| 2529 | + | ||
| 2447 | 2530 | /***/ 56490: | |
| 2448 | 2531 | /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { | |
| 2449 | 2532 | ||
@@ -133512,7 +133595,7 @@ module.exports = parseParams | |||
| 133512 | 133595 | /***/ ((module) => { | |
| 133513 | 133596 | ||
| 133514 | 133597 | "use strict"; | |
| 133515 | - module.exports = JSON.parse('{"name":"@actions/cache","version":"4.0.2","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/semver":"^6.0.0","typescript":"^5.2.2"}}'); | ||
| 133598 | + module.exports = JSON.parse('{"name":"@actions/cache","version":"4.0.3","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/node":"^22.13.9","@types/semver":"^6.0.0","typescript":"^5.2.2"}}'); | ||
| 133516 | 133599 | ||
| 133517 | 133600 | /***/ }), | |
| 133518 | 133601 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ | |||
| 26 | 26 | "author": "GitHub", | |
| 27 | 27 | "license": "MIT", | |
| 28 | 28 | "dependencies": { | |
| 29 | - "@actions/cache": "^4.0.2", | ||
| 29 | + "@actions/cache": "^4.0.3", | ||
| 30 | 30 | "@actions/core": "^1.10.0", | |
| 31 | 31 | "@actions/exec": "^1.0.4", | |
| 32 | 32 | "@actions/glob": "^0.5.0", | |
| Back | FazBrowse Home | New Git URL |
0 commit comments