-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
model: extend AuthMethod model and embedded config
Introduce MountConfig and UserLockoutConfig models and add some missing fields to AuthMethod.
- Loading branch information
Showing
6 changed files
with
434 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
168 changes: 168 additions & 0 deletions
168
src/main/java/de/stklcode/jvault/connector/model/response/embedded/MountConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
package de.stklcode.jvault.connector.model.response.embedded; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
/** | ||
* Embedded mount config output. | ||
* | ||
* @author Stefan Kalscheuer | ||
* @since 1.2 | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class MountConfig implements Serializable { | ||
private static final long serialVersionUID = -8653909672663717792L; | ||
|
||
@JsonProperty("default_lease_ttl") | ||
private Integer defaultLeaseTtl; | ||
|
||
@JsonProperty("max_lease_ttl") | ||
private Integer maxLeaseTtl; | ||
|
||
@JsonProperty("force_no_cache") | ||
private Boolean forceNoCache; | ||
|
||
@JsonProperty("token_type") | ||
private String tokenType; | ||
|
||
@JsonProperty("audit_non_hmac_request_keys") | ||
private List<String> auditNonHmacRequestKeys; | ||
|
||
@JsonProperty("audit_non_hmac_response_keys") | ||
private List<String> auditNonHmacResponseKeys; | ||
|
||
@JsonProperty("listing_visibility") | ||
private String listingVisibility; | ||
|
||
@JsonProperty("passthrough_request_headers") | ||
private List<String> passthroughRequestHeaders; | ||
|
||
@JsonProperty("allowed_response_headers") | ||
private List<String> allowedResponseHeaders; | ||
|
||
@JsonProperty("allowed_managed_keys") | ||
private List<String> allowedManagedKeys; | ||
|
||
@JsonProperty("delegated_auth_accessors") | ||
private List<String> delegatedAuthAccessors; | ||
|
||
@JsonProperty("user_lockout_config") | ||
private UserLockoutConfig userLockoutConfig; | ||
|
||
/** | ||
* @return Default lease TTL | ||
*/ | ||
public Integer getDefaultLeaseTtl() { | ||
return defaultLeaseTtl; | ||
} | ||
|
||
/** | ||
* @return Maximum lease TTL | ||
*/ | ||
public Integer getMaxLeaseTtl() { | ||
return maxLeaseTtl; | ||
} | ||
|
||
/** | ||
* @return Force no cache? | ||
*/ | ||
public Boolean getForceNoCache() { | ||
return forceNoCache; | ||
} | ||
|
||
/** | ||
* @return Token type | ||
*/ | ||
public String getTokenType() { | ||
return tokenType; | ||
} | ||
|
||
/** | ||
* @return Audit non HMAC request keys | ||
*/ | ||
public List<String> getAuditNonHmacRequestKeys() { | ||
return auditNonHmacRequestKeys; | ||
} | ||
|
||
/** | ||
* @return Audit non HMAC response keys | ||
*/ | ||
public List<String> getAuditNonHmacResponseKeys() { | ||
return auditNonHmacResponseKeys; | ||
} | ||
|
||
/** | ||
* @return Listing visibility | ||
*/ | ||
public String getListingVisibility() { | ||
return listingVisibility; | ||
} | ||
|
||
/** | ||
* @return Passthrough request headers | ||
*/ | ||
public List<String> getPassthroughRequestHeaders() { | ||
return passthroughRequestHeaders; | ||
} | ||
|
||
/** | ||
* @return Allowed response headers | ||
*/ | ||
public List<String> getAllowedResponseHeaders() { | ||
return allowedResponseHeaders; | ||
} | ||
|
||
/** | ||
* @return Allowed managed keys | ||
*/ | ||
public List<String> getAllowedManagedKeys() { | ||
return allowedManagedKeys; | ||
} | ||
|
||
/** | ||
* @return Delegated auth accessors | ||
*/ | ||
public List<String> getDelegatedAuthAccessors() { | ||
return delegatedAuthAccessors; | ||
} | ||
|
||
/** | ||
* @return User lockout config | ||
*/ | ||
public UserLockoutConfig getUserLockoutConfig() { | ||
return userLockoutConfig; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} else if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
MountConfig that = (MountConfig) o; | ||
return Objects.equals(defaultLeaseTtl, that.defaultLeaseTtl) && | ||
Objects.equals(maxLeaseTtl, that.maxLeaseTtl) && | ||
Objects.equals(forceNoCache, that.forceNoCache) && | ||
Objects.equals(tokenType, that.tokenType) && | ||
Objects.equals(auditNonHmacRequestKeys, that.auditNonHmacRequestKeys) && | ||
Objects.equals(auditNonHmacResponseKeys, that.auditNonHmacResponseKeys) && | ||
Objects.equals(listingVisibility, that.listingVisibility) && | ||
Objects.equals(passthroughRequestHeaders, that.passthroughRequestHeaders) && | ||
Objects.equals(allowedResponseHeaders, that.allowedResponseHeaders) && | ||
Objects.equals(allowedManagedKeys, that.allowedManagedKeys) && | ||
Objects.equals(delegatedAuthAccessors, that.delegatedAuthAccessors) && | ||
Objects.equals(userLockoutConfig, that.userLockoutConfig); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(defaultLeaseTtl, maxLeaseTtl, forceNoCache, tokenType, auditNonHmacRequestKeys, | ||
auditNonHmacResponseKeys, listingVisibility, passthroughRequestHeaders, allowedResponseHeaders, | ||
allowedManagedKeys, delegatedAuthAccessors, userLockoutConfig); | ||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
src/main/java/de/stklcode/jvault/connector/model/response/embedded/UserLockoutConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package de.stklcode.jvault.connector.model.response.embedded; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.io.Serializable; | ||
import java.util.Objects; | ||
|
||
/** | ||
* Embedded user lockout config output. | ||
* | ||
* @author Stefan Kalscheuer | ||
* @since 1.2 | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class UserLockoutConfig implements Serializable { | ||
private static final long serialVersionUID = -8051060041593140550L; | ||
|
||
@JsonProperty("lockout_threshold") | ||
private Integer lockoutThreshold; | ||
|
||
@JsonProperty("lockout_duration") | ||
private Integer lockoutDuration; | ||
|
||
@JsonProperty("lockout_counter_reset_duration") | ||
private Integer lockoutCounterResetDuration; | ||
|
||
@JsonProperty("lockout_disable") | ||
private Boolean lockoutDisable; | ||
|
||
/** | ||
* @return Lockout threshold | ||
*/ | ||
public Integer getLockoutThreshold() { | ||
return lockoutThreshold; | ||
} | ||
|
||
/** | ||
* @return Lockout duration | ||
*/ | ||
public Integer getLockoutDuration() { | ||
return lockoutDuration; | ||
} | ||
|
||
/** | ||
* @return Lockout counter reset duration | ||
*/ | ||
public Integer getLockoutCounterResetDuration() { | ||
return lockoutCounterResetDuration; | ||
} | ||
|
||
/** | ||
* @return Lockout disabled? | ||
*/ | ||
public Boolean getLockoutDisable() { | ||
return lockoutDisable; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} else if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
UserLockoutConfig that = (UserLockoutConfig) o; | ||
return Objects.equals(lockoutThreshold, that.lockoutThreshold) && | ||
Objects.equals(lockoutDuration, that.lockoutDuration) && | ||
Objects.equals(lockoutCounterResetDuration, that.lockoutCounterResetDuration) && | ||
Objects.equals(lockoutDisable, that.lockoutDisable); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(lockoutThreshold, lockoutDuration, lockoutCounterResetDuration, lockoutDisable); | ||
} | ||
} |
Oops, something went wrong.