Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

master -> develop #59

Merged
merged 6 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 17
server-id: sonatype-nexus-snapshots
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Set up Java for publishing to GitHub Packages
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 17
- name: Publish to GitHub Packages
run: mvn -P github,release -B deploy
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17
- name: Build with Maven
run: mvn -B clean package --file pom.xml -U
# run: mvn -B clean package jacoco:report --file pom.xml -U
Expand All @@ -28,8 +28,8 @@ jobs:
strategy:
matrix:
# test against latest update of each major Java version, as well as specific updates of LTS versions:
java: [ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ]
os: [ ubuntu-20.04, windows-2019, macos-10.15 ]
java: [ 17, 18, 19, 20, 21 ]
os: [ ubuntu-22.04, windows-2022, macos-12 ]
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Main features:
sides
- Flexible SPN resolution - you own the code and do not have to rely on magic SPN calculation algorithms

Java Compatibility
========
Version 0.2.x+ requires Java 17 or higher
Version 0.1.x+ supports Java 7+

Installation
========

Expand All @@ -23,7 +28,7 @@ Kerb4J is available from Maven Central repo:
<dependency>
<groupId>com.kerb4j</groupId>
<artifactId>kerb4j-client</artifactId>
<version>0.1.3</version>
<version>0.2.0</version>
</dependency>
```

Expand All @@ -33,7 +38,7 @@ Kerb4J is available from Maven Central repo:
<dependency>
<groupId>com.kerb4j</groupId>
<artifactId>kerb4j-server-spring-security</artifactId>
<version>0.1.3</version>
<version>0.2.0</version>
</dependency>
```

Expand All @@ -43,7 +48,7 @@ Kerb4J is available from Maven Central repo:
<dependency>
<groupId>com.kerb4j</groupId>
<artifactId>kerb4j-server-tomcat</artifactId>
<version>0.1.3</version>
<version>0.2.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion kerb4j-base64/kerb4j-base64-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>kerb4j-base64</artifactId>
<groupId>com.kerb4j</groupId>
<version>0.1.3</version>
<version>0.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class Base64Codec {

private final static Base64CodecImpl impl = getImpl();
private static final Base64CodecImpl impl = getImpl();

public static String encode(byte[] data) {
return impl.encodeImpl(data);
Expand All @@ -16,11 +16,9 @@ private static Base64CodecImpl getImpl() {
try {
try {
Class.forName("java.util.Base64");
return (Base64CodecImpl) Class.forName("com.kerb4j.common.util.base64.Java8Base64").
getConstructor().newInstance();
return (Base64CodecImpl) Class.forName("com.kerb4j.common.util.base64.Java8Base64").getConstructor().newInstance();
} catch (ClassNotFoundException e) {
return (Base64CodecImpl) Class.forName("com.kerb4j.common.util.base64.DatatypeConverterCodec").
getConstructor().newInstance();
return (Base64CodecImpl) Class.forName("com.kerb4j.common.util.base64.DatatypeConverterCodec").getConstructor().newInstance();
}
} catch (Exception e) {
return null;
Expand Down
41 changes: 0 additions & 41 deletions kerb4j-base64/kerb4j-base64-java7/pom.xml

This file was deleted.

This file was deleted.

12 changes: 6 additions & 6 deletions kerb4j-base64/kerb4j-base64-java8/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>kerb4j-base64</artifactId>
<groupId>com.kerb4j</groupId>
<version>0.1.3</version>
<version>0.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -15,7 +15,7 @@
<dependency>
<groupId>com.kerb4j</groupId>
<artifactId>kerb4j-base64-common</artifactId>
<version>0.1.3</version>
<version>0.2.0</version>
</dependency>
</dependencies>

Expand All @@ -30,16 +30,16 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.2</version>
<version>3.11.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<version>3.4.0</version>
<executions>
<execution>
<id>add-source</id>
Expand Down
4 changes: 1 addition & 3 deletions kerb4j-base64/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
<parent>
<artifactId>kerb4j</artifactId>
<groupId>com.kerb4j</groupId>
<version>0.1.3</version>
<version>0.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>kerb4j-base64</artifactId>
<packaging>pom</packaging>


<modules>
<module>kerb4j-base64-common</module>
<module>kerb4j-base64-java7</module>
<module>kerb4j-base64-java8</module>
</modules>

Expand Down
9 changes: 4 additions & 5 deletions kerb4j-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.kerb4j</groupId>
<artifactId>kerb4j</artifactId>
<version>0.1.3</version>
<version>0.2.0</version>
</parent>

<artifactId>kerb4j-client</artifactId>
Expand All @@ -18,20 +18,20 @@
<dependency>
<groupId>com.kerb4j</groupId>
<artifactId>kerb4j-common</artifactId>
<version>0.1.3</version>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>com.kerb4j</groupId>
<artifactId>kerb4j-common</artifactId>
<version>0.1.3</version>
<version>0.2.0</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.security.kerberos</groupId>
<artifactId>spring-security-kerberos-web</artifactId>
<version>1.0.1.RELEASE</version>
<version>2.0.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -49,7 +49,6 @@
<artifactId>kerb-simplekdc</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@
import java.net.HttpURLConnection;
import java.net.URL;
import java.security.PrivilegedActionException;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ public void testSpnegoWithForward() throws Exception {
huc.setRequestMethod("GET");
huc.connect();
int responseCode = huc.getResponseCode();
Assertions.assertEquals(401, responseCode);
//Forward is on and /login does not exist.
Assertions.assertEquals(404, responseCode);
}

@Test
public void testSpnegoWithSuccessHandler() throws Exception {

SimpleKdcServer kdc = getKdc();
Assertions.assertNotNull(kdc);
File workDir = getWorkDir();
Expand Down Expand Up @@ -149,11 +149,11 @@ public void testSpnegoWithSuccessHandler() throws Exception {
Assertions.assertEquals("hello", br.readLine());
}

// TODO: uncomment
// TODO: uncomment - rather provide a proper timeout test with kerby configured to generate very short token interval
{
// now let's test ticket renewal

Thread.sleep(400_000); // Make it a separate test probably with "slow" classifier somehow
//Thread.sleep(400_000); // Make it a separate test probably with "slow" classifier somehow

HttpURLConnection huc = new SpnegoHttpURLConnection(spnegoClient).connect(new URL("http://" + host + ":" + port + "/hello"));
BufferedReader br = new BufferedReader(new InputStreamReader(huc.getInputStream()));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.kerb4j.client;


import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
Expand All @@ -11,37 +10,28 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Configuration
@Import({
ServletWebServerFactoryAutoConfiguration.class,
@Import({ServletWebServerFactoryAutoConfiguration.class,
DispatcherServletAutoConfiguration.class,
WebMvcAutoConfiguration.class,
SecurityAutoConfiguration.class,
HttpMessageConvertersAutoConfiguration.class,
ErrorMvcAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class
})
PropertyPlaceholderAutoConfiguration.class})
@Controller
public class TestAppConfiguration {

@RequestMapping(
path = "/",
method = RequestMethod.GET,
produces = "text/plain")
@ResponseBody
@GetMapping(path = "/", produces = "text/plain")
public String home() {
return "home";
}

@RequestMapping(
path = "/hello",
method = RequestMethod.GET,
produces = "text/plain")
@ResponseBody
@GetMapping(path = "/hello", produces = "text/plain")
public String hello() {
return "hello";
}
Expand Down
Loading
Loading