feat(app): add the Nostro app, a window for phones and desktops
Linux phones have no banking apps, and a command line is no answer on a phone. The app does everything the nostro command does and, like it, only talks to nostrod: it holds no key and no token. - Nostro.Ui, a toolkit whose screens are functions that fill a frame, ported from imsd-messages ca5cd72d; Nostro.App, the app's state, forms and screens; Nostro.Ui.Shell, which puts them on a Wayland window with Crafter.Graphics; nostro-app; and Nostro.DebugCommands for the --debug-api build. - Client: every method also in an asynchronous form for an sd-event loop, with DaemonMissing and OutcomeUnknown. - nostrod's Flatpak is net.catcrafts.Nostrod now and the app takes net.catcrafts.Nostro; install.sh moves the state. The app's Flatpak, both Flatpaks cross-built for aarch64, and the licence texts they carry. - nostro-fake-system, a made-up bus and bank with a real nostrod on them, to look at the app against. The README's screenshots are taken on it. - The nostro command: an API key's environment is the key's own to say, so --sandbox is for bunq-oauth alone, and a virtual card is listed as VIRTUAL. The published contract changes in three places, before any release (design rule 10): - Transactions' query takes `stored`: answered from what nostrod has stored, without asking the bank. The app searches with it; before, every search was a call to bunq. - AddBunq's `environment` no longer chooses over what the key says of itself: a key of the other environment is refused. - SetCardStatus refuses to freeze or unfreeze a virtual card. bunq reports one as DEACTIVATED however well it pays, and leaves it as it is when asked, without an error. The app is GPL-3.0-only, the library stays LGPL-3.0-only, and no code moved from one to the other (design rule 13). Transaction's schema is unchanged. Verified: the 17 tests pass with every line, function and region of what they link run, and the five lint runs are clean. Every screen was looked at on the made-up system, at a phone's and a desktop's sizes in the light and the dark look, on Plasma under Wayland. What is said of bunq's cards comes from its sandbox, with throwaway users, and from one real virtual card. Known to have been used against production: connecting, and reading accounts, payments and cards. Not known to have been tried: a payment from the app against bunq, OAuth against bunq, and anything on a phone. Building the app takes --graphics=, a Crafter.Graphics checkout on its branch claude/nostro-app, until that branch is merged and pinned here. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
parent
1ea50c50bc
commit
5b4037955b
106 changed files with 17804 additions and 289 deletions
57
interfaces/Nostro.App-Banks.cppm
Normal file
57
interfaces/Nostro.App-Banks.cppm
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
export module Nostro.App:Banks;
|
||||
|
||||
import std;
|
||||
|
||||
// The banks the app can connect, and what is a bank's own: its name, the ways a connection to it is made, and what
|
||||
// each way lets a connection do. The settings are built from this: adding a connection lists the banks, a bank lists
|
||||
// its ways, and each way has a form of its own (bunq's are in Nostro.App-Bunq.cpp). Nothing else in the app names a
|
||||
// bank or a way: every other screen says "your bank", and asks here what a connection can do. A bank and a way are
|
||||
// found by what nostrod calls them, and one that nostrod has and this app does not know is shown by that name.
|
||||
|
||||
export namespace Nostro::App {
|
||||
// The form a way is filled in on. One for each way of each bank: what a bank asks for is its own.
|
||||
enum class ConnectForm : std::uint8_t {
|
||||
BunqKey,
|
||||
BunqOAuth
|
||||
};
|
||||
|
||||
// One way to connect to a bank.
|
||||
struct Way {
|
||||
std::string_view key; // names it in a route and a region: "key"
|
||||
std::string_view auth; // what nostrod calls a connection made this way (ConnectorSummary::auth): "api key"
|
||||
std::string_view title; // "API key"
|
||||
std::string_view about; // what it gives and what it takes, in a line for under its title
|
||||
std::string_view revoke; // what stays valid at the bank once a connection is removed, and where it is revoked
|
||||
ConnectForm form = ConnectForm::BunqKey;
|
||||
// A connection made this way pays between the user's own accounts and nobody else. What it cannot pay it can
|
||||
// save as a draft, so this is for a bank that has drafts.
|
||||
bool ownAccountsOnly = false;
|
||||
};
|
||||
|
||||
struct Bank {
|
||||
std::string_view id; // what nostrod calls it (ConnectorSummary::bank): "bunq"
|
||||
std::string_view name; // as the bank writes its own name
|
||||
std::span<const Way> ways;
|
||||
};
|
||||
|
||||
// The banks the app can connect, in the order they are offered.
|
||||
std::span<const Bank> Banks() noexcept;
|
||||
// The bank nostrod calls `id`; null for one this app does not know.
|
||||
const Bank* FindBank(std::string_view id) noexcept;
|
||||
// The way a connection to that bank was made, by what nostrod calls the bank and the way; null for one this app
|
||||
// does not know.
|
||||
const Way* FindWay(std::string_view bank, std::string_view auth) noexcept;
|
||||
|
||||
// A bank's name as it writes it, and what nostrod calls it for one this app does not know.
|
||||
std::string BankName(std::string_view id);
|
||||
// How a connection was made, in words: "API key", and what nostrod calls it for a way this app does not know.
|
||||
std::string WayName(std::string_view bank, std::string_view auth);
|
||||
// Whether a connection made that way pays between the user's own accounts only. Not that the app knows of, for a
|
||||
// way it does not know: nostrod refuses what such a connection cannot do.
|
||||
bool OwnAccountsOnly(std::string_view bank, std::string_view auth) noexcept;
|
||||
// What a connection was made with stays valid at the bank when the connection is removed: where to revoke it.
|
||||
std::string Revoking(std::string_view bank, std::string_view auth);
|
||||
}
|
||||
Loading…
Reference in a new issue