Skip to main content
← rust.krizaka.comkrizaka.com

Crate krizaka_rust

Crate krizaka_rust 

Source
Expand description

What every Krizaka macOS app (Tauri 2) shares, with no dependency on Tauri itself so it is tested without a window. The Tauri glue that wires these rules into an app is the tauri-plugin-krizaka crate of this repository.

  • scope: the folder grants. A path is readable only inside a folder the user granted, compared on canonical paths.
  • files: listing and previewing inside a grant.
  • access: who may read what: the granted folders, and the files dropped on the window this session.
  • nav_guard: a window stays on the app’s own places; a web link elsewhere opens in the browser.
  • deep_link: product://… and the product’s web links become a route inside the app, or are refused.
  • menu: the native menu bar the page describes, checked before it is built.
  • secrets: small secrets (the session token) and their rules; the Keychain store is in the plugin.
  • device_flow: the OAuth device flow (GitHub first) with the tokens in the Keychain, refreshed, signed out locally.
  • settings: small JSON files written atomically.
  • update: the update channel (stable, beta) and its feed.

Modules§

access
Who may read what: the folders the person granted, and the files they dropped on the window this session.
deep_link
Deep links: verikora://app/bibliotheque/bail?tags=2026 or https://www.verikora.com/app/bibliotheque/bail opens the same screen as the web (the URL is the state). A link becomes a route inside the app (/app/bibliotheque/bail?tags=2026) or is refused; it is never a place the window navigates to.
device_flow
OAuth device flow (RFC 8628) for a Mac app that signs in to a provider (GitHub first: a GitHub App’s user-to-server token), with no client secret on the Mac. The rules live here, with no network: the app gives a Transport (one form POST that answers JSON), and the tokens are kept through crate::secrets::SecretStore (the Keychain), on the Rust side only — the page sees Session (connected as whom), never a token.
files
Listing and previewing files — always through the scope (ScopeStore::resolve), never directly.
keychain
Small secrets in the macOS Keychain: one generic password per key, service = the app’s bundle id, account = the key. Never a file, never the page’s storage.
menu
The native menu bar, described by the page (krizaka-ui ADR-002: « desktop is the web in a window »).
nav_guard
The navigation guard: a window stays on the app’s own pages (its local page, or the hosted web app it shows); a web link elsewhere opens in the person’s browser; anything else is refused.
scope
The folder scope — the heart of the app’s least-privilege file access.
secrets
Small secrets of a Mac app (the session token first of all: the bearer the product’s API gave at sign in, the same kind the mobile apps hold), in the macOS Keychain — never a file, never the page’s storage. The page sees it as the KeyValueStorage port of @krizaka/app-client, so the Mac apps use the same session store and API client as the mobile ones. This module holds the rules every store follows, and an in-memory store for tests.
settings
A small JSON file in the app’s data folder (the scope, the app’s settings), read leniently and written atomically.
update
The update channel of a Mac app: stable by default, beta when the person (or the product’s admin) chooses it.