diff --git a/internal/domain/me.go b/internal/domain/me.go index 8760470..9670149 100644 --- a/internal/domain/me.go +++ b/internal/domain/me.go @@ -101,10 +101,10 @@ func NewMe(raw string) (*Me, error) { } // TestMe returns a valid random generated Me for tests. -func TestMe(tb testing.TB) *Me { +func TestMe(tb testing.TB, src string) *Me { tb.Helper() - me, err := NewMe("https://user.example.net/") + me, err := NewMe(src) require.NoError(tb, err) return me diff --git a/internal/domain/session.go b/internal/domain/session.go index 534a33b..293a946 100644 --- a/internal/domain/session.go +++ b/internal/domain/session.go @@ -17,7 +17,7 @@ func TestSession(tb testing.TB) *Session { return &Session{ ClientID: TestClientID(tb), - Me: TestMe(tb), + Me: TestMe(tb, "https://user.example.net/"), RedirectURI: TestURL(tb, "https://example.com/callback"), CodeChallengeMethod: CodeChallengeMethodPLAIN, Scope: Scopes{ScopeProfile, ScopeEmail}, diff --git a/internal/domain/ticket.go b/internal/domain/ticket.go index c3a43d8..3c8c1c9 100644 --- a/internal/domain/ticket.go +++ b/internal/domain/ticket.go @@ -12,7 +12,7 @@ type Ticket struct { Resource *URL // The access token should be used when acting on behalf of this URL. - Subject *URL + Subject *Me } func TestTicket(tb testing.TB) *Ticket { @@ -20,7 +20,7 @@ func TestTicket(tb testing.TB) *Ticket { return &Ticket{ Resource: TestURL(tb, "https://alice.example.com/private/"), - Subject: TestURL(tb, "https://bob.example.com/"), + Subject: TestMe(tb, "https://bob.example.com/"), Ticket: "32985723984723985792834", } } diff --git a/internal/domain/token.go b/internal/domain/token.go index 57e9fa0..d1038b3 100644 --- a/internal/domain/token.go +++ b/internal/domain/token.go @@ -88,7 +88,7 @@ func TestToken(tb testing.TB) *Token { t := jwt.New() cid := TestClientID(tb) - me := TestMe(tb) + me := TestMe(tb, "https://user.example.net/") now := time.Now().UTC().Round(time.Second) scope := Scopes{ ScopeCreate, diff --git a/internal/domain/user.go b/internal/domain/user.go index bb5cc5e..e1900ad 100644 --- a/internal/domain/user.go +++ b/internal/domain/user.go @@ -19,7 +19,7 @@ func TestUser(tb testing.TB) *User { tb.Helper() return &User{ - Me: TestMe(tb), + Me: TestMe(tb, "https://user.example.net/"), Profile: TestProfile(tb), AuthorizationEndpoint: TestURL(tb, "https://example.org/auth"), IndieAuthMetadata: TestURL(tb, "https://example.org/.well-known/oauth-authorization-server"),