fix: use Long
for numeric TTL fields (#103) (#104)
All checks were successful
CI / build-with-it (11, 1.2.0) (push) Successful in 55s
CI / build-with-it (11, 1.20.0) (push) Successful in 1m8s
CI / build-with-it (17, 1.2.0) (push) Successful in 43s
CI / build-with-it (17, 1.20.0) (push) Successful in 1m3s
CI / build-with-it (21, 1.2.0) (push) Successful in 47s
CI / build-with-it (true, 21, 1.20.0) (push) Successful in 53s
All checks were successful
CI / build-with-it (11, 1.2.0) (push) Successful in 55s
CI / build-with-it (11, 1.20.0) (push) Successful in 1m8s
CI / build-with-it (17, 1.2.0) (push) Successful in 43s
CI / build-with-it (17, 1.20.0) (push) Successful in 1m3s
CI / build-with-it (21, 1.2.0) (push) Successful in 47s
CI / build-with-it (true, 21, 1.20.0) (push) Successful in 53s
Mapping these fields as Integer limits the possible maximum TTL value to roughly 68 years. This may or may not be a reasonable value, but is technically a valid number in the JSON response. Convert all TTL-related fields to Long, so we can map such values.
This commit is contained in:
@@ -32,7 +32,7 @@ import java.util.Objects;
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public final class AppRole implements Serializable {
|
||||
private static final long serialVersionUID = 693228837510483448L;
|
||||
private static final long serialVersionUID = 1546673231280751679L;
|
||||
|
||||
@JsonProperty("role_name")
|
||||
private String name;
|
||||
@@ -53,7 +53,7 @@ public final class AppRole implements Serializable {
|
||||
|
||||
@JsonProperty("secret_id_ttl")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Integer secretIdTtl;
|
||||
private Long secretIdTtl;
|
||||
|
||||
@JsonProperty("local_secret_ids")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@@ -61,11 +61,11 @@ public final class AppRole implements Serializable {
|
||||
|
||||
@JsonProperty("token_ttl")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Integer tokenTtl;
|
||||
private Long tokenTtl;
|
||||
|
||||
@JsonProperty("token_max_ttl")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Integer tokenMaxTtl;
|
||||
private Long tokenMaxTtl;
|
||||
|
||||
private List<String> tokenPolicies;
|
||||
|
||||
@@ -75,7 +75,7 @@ public final class AppRole implements Serializable {
|
||||
|
||||
@JsonProperty("token_explicit_max_ttl")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Integer tokenExplicitMaxTtl;
|
||||
private Long tokenExplicitMaxTtl;
|
||||
|
||||
@JsonProperty("token_no_default_policy")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@@ -255,7 +255,7 @@ public final class AppRole implements Serializable {
|
||||
/**
|
||||
* @return maximum TTL in seconds for secrets
|
||||
*/
|
||||
public Integer getSecretIdTtl() {
|
||||
public Long getSecretIdTtl() {
|
||||
return secretIdTtl;
|
||||
}
|
||||
|
||||
@@ -271,14 +271,14 @@ public final class AppRole implements Serializable {
|
||||
/**
|
||||
* @return token TTL in seconds
|
||||
*/
|
||||
public Integer getTokenTtl() {
|
||||
public Long getTokenTtl() {
|
||||
return tokenTtl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return maximum token TTL in seconds, including renewals
|
||||
*/
|
||||
public Integer getTokenMaxTtl() {
|
||||
public Long getTokenMaxTtl() {
|
||||
return tokenMaxTtl;
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ public final class AppRole implements Serializable {
|
||||
* @return explicit maximum token TTL in seconds, including renewals
|
||||
* @since 0.9
|
||||
*/
|
||||
public Integer getTokenExplicitMaxTtl() {
|
||||
public Long getTokenExplicitMaxTtl() {
|
||||
return tokenExplicitMaxTtl;
|
||||
}
|
||||
|
||||
@@ -370,12 +370,12 @@ public final class AppRole implements Serializable {
|
||||
private List<String> secretIdBoundCidrs;
|
||||
private List<String> tokenPolicies;
|
||||
private Integer secretIdNumUses;
|
||||
private Integer secretIdTtl;
|
||||
private Long secretIdTtl;
|
||||
private Boolean localSecretIds;
|
||||
private Integer tokenTtl;
|
||||
private Integer tokenMaxTtl;
|
||||
private Long tokenTtl;
|
||||
private Long tokenMaxTtl;
|
||||
private List<String> tokenBoundCidrs;
|
||||
private Integer tokenExplicitMaxTtl;
|
||||
private Long tokenExplicitMaxTtl;
|
||||
private Boolean tokenNoDefaultPolicy;
|
||||
private Integer tokenNumUses;
|
||||
private Integer tokenPeriod;
|
||||
@@ -520,7 +520,7 @@ public final class AppRole implements Serializable {
|
||||
* @param secretIdTtl the TTL
|
||||
* @return self
|
||||
*/
|
||||
public Builder withSecretIdTtl(final Integer secretIdTtl) {
|
||||
public Builder withSecretIdTtl(final Long secretIdTtl) {
|
||||
this.secretIdTtl = secretIdTtl;
|
||||
return this;
|
||||
}
|
||||
@@ -544,7 +544,7 @@ public final class AppRole implements Serializable {
|
||||
* @param tokenTtl the TTL
|
||||
* @return self
|
||||
*/
|
||||
public Builder withTokenTtl(final Integer tokenTtl) {
|
||||
public Builder withTokenTtl(final Long tokenTtl) {
|
||||
this.tokenTtl = tokenTtl;
|
||||
return this;
|
||||
}
|
||||
@@ -555,7 +555,7 @@ public final class AppRole implements Serializable {
|
||||
* @param tokenMaxTtl the TTL
|
||||
* @return self
|
||||
*/
|
||||
public Builder withTokenMaxTtl(final Integer tokenMaxTtl) {
|
||||
public Builder withTokenMaxTtl(final Long tokenMaxTtl) {
|
||||
this.tokenMaxTtl = tokenMaxTtl;
|
||||
return this;
|
||||
}
|
||||
@@ -596,7 +596,7 @@ public final class AppRole implements Serializable {
|
||||
* @param tokenExplicitMaxTtl the TTL
|
||||
* @return self
|
||||
*/
|
||||
public Builder withTokenExplicitMaxTtl(final Integer tokenExplicitMaxTtl) {
|
||||
public Builder withTokenExplicitMaxTtl(final Long tokenExplicitMaxTtl) {
|
||||
this.tokenExplicitMaxTtl = tokenExplicitMaxTtl;
|
||||
return this;
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ import java.util.*;
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public final class Token implements Serializable {
|
||||
private static final long serialVersionUID = 5208508683665365287L;
|
||||
private static final long serialVersionUID = 7003016071684507115L;
|
||||
|
||||
@JsonProperty("id")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@@ -56,11 +56,11 @@ public final class Token implements Serializable {
|
||||
|
||||
@JsonProperty("ttl")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Integer ttl;
|
||||
private Long ttl;
|
||||
|
||||
@JsonProperty("explicit_max_ttl")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Integer explicitMaxTtl;
|
||||
private Long explicitMaxTtl;
|
||||
|
||||
@JsonProperty("num_uses")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@@ -162,7 +162,7 @@ public final class Token implements Serializable {
|
||||
/**
|
||||
* @return Time-to-live in seconds
|
||||
*/
|
||||
public Integer getTtl() {
|
||||
public Long getTtl() {
|
||||
return ttl;
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ public final class Token implements Serializable {
|
||||
* @return Explicit maximum time-to-live in seconds
|
||||
* @since 0.9
|
||||
*/
|
||||
public Integer getExplicitMaxTtl() {
|
||||
public Long getExplicitMaxTtl() {
|
||||
return explicitMaxTtl;
|
||||
}
|
||||
|
||||
@@ -282,8 +282,8 @@ public final class Token implements Serializable {
|
||||
private String displayName;
|
||||
private Boolean noParent;
|
||||
private Boolean noDefaultPolicy;
|
||||
private Integer ttl;
|
||||
private Integer explicitMaxTtl;
|
||||
private Long ttl;
|
||||
private Long explicitMaxTtl;
|
||||
private Integer numUses;
|
||||
private List<String> policies;
|
||||
private Map<String, String> meta;
|
||||
@@ -331,7 +331,7 @@ public final class Token implements Serializable {
|
||||
* @param ttl the ttl
|
||||
* @return self
|
||||
*/
|
||||
public Builder withTtl(final Integer ttl) {
|
||||
public Builder withTtl(final Long ttl) {
|
||||
this.ttl = ttl;
|
||||
return this;
|
||||
}
|
||||
@@ -342,7 +342,7 @@ public final class Token implements Serializable {
|
||||
* @param explicitMaxTtl the explicit max. TTL
|
||||
* @return self
|
||||
*/
|
||||
public Builder withExplicitMaxTtl(final Integer explicitMaxTtl) {
|
||||
public Builder withExplicitMaxTtl(final Long explicitMaxTtl) {
|
||||
this.explicitMaxTtl = explicitMaxTtl;
|
||||
return this;
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ import java.util.Objects;
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public final class TokenRole implements Serializable {
|
||||
private static final long serialVersionUID = -3505215215838576321L;
|
||||
private static final long serialVersionUID = -4856948364869438439L;
|
||||
|
||||
@JsonProperty("name")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@@ -78,7 +78,7 @@ public final class TokenRole implements Serializable {
|
||||
|
||||
@JsonProperty("token_explicit_max_ttl")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Integer tokenExplicitMaxTtl;
|
||||
private Long tokenExplicitMaxTtl;
|
||||
|
||||
@JsonProperty("token_no_default_policy")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@@ -204,7 +204,7 @@ public final class TokenRole implements Serializable {
|
||||
/**
|
||||
* @return Token explicit maximum TTL
|
||||
*/
|
||||
public Integer getTokenExplicitMaxTtl() {
|
||||
public Long getTokenExplicitMaxTtl() {
|
||||
return tokenExplicitMaxTtl;
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ public final class TokenRole implements Serializable {
|
||||
private String pathSuffix;
|
||||
private List<String> allowedEntityAliases;
|
||||
private List<String> tokenBoundCidrs;
|
||||
private Integer tokenExplicitMaxTtl;
|
||||
private Long tokenExplicitMaxTtl;
|
||||
private Boolean tokenNoDefaultPolicy;
|
||||
private Integer tokenNumUses;
|
||||
private Integer tokenPeriod;
|
||||
@@ -537,7 +537,7 @@ public final class TokenRole implements Serializable {
|
||||
* @param tokenExplicitMaxTtl explicit maximum TTL
|
||||
* @return self
|
||||
*/
|
||||
public Builder withTokenExplicitMaxTtl(final Integer tokenExplicitMaxTtl) {
|
||||
public Builder withTokenExplicitMaxTtl(final Long tokenExplicitMaxTtl) {
|
||||
this.tokenExplicitMaxTtl = tokenExplicitMaxTtl;
|
||||
return this;
|
||||
}
|
||||
|
@@ -15,13 +15,13 @@ import java.util.Objects;
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class MountConfig implements Serializable {
|
||||
private static final long serialVersionUID = -8653909672663717792L;
|
||||
private static final long serialVersionUID = 7241631159224756605L;
|
||||
|
||||
@JsonProperty("default_lease_ttl")
|
||||
private Integer defaultLeaseTtl;
|
||||
private Long defaultLeaseTtl;
|
||||
|
||||
@JsonProperty("max_lease_ttl")
|
||||
private Integer maxLeaseTtl;
|
||||
private Long maxLeaseTtl;
|
||||
|
||||
@JsonProperty("force_no_cache")
|
||||
private Boolean forceNoCache;
|
||||
@@ -56,14 +56,14 @@ public class MountConfig implements Serializable {
|
||||
/**
|
||||
* @return Default lease TTL
|
||||
*/
|
||||
public Integer getDefaultLeaseTtl() {
|
||||
public Long getDefaultLeaseTtl() {
|
||||
return defaultLeaseTtl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Maximum lease TTL
|
||||
*/
|
||||
public Integer getMaxLeaseTtl() {
|
||||
public Long getMaxLeaseTtl() {
|
||||
return maxLeaseTtl;
|
||||
}
|
||||
|
||||
|
@@ -34,7 +34,7 @@ import java.util.Objects;
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public final class TokenData implements Serializable {
|
||||
private static final long serialVersionUID = -5749716740973138916L;
|
||||
private static final long serialVersionUID = -4168046151053509784L;
|
||||
|
||||
@JsonProperty("accessor")
|
||||
private String accessor;
|
||||
@@ -43,7 +43,7 @@ public final class TokenData implements Serializable {
|
||||
private Integer creationTime;
|
||||
|
||||
@JsonProperty("creation_ttl")
|
||||
private Integer creationTtl;
|
||||
private Long creationTtl;
|
||||
|
||||
@JsonProperty("display_name")
|
||||
private String name;
|
||||
@@ -55,7 +55,7 @@ public final class TokenData implements Serializable {
|
||||
private ZonedDateTime expireTime;
|
||||
|
||||
@JsonProperty("explicit_max_ttl")
|
||||
private Integer explicitMaxTtl;
|
||||
private Long explicitMaxTtl;
|
||||
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
@@ -82,7 +82,7 @@ public final class TokenData implements Serializable {
|
||||
private boolean renewable;
|
||||
|
||||
@JsonProperty("ttl")
|
||||
private Integer ttl;
|
||||
private Long ttl;
|
||||
|
||||
@JsonProperty("type")
|
||||
private String type;
|
||||
@@ -104,7 +104,7 @@ public final class TokenData implements Serializable {
|
||||
/**
|
||||
* @return Creation TTL (in seconds)
|
||||
*/
|
||||
public Integer getCreationTtl() {
|
||||
public Long getCreationTtl() {
|
||||
return creationTtl;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public final class TokenData implements Serializable {
|
||||
* @return Explicit maximum TTL
|
||||
* @since 0.9
|
||||
*/
|
||||
public Integer getExplicitMaxTtl() {
|
||||
public Long getExplicitMaxTtl() {
|
||||
return explicitMaxTtl;
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ public final class TokenData implements Serializable {
|
||||
/**
|
||||
* @return Token TTL (in seconds)
|
||||
*/
|
||||
public Integer getTtl() {
|
||||
public Long getTtl() {
|
||||
return ttl;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user