Documentation
¶
Overview ¶
Package vault carries an agent's request that the person's page log in on a site with the password safe: the origin check, the cleaning of the page's answer, the per-tab rate limit and the bridge over the sync socket. A value of the safe never passes through here, only a status.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Statuses = []string{"logged-in", "not-logged-in", "needs-approval", "denied", "no-entry", "no-tab", "unavailable", "failed"}
Statuses a page may report.
Functions ¶
func Origin ¶
Origin is the one spelling of a site a password belongs to, `https://host[:port]` (lowercase, no default port); "" for anything else: another scheme, a path, a query, `user@`, a trailing dot.
Types ¶
type Bridge ¶
type Bridge struct {
Publish func(event *jsvalue.Object)
Subscribers func() int
Now func() time.Time
Timeout time.Duration
// contains filtered or unexported fields
}
Bridge carries requests to the pages and answers back.
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
Limiter is a set of sliding windows per key, every rule at once. A refused take takes no slot, and keys whose stamps all left the longest window are dropped.
func NewLimiter ¶
type Outcome ¶
Outcome is how a request ended: answered (with Result), no-ui, timeout, busy or rate-limited.
type Result ¶
type Result struct {
Status, Message string
}
Result is how a login went, as the page says: a status and one safe line.
func ParseResult ¶
ParseResult reads a page's answer; nil when it is not one.