Documentation
¶
Overview ¶
Package ircsts implements storage for IRCv3 Strict Transport Security policies. The consumer supplies the Store; the library never chooses a path.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSTSPolicyViolation = errors.New("ircsts: refusing insecure connect under STS policy")
ErrSTSPolicyViolation indicates an insecure connection was refused because an STS policy applies.
Functions ¶
This section is empty.
Types ¶
type FileStore ¶
type FileStore struct {
// Path is the location of the JSON file backing the store.
Path string
// contains filtered or unexported fields
}
FileStore is a Store that persists policies as JSON on disk at a consumer-supplied path.
type Policy ¶
type Policy struct {
Host string `json:"host"`
Port int `json:"port"`
// Expires is the UTC expiry time; the zero value means the policy never expires.
Expires time.Time `json:"expires"`
Preload bool `json:"preload"`
}
Policy describes a Strict Transport Security policy for a single host.
type Store ¶
type Store interface {
// Get returns the policy for host and reports whether one was found.
Get(host string) (Policy, bool, error)
// Set stores the policy.
Set(p Policy) error
// Delete removes the policy for host.
Delete(host string) error
}
Store persists Strict Transport Security policies and is provided by the consumer.
Click to show internal directories.
Click to hide internal directories.