mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-07 18:42:25 +00:00
chore(tlon): remove inert SSRF policy helper
This commit is contained in:
@@ -10,7 +10,6 @@ import {
|
||||
saveRemoteMedia,
|
||||
} from "openclaw/plugin-sdk/media-runtime";
|
||||
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
||||
import { getDefaultSsrFPolicy } from "../urbit/context.js";
|
||||
|
||||
const MAX_IMAGES_PER_MESSAGE = 8;
|
||||
const TLON_MEDIA_DOWNLOAD_IDLE_TIMEOUT_MS = 30_000;
|
||||
@@ -72,7 +71,7 @@ export async function downloadMedia(
|
||||
url,
|
||||
maxBytes: MAX_IMAGE_BYTES,
|
||||
readIdleTimeoutMs: TLON_MEDIA_DOWNLOAD_IDLE_TIMEOUT_MS,
|
||||
ssrfPolicy: getDefaultSsrFPolicy(),
|
||||
ssrfPolicy: undefined,
|
||||
requestInit: { method: "GET" },
|
||||
};
|
||||
|
||||
|
||||
@@ -40,12 +40,3 @@ export function getUrbitContext(url: string, ship?: string): UrbitContext {
|
||||
ship: normalizeUrbitShip(ship, validated.hostname),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default SSRF policy for image uploads.
|
||||
* Uses a restrictive policy that blocks private networks by default.
|
||||
*/
|
||||
export function getDefaultSsrFPolicy(): undefined {
|
||||
// Default: block private networks for image uploads (safer default)
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
*/
|
||||
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
||||
import { uploadFile } from "../tlon-api.js";
|
||||
import { getDefaultSsrFPolicy } from "./context.js";
|
||||
|
||||
/**
|
||||
* Fetch an image from a URL and upload it to Tlon storage.
|
||||
@@ -25,7 +24,7 @@ export async function uploadImageFromUrl(imageUrl: string): Promise<string> {
|
||||
const { response, release } = await fetchWithSsrFGuard({
|
||||
url: imageUrl,
|
||||
init: { method: "GET" },
|
||||
policy: getDefaultSsrFPolicy(),
|
||||
policy: undefined,
|
||||
auditContext: "tlon-upload-image",
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user