auth/internal/domain/user.go

33 lines
947 B
Go
Raw Normal View History

2021-12-29 20:08:03 +00:00
package domain
2022-01-08 10:53:58 +00:00
import (
"testing"
)
2021-12-29 20:08:03 +00:00
type User struct {
Me *Me
AuthorizationEndpoint *URL
IndieAuthMetadata *URL
Micropub *URL
Microsub *URL
TicketEndpoint *URL
TokenEndpoint *URL
*Profile
}
2022-01-29 17:50:45 +00:00
// TestUser returns valid random generated user for tests.
2021-12-29 20:08:03 +00:00
func TestUser(tb testing.TB) *User {
tb.Helper()
return &User{
Profile: TestProfile(tb),
Me: TestMe(tb, "https://user.example.net/"),
2021-12-29 20:08:03 +00:00
AuthorizationEndpoint: TestURL(tb, "https://example.org/auth"),
IndieAuthMetadata: TestURL(tb, "https://example.org/.well-known/oauth-authorization-server"),
Micropub: TestURL(tb, "https://microsub.example.org/"),
Microsub: TestURL(tb, "https://micropub.example.org/"),
TicketEndpoint: TestURL(tb, "https://example.org/ticket"),
TokenEndpoint: TestURL(tb, "https://example.org/token"),
}
}