Refactoring work to support multi-tenancy and multiple storage, database backends (#598)
* Backend infrastructure * New backend configuration work * Factor out KV prefixing * Don't put assets in the manifest cache * Removed fancy authentication stuff * Documentation updates
This commit is contained in:
@@ -9,6 +9,7 @@ Deno.test("s3_space_primitives", async () => {
|
||||
endPoint: "s3.eu-central-1.amazonaws.com",
|
||||
region: "eu-central-1",
|
||||
bucket: "zef-sb-space",
|
||||
prefix: "test",
|
||||
};
|
||||
|
||||
const primitives = new S3SpacePrimitives(options);
|
||||
|
||||
@@ -7,10 +7,15 @@ import { FileMeta } from "$sb/types.ts";
|
||||
|
||||
// TODO: IMPORTANT: This needs a different way to keep meta data (last modified and created dates)
|
||||
|
||||
export type S3SpacePrimitivesOptions = ClientOptions & { prefix: string };
|
||||
|
||||
export class S3SpacePrimitives implements SpacePrimitives {
|
||||
client: S3Client;
|
||||
constructor(options: ClientOptions) {
|
||||
prefix: string;
|
||||
constructor(options: S3SpacePrimitivesOptions) {
|
||||
this.client = new S3Client(options);
|
||||
// TODO: Use this
|
||||
this.prefix = options.prefix;
|
||||
}
|
||||
|
||||
private encodePath(name: string): string {
|
||||
@@ -18,7 +23,7 @@ export class S3SpacePrimitives implements SpacePrimitives {
|
||||
}
|
||||
|
||||
private decodePath(encoded: string): string {
|
||||
// AWS only returns ' replace dwith '
|
||||
// AWS only returns ' replace with '
|
||||
return encoded.replaceAll("'", "'");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user