summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2024-03-13 08:59:57 +0100
committerGitHub <noreply@github.com>2024-03-13 08:59:57 +0100
commitba21dc685e4be472605ba337b9d37adffc00ac6a (patch)
treed7e2008329168d21f8255ea5f6fd94e88da96747
parentffaf23b9d65ae9c2713698ba4aee0efef7200030 (diff)
parentba402b55c89b4eb966f4a635a9f316d578c6a275 (diff)
Merge pull request #30603 from vespa-engine/cloud-common-pt2
Remove TypedSecretStore
-rw-r--r--container-disc/src/main/java/com/yahoo/container/jdisc/secret/Key.java41
-rw-r--r--container-disc/src/main/java/com/yahoo/container/jdisc/secret/Secret.java58
-rw-r--r--container-disc/src/main/java/com/yahoo/container/jdisc/secret/TypedSecretStore.java18
-rw-r--r--container-disc/src/main/java/com/yahoo/container/jdisc/secret/package-info.java6
4 files changed, 0 insertions, 123 deletions
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/secret/Key.java b/container-disc/src/main/java/com/yahoo/container/jdisc/secret/Key.java
deleted file mode 100644
index 3de482b9cc6..00000000000
--- a/container-disc/src/main/java/com/yahoo/container/jdisc/secret/Key.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.yahoo.container.jdisc.secret;
-
-import java.util.Objects;
-
-public class Key {
-
- private final String keyGroup;
- private final String keyName;
-
- public Key(String keyGroup, String keyName) {
- this.keyGroup = keyGroup;
- this.keyName = keyName;
- }
-
- public String keyGroup() {
- return keyGroup;
- }
-
- public String keyName() {
- return keyName;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- Key that = (Key) o;
- if ( ! (that.keyGroup.equals(keyGroup))) return false;
- if ( ! (that.keyName.equals(keyName))) return false;
- return true;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(keyGroup, keyName);
- }
-
- @Override
- public String toString() { return "key group: " + keyGroup + ", key name: " + keyName; }
-
-}
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/secret/Secret.java b/container-disc/src/main/java/com/yahoo/container/jdisc/secret/Secret.java
deleted file mode 100644
index fef0ba804eb..00000000000
--- a/container-disc/src/main/java/com/yahoo/container/jdisc/secret/Secret.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package com.yahoo.container.jdisc.secret;
-
-import com.yahoo.security.YBase64;
-import com.yahoo.text.Utf8;
-
-import java.util.Arrays;
-import java.util.Objects;
-
-public class Secret {
-
- private final Key key;
- private final byte[] secret;
- private final int version;
-
- public Secret(Key key, byte[] secret, int version) {
- this.key = key;
- this.secret = secret;
- this.version = version;
- }
-
- public String keyGroup() {
- return key.keyGroup();
- }
-
- public String keyName() {
- return key.keyName();
- }
-
- public byte[] secret() {
- return secret;
- }
-
- public String secretAsString() { return Utf8.toString(secret); }
-
- /** @return secret value for keys that are auto-rotated by CKMS */
- public byte[] secretAsYbase64Decoded() { return YBase64.decode(secret); }
-
- public int version() {
- return version;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- Secret that = (Secret) o;
- if ( ! (that.key.equals(key))) return false;
- if ( ! (Arrays.equals(that.secret, secret))) return false;
- if (that.version != (version)) return false;
- return true;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(key, version, Arrays.hashCode(secret));
- }
-
-}
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/secret/TypedSecretStore.java b/container-disc/src/main/java/com/yahoo/container/jdisc/secret/TypedSecretStore.java
deleted file mode 100644
index 5bb00e836f5..00000000000
--- a/container-disc/src/main/java/com/yahoo/container/jdisc/secret/TypedSecretStore.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.yahoo.container.jdisc.secret;
-
-import com.yahoo.container.jdisc.secretstore.SecretStore;
-
-import java.util.List;
-
-public interface TypedSecretStore extends SecretStore {
-
- Secret getSecret(Key key);
-
- Secret getSecret(Key key, int version);
-
- /** Lists the existing versions of this secret (nonnegative integers) */
- default List<Secret> listSecretVersions(Key key) {
- throw new UnsupportedOperationException("Secret store does not support listing versions");
- }
-
-}
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/secret/package-info.java b/container-disc/src/main/java/com/yahoo/container/jdisc/secret/package-info.java
deleted file mode 100644
index c80c6e66066..00000000000
--- a/container-disc/src/main/java/com/yahoo/container/jdisc/secret/package-info.java
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-@ExportPackage
-package com.yahoo.container.jdisc.secret;
-
-import com.yahoo.osgi.annotation.ExportPackage;