pom updates
This commit is contained in:
parent
0d9f3890af
commit
0a8c492ff0
|
@ -5,12 +5,12 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>core</artifactId>
|
||||
<version>${revision}</version>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.opencdmp</groupId>
|
||||
<artifactId>opencdmp-backend</artifactId>
|
||||
<version>${revision}</version>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
|||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<revision>1.0.0-SNAPSHOT</revision>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
@ -52,17 +51,17 @@
|
|||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
<artifactId>oidc-authz</artifactId>
|
||||
<version>2.1.0</version>
|
||||
<version>2.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.opencdmp</groupId>
|
||||
<artifactId>repositorydepositbase</artifactId>
|
||||
<version>1.0.0-dev</version>
|
||||
<artifactId>repository-deposit-base</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.opencdmp</groupId>
|
||||
<artifactId>common-models</artifactId>
|
||||
<version>1.0.0-dev</version>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
|
@ -72,7 +71,7 @@
|
|||
<dependency>
|
||||
<groupId>org.opencdmp</groupId>
|
||||
<artifactId>file-transformer-base</artifactId>
|
||||
<version>1.0.0-dev</version>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
|
@ -82,12 +81,12 @@
|
|||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
<artifactId>queue-inbox</artifactId>
|
||||
<version>2.1.1</version>
|
||||
<version>2.1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
<artifactId>queue-outbox</artifactId>
|
||||
<version>2.1.1</version>
|
||||
<version>2.1.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -115,6 +114,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>21</source>
|
||||
<target>21</target>
|
||||
|
|
114
backend/pom.xml
114
backend/pom.xml
|
@ -5,13 +5,13 @@
|
|||
<groupId>org.opencdmp</groupId>
|
||||
<artifactId>opencdmp-backend</artifactId>
|
||||
<name>OpenCDMP Backend Parent</name>
|
||||
<version>${revision}</version>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.3.3</version>
|
||||
<version>3.3.4</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@ -24,19 +24,16 @@
|
|||
<project.oauth.version>1.19.0</project.oauth.version>
|
||||
<project.version>0.2.0</project.version>
|
||||
<java.version>21</java.version>
|
||||
|
||||
<commons-codec.version>1.9</commons-codec.version>
|
||||
<org.junit.version>4.11</org.junit.version>
|
||||
<log4j.version>1.2.17</log4j.version>
|
||||
<log4j2.version>2.15.0</log4j2.version>
|
||||
<revision>1.0.0-SNAPSHOT</revision>
|
||||
<maven.compiler.release>21</maven.compiler.release>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
|
@ -50,55 +47,41 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents.client5</groupId>
|
||||
<artifactId>httpclient5</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcore-nio</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcore</artifactId>
|
||||
<version>4.4.13</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hibernate.orm</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
<version>6.5.2.Final</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hibernate.orm</groupId>
|
||||
<artifactId>hibernate-c3p0</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.jayway.jsonpath/json-path -->
|
||||
<dependency>
|
||||
<groupId>com.jayway.jsonpath</groupId>
|
||||
<artifactId>json-path</artifactId>
|
||||
<version>2.9.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-xml -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
<artifactId>jackson-dataformat-xml</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackeu.eudat.corecore/jackeu.eudat.corecore -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackeu.eudat.corecore/jackson-databind -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
|
@ -108,62 +91,11 @@
|
|||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
<version>2.17.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- g/a spring -->
|
||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackeu.eudat.corecore/jackson-databind -->
|
||||
|
||||
|
||||
|
||||
<!-- Various libs -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.14.0</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.xmlgraphics/fop -->
|
||||
|
||||
|
||||
|
||||
<!--<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-jpamodelgen</artifactId>
|
||||
</dependency>-->
|
||||
|
||||
<!--<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-to-slf4j</artifactId>
|
||||
<version>2.8.2</version>
|
||||
</dependency>-->
|
||||
|
||||
|
||||
<!-- <!– The client –>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>io.prometheus</groupId>-->
|
||||
<!-- <artifactId>simpleclient</artifactId>-->
|
||||
<!-- <version>0.11.0</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <!– Hotspot JVM metrics–>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>io.prometheus</groupId>-->
|
||||
<!-- <artifactId>simpleclient_hotspot</artifactId>-->
|
||||
<!-- <version>0.11.0</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <!– Exposition HTTPServer–>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>io.prometheus</groupId>-->
|
||||
<!-- <artifactId>simpleclient_httpserver</artifactId>-->
|
||||
<!-- <version>0.11.0</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <!– Pushgateway exposition–>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>io.prometheus</groupId>-->
|
||||
<!-- <artifactId>simpleclient_pushgateway</artifactId>-->
|
||||
<!-- <version>0.11.0</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-prometheus -->
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-registry-prometheus</artifactId>
|
||||
|
@ -173,7 +105,6 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<!-- Micormeter core dependecy -->
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-core</artifactId>
|
||||
|
@ -205,46 +136,10 @@
|
|||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>devel</id>
|
||||
<id>cite-dev</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<packaging.type>jar</packaging.type>
|
||||
</properties>
|
||||
</profile>
|
||||
<!-- <profile>-->
|
||||
<!-- <id>intellij-properties-launcher</id>-->
|
||||
|
||||
<!-- <dependencies>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-loader</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- </dependencies>-->
|
||||
|
||||
<!-- </profile>-->
|
||||
<profile>
|
||||
<id>production</id>
|
||||
<properties>
|
||||
<packaging.type>jar</packaging.type>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<activation>
|
||||
<property>
|
||||
<name>profile</name>
|
||||
<value>production</value>
|
||||
</property>
|
||||
</activation>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>cite-dev</id>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>cite-maven</id>
|
||||
|
@ -252,9 +147,6 @@
|
|||
<url>https://crepo.cite.gr/repository/cite-maven/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>web</artifactId>
|
||||
<version>${revision}</version>
|
||||
<packaging>${packaging.type}</packaging>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.opencdmp</groupId>
|
||||
<artifactId>opencdmp-backend</artifactId>
|
||||
<version>${revision}</version>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -20,15 +20,13 @@
|
|||
<maven.compiler.release>21</maven.compiler.release>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<revision>1.0.0-SNAPSHOT</revision>
|
||||
<packaging.type>jar</packaging.type>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.opencdmp</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>${revision}</version>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -39,10 +37,6 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-webflux</artifactId>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
|
||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
|
@ -51,36 +45,17 @@
|
|||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
|
||||
<!--<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>5.3.8</version>
|
||||
</dependency>-->
|
||||
|
||||
<!-- guava org.opencdmp.cache -->
|
||||
<!-- <dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>30.1.1-jre</version>
|
||||
</dependency>-->
|
||||
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context-support -->
|
||||
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>1.6.14</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/junit/junit -->
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<version>5.10.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
|
@ -89,61 +64,29 @@
|
|||
<groupId>org.hibernate.orm</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
<version>2.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--CITE DEPENDENCIES-->
|
||||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
<artifactId>cors-web</artifactId>
|
||||
<version>2.1.0</version>
|
||||
<version>2.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
<artifactId>exceptions-web</artifactId>
|
||||
<version>2.2.0</version>
|
||||
<version>2.2.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}-${project.version}</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/ui-resources</directory>
|
||||
<excludes>
|
||||
<exclude>node_modules/**</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
@ -158,39 +101,6 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<mainClass>org.opencdmp.OpenCDMPApplication</mainClass>
|
||||
<classpathPrefix>dependency-jars/</classpathPrefix>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.5.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>
|
||||
${project.build.directory}/dependency-jars/
|
||||
</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,28 @@
|
|||
package org.opencdmp.configurations;
|
||||
|
||||
import gr.cite.commons.web.authz.configuration.AuthorizationConfiguration;
|
||||
import gr.cite.commons.web.authz.configuration.PermissionPolicyContextImpl;
|
||||
import gr.cite.tools.logging.LoggerService;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@Service
|
||||
public class OpencdmpPermissionPolicyContextImpl extends PermissionPolicyContextImpl {
|
||||
private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(OpencdmpPermissionPolicyContextImpl.class));
|
||||
|
||||
public OpencdmpPermissionPolicyContextImpl(AuthorizationConfiguration authorizationConfiguration) {
|
||||
super(authorizationConfiguration);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void refresh(boolean force) {
|
||||
if (!force && this.policies != null) return;
|
||||
this.policies = this.authorizationConfiguration.getRawPolicies();
|
||||
this.extendedClaims = this.authorizationConfiguration.getRawExtendedClaims();
|
||||
logger.info("Authorization policies found: {}", this.policies.size());
|
||||
this.reload();
|
||||
}
|
||||
|
||||
}
|
|
@ -3,7 +3,6 @@ package org.opencdmp.configurations;
|
|||
|
||||
import org.opencdmp.authorization.*;
|
||||
import gr.cite.commons.web.authz.handler.AuthorizationHandler;
|
||||
import gr.cite.commons.web.authz.handler.PermissionClientAuthorizationHandler;
|
||||
import gr.cite.commons.web.authz.policy.AuthorizationRequirement;
|
||||
import gr.cite.commons.web.authz.policy.AuthorizationRequirementMapper;
|
||||
import gr.cite.commons.web.authz.policy.AuthorizationResource;
|
||||
|
@ -26,9 +25,7 @@ import org.springframework.security.web.authentication.preauth.AbstractPreAuthen
|
|||
import jakarta.servlet.Filter;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
|
@ -61,7 +58,7 @@ public class SecurityConfiguration {
|
|||
.headers(httpSecurityHeadersConfigurer -> httpSecurityHeadersConfigurer.frameOptions(HeadersConfigurer.FrameOptionsConfig::disable))
|
||||
.addFilterBefore(apiKeyFilter, AbstractPreAuthenticatedProcessingFilter.class)
|
||||
.authorizeHttpRequests(authRequest ->
|
||||
authRequest.requestMatchers(buildAntPatterns(webSecurityProperties.getAllowedEndpoints())).anonymous()
|
||||
authRequest.requestMatchers(buildAntPatterns(webSecurityProperties.getAllowedEndpoints())).anonymous()
|
||||
.requestMatchers(buildAntPatterns(webSecurityProperties.getAuthorizedEndpoints())).authenticated())
|
||||
.sessionManagement( sessionManagementConfigurer-> sessionManagementConfigurer.sessionCreationPolicy(SessionCreationPolicy.NEVER))
|
||||
.oauth2ResourceServer(oauth2 -> oauth2.authenticationManagerResolver(authenticationManagerResolver));
|
||||
|
@ -107,6 +104,11 @@ public class SecurityConfiguration {
|
|||
};
|
||||
}
|
||||
|
||||
// @Bean()
|
||||
// public PermissionPolicyContext permissionPolicyContext(){
|
||||
// return new PermissionPolicyContextImpl(configuration);
|
||||
// }
|
||||
|
||||
@Bean
|
||||
AuthorizationRequirementMapper authorizationRequirementMapper() {
|
||||
return new AuthorizationRequirementMapper() {
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.opencdmp.models;
|
|||
|
||||
import gr.cite.commons.web.authz.configuration.AuthorizationConfiguration;
|
||||
import gr.cite.commons.web.authz.configuration.Permission;
|
||||
import gr.cite.commons.web.authz.configuration.PermissionPolicyContext;
|
||||
import gr.cite.commons.web.oidc.principal.CurrentPrincipalResolver;
|
||||
import gr.cite.commons.web.oidc.principal.MyPrincipal;
|
||||
import gr.cite.commons.web.oidc.principal.extractor.ClaimExtractor;
|
||||
|
@ -33,6 +34,7 @@ public class AccountBuilder {
|
|||
private final ClaimExtractor claimExtractor;
|
||||
private final Set<String> excludeMoreClaim;
|
||||
private final CurrentPrincipalResolver currentPrincipalResolver;
|
||||
private final PermissionPolicyContext permissionPolicyContext;
|
||||
private final AuthorizationConfiguration authorizationConfiguration;
|
||||
private final AuthorizationContentResolver authorizationContentResolver;
|
||||
private final JsonHandlingService jsonHandlingService;
|
||||
|
@ -42,9 +44,10 @@ public class AccountBuilder {
|
|||
private final QueryFactory queryFactory;
|
||||
private final BuilderFactory builderFactory;
|
||||
|
||||
public AccountBuilder(ClaimExtractor claimExtractor, CurrentPrincipalResolver currentPrincipalResolver, AuthorizationConfiguration authorizationConfiguration, AuthorizationContentResolver authorizationContentResolver, JsonHandlingService jsonHandlingService, UserScope userScope, TenantEntityManager entityManager, TenantScope tenantScope, QueryFactory queryFactory, BuilderFactory builderFactory) {
|
||||
public AccountBuilder(ClaimExtractor claimExtractor, CurrentPrincipalResolver currentPrincipalResolver, PermissionPolicyContext permissionPolicyContext, AuthorizationConfiguration authorizationConfiguration, AuthorizationContentResolver authorizationContentResolver, JsonHandlingService jsonHandlingService, UserScope userScope, TenantEntityManager entityManager, TenantScope tenantScope, QueryFactory queryFactory, BuilderFactory builderFactory) {
|
||||
this.claimExtractor = claimExtractor;
|
||||
this.currentPrincipalResolver = currentPrincipalResolver;
|
||||
this.permissionPolicyContext = permissionPolicyContext;
|
||||
this.authorizationConfiguration = authorizationConfiguration;
|
||||
this.authorizationContentResolver = authorizationContentResolver;
|
||||
this.jsonHandlingService = jsonHandlingService;
|
||||
|
@ -107,8 +110,8 @@ public class AccountBuilder {
|
|||
}
|
||||
if (fields.hasField(Account._permissions)) {
|
||||
List<String> roles = this.claimExtractor.roles(this.currentPrincipalResolver.currentPrincipal());
|
||||
Set<String> permissions = this.authorizationConfiguration.permissionsOfRoles(roles);
|
||||
for (Map.Entry<String, Permission> permissionEntry : this.authorizationConfiguration.getRawPolicies().entrySet()){
|
||||
Set<String> permissions = this.permissionPolicyContext.permissionsOfRoles(roles);
|
||||
for (Map.Entry<String, Permission> permissionEntry : this.permissionPolicyContext.getRawPolicies().entrySet()){
|
||||
if (permissionEntry.getValue().getAllowAuthenticated()){
|
||||
permissions.add(permissionEntry.getKey());
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<file>logs/logging.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>logs/logging.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFileNamingAndTriggeringPolicy">
|
||||
<maxFileSize>100MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<maxHistory>15</maxHistory>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<file>logs/auditing.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>logs/auditing.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFileNamingAndTriggeringPolicy">
|
||||
<maxFileSize>100MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<maxHistory>15</maxHistory>
|
||||
|
|
Loading…
Reference in New Issue