// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.container.http; import com.yahoo.config.provision.DataplaneToken; 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 final String id; private final List permissions; private final List certificates; private final List tokens; private final boolean internal; public Client(String id, List permissions, List certificates, List tokens) { this(id, permissions, certificates, tokens, false); } private Client(String id, List permissions, List certificates, List tokens, boolean internal) { this.id = id; this.permissions = List.copyOf(permissions); this.certificates = List.copyOf(certificates); this.tokens = List.copyOf(tokens); this.internal = internal; } public String id() { return id; } public List permissions() { return permissions; } public List certificates() { return certificates; } public List tokens() { return tokens; } public boolean internal() { return internal; } public static Client internalClient(List certificates) { return new Client("_internal", List.of("read","write"), certificates, List.of(), true); } }