add String method to Whitelist

This commit is contained in:
AJ ONeal 2019-03-22 16:17:13 -06:00
parent 3ab2594234
commit c4fc285259
1 changed files with 9 additions and 0 deletions

View File

@ -451,3 +451,12 @@ func NewWhitelist(issuers []string, assumePrivate ...bool) (Whitelist, error) {
func (w Whitelist) IsTrustedIssuer(iss string, rs ...*http.Request) bool { func (w Whitelist) IsTrustedIssuer(iss string, rs ...*http.Request) bool {
return isTrustedIssuer(iss, w, rs...) 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, " ")
}