This change adds Go 1.22 as a build target and drops support for Go 1.20 and older. The golang.org/x/exp/slog import is migrated to log/slog. Slog has been part of the Go standard library since Go 1.21. Therefore we are dropping support for older Go versions. This is in line of our support policy of "the latest two Go versions".
27 lines
595 B
Go
27 lines
595 B
Go
//go:build go1.20
|
|
|
|
package oidc
|
|
|
|
import (
|
|
"log/slog"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestAuthRequest_LogValue(t *testing.T) {
|
|
a := &AuthRequest{
|
|
Scopes: SpaceDelimitedArray{"a", "b"},
|
|
ResponseType: "respType",
|
|
ClientID: "123",
|
|
RedirectURI: "http://example.com/callback",
|
|
}
|
|
want := slog.GroupValue(
|
|
slog.Any("scopes", SpaceDelimitedArray{"a", "b"}),
|
|
slog.String("response_type", "respType"),
|
|
slog.String("client_id", "123"),
|
|
slog.String("redirect_uri", "http://example.com/callback"),
|
|
)
|
|
got := a.LogValue()
|
|
assert.Equal(t, want, got)
|
|
}
|