Skip to content

Commit

Permalink
Update dependencies to run on Java 17+
Browse files Browse the repository at this point in the history
  • Loading branch information
peace-maker committed Nov 3, 2024
1 parent 562d7d0 commit 10f6689
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ Talks to:
* Dolby CP750
* Jnior 310

## Prerequisites
[purejavacomm](https://github.com/nyholku/purejavacomm) doesn't have version 1.0.4 on maven central. That version fixes compatibility with Java 11+ and is required to run in a modern JVM.

Install the version 1.0.4 locally, so the dependency is picked up when building the kinoapi
```shell
git clone https://github.com/nyholku/purejavacomm
cd purejavacomm
git checkout dafb397
mvn install
```

## Usage
Use Maven 3 to build.

Expand Down
21 changes: 10 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,39 @@
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<version>1.5.4</version>
<version>1.5.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.36</version>
<version>2.0.16</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
<version>2.11.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.purejavacomm</groupId>
<artifactId>purejavacomm</artifactId>
<version>1.0.2.RELEASE</version>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<version>0.11.5</version>
<version>0.12.6</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-impl</artifactId>
<version>0.11.5</version>
<version>0.12.6</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>
<version>0.11.5</version>
<version>0.12.6</version>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -82,16 +82,15 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>16</release>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<version>3.5.0</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
import io.jsonwebtoken.ExpiredJwtException;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;

/**
* WebSocket server class which serves the documented JSON API. This class acts
Expand Down Expand Up @@ -208,8 +209,9 @@ private void validateToken(ClientHandshake request) throws InvalidDataException
// because.
try {
Jwts.parser().requireSubject("SchunterKinoRemote")
.setSigningKey(Decoders.BASE64.decode(App.getConfigurationString("jws_signature_key")))
.parseClaimsJws(compactJws);
.verifyWith(Keys.hmacShaKeyFor(Decoders.BASE64.decode(App.getConfigurationString("jws_signature_key"))))
.build()
.parseSignedClaims(compactJws);
} catch (ExpiredJwtException e) {
System.err.println("Expired! " + e.getMessage());
// e.printStackTrace();
Expand Down

0 comments on commit 10f6689

Please sign in to comment.