Documentation
¶
Index ¶
- Constants
- Variables
- func AuthFilePath(dbPath string) string
- func BootstrapAuthFile(dbPath string, username string, password string) error
- func GenerateSeed() (string, error)
- func HashPassword(password string) (string, error)
- func VerifyPassword(password string, encoded string) bool
- func VerifyPasswordWithUpgrade(password string, encoded string) (bool, bool)
- type Material
- type PendingUpgrade
- type Record
- type Store
- func (s *Store) AdvancePendingUpgrade(username string, stage string) error
- func (s *Store) BeginPendingUpgrade(current Record, target Record) error
- func (s *Store) Bootstrap(username string, password string) error
- func (s *Store) ClearPendingUpgrade(username string) error
- func (s *Store) Exists() (bool, error)
- func (s *Store) FinalizePendingUpgrade(username string) (Record, error)
- func (s *Store) Load() (Record, error)
- func (s *Store) UpdatePasswordHash(username string, passwordHash string) error
- func (s *Store) UpdateRecord(updated Record) error
Constants ¶
View Source
const ( UpgradeStagePrepared = "prepared" UpgradeStageCookiesRewrapped = "cookies_rewrapped" UpgradeStageDataRewrapped = "data_rewrapped" )
View Source
const (
// AuthPasswordMinLength defines the minimum web auth password length.
AuthPasswordMinLength = 12
)
View Source
const (
WebAuthFileName = "web-auth.json"
)
Variables ¶
Functions ¶
func AuthFilePath ¶
func BootstrapAuthFile ¶
func GenerateSeed ¶
func HashPassword ¶
func VerifyPassword ¶
Types ¶
type Material ¶
type Material struct {
Username string `json:"username"`
PasswordHash string `json:"password_hash"`
EncryptionKeySeed string `json:"encryption_key_seed,omitempty"`
AllowUnencryptedExport bool `json:"allow_unencrypted_export,omitempty"`
}
func LoadFromDBPath ¶
type PendingUpgrade ¶
type Record ¶
type Record struct {
Username string `json:"username"`
PasswordHash string `json:"password_hash"`
EncryptionKeySeed string `json:"encryption_key_seed,omitempty"`
AllowUnencryptedExport bool `json:"allow_unencrypted_export,omitempty"`
BrowseRoot string `json:"browse_root,omitempty"`
AllowUnrestrictedBrowse bool `json:"allow_unrestricted_browse,omitempty"`
PendingUpgrade *PendingUpgrade `json:"pending_upgrade,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
func LoadRecordFromDBPath ¶
func (Record) AuthMaterial ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AdvancePendingUpgrade ¶
func (*Store) BeginPendingUpgrade ¶
func (*Store) ClearPendingUpgrade ¶
func (*Store) FinalizePendingUpgrade ¶
func (*Store) UpdatePasswordHash ¶
func (*Store) UpdateRecord ¶
Click to show internal directories.
Click to hide internal directories.