Compare commits
2 Commits
v1.5.1
...
experiment
Author | SHA1 | Date | |
---|---|---|---|
62cc4de690
|
|||
6a813b2541
|
2
.github/workflows/ci-it.yml
vendored
2
.github/workflows/ci-it.yml
vendored
@ -14,7 +14,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
jdk: [ 11, 17, 21 ]
|
jdk: [ 17, 21 ]
|
||||||
vault: [ '1.2.0', '1.19.0' ]
|
vault: [ '1.2.0', '1.19.0' ]
|
||||||
include:
|
include:
|
||||||
- jdk: 21
|
- jdk: 21
|
||||||
|
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
jdk: [ 11, 17, 21 ]
|
jdk: [ 17, 21 ]
|
||||||
include:
|
include:
|
||||||
- jdk: 21
|
- jdk: 21
|
||||||
analysis: true
|
analysis: true
|
||||||
|
13
CHANGELOG.md
13
CHANGELOG.md
@ -1,3 +1,13 @@
|
|||||||
|
## unreleased
|
||||||
|
|
||||||
|
### Breaking
|
||||||
|
* Requires Java 17 or later
|
||||||
|
* Required Jackson 3
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
* Updated Jackson to 3.0.0
|
||||||
|
|
||||||
|
|
||||||
## 1.5.0 (2025-04-13)
|
## 1.5.0 (2025-04-13)
|
||||||
|
|
||||||
### Deprecations
|
### Deprecations
|
||||||
@ -13,9 +23,6 @@
|
|||||||
### Fix
|
### Fix
|
||||||
* Fix initialization from environment without explicit port
|
* Fix initialization from environment without explicit port
|
||||||
|
|
||||||
### Dependencies
|
|
||||||
* Updated Jackson to 2.18.3 (#90)
|
|
||||||
|
|
||||||
### Test
|
### Test
|
||||||
* Tested against Vault 1.2 to 1.19
|
* Tested against Vault 1.2 to 1.19
|
||||||
|
|
||||||
|
17
pom.xml
17
pom.xml
@ -48,14 +48,9 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>tools.jackson.core</groupId>
|
||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
<version>2.19.0</version>
|
<version>3.0.0-rc5</version>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
|
||||||
<version>2.19.0</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -110,7 +105,7 @@
|
|||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.14.0</version>
|
<version>3.14.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<release>11</release>
|
<release>17</release>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -130,7 +125,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<argLine>
|
<argLine>
|
||||||
@{argLine}
|
@{argLine}
|
||||||
--add-opens de.stklcode.jvault.connector/de.stklcode.jvault.connector.test=com.fasterxml.jackson.databind
|
--add-opens de.stklcode.jvault.connector/de.stklcode.jvault.connector.test=tools.jackson.databind
|
||||||
</argLine>
|
</argLine>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
@ -207,7 +202,7 @@
|
|||||||
<version>[3.6.3,)</version>
|
<version>[3.6.3,)</version>
|
||||||
</requireMavenVersion>
|
</requireMavenVersion>
|
||||||
<requireJavaVersion>
|
<requireJavaVersion>
|
||||||
<version>[11,)</version>
|
<version>[17,)</version>
|
||||||
</requireJavaVersion>
|
</requireJavaVersion>
|
||||||
</rules>
|
</rules>
|
||||||
</configuration>
|
</configuration>
|
||||||
@ -253,7 +248,7 @@
|
|||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>3.11.2</version>
|
<version>3.11.2</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>11</source>
|
<source>17</source>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
package de.stklcode.jvault.connector.internal;
|
package de.stklcode.jvault.connector.internal;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import tools.jackson.core.JacksonException;
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
|
||||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
|
||||||
import com.fasterxml.jackson.databind.json.JsonMapper;
|
|
||||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
|
||||||
import de.stklcode.jvault.connector.exception.*;
|
import de.stklcode.jvault.connector.exception.*;
|
||||||
import de.stklcode.jvault.connector.model.response.ErrorResponse;
|
import de.stklcode.jvault.connector.model.response.ErrorResponse;
|
||||||
|
import tools.jackson.databind.cfg.DateTimeFeature;
|
||||||
|
import tools.jackson.databind.json.JsonMapper;
|
||||||
|
|
||||||
import javax.net.ssl.SSLContext;
|
import javax.net.ssl.SSLContext;
|
||||||
import javax.net.ssl.TrustManagerFactory;
|
import javax.net.ssl.TrustManagerFactory;
|
||||||
@ -66,9 +65,8 @@ public final class RequestHelper implements Serializable {
|
|||||||
this.tlsVersion = tlsVersion;
|
this.tlsVersion = tlsVersion;
|
||||||
this.trustedCaCert = trustedCaCert;
|
this.trustedCaCert = trustedCaCert;
|
||||||
this.jsonMapper = JsonMapper.builder()
|
this.jsonMapper = JsonMapper.builder()
|
||||||
.addModule(new JavaTimeModule())
|
.enable(DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS)
|
||||||
.enable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
|
.disable(DateTimeFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)
|
||||||
.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +87,7 @@ public final class RequestHelper implements Serializable {
|
|||||||
// Generate JSON from payload.
|
// Generate JSON from payload.
|
||||||
try {
|
try {
|
||||||
req.POST(HttpRequest.BodyPublishers.ofString(jsonMapper.writeValueAsString(payload), UTF_8));
|
req.POST(HttpRequest.BodyPublishers.ofString(jsonMapper.writeValueAsString(payload), UTF_8));
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JacksonException e) {
|
||||||
throw new InvalidRequestException(Error.PARSE_RESPONSE, e);
|
throw new InvalidRequestException(Error.PARSE_RESPONSE, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,7 +118,7 @@ public final class RequestHelper implements Serializable {
|
|||||||
try {
|
try {
|
||||||
String response = post(path, payload, token);
|
String response = post(path, payload, token);
|
||||||
return jsonMapper.readValue(response, target);
|
return jsonMapper.readValue(response, target);
|
||||||
} catch (IOException e) {
|
} catch (JacksonException e) {
|
||||||
throw new InvalidResponseException(Error.PARSE_RESPONSE, e);
|
throw new InvalidResponseException(Error.PARSE_RESPONSE, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -159,7 +157,7 @@ public final class RequestHelper implements Serializable {
|
|||||||
// Generate JSON from payload.
|
// Generate JSON from payload.
|
||||||
try {
|
try {
|
||||||
req.PUT(HttpRequest.BodyPublishers.ofString(jsonMapper.writeValueAsString(payload), UTF_8));
|
req.PUT(HttpRequest.BodyPublishers.ofString(jsonMapper.writeValueAsString(payload), UTF_8));
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JacksonException e) {
|
||||||
throw new InvalidRequestException("Payload serialization failed", e);
|
throw new InvalidRequestException("Payload serialization failed", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,7 +188,7 @@ public final class RequestHelper implements Serializable {
|
|||||||
try {
|
try {
|
||||||
String response = put(path, payload, token);
|
String response = put(path, payload, token);
|
||||||
return jsonMapper.readValue(response, target);
|
return jsonMapper.readValue(response, target);
|
||||||
} catch (IOException e) {
|
} catch (JacksonException e) {
|
||||||
throw new InvalidResponseException(Error.PARSE_RESPONSE, e);
|
throw new InvalidResponseException(Error.PARSE_RESPONSE, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -302,7 +300,7 @@ public final class RequestHelper implements Serializable {
|
|||||||
try {
|
try {
|
||||||
String response = get(path, payload, token);
|
String response = get(path, payload, token);
|
||||||
return jsonMapper.readValue(response, target);
|
return jsonMapper.readValue(response, target);
|
||||||
} catch (IOException e) {
|
} catch (JacksonException e) {
|
||||||
throw new InvalidResponseException(Error.PARSE_RESPONSE, e);
|
throw new InvalidResponseException(Error.PARSE_RESPONSE, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -443,7 +441,7 @@ public final class RequestHelper implements Serializable {
|
|||||||
throw new InvalidResponseException(Error.RESPONSE_CODE, response.statusCode(), er.toString());
|
throw new InvalidResponseException(Error.RESPONSE_CODE, response.statusCode(), er.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException ignored) {
|
} catch (IOException | JacksonException ignored) {
|
||||||
// Exception ignored.
|
// Exception ignored.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,14 +17,12 @@
|
|||||||
package de.stklcode.jvault.connector.model.response;
|
package de.stklcode.jvault.connector.model.response;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
|
||||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
|
||||||
import com.fasterxml.jackson.databind.json.JsonMapper;
|
|
||||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
|
||||||
import de.stklcode.jvault.connector.exception.InvalidResponseException;
|
import de.stklcode.jvault.connector.exception.InvalidResponseException;
|
||||||
import de.stklcode.jvault.connector.model.response.embedded.VersionMetadata;
|
import de.stklcode.jvault.connector.model.response.embedded.VersionMetadata;
|
||||||
|
import tools.jackson.core.JacksonException;
|
||||||
|
import tools.jackson.databind.cfg.DateTimeFeature;
|
||||||
|
import tools.jackson.databind.json.JsonMapper;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -86,9 +84,8 @@ public abstract class SecretResponse extends VaultDataResponse {
|
|||||||
return type.cast(rawValue);
|
return type.cast(rawValue);
|
||||||
} else {
|
} else {
|
||||||
var om = JsonMapper.builder()
|
var om = JsonMapper.builder()
|
||||||
.addModule(new JavaTimeModule())
|
.enable(DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS)
|
||||||
.enable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
|
.disable(DateTimeFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)
|
||||||
.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)
|
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
if (rawValue instanceof String) {
|
if (rawValue instanceof String) {
|
||||||
@ -97,7 +94,7 @@ public abstract class SecretResponse extends VaultDataResponse {
|
|||||||
return om.readValue(om.writeValueAsString(rawValue), type);
|
return om.readValue(om.writeValueAsString(rawValue), type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (JacksonException e) {
|
||||||
throw new InvalidResponseException("Unable to parse response payload: " + e.getMessage());
|
throw new InvalidResponseException("Unable to parse response payload: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,12 +26,11 @@ module de.stklcode.jvault.connector {
|
|||||||
exports de.stklcode.jvault.connector.model.response;
|
exports de.stklcode.jvault.connector.model.response;
|
||||||
exports de.stklcode.jvault.connector.model.response.embedded;
|
exports de.stklcode.jvault.connector.model.response.embedded;
|
||||||
|
|
||||||
opens de.stklcode.jvault.connector.model to com.fasterxml.jackson.databind;
|
opens de.stklcode.jvault.connector.model to tools.jackson.databind;
|
||||||
opens de.stklcode.jvault.connector.model.response to com.fasterxml.jackson.databind;
|
opens de.stklcode.jvault.connector.model.response to tools.jackson.databind;
|
||||||
opens de.stklcode.jvault.connector.model.response.embedded to com.fasterxml.jackson.databind;
|
opens de.stklcode.jvault.connector.model.response.embedded to tools.jackson.databind;
|
||||||
|
|
||||||
requires java.net.http;
|
requires java.net.http;
|
||||||
requires com.fasterxml.jackson.annotation;
|
requires com.fasterxml.jackson.annotation;
|
||||||
requires com.fasterxml.jackson.databind;
|
requires tools.jackson.databind;
|
||||||
requires com.fasterxml.jackson.datatype.jsr310;
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user