Documentation
¶
Overview ¶
Package sts persists IRCv3 Strict Transport Security policies.
Package sts persists IRCv3 Strict Transport Security policies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store mirrors sts.ts's STSPolicies class (the file's default-exported singleton), wrapped in a struct rather than package state for the same reason every other Stage 9/10 store is - independent instances per server/test.
func New ¶
New mirrors the STSPolicies constructor: path is Config.getHomePath() joined with "sts-policies.json" (internal/config.Loaded.HomePath()), loaded synchronously so an existing file's live (non-expired) policies are available immediately.
func (*Store) Close ¶
func (s *Store) Close()
Close stops any pending debounced save and flushes it immediately, mirroring how a process exit would still leave a `refresh()` scheduled by Node's debounce eventually running on its own timer - useful for tests and graceful shutdown so a trailing update isn't lost.
func (*Store) Get ¶
Get mirrors STSPolicies.get, narrowed to what model.STSLookup needs (the callers this stage has - Network.Validate - only ever read the port). An expired policy is evicted and a debounced save scheduled, exactly like the TS getter's side effect.
func (*Store) RefreshExpiration ¶
RefreshExpiration mirrors STSPolicies.refreshExpiration exactly, including its apparent omission of a debounced save afterward (the refreshed expiry is only persisted the next time some other mutation schedules a save) - preserved for parity rather than silently fixed, since it's the original's actual behavior, not a porting mistake.