lavender/openid/config_test.go

22 lines
844 B
Go
Raw Normal View History

2024-02-07 01:18:17 +00:00
package openid
import (
2025-01-19 12:04:25 +00:00
"github.com/1f349/lavender/url"
2024-02-07 01:18:17 +00:00
"github.com/stretchr/testify/assert"
"testing"
)
func TestGenConfig(t *testing.T) {
assert.Equal(t, Config{
Issuer: "https://example.com",
AuthorizationEndpoint: "https://example.com/authorize",
TokenEndpoint: "https://example.com/token",
UserInfoEndpoint: "https://example.com/userinfo",
ResponseTypesSupported: []string{"code"},
ScopesSupported: []string{"openid", "email"},
ClaimsSupported: []string{"name", "email", "preferred_username"},
GrantTypesSupported: []string{"authorization_code", "refresh_token"},
2024-07-27 22:26:00 +01:00
JwksUri: "https://example.com/.well-known/jwks.json",
2025-01-19 12:04:25 +00:00
}, GenConfig(url.MustParse("https://example.com"), []string{"openid", "email"}, []string{"name", "email", "preferred_username"}))
2024-02-07 01:18:17 +00:00
}