aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/vespa/model/container/http
diff options
context:
space:
mode:
authorMorten Tokle <mortent@yahooinc.com>2022-11-22 13:34:48 +0100
committerBjørn Christian Seime <bjorncs@yahooinc.com>2022-11-22 13:43:04 +0100
commit23ba858ac77a5735c84570a040a1498c044d2a3b (patch)
tree2525f113a78aca9d7dd5828dc6c594a4737a8220 /config-model/src/main/java/com/yahoo/vespa/model/container/http
parentdd070e60aa612e806c83ce7115fce08d777ff910 (diff)
Generate config for clients
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/container/http')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/http/Client.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/http/Client.java b/config-model/src/main/java/com/yahoo/vespa/model/container/http/Client.java
new file mode 100644
index 00000000000..f588f4f5962
--- /dev/null
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/http/Client.java
@@ -0,0 +1,43 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.vespa.model.container.http;
+
+import java.security.cert.X509Certificate;
+import java.util.List;
+
+/**
+ * Represents a client. The client is identified by one of the provided certificates and have a set of permissions.
+ *
+ * @author mortent
+ */
+public class Client {
+ private String id;
+ private List<String> permissions;
+ private List<X509Certificate> certificates;
+
+ public Client(String id, List<String> permissions, List<X509Certificate> certificates) {
+ this.id = id;
+ this.permissions = permissions;
+ this.certificates = certificates;
+ }
+
+// public static Client createLegacyClient(List<X509Certificate> certificates) {
+// return new Client(true, "default", List.of(AclMapping.Action.READ.name(), AclMapping.Action.WRITE.name()), certificates);
+// }
+//
+// public static Client createClient(String id, List<String> permissions, List<X509Certificate> certificates) {
+// return new Client(false, id, permissions, certificates);
+// }
+//
+
+ public String id() {
+ return id;
+ }
+
+ public List<String> permissions() {
+ return permissions;
+ }
+
+ public List<X509Certificate> certificates() {
+ return certificates;
+ }
+}