From c4fc285259e0a064915742479c9a20a14ccbd5a0 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 22 Mar 2019 16:17:13 -0600 Subject: [PATCH] add String method to Whitelist --- keyfetch/fetch.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/keyfetch/fetch.go b/keyfetch/fetch.go index 9476444..8ee94a8 100644 --- a/keyfetch/fetch.go +++ b/keyfetch/fetch.go @@ -451,3 +451,12 @@ func NewWhitelist(issuers []string, assumePrivate ...bool) (Whitelist, error) { func (w Whitelist) IsTrustedIssuer(iss string, rs ...*http.Request) bool { return isTrustedIssuer(iss, w, rs...) } + +// String will generate a space-delimited list of whitelisted URLs +func (w Whitelist) String() string { + s := []string{} + for i := range w { + s = append(s, w[i].String()) + } + return strings.Join(s, " ") +}