// Package config defines the persistent shape of a winauth-go config and // provides loaders for both the new YAML format and the legacy WinAuth // XML format produced by the original C# application. package config // Entry is a serialized authenticator inside the config file. Vendor // determines how Data is interpreted by the authenticator package's // SetSecretData method. type Entry struct { Name string `yaml:"name" json:"name"` Vendor string `yaml:"vendor" json:"vendor"` // google|microsoft|okta|hotp|battlenet|steam IconName string `yaml:"icon" json:"icon,omitempty"` SecretRaw string `yaml:"secret" json:"secret"` // value returned by Authenticator.SecretData() // Hotkey is a human-readable global hotkey like "Ctrl+Alt+G". Empty // means no hotkey. Parsed by internal/hotkey.Parse — invalid strings // log a warning at registration time and are otherwise ignored. Hotkey string `yaml:"hotkey,omitempty" json:"hotkey,omitempty"` } // Config is the top-level file shape. Entries are stored unencrypted by // default; if Encrypted is true, EncryptedBlob holds a WAGO1 base64 ciphertext // produced by internal/crypto.EncryptModern and Entries is empty on disk. type Config struct { Version int `yaml:"version" json:"version"` Language string `yaml:"language,omitempty" json:"language,omitempty"` Encrypted bool `yaml:"encrypted" json:"encrypted"` EncryptedBlob string `yaml:"encrypted_blob,omitempty" json:"encrypted_blob,omitempty"` Entries []Entry `yaml:"entries,omitempty" json:"entries,omitempty"` }