fixture

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package fixture provides fixed sample data for the UI prototype in dev mode. Nothing here is a real certificate or key: serials and fingerprints are derived from names so they are stable across runs. Phase 1 replaces this package with the store; the pages don't change.

Index

Constants

View Source
const User = "it-admin"

User is the signed-in sample user.

Variables

View Source
var Now = time.Date(2026, 10, 13, 8, 0, 0, 0, time.UTC)

Now is the fixed reference time of the sample data, so relative dates ("in 83 days") and screenshots are reproducible.

View Source
var Tenants = []string{"homelab", "lab-2"}

Tenants are the sample tenants for the header switch.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	Time                  time.Time
	Actor, Action, Target string
	Result                string // success | denied | failure
}

Activity is one entry of the recent-activity list.

func RecentActivity

func RecentActivity() []Activity

RecentActivity returns the activity list, newest first.

type CA

type CA struct {
	ID, Name, Kind, ParentID string
	Subject                  string
	KeyAlgorithm, KeyMode    string
	NotBefore, NotAfter      time.Time
	PathLen                  string
	PermittedDNS             []string
	PermittedIP              []string
	MaxValidityDays          int
	CRLNumber                int
	CRLThisUpdate            time.Time
	CRLNextUpdate            time.Time
	PublicBaseURL            string
}

CA is a sample certificate authority.

func CAByID

func CAByID(id string) (CA, bool)

CAByID returns one CA.

func CAs

func CAs() []CA

CAs returns all sample CAs.

func (CA) Fingerprint

func (c CA) Fingerprint() string

Fingerprint is a stable, fake SHA-256 fingerprint.

func (CA) FingerprintSHA1 added in v0.3.1

func (c CA) FingerprintSHA1() string

FingerprintSHA1 is a stable, fake display-only SHA-1 fingerprint.

func (CA) Serial

func (c CA) Serial() string

Serial is a stable, fake serial number.

type Certificate

type Certificate struct {
	ID, CommonName, Preset, CAID string
	NotBefore, NotAfter          time.Time
	KeyAlgorithm                 string
	DNS, IP, Email               []string
	KeyStored                    bool
	RequestedBy                  string
	RevokedAt                    time.Time // zero if not revoked
	RevocationReason             string
	History                      []Event
}

Certificate is a sample end-entity certificate.

func CertificateByID

func CertificateByID(id string) (Certificate, bool)

CertificateByID returns one certificate.

func Certificates

func Certificates() []Certificate

Certificates returns all sample certificates, newest first.

func (Certificate) Fingerprint

func (c Certificate) Fingerprint() string

Fingerprint is a stable, fake SHA-256 fingerprint.

func (Certificate) Serial

func (c Certificate) Serial() string

Serial is a stable, fake serial number.

type Event

type Event struct {
	Time   time.Time
	Actor  string
	Action string
}

Event is one entry of a certificate's history.

Jump to

Keyboard shortcuts

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