core/lint: upgrade golangci-lint, replace interface{} with any (#5099)

* core/lint: upgrade golangci-lint, replace interface{} with any

* regen proto
This commit is contained in:
Caleb Doxsey 2024-05-02 14:33:52 -06:00 committed by GitHub
parent 614048ae9c
commit 1a5b8b606f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
135 changed files with 341 additions and 340 deletions

View file

@ -115,7 +115,7 @@ func (transport *wellKnownConfiguration) RoundTrip(req *http.Request) (*http.Res
return nil, err
}
var wk map[string]interface{}
var wk map[string]any
if err := json.Unmarshal(bs, &wk); err == nil {
if issuerVar, ok := wk["issuer"]; ok {
if fmt.Sprint(issuerVar) == nonSpecIssuerURL {

View file

@ -158,7 +158,7 @@ func (p *Provider) Authenticate(ctx context.Context, code string, v identity.Sta
// groups endpoint (non-spec) to populate the rest of the user's information.
//
// https://openid.net/specs/openid-connect-core-1_0.html#UserInfo
func (p *Provider) UpdateUserInfo(ctx context.Context, t *oauth2.Token, v interface{}) error {
func (p *Provider) UpdateUserInfo(ctx context.Context, t *oauth2.Token, v any) error {
pp, err := p.GetProvider()
if err != nil {
return err
@ -255,7 +255,7 @@ func (p *Provider) Revoke(ctx context.Context, t *oauth2.Token) error {
}
// GetSubject gets the RFC 7519 Subject claim (`sub`) from a
func (p *Provider) GetSubject(v interface{}) (string, error) {
func (p *Provider) GetSubject(v any) (string, error) {
b, err := json.Marshal(v)
if err != nil {
return "", err

View file

@ -18,7 +18,7 @@ func TestRefresh(t *testing.T) {
ctx, clearTimeout := context.WithTimeout(context.Background(), 10*time.Second)
t.Cleanup(clearTimeout)
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.Write([]byte(`{
"access_token": "NEW_TOKEN",
@ -52,7 +52,7 @@ func TestRefresh_errors(t *testing.T) {
ctx, clearTimeout := context.WithTimeout(context.Background(), 10*time.Second)
t.Cleanup(clearTimeout)
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.Write([]byte("{}"))
}))
t.Cleanup(s.Close)

View file

@ -52,7 +52,7 @@ func (transport *userInfoRoundTripper) RoundTrip(req *http.Request) (*http.Respo
return nil, err
}
var userInfo map[string]interface{}
var userInfo map[string]any
if err := json.Unmarshal(bs, &userInfo); err == nil {
// AWS Cognito returns email_verified as a string, so we'll make it a bool
if ev, ok := userInfo["email_verified"]; ok {