tokencheck

package
v1.0.0-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

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

View Source
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

func CheckAndAudit(ctx context.Context, d *db.DB, t *db.BackupTarget)

CheckAndAudit runs Check outside a request (scheduled, or after a target was saved) and audits a status change as the system

func Run

func Run(ctx context.Context, d *db.DB)

Run checks every target a minute after start and then every Interval until ctx ends

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL