diff options
author | Morten Tokle <mortent@yahooinc.com> | 2023-06-09 08:34:31 +0200 |
---|---|---|
committer | Morten Tokle <mortent@yahooinc.com> | 2023-06-12 22:53:33 +0200 |
commit | e4a5a20eb19ff2e2d5759f6fef83da5611d1a94e (patch) | |
tree | 1cef0d16766e852e36d9f44b7b2e788b17d9d8b2 /config-provisioning/src | |
parent | 5f25e0ba346c04ccc27c60cc410c0ed2fdb6b06b (diff) |
Persist tokens on deploy
Diffstat (limited to 'config-provisioning/src')
-rw-r--r-- | config-provisioning/src/main/java/com/yahoo/config/provision/DataplaneToken.java | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/DataplaneToken.java b/config-provisioning/src/main/java/com/yahoo/config/provision/DataplaneToken.java new file mode 100644 index 00000000000..422c8bf3a08 --- /dev/null +++ b/config-provisioning/src/main/java/com/yahoo/config/provision/DataplaneToken.java @@ -0,0 +1,54 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.config.provision; + +import java.util.List; +import java.util.Objects; + +/** + * Id, fingerprints and check access hashes of a data plane token + * + * @author mortent + */ +public class DataplaneToken { + + private final String tokenId; + private final List<TokenValue> tokenValues; + + + public DataplaneToken(String tokenId, List<TokenValue> tokenValues) { + this.tokenId = tokenId; + this.tokenValues = List.copyOf(tokenValues); + } + + public String tokenId() { + return tokenId; + } + + public List<TokenValue> tokenValues() { + return tokenValues; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + DataplaneToken that = (DataplaneToken) o; + return Objects.equals(tokenId, that.tokenId) && Objects.equals(tokenValues, that.tokenValues); + } + + @Override + public int hashCode() { + return Objects.hash(tokenId, tokenValues); + } + + @Override + public String toString() { + return "DataplaneToken{" + + "tokenId='" + tokenId + '\'' + + ", tokenValues=" + tokenValues + + '}'; + } + + public record TokenValue (String fingerprint, String checkAccessHash){ + } +} |