Skip to content

Commit

Permalink
WIP: Migrate to PostgreSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekSuchanek committed Nov 24, 2023
1 parent 3ae9418 commit 926e532
Show file tree
Hide file tree
Showing 55 changed files with 18 additions and 4,135 deletions.
53 changes: 14 additions & 39 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.5</version>
<version>3.2.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>nl.dtls</groupId>
Expand Down Expand Up @@ -52,12 +52,10 @@

<!-- Project related -->
<spring.rdf.migration.version>1.2.0.RELEASE</spring.rdf.migration.version>
<spring.security.acl.mongo.version>5.2.4.RELEASE</spring.security.acl.mongo.version>

<!-- Core -->
<springdoc.version>2.2.0</springdoc.version>
<mongock.version>5.3.5</mongock.version>
<mongodb.spring-data.version>4.1.5</mongodb.spring-data.version>
<postgresql.version>42.7.0</postgresql.version>
<rdf4j.version>4.3.8</rdf4j.version>
<jwt.version>0.12.3</jwt.version>
<lombok.version>1.18.30</lombok.version>
Expand Down Expand Up @@ -104,18 +102,6 @@
</repository>
</repositories>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.mongock</groupId>
<artifactId>mongock-bom</artifactId>
<version>${mongock.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>

<!-- ////////////////// -->
Expand Down Expand Up @@ -154,7 +140,7 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
Expand All @@ -172,28 +158,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-acl-mongodb</artifactId>
<version>${spring.security.acl.mongo.version}</version>
</dependency>

<!-- ////////////////// -->
<!-- Mongock -->
<!-- ////////////////// -->
<dependency>
<groupId>io.mongock</groupId>
<artifactId>mongock-springboot</artifactId>
</dependency>
<dependency>
<groupId>io.mongock</groupId>
<artifactId>mongodb-springdata-v4-driver</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<version>${mongodb.spring-data.version}</version>
</dependency>

<!-- ////////////////// -->
<!-- Core -->
Expand Down Expand Up @@ -257,6 +221,17 @@
<artifactId>rdf-resource-resolver-api</artifactId>
<version>${rdf-resolver.version}</version>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
<scope>runtime</scope>
</dependency>

<!-- ////////////////// -->
<!-- Test -->
Expand Down
15 changes: 2 additions & 13 deletions src/main/java/nl/dtls/fairdatapoint/config/AclConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,15 @@
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler;
import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler;
import org.springframework.security.acls.AclPermissionCacheOptimizer;
import org.springframework.security.acls.AclPermissionEvaluator;
import org.springframework.security.acls.dao.AclRepository;
import org.springframework.security.acls.domain.*;
import org.springframework.security.acls.jdbc.LookupStrategy;
import org.springframework.security.acls.model.AclCache;
import org.springframework.security.acls.model.AclService;
import org.springframework.security.acls.model.PermissionGrantingStrategy;
import org.springframework.security.acls.mongodb.BasicLookupStrategy;
import org.springframework.security.acls.mongodb.MongoDBMutableAclService;
import org.springframework.security.core.authority.SimpleGrantedAuthority;

import static java.lang.String.format;
Expand All @@ -50,12 +46,6 @@ public class AclConfig {

public static final String ACL_CACHE = "ACL_CACHE";

@Autowired
private MongoTemplate mongoTemplate;

@Autowired
private AclRepository aclRepository;

@Bean
public AclCache aclCache(ConcurrentMapCacheManager cacheManager) {
final Cache springCache = cacheManager.getCache(ACL_CACHE);
Expand All @@ -66,7 +56,7 @@ springCache, permissionGrantingStrategy(), aclAuthorizationStrategy()

@Bean
public AclService aclService(AclCache aclCache) {
return new MongoDBMutableAclService(aclRepository, lookupStrategy(aclCache), aclCache);
return null; // TODO
}

@Bean
Expand Down Expand Up @@ -98,8 +88,7 @@ public MethodSecurityExpressionHandler defaultMethodSecurityExpressionHandler(

@Bean
public LookupStrategy lookupStrategy(AclCache aclCache) {
return new BasicLookupStrategy(mongoTemplate, aclCache, aclAuthorizationStrategy(),
permissionGrantingStrategy());
return null; // TODO
}

}
77 changes: 0 additions & 77 deletions src/main/java/nl/dtls/fairdatapoint/config/MongoConfig.java

This file was deleted.

This file was deleted.

Loading

0 comments on commit 926e532

Please sign in to comment.