Browse modulesStorageFunctions
Function: parseFileId()
function parseFileId(fileId: string):
| {
actorId: string;
context: string;
storageKey: string;
}
| undefined;Defined in: server/storage/s3-file-store.ts:154
Parse a fileId into a validated, well-formed storage key + decoded raw actor
id, or undefined if it is malformed/forged. Rejects ids that don't decode to
exactly the context/actor/uuid/filename shape, or whose actor segment isn't
valid base64url — so we never presign or HEAD an arbitrary, attacker-chosen
key.
Parameters
| Parameter | Type |
|---|---|
fileId | string |
Returns
| {
actorId: string;
context: string;
storageKey: string;
}
| undefined