Skip to content

feat: website logins from a shared Bitwarden collection (#103) - #181

Merged
groupsky merged 8 commits into
mainfrom
feat/103-web-logins
Nov 13, 2026
Merged

groupsky merged 8 commits into
mainfrom
feat/103-web-logins

Conversation

@groupsky

@groupsky groupsky commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Part of #103: website logins from a shared Bitwarden collection, with TOTP codes made on the broker, and the one-use pre-approval (step 9).

What is here

  • internal/totp: TOTP codes (RFC 6238) from login.totp: plain base32 and otpauth://totp (SHA1, SHA256, SHA512; 6 to 8 digits; any period). steam:// and others are refused. Tests use the RFC 6238 test vectors.
  • internal/loginmatch: the page URL (only https) and Bitwarden's URI match types. Base domain uses golang.org/x/net/publicsuffix.
  • internal/store/bwlogin.go: list and fetch of login items for the bw store. A list never keeps a password or a TOTP seed.
  • internal/config/logins.go: [logins.NAME] and [[logins.NAME.items]]; the item's rule wins completely; checks at start; config-diff.
  • internal/approval: the web_login request, window grants per (client, item ID), and the one-use pre-approval per (client, item ID, origin) that ends LoginPreapproveTime (60 s) after the tap. Telegram and ntfy messages; the pre-approval message names no time limit for the tap.
  • internal/broker/logins.go: /v1/logins/list (no tap, rate limit, always audited), /v1/logins/login (all item checks; two configured collections means deny; the password is cleared during the wait and read and checked again after the tap), /v1/logins/totp (one code for 2 minutes after a login, or during a window grant; the seed never leaves the broker).
  • internal/client: list, login and TOTP requests (for feat: a nodkey credential plugin for agent-browser logins #104), and nodkey preapprove --login ITEM --url URL.
  • DESIGN.md section 21 and the audit fields; THREAT-MODEL.md T32, T43 to T47; docs/setup.md.

New dependency

golang.org/x/net was already an indirect dependency. It is now direct, only for publicsuffix. Licence BSD-3-Clause, the same authors as golang.org/x/crypto. AGENTS.md names it.

Security review

Every commit had a review by .claude/agents/security-reviewer.md. The review of the broker part found 2 medium and 6 low findings; all are fixed in ce69d67. One earlier finding is left as it is: a URI with no match type uses base domain. This was the proposed answer to open question 5; the risk is written in DESIGN.md 21.4, T43 and docs/setup.md.

Progress

  • TOTP generator with RFC 6238 vectors
  • URI match and page URL checks
  • bw store: list and fetch of login items
  • config [logins.*] with item rules, checks at start, config-diff
  • API and broker: list, login, TOTP code
  • grants per (client, item ID); kept on reload only with the same rule
  • nodkey preapprove --login ITEM --url URL: one use, (client, item, origin), 60 s
  • client side and audit events
  • docs
  • standing grants for logins, and a reload that changes [logins.*] (later work; refused for now)
  • manual test: a password changed in the owner's vault is served on the next request (needs Geno)

🤖 Generated with Claude Code

groupsky and others added 2 commits November 12, 2026 16:21
…gins (#103)

First part of #103: internal/totp (RFC 6238, base32 and otpauth://totp),
internal/loginmatch (Bitwarden match types, https pages only, public
suffix list from golang.org/x/net/publicsuffix), and ListLogins and
FetchLogin of the bw store. DESIGN.md section 21, THREAT-MODEL.md T32
and T43 to T46, and the collection steps in docs/setup.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The broker checks [logins.NAME] (a bw store and a collection) and
[[logins.NAME.items]] rules. The item's rule wins completely. The same
collection twice, two rules for one item, and ask = "never" are
refused. config-diff lists the changes; a reload refuses a change of
[logins.*] until the broker keeps login grants per item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
groupsky and others added 6 commits November 13, 2026 01:02
…udit and messages (#103)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#103)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…--login (#103)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@groupsky
groupsky marked this pull request as ready for review November 13, 2026 00:37
@groupsky
groupsky merged commit 4ebffa8 into main Nov 13, 2026
7 checks passed
@groupsky
groupsky deleted the feat/103-web-logins branch November 13, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant