gotextlog

gotextlog
git clone https://git.ryansepassi.com/git/gotextlog.git
Log | Files | Refs | README

Key-authenticated Textlog server

Cross-repository contract

The server lives at ../gotextlog-srv and the client remains in this repository. The server implements the API consumed in doc/api.md, except that account creation and login use SSH Ed25519 keys. The existing email-code methods remain available in the client for other Textlog instances.

Key authentication uses these endpoints under /api/v1:

The TUI discovers ssh-ed25519 public keys from ~/.ssh/*.pub. A selected public key is signed through SSH_AUTH_SOCK when available, otherwise through the matching unencrypted private-key file. Encrypted private keys must be loaded into an agent. The login screen allows switching between existing email-code login and key login, selecting a discovered key, and entering a handle for first use.

Bearer sessions remain unchanged. The server returns empty email and false email_verified fields so the existing current-user decoder remains compatible. Opaque cursors represent stable (created_at,id) pagination positions.

Ownership and boundaries

W1: Complete server

Files: all files under ../gotextlog-srv. Do not edit this repository.

Deliverables:

Verification: CGO_ENABLED=1 go test -race ./..., just build, and the server smoke script.

W2: Client key-auth transport and local SSH keys

Files: internal/textlog/client.go, internal/textlog/client_test.go, internal/textlog/types.go, internal/textlog/types_test.go, new internal/sshkey/*, and go.mod/go.sum. Do not edit TUI, docs, command, or config files.

Deliverables:

Verification: go test -race ./internal/textlog ./internal/sshkey.

W3: TUI key-login flow

Depends on W2. Files: internal/tui/backend.go, internal/tui/backend_test.go, internal/tui/model.go, internal/tui/model_test.go, and internal/tui/view.go. Do not edit client, SSH-key, config, docs, or command files.

Deliverables:

Verification: go test -race ./internal/tui.

Integration and acceptance

Handled after W1-W3. Add durable client API/usage documentation, then run two real TUI backends against a temporary server/database using generated keys. The acceptance test registers two accounts, logs both in, creates a post and reply, follows, observes feeds/activity, searches, blocks, and revokes sessions. Run all tests in both repositories and remove this completed plan.