Skip to content

Commit

Permalink
merge: #12234
Browse files Browse the repository at this point in the history
12234: [Backport release-8.2.0] build(deps): bump snakeyaml from 1.33 to 2.0 in /parent r=npepinpe a=backport-action

# Description
Backport of #11941 to `release-8.2.0`.

relates to 

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nicolas Pepin-Perreault <[email protected]>
  • Loading branch information
3 people authored Apr 4, 2023
2 parents cb28a31 + 058cc44 commit 4b1dcf1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonSetter;
import java.time.Instant;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Objects;

@JsonIgnoreProperties(ignoreUnknown = true)
public final class ZeebeClientCredentials {

@JsonAlias({"accesstoken", "access_token"})
Expand Down Expand Up @@ -51,11 +53,6 @@ public String getTokenType() {
return tokenType;
}

@JsonSetter("expiry")
public void setExpiry(final String expiry) {
this.expiry = ZonedDateTime.parse(expiry);
}

@JsonSetter("expires_in")
public void setExpiresIn(final String expiresIn) {
expiry = ZonedDateTime.now().plusSeconds(Long.parseLong(expiresIn));
Expand All @@ -66,6 +63,11 @@ public String getExpiry() {
return expiry.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
}

@JsonSetter("expiry")
public void setExpiry(final String expiry) {
this.expiry = ZonedDateTime.parse(expiry);
}

@JsonIgnore
public boolean isValid() {
return expiry.toInstant().isAfter(Instant.now());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down Expand Up @@ -173,6 +174,7 @@ private void requireSymbolicLinkPointsToDirectory(final File file) throws IOExce
}
}

@JsonIgnoreProperties(ignoreUnknown = true)
private static final class OAuthCachedCredentials {

private final ZeebeClientCredentials credentials;
Expand Down
2 changes: 1 addition & 1 deletion parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<version.sbe>1.27.0</version.sbe>
<version.scala>2.13.10</version.scala>
<version.slf4j>2.0.7</version.slf4j>
<version.snakeyaml>1.33</version.snakeyaml>
<version.snakeyaml>2.0</version.snakeyaml>
<version.javax>1.3.2</version.javax>
<version.wiremock>2.35.0</version.wiremock>
<version.conscrypt>2.5.2</version.conscrypt>
Expand Down

0 comments on commit 4b1dcf1

Please sign in to comment.