mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-08-30 16:53:21 +08:00
16f11380ee
Adds the OS keyring secret backend and the huh-based TTY Prompter so PR-4 (auth login) can persist credentials and read interactive input. The Factory's Client closure SDK wiring + Secrets closure landed in PR-1's foundation tree to keep PR-1 self-contained. internal/secrets/keyring.go: - KeyringStore: zalando/go-keyring backed; namespace "weknora:<context>". KeyringStore.Ref -> keychain://weknora/<context>/<key> - NewBestEffortStore probes the OS keyring with a sentinel get and falls back to FileStore on unsupported platforms (WSL without DBus, etc.) internal/prompt/tty.go: - TTYPrompter: huh.NewForm / huh.NewInput / huh.NewConfirm wrapper satisfying Prompter. Used when iostreams.IO reports both stdout and stderr are TTYs. Dependencies (zalando/go-keyring, charmbracelet/huh) are declared in PR-1's go.mod since the foundation tree referenced them via the Store interface and TTY-detection helpers.