(key: string, webId: WebId)
| 24 | ): string => [ANALYSIS_STORAGE_PREFIX, webId, namespace, ...parts].join("/"); |
| 25 | |
| 26 | export const isWebScopedKeyForWeb = (key: string, webId: WebId): boolean => { |
| 27 | const [prefix, scopedWebId, ...artifactParts] = key.split("/"); |
| 28 | return ( |
| 29 | prefix === ANALYSIS_STORAGE_PREFIX && |
| 30 | scopedWebId === webId && |
| 31 | artifactParts.length > 0 && |
| 32 | artifactParts.every( |
| 33 | (part) => part.length > 0 && part !== "." && part !== "..", |
| 34 | ) |
| 35 | ); |
| 36 | }; |
| 37 | |
| 38 | /** |
| 39 | * Slugs are the only values interpolated into storage keys from client input. |
no test coverage detected