Documentation
¶
Overview ¶
Package tokencheck keeps an eye on the PBS API tokens of backup targets: each one should hold Datastore.Backup within its datastore and nothing else. PBS lets a token read its own permissions, so the check needs no extra privilege. Anything but ok stays on the target as a warning until a later check passes.
Index ¶
- Constants
- func ChangeEntry(t *db.BackupTarget, prev string, res *pbs.TokenCheck) *db.AuditEntry
- func Check(ctx context.Context, d *db.DB, t *db.BackupTarget) (*pbs.TokenCheck, string, error)
- func CheckAndAudit(ctx context.Context, d *db.DB, t *db.BackupTarget)
- func Run(ctx context.Context, d *db.DB)
Constants ¶
const Interval = 6 * time.Hour
Interval between scheduled checks of every target
Variables ¶
This section is empty.
Functions ¶
func ChangeEntry ¶
func ChangeEntry(t *db.BackupTarget, prev string, res *pbs.TokenCheck) *db.AuditEntry
ChangeEntry is the audit entry for a status change seen by the scheduled check (no request behind it); nil when the status did not change
func Check ¶
func Check(ctx context.Context, d *db.DB, t *db.BackupTarget) (*pbs.TokenCheck, string, error)
Check asks PBS about the target's token, stores the result on the target and returns it with the previous status ("" when never checked). A failed check is stored as status error, never as ok; the returned error is only a storage failure.
func CheckAndAudit ¶
CheckAndAudit runs Check outside a request (scheduled, or after a target was saved) and audits a status change as the system
Types ¶
This section is empty.