From 469534b32188db24401b467b1fc42b7f41a20d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Wed, 12 Apr 2023 12:05:53 +0200 Subject: [PATCH] small cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- ocis-pkg/oidc/client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ocis-pkg/oidc/client.go b/ocis-pkg/oidc/client.go index eb3b2c61e..aefca8e02 100644 --- a/ocis-pkg/oidc/client.go +++ b/ocis-pkg/oidc/client.go @@ -5,7 +5,7 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "io" "mime" "net/http" "strings" @@ -80,7 +80,7 @@ func (c *oidcClient) lookupWellKnownOpenidConfiguration(ctx context.Context) err c.providerLock.Lock() defer c.providerLock.Unlock() if c.provider == nil { - wellKnown := strings.TrimSuffix(c.issuer, "/") + "/.well-known/openid-configuration" + wellKnown := strings.TrimSuffix(c.issuer, "/") + wellknownPath req, err := http.NewRequest("GET", wellKnown, nil) if err != nil { return err @@ -91,7 +91,7 @@ func (c *oidcClient) lookupWellKnownOpenidConfiguration(ctx context.Context) err } defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("unable to read response body: %v", err) } @@ -191,7 +191,7 @@ func (c *oidcClient) UserInfo(ctx context.Context, tokenSource oauth2.TokenSourc return nil, err } defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { return nil, err }