diff --git a/src/test/java/com/mytiki/l0_storage/ApiIdTest.java b/src/test/java/com/mytiki/l0_storage/ApiIdTest.java index 88e02a8..3783a7c 100644 --- a/src/test/java/com/mytiki/l0_storage/ApiIdTest.java +++ b/src/test/java/com/mytiki/l0_storage/ApiIdTest.java @@ -30,7 +30,7 @@ webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {App.class} ) -@ActiveProfiles(profiles = {"test", "local"}) +@ActiveProfiles(profiles = {"ci", "local"}) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class ApiIdTest { diff --git a/src/test/java/com/mytiki/l0_storage/ReportTest.java b/src/test/java/com/mytiki/l0_storage/ReportTest.java index bf06a28..e16704c 100644 --- a/src/test/java/com/mytiki/l0_storage/ReportTest.java +++ b/src/test/java/com/mytiki/l0_storage/ReportTest.java @@ -30,7 +30,7 @@ webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {App.class} ) -@ActiveProfiles(profiles = {"test", "local"}) +@ActiveProfiles(profiles = {"ci", "local"}) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class ReportTest { diff --git a/src/test/java/com/mytiki/l0_storage/TokenTest.java b/src/test/java/com/mytiki/l0_storage/TokenTest.java index 89dbffb..7411662 100644 --- a/src/test/java/com/mytiki/l0_storage/TokenTest.java +++ b/src/test/java/com/mytiki/l0_storage/TokenTest.java @@ -40,7 +40,7 @@ webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {App.class} ) -@ActiveProfiles(profiles = {"test", "local"}) +@ActiveProfiles(profiles = {"ci", "local"}) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TokenTest { diff --git a/worker/upload/src/index.js b/worker/upload/src/index.js index 1433576..26c4dcd 100644 --- a/worker/upload/src/index.js +++ b/worker/upload/src/index.js @@ -38,39 +38,6 @@ export default { } } } - - /* - if (request.method === 'POST') { - const requestBody = await request.clone().formData() - const wasabiResponse = await fetch( - new Request('https://' + env.BUCKET_NAME, { - method: request.method, - headers: request.headers, - body: request.body - }) - ) - if (wasabiResponse.status !== 204) return wasabiResponse - else { - const file = requestBody.get('file') - return report( - env.REMOTE_ID, - env.REMOTE_SECRET, - requestBody.get('key'), - file.length == null ? file.size : file.length - ) - } - } else { - return new Response( - JSON.stringify({ - message: 'Full authentication is required to access this resource' - }), - { - status: 401, - statusText: 'Unauthorized', - headers: { 'Content-Type': 'application/json' } - } - ) - } */ } function handleMethod (request) { diff --git a/worker/upload/wrangler.toml b/worker/upload/wrangler.toml index 466f2d7..207e66a 100644 --- a/worker/upload/wrangler.toml +++ b/worker/upload/wrangler.toml @@ -11,6 +11,7 @@ compatibility_date = "2022-09-12" [vars] PUBKEY = '{ "kty": "EC", "use": "sig", "crv": "P-256", "kid": "dc4bde16-1cff-4335-bd8f-e5639761fdbe", "x": "zAq5eyNt6b25XGckC5u4whIl558xs-IzogJqjygysZo", "y": "hjwlv3xt0L10XiJASkjOFHUxI_72ZeLI378trg8pN6c" }' MAX_BYTES = 1000000 + # The necessary secrets are: # - REMOTE_ID # - REMOTE_SECRET