From e111ca02dacdecfe8e549dc0e6cd1aa916336dd8 Mon Sep 17 00:00:00 2001 From: aram price Date: Wed, 9 Dec 2020 17:20:57 -0800 Subject: [PATCH] Use the narrowest possible interface --- internal/oidc/auth/auth_handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/oidc/auth/auth_handler.go b/internal/oidc/auth/auth_handler.go index 61ab7529..36e42b25 100644 --- a/internal/oidc/auth/auth_handler.go +++ b/internal/oidc/auth/auth_handler.go @@ -136,7 +136,7 @@ func NewHandler( }) } -func readCSRFCookie(r *http.Request, codec oidc.Codec) csrftoken.CSRFToken { +func readCSRFCookie(r *http.Request, codec oidc.Decoder) csrftoken.CSRFToken { receivedCSRFCookie, err := r.Cookie(oidc.CSRFCookieName) if err != nil { // Error means that the cookie was not found @@ -214,7 +214,7 @@ func upstreamStateParam( return encodedStateParamValue, nil } -func addCSRFSetCookieHeader(w http.ResponseWriter, csrfValue csrftoken.CSRFToken, codec oidc.Codec) error { +func addCSRFSetCookieHeader(w http.ResponseWriter, csrfValue csrftoken.CSRFToken, codec oidc.Encoder) error { encodedCSRFValue, err := codec.Encode(oidc.CSRFCookieEncodingName, csrfValue) if err != nil { return httperr.Wrap(http.StatusInternalServerError, "error encoding CSRF cookie", err)