Documentation
¶
Index ¶
- Variables
- func CheckPassword(hash, password string) error
- func HashPassword(password string) (string, error)
- func NewSessionToken() (cookie string, digest []byte, err error)
- func SessionDigest(cookie string) ([]byte, error)
- type Attempt
- type Delivery
- type EventDetail
- type EventSummary
- type Filter
- type Mapping
- type Membership
- type Operator
- type Overruled
- type Placement
- type Round
- type RouteRow
- type SigningSecret
- type Tenant
- type UnroutedProvider
- type UnsignedDestination
- type User
- type Verification
Constants ¶
This section is empty.
Variables ¶
var ErrWrongPassword = errors.New("wrong email or password")
Functions ¶
func CheckPassword ¶
func HashPassword ¶
func NewSessionToken ¶
The cookie carries the token; the database stores only its digest, so a leaked table does not hand over live sessions.
func SessionDigest ¶
Types ¶
type Attempt ¶
type Attempt struct {
Round int32
Attempt int32
AttemptedAt time.Time
Status int32
Error string
DurationMs int32
// SignedWith is what this attempt went out signed with, as it stood then.
// After a rotation the destination's current secrets no longer answer it.
SignedWith string
// Forced says the event's signature had failed and somebody decided it
// should go anyway.
Forced bool
// Answer is what the destination said back. A status code is usually the
// whole of it and cannot be counted on to be.
Answer []byte
AnswerType string
AnswerTruncated bool
}
type Delivery ¶
type Delivery struct {
ID uuid.UUID
Destination string
URL string
State string
Attempts int32
NextAttemptAt time.Time
LastStatus int32
LastError string
DeliveredAt time.Time
ReplayCount int32
ReplayedAt time.Time
// Whether the destination is still routed for this event's provider and
// enabled. A delivery that is not stays as history and is never resent.
Routed bool
Rounds []Round
}
type EventDetail ¶
type EventDetail struct {
ID uuid.UUID
Provider string
Path string
ReceivedAt time.Time
BodySize int32
Signature string
Planned bool
Headers map[string][]string
Body []byte
// Overruled is the decision that had this delivered although it did not
// verify, when there was one. The signature above still says what it said.
Overruled *Overruled
}
type EventSummary ¶
type EventSummary struct {
ID uuid.UUID
Provider string
Path string
ReceivedAt time.Time
BodySize int32
Signature string
Planned bool
Deliveries int64
Delivered int64
Dead int64
Pending int64
// Deliveries left over from a destination that is no longer routed. Kept
// out of the counts above so they reconcile with the routes page.
Unrouted int64
// The highest attempt count among the routed deliveries, so the list shows
// what is struggling without opening it.
Attempts int32
// Forced says an operator overruled a failed signature to have this
// delivered. The signature itself still says what it said.
Forced bool
}
type Filter ¶
type Membership ¶
type Membership struct {
Tenant uuid.UUID
Slug string
Name string
Role string
// Since is when they joined. The oldest is where they started, which is
// where they are put when they have not chosen.
Since time.Time
}
Membership is somebody belonging to a tenant, as a role. A person can hold several, and sees one at a time.
type Operator ¶
type Operator struct {
ID uuid.UUID
Email string
Role string
Subject string
CreatedAt time.Time
SystemAdmin bool
}
Operator is someone who can sign in to the panel of one tenant.
func (Operator) SignsInWithSingleSignOn ¶
SignsInWithSingleSignOn reports whether the account is linked to an identity provider, which is the difference between an operator created here and one that arrived from outside.
type Overruled ¶
Overruled is why something that failed verification was delivered anyway, and who said so.
type Placement ¶
Placement is a tenant and the role held in it. It is what a mapping says and what joining a tenant records.
type Round ¶
A run of attempts. Round zero is the original delivery; every replay opens the next one, and each keeps its own attempt numbering.
type SigningSecret ¶
type SigningSecret struct {
Reference string
Added time.Time
Checked bool
Readable bool
Detail string
CheckedAt time.Time
}
One secret a destination signs with: where it is kept, when it was added, and what the process that delivers last found when it tried to read it. Whether it is readable is never decided here, because the panel does not run where the signing happens.
type UnroutedProvider ¶
A provider whose events have been recorded but that has no route at all, so nothing it sent has anywhere to go.
type UnsignedDestination ¶
A destination that is delivered to and signs with nothing, which once signing exists is a finding rather than a default.
type User ¶
type User struct {
ID uuid.UUID
Email string
PasswordHash string
Subject string
// SystemAdmin is not a role: a role is held inside a tenant, and the whole
// point of this is not being confined to one.
SystemAdmin bool
}
func (User) CanSignInWithPassword ¶
A user provisioned through single sign-on has no password, and must not be able to sign in with one.
type Verification ¶
type Verification struct {
Provider string
Verifier string
Scheme string
Algorithm string
Encoding string
Header string
SecretEnv string
SecretPresent bool
Refused int64
}
Verification is a provider's signature settings as the panel shows them. The secret never appears here: only the name of the variable that holds it.