auth/internal/domain/ticket.go

28 lines
579 B
Go
Raw Normal View History

2021-12-29 20:07:23 +00:00
package domain
import (
"testing"
)
type Ticket struct {
// The access token will work at this URL.
Resource *URL
// The access token should be used when acting on behalf of this URL.
Subject *Me
// A random string that can be redeemed for an access token.
Ticket string
2021-12-29 20:07:23 +00:00
}
2022-01-29 17:50:45 +00:00
// TestTicket returns valid random generated ticket for tests.
2021-12-29 20:07:23 +00:00
func TestTicket(tb testing.TB) *Ticket {
tb.Helper()
return &Ticket{
Resource: TestURL(tb, "https://alice.example.com/private/"),
Subject: TestMe(tb, "https://bob.example.com/"),
2021-12-29 20:07:23 +00:00
Ticket: "32985723984723985792834",
}
}