chore(tlon): remove inert SSRF policy helper

This commit is contained in:
Vincent Koc
2026-06-22 22:12:48 +08:00
parent 83cfb6112c
commit 9c85b812fe
3 changed files with 2 additions and 13 deletions

View File

@@ -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" },
};

View File

@@ -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;
}

View File

@@ -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",
});