Commit 17d8a62d authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

2: Migrate core behavior to new base

Task-Url: #2
parent ee525ac1
Pipeline #17542 failed with stage
in 1 minute and 4 seconds
allprojects {
apply plugin: "maven-publish"
apply plugin: "eclipse"
plugins {
id 'java-library'
id 'org.springframework.boot' version "2.3.4.RELEASE"
id 'io.spring.dependency-management' version "1.0.8.RELEASE"
}
group = 'eu.dariah.de'
allprojects {
group = 'eu.dariah.de'
version = '2.0.0-DEV'
repositories {
//mavenLocal()
maven {
repositories {
maven {
url = 'https://minfba.de.dariah.eu/nexus/repository/minfba-central/'
}
}
}
ext {
jupiterVersion = "5.7.0"
slf4jVersion = "1.7.30"
logbackVersion = "1.2.3"
ext {
coreVersion = "6.0.0-SNAPSHOT"
springPac4jVersion = "5.1.0"
webmvcPac4jVersion = "4.0.1"
pac4jVersion = "4.1.0"
librarySets = [
commonTest: [
"org.junit.jupiter:junit-jupiter-engine:$jupiterVersion",
"org.junit.jupiter:junit-jupiter-api:$jupiterVersion",
"org.junit.jupiter:junit-jupiter-params:$jupiterVersion",
"org.slf4j:slf4j-api:$slf4jVersion",
"org.slf4j:jcl-over-slf4j:$slf4jVersion",
"org.slf4j:log4j-over-slf4j:$slf4jVersion",
"ch.qos.logback:logback-core:$logbackVersion",
"ch.qos.logback:logback-classic:$logbackVersion",
"org.junit.jupiter:junit-jupiter-engine",
"org.junit.jupiter:junit-jupiter-api",
"org.junit.jupiter:junit-jupiter-params",
"org.slf4j:slf4j-api",
"org.slf4j:jcl-over-slf4j",
"org.slf4j:log4j-over-slf4j",
"ch.qos.logback:logback-core",
"ch.qos.logback:logback-classic",
]
]
}
}
subprojects {
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'java'
apply plugin: 'maven-publish'
publishing {
publications {
......@@ -81,10 +90,6 @@ allprojects {
}
}
}
}
subprojects {
apply plugin: "java"
java {
sourceCompatibility = JavaVersion.VERSION_11
......@@ -119,3 +124,7 @@ subprojects {
}
}
}
bootJar {
enabled = false
}
......@@ -4,8 +4,23 @@ plugins {
description = 'dariahsp - core library'
ext {}
dependencies {
implementation "de.unibamberg.minf.core:core-metamodel:$coreVersion"
implementation 'org.springframework.boot:spring-boot-starter-web'
//implementation 'org.apache.tomcat.embed:tomcat-embed-jasper'
compileOnly 'org.projectlombok:lombok'
//developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
//providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
implementation "org.pac4j:spring-security-pac4j:$springPac4jVersion"
implementation "org.pac4j:spring-webmvc-pac4j:$webmvcPac4jVersion"
implementation "org.pac4j:pac4j-saml:$pac4jVersion"
implementation "org.pac4j:pac4j-http:$pac4jVersion"
testImplementation librarySets.commonTest
}
jar {
enabled = true
}
\ No newline at end of file
package eu.dariah.de.dariahsp.sample;
package eu.dariah.de.dariahsp;
public class Constants {
public enum AUTHENTICATION_STAGE { AUTHENTICATION, ATTRIBUTES }
......
package eu.dariah.de.dariahsp.sample;
package eu.dariah.de.dariahsp;
//import org.apache.commons.lang.StringUtils;
import org.pac4j.core.authorization.authorizer.ProfileAuthorizer;
......
package eu.dariah.de.dariahsp.sample.authenticator;
package eu.dariah.de.dariahsp.authenticator;
import java.util.ArrayList;
......@@ -14,9 +14,9 @@ import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.password.PasswordEncoder;
import eu.dariah.de.dariahsp.sample.local.LocalUsers;
import eu.dariah.de.dariahsp.sample.model.RoleImpl;
import eu.dariah.de.dariahsp.sample.model.UserImpl;
import eu.dariah.de.dariahsp.local.LocalUsers;
import eu.dariah.de.dariahsp.model.RoleImpl;
import eu.dariah.de.dariahsp.model.UserImpl;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
......
package eu.dariah.de.dariahsp.sample.config;
package eu.dariah.de.dariahsp.config;
import lombok.Getter;
import lombok.Setter;
......
package eu.dariah.de.dariahsp.sample.config;
package eu.dariah.de.dariahsp.config;
import java.net.URI;
import java.net.URISyntaxException;
......
package eu.dariah.de.dariahsp.sample.config;
package eu.dariah.de.dariahsp.config;
import java.util.List;
import eu.dariah.de.dariahsp.sample.Constants.REQUIRED_ATTRIBUTE_CHECKLOGIC;
import eu.dariah.de.dariahsp.Constants.REQUIRED_ATTRIBUTE_CHECKLOGIC;
import lombok.Getter;
import lombok.Setter;
......
package eu.dariah.de.dariahsp.sample.config;
package eu.dariah.de.dariahsp.config;
import java.util.List;
import eu.dariah.de.dariahsp.sample.Constants.AUTHENTICATION_STAGE;
import eu.dariah.de.dariahsp.Constants.AUTHENTICATION_STAGE;
import lombok.Getter;
import lombok.Setter;
......
package eu.dariah.de.dariahsp.sample.config;
package eu.dariah.de.dariahsp.config;
import eu.dariah.de.dariahsp.sample.local.LocalUsers;
import eu.dariah.de.dariahsp.local.LocalUsers;
import lombok.Getter;
import lombok.Setter;
......
package eu.dariah.de.dariahsp.sample.config;
package eu.dariah.de.dariahsp.config;
import org.apache.http.client.HttpClient;
import java.time.Duration;
......
package eu.dariah.de.dariahsp.sample.config;
package eu.dariah.de.dariahsp.config;
import java.io.FileNotFoundException;
import java.net.URISyntaxException;
......@@ -23,8 +23,9 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import eu.dariah.de.dariahsp.sample.CustomAuthorizer;
import eu.dariah.de.dariahsp.sample.authenticator.LocalUsernamePasswordAuthenticator;
import eu.dariah.de.dariahsp.CustomAuthorizer;
import eu.dariah.de.dariahsp.authenticator.LocalUsernamePasswordAuthenticator;
import eu.dariah.de.dariahsp.metadata.MetadataHelper;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
......@@ -55,6 +56,11 @@ public class SecurityConfig {
return new BaseUrl(saml.getSp().getBaseUrl());
}
@Bean
public MetadataHelper metadataHelper() {
return new MetadataHelper();
}
@Bean
@SuppressWarnings("rawtypes")
public Config config() throws URISyntaxException {
......
package eu.dariah.de.dariahsp.sample.config;
package eu.dariah.de.dariahsp.config;
import java.util.List;
import java.util.stream.Collectors;
......
package eu.dariah.de.dariahsp.sample.error;
package eu.dariah.de.dariahsp.error;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
......
package eu.dariah.de.dariahsp.sample.error;
package eu.dariah.de.dariahsp.error;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
......
package eu.dariah.de.dariahsp.sample.error;
package eu.dariah.de.dariahsp.error;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
......
package eu.dariah.de.dariahsp.sample.error;
package eu.dariah.de.dariahsp.error;
public class SecurityConfigurationException extends Exception {
private static final long serialVersionUID = -7982246481903633882L;
......
package eu.dariah.de.dariahsp.local;
/*package eu.dariah.de.dariahsp.sample.local;
import org.springframework.beans.factory.InitializingBean;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment