From c2a4cac3d6e9917fdcf10f58ada05b1e19f292bb Mon Sep 17 00:00:00 2001 From: Aneesh Atri Date: Tue, 27 Aug 2024 17:08:41 -0400 Subject: [PATCH] log kids with http response header --- vendor/github.com/coreos/go-oidc/jwks.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/vendor/github.com/coreos/go-oidc/jwks.go b/vendor/github.com/coreos/go-oidc/jwks.go index 433025852c4dd..d52c91325c38b 100644 --- a/vendor/github.com/coreos/go-oidc/jwks.go +++ b/vendor/github.com/coreos/go-oidc/jwks.go @@ -233,6 +233,16 @@ func (r *remoteKeySet) updateKeys() ([]jose.JSONWebKey, time.Time, error) { for i, k := range keySet.Keys { kids[i] = k.KeyID } + + klog.Infof( + "http response header", + logHeaders(resp.Header), + "kids: %+v", + kids, + "url: %s", + r.jwksURL, + ) + klog.Infof("got %d keys from %s. kids: %+v", len(kids), r.jwksURL, kids) // If the server doesn't provide cache control headers, assume the @@ -245,3 +255,13 @@ func (r *remoteKeySet) updateKeys() ([]jose.JSONWebKey, time.Time, error) { } return keySet.Keys, expiry, nil } + +func logHeaders(r http.Header) string { + multiline := "" + for name, values := range r.Clone() { + for _, value := range values { + multiline = fmt.Sprintf("%s\n%s: %s", multiline, name, value) + } + } + return multiline +}