From 7aed2e846878c1d339d8a3d43f97b58291c0ab8e Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Wed, 16 Apr 2025 11:16:12 +0200 Subject: [PATCH] policy/v2: add String func to AutoApprover interface Signed-off-by: Kristoffer Dalby --- hscontrol/policy/v2/types.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hscontrol/policy/v2/types.go b/hscontrol/policy/v2/types.go index 6e644539..28cf48d7 100644 --- a/hscontrol/policy/v2/types.go +++ b/hscontrol/policy/v2/types.go @@ -160,6 +160,10 @@ func (g Group) CanBeAutoApprover() bool { return true } +func (g Group) String() string { + return string(g) +} + func (g Group) Resolve(p *Policy, users types.Users, nodes types.Nodes) (*netipx.IPSet, error) { var ips netipx.IPSetBuilder var errs []error @@ -233,6 +237,10 @@ func (t Tag) CanBeAutoApprover() bool { return true } +func (t Tag) String() string { + return string(t) +} + // Host is a string that represents a hostname. type Host string @@ -591,6 +599,7 @@ func unmarshalPointer[T any]( type AutoApprover interface { CanBeAutoApprover() bool UnmarshalJSON([]byte) error + String() string } type AutoApprovers []AutoApprover