diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 2e337df..6ec74f1 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -25,10 +25,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- - name: Set up JDK 21
+ - name: Set up JDK 22
uses: actions/setup-java@v3
with:
- java-version: '21'
+ java-version: '22'
distribution: 'temurin'
cache: maven
- name: Build with Maven
diff --git a/backend/pom.xml b/backend/pom.xml
index 5407cb4..665b350 100644
--- a/backend/pom.xml
+++ b/backend/pom.xml
@@ -1,93 +1,145 @@
- 4.0.0
-
- org.springframework.boot
- spring-boot-starter-parent
- 3.2.4
-
-
- meowhub
- backend
- 0.0.1-SNAPSHOT
- backend
- backend
-
- 21
-
-
-
- com.h2database
- h2
- runtime
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
-
- com.oracle.database.jdbc
- ojdbc8
- 19.8.0.0
-
-
- org.springframework.boot
- spring-boot-starter-security
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- org.springframework.security
- spring-security-test
- test
-
-
- org.springframework.boot
- spring-boot-starter-validation
- 3.3.5
-
-
- org.projectlombok
- lombok
- provided
-
-
- io.jsonwebtoken
- jjwt-api
- 0.12.6
-
-
- io.jsonwebtoken
- jjwt-impl
- 0.12.6
-
-
- io.jsonwebtoken
- jjwt-jackson
- 0.12.6
-
-
- org.springdoc
- springdoc-openapi-starter-webmvc-ui
- 2.0.2
-
-
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 3.2.4
+
+
+ meowhub
+ backend
+ 0.0.1-SNAPSHOT
+ backend
+ backend
+
+ 22
+
+
+
+ com.h2database
+ h2
+ runtime
+
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
+
+
+ com.oracle.database.jdbc
+ ojdbc8
+ 19.8.0.0
+
+
+ org.springframework.boot
+ spring-boot-starter-security
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.springframework.security
+ spring-security-test
+ test
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+ 3.3.5
+
+
+ org.projectlombok
+ lombok
+ provided
+
+
+ io.jsonwebtoken
+ jjwt-api
+ 0.12.6
+
+
+ io.jsonwebtoken
+ jjwt-impl
+ 0.12.6
+
+
+ io.jsonwebtoken
+ jjwt-jackson
+ 0.12.6
+
+
+ org.springdoc
+ springdoc-openapi-starter-webmvc-ui
+ 2.0.2
+
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
+
+ com.oracle.oci.sdk
+ oci-java-sdk-addons-resteasy-client-configurator
+
+
+
+ com.oracle.oci.sdk
+ oci-java-sdk-objectstorage
+
+
+
+ com.oracle.oci.sdk
+ oci-java-sdk-common-httpclient-jersey
+
+
+
+ javax.xml.bind
+ jaxb-api
+ 2.3.1
+
+
+ org.glassfish.jaxb
+ jaxb-runtime
+ 2.3.1
+
+
+ commons-io
+ commons-io
+ 2.18.0
+
+
+
+
+
+
+
+
+ com.oracle.oci.sdk
+ oci-java-sdk-bom
+ 3.55.1
+ pom
+ import
+
+
+ com.oracle.oci.sdk
+ oci-java-sdk-common-httpclient-jersey
+ 3.55.1
+ pom
+ import
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
diff --git a/backend/src/main/java/meowhub/backend/ext/oci/MockOCIUploadService.java b/backend/src/main/java/meowhub/backend/ext/oci/MockOCIUploadService.java
new file mode 100644
index 0000000..e739d82
--- /dev/null
+++ b/backend/src/main/java/meowhub/backend/ext/oci/MockOCIUploadService.java
@@ -0,0 +1,23 @@
+package meowhub.backend.ext.oci;
+
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.logging.Logger;
+
+@Service
+@Profile("mock-oci")
+public class MockOCIUploadService extends OCIUploadService {
+ Logger logger = Logger.getLogger(getClass().getName());
+
+ @Override
+ public void upload(MultipartFile file, String objectName) throws Exception {
+ logger.info("Mock upload: %s" + objectName);
+ }
+
+ @Override
+ public String getFileObjectUrl(String objectName) throws Exception {
+ return "https://mock-oci-url.com/" + objectName;
+ }
+}
diff --git a/backend/src/main/java/meowhub/backend/ext/oci/OCIClientConfiguration.java b/backend/src/main/java/meowhub/backend/ext/oci/OCIClientConfiguration.java
new file mode 100644
index 0000000..ed4d941
--- /dev/null
+++ b/backend/src/main/java/meowhub/backend/ext/oci/OCIClientConfiguration.java
@@ -0,0 +1,26 @@
+package meowhub.backend.ext.oci;
+
+import com.oracle.bmc.ConfigFileReader;
+import com.oracle.bmc.auth.ConfigFileAuthenticationDetailsProvider;
+import com.oracle.bmc.objectstorage.ObjectStorage;
+import com.oracle.bmc.objectstorage.ObjectStorageClient;
+import org.springframework.context.annotation.Configuration;
+
+import java.io.IOException;
+
+@Configuration
+public class OCIClientConfiguration {
+ // Path to OCI configs file
+ String configurationFilePath = "backend/src/main/resources/config";
+ String profile = "DEFAULT";
+
+ public ObjectStorage getObjectStorage() throws IOException {
+ //load configs file
+ final ConfigFileReader.ConfigFile configFile = ConfigFileReader.parse(configurationFilePath, profile);
+ final ConfigFileAuthenticationDetailsProvider provider = new ConfigFileAuthenticationDetailsProvider(configFile);
+
+ //build and return client
+ return ObjectStorageClient.builder().build(provider);
+ }
+
+}
diff --git a/backend/src/main/java/meowhub/backend/ext/oci/OCIController.java b/backend/src/main/java/meowhub/backend/ext/oci/OCIController.java
new file mode 100644
index 0000000..5f4a6b5
--- /dev/null
+++ b/backend/src/main/java/meowhub/backend/ext/oci/OCIController.java
@@ -0,0 +1,42 @@
+package meowhub.backend.ext.oci;
+
+import jakarta.annotation.security.RolesAllowed;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+@RestController
+@RequestMapping("api/ext")
+@Deprecated(since = "only to test connection with OCI Object Storage. Otherwise - don't use!!!", forRemoval = true)
+@RolesAllowed("ROLE_ADMIN")
+public class OCIController {
+ private static final String urlPrefix = "https://objectstorage.eu-frankfurt-1.oraclecloud.com";
+
+ @Autowired
+ private OCIUploadService ociUploadService;
+
+ @PostMapping(path = "upload")
+ public ResponseEntity