private boolean isTenantPeer(HttpRequest request) {
        return request.getJDiscRequest().getUserPrincipal() instanceof NodePrincipal nodePrincipal &&
               switch (nodePrincipal.getIdentity().nodeType()) {
                   case host, tenant -> true;
                   default -> false;
               };
    }
Returns true if the peer is a tenant host or node.
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/NodesV2ApiHandler.java