Auth: Add request context to UserInfo calls (#70007)

* use context for UserInfo requests

* set timeouts for oauth http client

* Update pkg/login/social/common.go

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
This commit is contained in:
Jo
2023-06-14 12:30:40 +00:00
committed by GitHub
parent 1445a7cc5c
commit 914daef0fd
19 changed files with 172 additions and 138 deletions

View File

@@ -1,6 +1,7 @@
package social
import (
"context"
"net/http"
"net/http/httptest"
"testing"
@@ -81,7 +82,7 @@ func TestSocialGrafanaCom_UserInfo(t *testing.T) {
}
}))
provider.url = ts.URL
actualResult, err := provider.UserInfo(ts.Client(), nil)
actualResult, err := provider.UserInfo(context.Background(), ts.Client(), nil)
if test.ExpectedError != nil {
require.Equal(t, err, test.ExpectedError)
return