Skip to content
1 change: 0 additions & 1 deletion docs/CNAME

This file was deleted.

16 changes: 0 additions & 16 deletions src/storage/object/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,6 @@ function createBucketIfMissing(client) {
);
}

/**
* Check to see if the org is in the existing list of orgs
*
* @param {Object} env the cloud provider environment
* @param {*} org the org associated with the bucket
* @returns null
*/
async function checkOrgIndex(env, org) {
const orgs = await env.DA_AUTH.get('orgs', { type: 'json' });
if (orgs.some((existingOrg) => existingOrg.name === org)) return;
orgs.push({ name: org, created: new Date().toISOString() });
await env.DA_AUTH.put('orgs', JSON.stringify(orgs));
}

export default async function putObject(env, daCtx, obj) {
const config = getS3Config(env);
const client = new S3Client(config);
Expand All @@ -74,8 +60,6 @@ export default async function putObject(env, daCtx, obj) {

// Only allow creating a new bucket for orgs and repos
if (key.split('/').length <= 1) {
// await checkOrgIndex(env, org);

// R2 ONLY FEATURE
createBucketIfMissing(client);
}
Expand Down
4 changes: 2 additions & 2 deletions src/storage/utils/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ export default function formatList(resp, daCtx) {
// Do not show any props sidecar files
if (props) return;

// See if the folder is already in the list
if (ext === 'props') {
if (combined.some((item) => item.name === name)) return;
// Do not add if it already exists as a folder (does not have an extension)
if (combined.some((item) => item.name === name && !item.ext)) return;

// Remove props from the key so it can look like a folder
// eslint-disable-next-line no-param-reassign
Expand Down
4 changes: 4 additions & 0 deletions src/utils/daResp.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export default function daResp({
headers.append('X-da-id', metadata.id);
}

if (metadata?.timestamp) {
headers.append('Last-Modified', new Date(parseInt(metadata.timestamp, 10)).toUTCString());
}

if (ctx?.aclCtx && status < 500) {
headers.append('X-da-actions', `/${ctx.key}=${[...ctx.aclCtx.actionSet]}`);

Expand Down
13 changes: 1 addition & 12 deletions test/storage/object/delete.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
import assert from 'node:assert';
import esmock from 'esmock';
import { mockClient } from 'aws-sdk-client-mock';
import { DeleteObjectCommand, ListObjectsV2Command, S3Client } from '@aws-sdk/client-s3';
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
import { ListObjectsV2Command, S3Client } from '@aws-sdk/client-s3';

const s3Mock = mockClient(S3Client);

Expand Down Expand Up @@ -252,11 +251,6 @@ describe('Object delete', () => {
getSignedUrl: mockSignedUrl,
}
},
{
import: {
fetch: async () => ({ status: 200 }),
}
}
);
s3Mock.on(ListObjectsV2Command).resolves({ Contents: [{ Key: 'foo/bar.html' }] });
const resp = await deleteObjects(env, daCtx, {});
Expand Down Expand Up @@ -287,11 +281,6 @@ describe('Object delete', () => {
getSignedUrl: mockSignedUrl,
}
},
{
import: {
fetch: async () => ({ status: 200 }),
}
}
);
s3Mock.on(ListObjectsV2Command).resolves({ Contents: [{ Key: 'foo/bar.html' }], NextContinuationToken: 'token' });
const resp = await deleteObjects(env, daCtx, {});
Expand Down
65 changes: 0 additions & 65 deletions test/storage/utils.t.js

This file was deleted.

Loading