Skip to content

Commit

Permalink
First step in SAML migration - breaks everything
Browse files Browse the repository at this point in the history
Added TODO for saml migration

Added TODO for saml migration

WIP for SAML migration

WIP for SAML migration

WIP for SAML migration

Start fixing all the broken tests...

WIP for fixing test after sam-migration

Fixed tests after saml migration
  • Loading branch information
oharsta committed Nov 7, 2023
1 parent 692dcce commit 5c2ff8c
Show file tree
Hide file tree
Showing 20 changed files with 280 additions and 488 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ local.application.yml
.classpath
log
NOTES.md
dep.tree
dep.tree
application-test2.yml
50 changes: 25 additions & 25 deletions myconext-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security.extensions</groupId>
<artifactId>spring-security-saml2-core</artifactId>
<version>2.0.0.M31</version>
<groupId>org.openconext</groupId>
<artifactId>saml-idp</artifactId>
<version>0.0.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -121,14 +121,14 @@
<version>0.9.10</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>20030203.000550</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.13.0</version>
</dependency>
<dependency>
<groupId>org.openconext</groupId>
<artifactId>tiqr-java-connector</artifactId>
<version>1.1.0</version>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
Expand Down Expand Up @@ -226,24 +226,24 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.springdoc</groupId>-->
<!-- <artifactId>springdoc-openapi-maven-plugin</artifactId>-->
<!-- <version>1.4</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <phase>test</phase>-->
<!-- <goals>-->
<!-- <goal>generate</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- <configuration>-->
<!-- <apiDocsUrl>http://localhost:8081/myconext/api/mobile/api-docs</apiDocsUrl>-->
<!-- <outputFileName>openapi.json</outputFileName>-->
<!-- <skip>false</skip>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <groupId>org.springdoc</groupId>-->
<!-- <artifactId>springdoc-openapi-maven-plugin</artifactId>-->
<!-- <version>1.4</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <phase>test</phase>-->
<!-- <goals>-->
<!-- <goal>generate</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- <configuration>-->
<!-- <apiDocsUrl>http://localhost:8081/myconext/api/mobile/api-docs</apiDocsUrl>-->
<!-- <outputFileName>openapi.json</outputFileName>-->
<!-- <skip>false</skip>-->
<!-- </configuration>-->
<!-- </plugin>-->
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
Expand Down
122 changes: 0 additions & 122 deletions myconext-server/src/main/java/myconext/config/BeanConfig.java

This file was deleted.

12 changes: 0 additions & 12 deletions myconext-server/src/main/java/myconext/config/NoopFilter.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtil;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Value;
Expand All @@ -19,6 +19,7 @@
import java.io.*;
import java.net.InetAddress;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.text.SimpleDateFormat;
import java.util.*;
Expand Down Expand Up @@ -116,7 +117,7 @@ public void refresh() {
FileOutputStream fileOutputStream = new FileOutputStream(file);

InputStream inputStream = new URL(String.format(urlTemplate, licenseKey)).openStream();
IOUtil.copy(inputStream, fileOutputStream);
IOUtils.copy(inputStream, fileOutputStream);

TarArchiveInputStream fin = new TarArchiveInputStream(new GzipCompressorInputStream(new FileInputStream(file)));
ArchiveEntry entry;
Expand All @@ -125,7 +126,7 @@ public void refresh() {
if (entry.getName().endsWith("mmdb")) {
binaryData = new File(String.format("%s/%s/%s", this.downloadDirectory, name, GEO_LITE_2_CITY_MMDB));
try (OutputStream o = Files.newOutputStream(binaryData.toPath())) {
IOUtil.copy(fin, o);
IOUtils.copy(fin, o);
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.SneakyThrows;
import myconext.model.ServiceProvider;
import org.apache.commons.io.IOUtil;
import org.apache.commons.io.IOUtils;
import org.springframework.core.io.Resource;

import java.nio.charset.Charset;
import java.util.List;
import java.util.Map;
import java.util.Optional;
Expand All @@ -17,8 +18,9 @@ public class ResourceServiceProviderResolver implements ServiceProviderResolver

@SneakyThrows
public ResourceServiceProviderResolver(Resource resource, ObjectMapper objectMapper) {
spNames = objectMapper.readValue(IOUtil.toString(resource.getInputStream()), new TypeReference<>() {
});
spNames = objectMapper.readValue(IOUtils.toString(resource.getInputStream(), Charset.defaultCharset()),
new TypeReference<>() {
});
}

@Override
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5c2ff8c

Please sign in to comment.