dashboardauth

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package dashboardauth provides a bcrypt-backed SQLite store for the launcher dashboard password. The database contains a single row (id=1) with the bcrypt hash; no plaintext is ever persisted.

Index

Constants

View Source
const (
	// DBFilename is the SQLite database file stored under the PicoClaw home directory.
	DBFilename = "launcher-auth.db"
)

Variables

View Source
var ErrUnsupportedPlatform = errors.New("dashboard password store is unavailable on this platform")

ErrUnsupportedPlatform reports that the SQLite-backed password store is not available for the current target platform.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store holds a handle to the SQLite database that stores the bcrypt hash.

func New

func New(dir string) (*Store, error)

New opens (or creates) the database inside dir, using the package's canonical filename. This is the preferred constructor for most callers. Any error is wrapped with the resolved path so callers get actionable output.

func Open

func Open(path string) (*Store, error)

Open opens (or creates) the SQLite database at path and migrates the schema.

func (*Store) Close

func (s *Store) Close() error

Close releases the database handle.

func (*Store) DBPath

func (s *Store) DBPath() string

DBPath returns the absolute path to the SQLite database file.

func (*Store) IsInitialized

func (s *Store) IsInitialized(ctx context.Context) (bool, error)

IsInitialized reports whether a password hash has been stored.

func (*Store) SetPassword

func (s *Store) SetPassword(ctx context.Context, plain string) error

SetPassword hashes plain with bcrypt (cost 12) and stores (or replaces) it. The plaintext is never written to disk.

func (*Store) VerifyPassword

func (s *Store) VerifyPassword(ctx context.Context, plain string) (bool, error)

VerifyPassword returns true iff plain matches the stored bcrypt hash. Returns (false, nil) when no password has been set yet.

Jump to

Keyboard shortcuts

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