Keybase Client

repository·master·Indexed 27 days ago

https://github.com/keybase/client

Client applications for Keybase, a platform for secure, encrypted communication and file sharing. This repository includes the core Go-based cryptographic services, communication protocols, and clients for macOS, Windows, Linux, iOS, and Android. It contains documentation for the Keybase Browser Extension, the Keybase Filesystem (KBFS) including kbfsfuse and kbfsdokan, and the kbnm native messaging client.

Tokens
65.9K
Snippets
210
Records
458
Agent score
94%

What's inside keybase-client

  1. Overview of the Updater library

    master

    The updater library provides a cross-platform (OS X, Windows, Linux) mechanism for performing background and on-demand updates. It is designed to be simple, secure, and resilient, featuring timeouts for all requests/commands, recovery from non-fatal errors, and the ability to run as an unprivileged background service.

    Warning: This library is currently intended for Keybase-specific use and is not yet ready for general non-Keybase libraries.

  2. Overview of kbnm (Keybase Native Messaging)

    master
    kbnm is a lightweight shim designed to bridge communication between the Keybase daemon and browser extensions. It facilitates the native messaging protocol required for browser-based Keybase features to interact with the local Keybase service.
  3. Overview of the Watchdog process manager

    master

    The Watchdog is a process management utility designed to ensure a specific list of programs remain running. It acts as a parent process to the monitored programs.

    Key behaviors include:

    • Lifecycle Management: If the Watchdog process is terminated, all monitored programs are also terminated.
    • Startup Cleanup: Upon startup, the Watchdog automatically kills any existing instances of the programs it is configured to monitor to ensure a clean state.
    • Automatic Restarts: The Watchdog monitors the list of programs and automatically restarts them if they exit.
    • Configurable Exit Logic: Programs can be configured with different behaviors: they can be set to always run (restarting on any exit) or to stop if they exit with a specific status code.
  4. Differentiate between Typing and Draft states

    master

    Keybase maintains intentional dualities for typing and draft states to support both active conversation and inbox views:

    • Typing State:
      • The Thread Store maintains a live Set<string> of users currently typing in the active conversation.
      • The Inbox Store (typing-state.tsx) maintains a map used to compute a typingSnippet (e.g., "X is typing...") for unopened conversation rows.
    • Draft State:
      • The Composer (input-state.tsx) maintains unsentText as local, per-conversation UI state that is cleared on unmount.
      • The Inbox Metadata Store maintains meta.draft, which is the last draft synced to the service, used to show draft snippets on inbox rows for conversations not currently being viewed.
  5. Understand Inbox Conversation Types and Modes

    master

    Conversations are categorized into two types:

    • Small: Adhoc conversations or teams with only the #general channel.
    • Big: Teams with multiple channels.

    Inbox Modes:

    • Filtered Mode: Driven by a filter string. Items are sorted by score (exact match > prefix match > substring match), showing small items before big items.
    • Normal Mode: Split into two sections:
      1. Small rows sorted by timestamp.
      2. Big teams sorted alphabetically (by team, then channel).

    Unboxing: Untrusted conversations (those without snippets or verified participants) are requested to be "unboxed" (converted to trusted) via a queue (queueMetaToRequest) as rows scroll into view.

  6. Use fsrpc for KBFS RPC operations

    master
    The fsrpc package provides RPC (Remote Procedure Call) interfaces that connected clients can use to interact with the Keybase Filesystem (KBFS). It allows clients to perform filesystem operations, such as listing files, through a structured RPC mechanism.
  7. Use the kbfs/env package to implement libkbfs.Context

    master
    The go/kbfs/env package provides an implementation of the libkbfs.Context interface by leveraging libkb. This allows developers to bridge Keybase Filesystem (KBFS) context requirements with the underlying Keybase library functionality.
  8. Use AVDL Variants (Tagged Unions)

    master
    AVDL supports variants (also known as discriminated, tagged, or disjoint unions). This allows a single data type to represent one of several different types explicitly and type-safely. Instead of using records with multiple nullable pointers, a variant uses a selector (an enum) to determine which specific type is currently held by the structure.
  9. Use spotty to read the current TTY

    master
    The spotty module is a Go port of keybase/node-spotty. It provides a mechanism to read from the current TTY (teletypewriter) on both Linux and OSX. This is useful for interactive CLI applications that need to capture input directly from the terminal device.
  10. Understand Keybase prerelease versioning

    master

    Keybase uses semantic versioning (e.g., 1.2.3, 1.2.3-400, or 1.2.3-400+comment).

    Prerelease builds are managed via the libkb.PrereleaseBuild ldflag at compile time. The scripts use a timestamp format +%Y%m%d%H%M%S (e.g., 20151215102019) for the prerelease info. This ensures builds are human-readable, ordered numerically to prevent downgrades, and do not require manual build number increments in the repository. A comment field containing a short SHA of the last commit is also appended to identify the specific git history point.