auth/internal/domain/client.go

36 lines
826 B
Go
Raw Normal View History

package domain
2021-12-29 20:08:30 +00:00
import (
"testing"
)
2021-12-29 20:08:30 +00:00
// Client describes the client requesting data about the user.
type Client struct {
ID *ClientID
Logo []*URL
RedirectURI []*URL
URL []*URL
Name []string
}
2021-12-29 20:08:30 +00:00
// TestClient returns a valid Client with the generated test data filled in.
func TestClient(tb testing.TB) *Client {
tb.Helper()
2021-12-29 20:08:30 +00:00
redirects := make([]*URL, 0)
for _, redirect := range []string{
"https://app.example.net/redirect",
"https://app.example.com/redirect",
} {
redirects = append(redirects, TestURL(tb, redirect))
2021-12-29 20:08:30 +00:00
}
return &Client{
2021-12-29 20:08:30 +00:00
ID: TestClientID(tb),
Name: []string{"Example App"},
URL: []*URL{TestURL(tb, "https://app.example.com/")},
Logo: []*URL{TestURL(tb, "https://app.example.com/logo.png")},
2021-12-29 20:08:30 +00:00
RedirectURI: redirects,
}
}