diff options
author | Arnstein Ressem <aressem@gmail.com> | 2017-12-05 20:56:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-05 20:56:43 +0100 |
commit | e7263ed38db652f573fa1148c4b9f8d34b4be02f (patch) | |
tree | 3953ad5636e2566cb48067a2b71e678badb0b10a /controller-api | |
parent | fa22b79f210ed7d8b585abb2ac0fb3c7b9f8e65c (diff) |
Revert "Replace usage of KeyService with SecretStore"
Diffstat (limited to 'controller-api')
3 files changed, 36 insertions, 0 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/security/KeyService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/security/KeyService.java new file mode 100644 index 00000000000..61cd738314a --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/security/KeyService.java @@ -0,0 +1,18 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.integration.security; + +/** + * A service for retrieving secrets, such as API keys, private keys and passwords. + * + * @author mpolden + * @author bjorncs + */ +public interface KeyService { + + String getSecret(String key); + + default String getSecret(String key, int version) { + throw new UnsupportedOperationException("KeyService implementation does not support versioned secrets"); + } + +} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/security/KeyServiceMock.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/security/KeyServiceMock.java new file mode 100644 index 00000000000..46fa2a593c5 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/security/KeyServiceMock.java @@ -0,0 +1,13 @@ +package com.yahoo.vespa.hosted.controller.api.integration.security; + +/** + * @author mpolden + */ +public class KeyServiceMock implements KeyService { + + @Override + public String getSecret(String key) { + return "fake-secret-for-" + key; + } + +} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/security/package-info.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/security/package-info.java new file mode 100644 index 00000000000..296eebf8ea5 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/security/package-info.java @@ -0,0 +1,5 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +@ExportPackage +package com.yahoo.vespa.hosted.controller.api.integration.security; + +import com.yahoo.osgi.annotation.ExportPackage; |