♻️ Updated Me domain usage
* Updated TestMe for use custom url as in TestURL * Use Me as Ticket Subject
This commit is contained in:
parent
6aad8f8ee9
commit
4ce47440aa
|
@ -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
|
||||
|
|
|
@ -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},
|
||||
|
|
|
@ -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",
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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"),
|
||||
|
|
Loading…
Reference in New Issue