🏷️ Added Ticket domain

This commit is contained in:
Maxim Lebedev 2021-12-30 01:07:23 +05:00
parent 42e7565c10
commit bf8e0b0e86
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 34 additions and 0 deletions

34
internal/domain/ticket.go Normal file
View File

@ -0,0 +1,34 @@
package domain
import (
"testing"
"github.com/stretchr/testify/require"
)
type Ticket struct {
// A random string that can be redeemed for an access token.
Ticket string
// 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
}
func TestTicket(tb testing.TB) *Ticket {
tb.Helper()
subject, err := NewMe("https://bob.example.org/")
require.NoError(tb, err)
resource, err := NewURL("https://alice.example.com/private/")
require.NoError(tb, err)
return &Ticket{
Ticket: "32985723984723985792834",
Resource: resource,
Subject: subject,
}
}