summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2022-11-16 13:58:45 +0100
committerjonmv <venstad@gmail.com>2022-11-16 13:58:45 +0100
commitb3a445ba16c0c834b71feb01a0ec6dc6eee3577f (patch)
tree0406bf2b49c3330f5342a8c40e0820c869d6db77 /controller-api
parent7f2f6aff04c8aafc038c55a3aa288b57eeb47d2d (diff)
Enclave access service
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java3
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/EnclaveAccessService.java15
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockEnclaveAccessService.java22
3 files changed, 40 insertions, 0 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java
index bf16913d05a..1da8e5bf761 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java
@@ -7,6 +7,7 @@ import com.yahoo.vespa.hosted.controller.api.identifiers.ControllerVersion;
import com.yahoo.vespa.hosted.controller.api.integration.archive.ArchiveService;
import com.yahoo.vespa.hosted.controller.api.integration.artifact.ArtifactRegistry;
import com.yahoo.vespa.hosted.controller.api.integration.athenz.AccessControlService;
+import com.yahoo.vespa.hosted.controller.api.integration.aws.EnclaveAccessService;
import com.yahoo.vespa.hosted.controller.api.integration.aws.ResourceTagger;
import com.yahoo.vespa.hosted.controller.api.integration.aws.RoleService;
import com.yahoo.vespa.hosted.controller.api.integration.billing.BillingController;
@@ -86,6 +87,8 @@ public interface ServiceRegistry {
ResourceTagger resourceTagger();
+ EnclaveAccessService amiService();
+
RoleService roleService();
SystemMonitor systemMonitor();
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/EnclaveAccessService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/EnclaveAccessService.java
new file mode 100644
index 00000000000..44d7712c243
--- /dev/null
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/EnclaveAccessService.java
@@ -0,0 +1,15 @@
+package com.yahoo.vespa.hosted.controller.api.integration.aws;
+
+import com.yahoo.config.provision.CloudAccount;
+
+import java.util.Set;
+
+/**
+ * @author jonmv
+ */
+public interface EnclaveAccessService {
+
+ /** Makes the current AMIs available to the given accounts. */
+ void allowAccessFor(Set<CloudAccount> accounts);
+
+}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockEnclaveAccessService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockEnclaveAccessService.java
new file mode 100644
index 00000000000..95c69c6a8fa
--- /dev/null
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockEnclaveAccessService.java
@@ -0,0 +1,22 @@
+package com.yahoo.vespa.hosted.controller.api.integration.aws;
+
+import com.yahoo.config.provision.CloudAccount;
+
+import java.util.Set;
+import java.util.TreeSet;
+
+/**
+ * @author jonmv
+ */
+public class MockEnclaveAccessService implements EnclaveAccessService {
+
+ private volatile Set<CloudAccount> currentAccounts;
+
+ public Set<CloudAccount> currentAccounts() { return currentAccounts; }
+
+ @Override
+ public void allowAccessFor(Set<CloudAccount> accounts) {
+ currentAccounts = new TreeSet<>(accounts);
+ }
+
+}