2021-12-29 20:08:03 +00:00
|
|
|
package domain
|
|
|
|
|
2022-01-08 10:53:58 +00:00
|
|
|
import (
|
2023-01-02 01:15:11 +00:00
|
|
|
"net/url"
|
2022-01-08 10:53:58 +00:00
|
|
|
"testing"
|
|
|
|
)
|
2021-12-29 20:08:03 +00:00
|
|
|
|
|
|
|
type User struct {
|
|
|
|
Me *Me
|
2023-01-02 01:15:11 +00:00
|
|
|
AuthorizationEndpoint *url.URL
|
|
|
|
IndieAuthMetadata *url.URL
|
|
|
|
Micropub *url.URL
|
|
|
|
Microsub *url.URL
|
|
|
|
TicketEndpoint *url.URL
|
|
|
|
TokenEndpoint *url.URL
|
2021-12-29 20:08:03 +00:00
|
|
|
*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),
|
2022-02-17 15:12:34 +00:00
|
|
|
Me: TestMe(tb, "https://user.example.net/"),
|
2023-01-02 01:15:11 +00:00
|
|
|
AuthorizationEndpoint: &url.URL{Scheme: "https", Host: "example.org", Path: "/auth"},
|
|
|
|
IndieAuthMetadata: &url.URL{
|
|
|
|
Scheme: "https", Host: "example.org",
|
|
|
|
Path: "/.well-known/oauth-authorization-server",
|
|
|
|
},
|
|
|
|
Micropub: &url.URL{Scheme: "https", Host: "microsub.example.org", Path: "/"},
|
|
|
|
Microsub: &url.URL{Scheme: "https", Host: "micropub.example.org", Path: "/"},
|
|
|
|
TicketEndpoint: &url.URL{Scheme: "https", Host: "example.org", Path: "/ticket"},
|
|
|
|
TokenEndpoint: &url.URL{Scheme: "https", Host: "example.org", Path: "/token"},
|
2021-12-29 20:08:03 +00:00
|
|
|
}
|
|
|
|
}
|