This repository has been archived by the owner on Nov 22, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1215 from square/gchao/secret-contents-at-version
add automation API to get secrets by name+version
- Loading branch information
Showing
8 changed files
with
200 additions
and
0 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
40 changes: 40 additions & 0 deletions
40
api/src/main/java/keywhiz/api/automation/v2/SecretContentsAtVersionRequestV2.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,40 @@ | ||
package keywhiz.api.automation.v2; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.google.auto.value.AutoValue; | ||
|
||
@AutoValue public abstract class SecretContentsAtVersionRequestV2 { | ||
SecretContentsAtVersionRequestV2() {} // prevent sub-classing | ||
|
||
|
||
public static Builder builder() { | ||
return new AutoValue_SecretContentsAtVersionRequestV2.Builder() | ||
.secret("") | ||
.version(0L); | ||
} | ||
|
||
@AutoValue.Builder public abstract static class Builder { | ||
public abstract SecretContentsAtVersionRequestV2.Builder secret(String secrets); | ||
public abstract SecretContentsAtVersionRequestV2.Builder version(Long version); | ||
|
||
public abstract SecretContentsAtVersionRequestV2 build(); | ||
} | ||
|
||
/** | ||
* Static factory method used by Jackson for deserialization | ||
*/ | ||
@SuppressWarnings("unused") | ||
@JsonCreator public static SecretContentsAtVersionRequestV2 fromParts( | ||
@JsonProperty("secret") String secret, | ||
@JsonProperty("version") Long version | ||
) { | ||
return builder() | ||
.secret(secret) | ||
.version(version) | ||
.build(); | ||
} | ||
|
||
@JsonProperty("secret") public abstract String secret(); | ||
@JsonProperty("version") public abstract Long version(); | ||
} |
34 changes: 34 additions & 0 deletions
34
api/src/main/java/keywhiz/api/automation/v2/SecretContentsAtVersionResponseV2.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,34 @@ | ||
package keywhiz.api.automation.v2; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.google.auto.value.AutoValue; | ||
import com.google.common.collect.ImmutableList; | ||
import com.google.common.collect.ImmutableMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@AutoValue public abstract class SecretContentsAtVersionResponseV2 { | ||
SecretContentsAtVersionResponseV2() {} // prevent sub-classing | ||
|
||
|
||
public static Builder builder() { | ||
return new AutoValue_SecretContentsAtVersionResponseV2.Builder().secret(""); | ||
} | ||
|
||
@AutoValue.Builder public abstract static class Builder { | ||
public abstract SecretContentsAtVersionResponseV2.Builder secret(String secret); | ||
public abstract SecretContentsAtVersionResponseV2 build(); | ||
} | ||
|
||
/** | ||
* Static factory method used by Jackson for deserialization | ||
*/ | ||
@SuppressWarnings("unused") | ||
@JsonCreator public static SecretContentsAtVersionResponseV2 fromParts( | ||
@JsonProperty("secret") String secret) { | ||
return builder().secret(secret).build(); | ||
} | ||
|
||
@JsonProperty("secret") public abstract String secret(); | ||
} |
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
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
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