* Extract workspace ID from workspace file key pattern * Pattern: {workspaceId}/{timestamp}-{random}-{filename}
(key: string)
| 102 | * Pattern: {workspaceId}/{timestamp}-{random}-{filename} |
| 103 | */ |
| 104 | function extractWorkspaceIdFromKey(key: string): string | null { |
| 105 | const inferredContext = inferContextFromKey(key) |
| 106 | if (inferredContext !== 'workspace') { |
| 107 | return null |
| 108 | } |
| 109 | |
| 110 | // Use the proper parsing utility from workspace context module |
| 111 | const parts = key.split('/') |
| 112 | const workspaceId = parts[0] |
| 113 | |
| 114 | if (workspaceId && isUuid(workspaceId)) { |
| 115 | return workspaceId |
| 116 | } |
| 117 | |
| 118 | return null |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * Verify file access based on file path patterns and metadata |
no test coverage detected