(owner: Owner)
| 86 | ); |
| 87 | |
| 88 | const partitionFor = (owner: Owner): Effect.Effect<string, StorageError> => { |
| 89 | if (owner === "org") return Effect.succeed(partitions.org); |
| 90 | if (partitions.user == null) { |
| 91 | return Effect.fail( |
| 92 | new StorageError({ |
| 93 | message: 'Blob write targets owner "user" but the executor has no subject.', |
| 94 | cause: undefined, |
| 95 | }), |
| 96 | ); |
| 97 | } |
| 98 | return Effect.succeed(partitions.user); |
| 99 | }; |
| 100 | |
| 101 | return { |
| 102 | get: (key) => |