From 0c835dd6f7a27b3a99f3aee81c825f2f5be1969e Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 17 Feb 2022 15:38:34 +0100 Subject: [PATCH] Add config option annotation key for verdict names --- profile/endpoints/annotations.go | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/profile/endpoints/annotations.go b/profile/endpoints/annotations.go index bb37d048..8eea6f8b 100644 --- a/profile/endpoints/annotations.go +++ b/profile/endpoints/annotations.go @@ -4,21 +4,10 @@ package endpoints // list option. It's meant to be used with DisplayHintAnnotation. const DisplayHintEndpointList = "endpoint list" -// EndpointListAnnotation is the annotation identifier used in configuration -// options to hint the UI on available endpoint list types. If configured, only -// the specified set of entities is allowed to be used. The value is expected -// to be a single string or []string. If this annotation is missing, all -// values are expected to be allowed. -const EndpointListAnnotation = "safing/portmaster:ui:endpoint-list" - -// Allowed values for the EndpointListAnnotation. -const ( - EndpointListIP = "ip" - EndpointListAsn = "asn" - EndpointListCountry = "country" - EndpointListDomain = "domain" - EndpointListIPRange = "iprange" - EndpointListLists = "lists" - EndpointListScopes = "scopes" - EndpointListProtocolAndPorts = "protocol-port" -) +// EndpointListVerdictNamesAnnotation is the annotation identifier used in +// configuration options to hint the UI on names to be used for endpoint list +// verdicts. +// If configured, it must be of type map[string]string, mapping the verdict +// symbol to a name to be displayed in the UI. +// May only used when config.DisplayHintAnnotation is set to DisplayHintEndpointList. +const EndpointListVerdictNamesAnnotation = "safing/portmaster:ui:endpoint-list:verdict-names"