Nostro/implementations/Nostro.App-Format.cpp

216 lines
9.5 KiB
C++
Raw Normal View History

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>
2026-11-19 12:27:14 +01:00
// SPDX-License-Identifier: GPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
module Nostro.App:Format_impl;
import std;
import Nostro;
fix: close what the security review before the first release found A review of the tree and its history before they are published found no key and no bank data in them. It did find these, each closed here. The password dialog could be emptied (daemon). Shown(), which makes a payee's name fit for polkit's dialog, let an & through. GNOME's older agent (polkit-gnome) and MATE's put the message into Pango markup unescaped, where a bare & fails to parse and leaves the dialog without a message: paying "Tom & Jerry", or an order an app names so at checkout, asked for the password and showed no amount and no payee. Line and paragraph separators passed too. Shown() now shows & as +, leaves out what draws nothing or places text (control and format characters, the separators, what Unicode ignores by default, private use) and makes any run of spaces one space. An address is held to it instead of made fit: an e-mail address the dialog could not show unchanged is refused before anyone is asked, since "a&b@..." shown as "a+b@..." is somebody else's address. A refused caller could look (daemon). A call that names an account, a card, a request, a draft or a connector had it looked up, at the bank where that takes it, before polkit was asked. So a caller polkit refused was told whether it was there ("no account is called ..."), and had the bank asked. Such a call now asks for View first (HandleLookup), a call that only sees looks its account up after its yes, and the connectors are read, which refreshes the accounts at the bank, on the first yes instead of on the first call. An app at checkout was told too much (checkout). The refusal of an order's reference with another amount named the amount on record, and a refusal by the bank carried the call it answered, whose path has the user's and the account's ids at bunq. Neither does now. A key typed by hand could be read off the screen (app). The line under a key field showed how the key begins and its last four characters, which is every character of it as it is typed. It shows how the key begins and how long it is. Every change asks for the password (packaging, app). Change, the action for what changes something and pays nobody, passed without a password in an active session, so any program of the user's could cancel a scheduled payment, ask for money in their name or freeze a card. It asks now (auth_self), a draft saved and a card frozen included: only View passes as shipped, and loosening is an administrator's rule, of which the README has an example. The app says of every change where it is confirmed (AsksPassword is gone), and the request form sends on its button as the pay form does: its review sheet would be a second confirmation of what the dialog confirms. What is built is what was tested (build). Crafter.Network, Crafter.DB and Crafter.LintRules are named at the commits the tests ran against. Crafter.Thread still follows its branch, which Crafter.Network's own project file names, and so does Crafter.Network in the app's debug build, where Crafter.Debug names it too and crafter-build refuses a module built twice. lib/json.hpp was nlohmann/json's develop branch at 95e9a593 less its last newline, and called 3.12.0: it is that file byte for byte now, and called what it is. The published contract changes with this, before any release (design rule 10): an e-mail address the dialog cannot show as it is is refused, a call that looks something up needs View as well as its own action, the checkout's errors say less, and the policy asks for the password for Change. The XML, the policy and ShouldServeEveryUser, which now holds the policy to its defaults, change together. Reproduced and verified on the fake bus and the fake bunq. The new checks of ShouldServeEveryUser fail on the worker of before (50 of them: the & shown, the lookups answered, the bank asked) and pass now. crafter-build test (17 tests), lint for the library, the app and the fake system, and tests/coverage.sh (every line, function and region) pass. Looked at on the made-up system, 360x760 dp at scale 2, dark, on KDE Wayland: the key form with a key typed, the request form with its wait and its result, a card frozen, and About. No picture in the README shows a screen that changed. Not tried: bunq's sandbox, a real polkit agent, the Flatpak builds. The README's example rule ran against a stand-in for polkit's rule engine only. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
2026-11-19 16:09:48 +01:00
import Nostro.Ui;
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>
2026-11-19 12:27:14 +01:00
import :Format;
using namespace Nostro;
namespace {
constexpr std::array<std::string_view, 12> months = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
constexpr std::array<std::string_view, 7> weekdays = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
// A moment as the user's clock and calendar show it.
std::tm Local(std::chrono::system_clock::time_point time) {
const std::time_t seconds = std::chrono::system_clock::to_time_t(time);
return *std::localtime(&seconds);
}
std::int64_t DayOf(const std::tm& local) {
return static_cast<std::int64_t>(local.tm_year + 1900) * 1000 + local.tm_yday;
}
std::string_view Month(const std::tm& local) {
return months[static_cast<std::size_t>(local.tm_mon)];
}
// The bank's capitals and underscores as words: "PIN_TRIES_EXCEEDED" is "Pin tries exceeded", and "sandbox" is
// "Sandbox".
std::string Words(std::string_view shouted) {
std::string words;
for(const char c : shouted) {
if(c == '_') {
words += ' ';
} else if(c >= 'A' && c <= 'Z' && !words.empty()) {
words += static_cast<char>(c - 'A' + 'a');
} else if(c >= 'a' && c <= 'z' && words.empty()) {
words += static_cast<char>(c - 'a' + 'A');
} else {
words += c;
}
}
return words;
}
}
std::string App::GroupIban(std::string_view iban) {
const auto letter = [](char c) { return c >= 'A' && c <= 'Z'; };
const auto digit = [](char c) { return c >= '0' && c <= '9'; };
// A country, two check digits, and letters and digits after them: an e-mail address or a name is left alone.
if(iban.size() < 5 || !letter(iban[0]) || !letter(iban[1]) || !digit(iban[2]) || !digit(iban[3]) || !std::ranges::all_of(iban, [&letter, &digit](char c) { return letter(c) || digit(c); })) {
return std::string(iban);
}
std::string grouped;
for(std::size_t i = 0; i < iban.size(); i++) {
if(i > 0 && i % 4 == 0) {
grouped += ' ';
}
grouped += iban[i];
}
return grouped;
}
std::string App::AccountKey(const Account& account) {
return account.iban.empty() ? account.name : account.iban;
}
std::string App::PartyName(const BunqLabel& party) {
if(!party.name.empty()) {
return party.name;
}
return party.iban.empty() ? std::string("Unknown") : GroupIban(party.iban);
}
std::string App::PartyName(const BunqCounterparty& party) {
return party.name.empty() ? GroupIban(party.value) : party.name;
}
std::string App::Money(std::int64_t minor, Currency currency) {
std::string money = FormatMoney(minor, currency);
// A comma before every three digits of the whole part, from its end.
const std::size_t point = std::min(money.find('.'), money.size());
std::size_t first = point;
while(first > 0 && money[first - 1] >= '0' && money[first - 1] <= '9') {
first--;
}
for(std::size_t at = point; at > first + 3;) {
at -= 3;
money.insert(at, 1, ',');
}
return money;
}
std::string App::SignedMoney(std::int64_t minor, Currency currency) {
return minor > 0 ? std::format("+{}", Money(minor, currency)) : Money(minor, currency);
}
std::int64_t App::LocalDay(std::chrono::system_clock::time_point time) {
return DayOf(Local(time));
}
std::string App::DayLabel(std::chrono::system_clock::time_point time, std::chrono::system_clock::time_point now) {
const std::tm local = Local(time);
const std::tm today = Local(now);
if(DayOf(local) == DayOf(today)) {
return "Today";
}
// The day before by the calendar, from its noon: a day is 23 or 25 hours long where the clocks change.
std::tm before = today;
before.tm_mday -= 1;
before.tm_hour = 12;
before.tm_isdst = -1;
std::mktime(&before);
if(DayOf(local) == DayOf(before)) {
return "Yesterday";
}
const std::string day = std::format("{} {} {}", weekdays[static_cast<std::size_t>(local.tm_wday)], local.tm_mday, Month(local));
return local.tm_year == today.tm_year ? day : std::format("{} {}", day, local.tm_year + 1900);
}
std::string App::ShortDate(std::chrono::system_clock::time_point time, std::chrono::system_clock::time_point now) {
const std::tm local = Local(time);
const std::string day = std::format("{} {}", local.tm_mday, Month(local).substr(0, 3));
return local.tm_year == Local(now).tm_year ? day : std::format("{} {}", day, local.tm_year + 1900);
}
std::string App::ClockTime(std::chrono::system_clock::time_point time) {
const std::tm local = Local(time);
return std::format("{:02}:{:02}", local.tm_hour, local.tm_min);
}
std::string App::FullTime(std::chrono::system_clock::time_point time) {
const std::tm local = Local(time);
return std::format("{} {} {}, {:02}:{:02}", local.tm_mday, Month(local), local.tm_year + 1900, local.tm_hour, local.tm_min);
}
std::string App::DateInput(std::chrono::system_clock::time_point time) {
const std::tm local = Local(time);
return std::format("{:04}-{:02}-{:02}", local.tm_year + 1900, local.tm_mon + 1, local.tm_mday);
}
std::string App::KindLabel(std::string_view kind) {
// A type and a sub type, "MASTERCARD/PAYMENT", as the bank's connector stored them: the type says how the money
// moved. These are the kinds the app has words for; any other is said as the bank says it.
const std::string_view type = kind.substr(0, kind.find('/'));
static constexpr std::array<std::pair<std::string_view, std::string_view>, 6> known = {{
{"MASTERCARD", "Card payment"}, {"EBA_SDD", "Direct debit"}, {"EBA_SCT", "Bank transfer"},
{"IDEAL", "iDEAL"}, {"SOFORT", "Sofort"}, {"SWIFT", "International transfer"},
}};
const auto found = std::ranges::find(known, type, &std::pair<std::string_view, std::string_view>::first);
if(found != known.end()) {
return std::string(found->second);
}
// bunq's own type, for what stays inside it: a payment between two of its accounts, or of a request.
if(type == "BUNQ") {
return kind == "BUNQ/REQUEST" ? "Paid request" : "Payment within the bank";
}
return std::string(kind);
}
std::string App::StatusLabel(std::string_view status) {
return Words(status);
}
std::string App::CardProduct(std::string_view productType) {
return Words(productType);
}
std::string App::CardExpiry(std::string_view expiry) {
// The bank's day, YYYY-MM-DD: a card's face has the month and the last two digits of the year.
static constexpr std::array<std::size_t, 8> digits = {0, 1, 2, 3, 5, 6, 8, 9};
const bool day = expiry.size() == 10 && expiry[4] == '-' && expiry[7] == '-' && std::ranges::all_of(digits, [expiry](std::size_t at) { return expiry[at] >= '0' && expiry[at] <= '9'; });
return day ? std::format("{}/{}", expiry.substr(5, 2), expiry.substr(2, 2)) : std::string(expiry);
}
std::string App::ScheduleLabel(const BunqSchedule& schedule, std::chrono::system_clock::time_point now) {
// The day, and the time on it when that is not its midnight.
const auto moment = [now](std::chrono::system_clock::time_point time) {
const std::tm local = Local(time);
return local.tm_hour == 0 && local.tm_min == 0 ? ShortDate(time, now) : std::format("{}, {}", ShortDate(time, now), ClockTime(time));
};
if(schedule.unit == "ONCE") {
return std::format("Once on {}", moment(schedule.start));
}
static constexpr std::array<std::pair<std::string_view, std::string_view>, 5> units = {{
{"HOURLY", "hour"}, {"DAILY", "day"}, {"WEEKLY", "week"}, {"MONTHLY", "month"}, {"YEARLY", "year"},
}};
const auto found = std::ranges::find(units, schedule.unit, &std::pair<std::string_view, std::string_view>::first);
// A unit the bank has and this does not know yet is said as the bank says it.
const std::string unit = found != units.end() ? std::string(found->second) : Words(schedule.unit);
std::string label = schedule.every == 1 ? std::format("Every {} from {}", unit, moment(schedule.start)) : std::format("Every {} {}s from {}", schedule.every, unit, moment(schedule.start));
if(schedule.end) {
label += std::format(" until {}", moment(*schedule.end));
}
return label;
}
std::string App::Fingerprint(std::string_view secret) {
fix: close what the security review before the first release found A review of the tree and its history before they are published found no key and no bank data in them. It did find these, each closed here. The password dialog could be emptied (daemon). Shown(), which makes a payee's name fit for polkit's dialog, let an & through. GNOME's older agent (polkit-gnome) and MATE's put the message into Pango markup unescaped, where a bare & fails to parse and leaves the dialog without a message: paying "Tom & Jerry", or an order an app names so at checkout, asked for the password and showed no amount and no payee. Line and paragraph separators passed too. Shown() now shows & as +, leaves out what draws nothing or places text (control and format characters, the separators, what Unicode ignores by default, private use) and makes any run of spaces one space. An address is held to it instead of made fit: an e-mail address the dialog could not show unchanged is refused before anyone is asked, since "a&b@..." shown as "a+b@..." is somebody else's address. A refused caller could look (daemon). A call that names an account, a card, a request, a draft or a connector had it looked up, at the bank where that takes it, before polkit was asked. So a caller polkit refused was told whether it was there ("no account is called ..."), and had the bank asked. Such a call now asks for View first (HandleLookup), a call that only sees looks its account up after its yes, and the connectors are read, which refreshes the accounts at the bank, on the first yes instead of on the first call. An app at checkout was told too much (checkout). The refusal of an order's reference with another amount named the amount on record, and a refusal by the bank carried the call it answered, whose path has the user's and the account's ids at bunq. Neither does now. A key typed by hand could be read off the screen (app). The line under a key field showed how the key begins and its last four characters, which is every character of it as it is typed. It shows how the key begins and how long it is. Every change asks for the password (packaging, app). Change, the action for what changes something and pays nobody, passed without a password in an active session, so any program of the user's could cancel a scheduled payment, ask for money in their name or freeze a card. It asks now (auth_self), a draft saved and a card frozen included: only View passes as shipped, and loosening is an administrator's rule, of which the README has an example. The app says of every change where it is confirmed (AsksPassword is gone), and the request form sends on its button as the pay form does: its review sheet would be a second confirmation of what the dialog confirms. What is built is what was tested (build). Crafter.Network, Crafter.DB and Crafter.LintRules are named at the commits the tests ran against. Crafter.Thread still follows its branch, which Crafter.Network's own project file names, and so does Crafter.Network in the app's debug build, where Crafter.Debug names it too and crafter-build refuses a module built twice. lib/json.hpp was nlohmann/json's develop branch at 95e9a593 less its last newline, and called 3.12.0: it is that file byte for byte now, and called what it is. The published contract changes with this, before any release (design rule 10): an e-mail address the dialog cannot show as it is is refused, a call that looks something up needs View as well as its own action, the checkout's errors say less, and the policy asks for the password for Change. The XML, the policy and ShouldServeEveryUser, which now holds the policy to its defaults, change together. Reproduced and verified on the fake bus and the fake bunq. The new checks of ShouldServeEveryUser fail on the worker of before (50 of them: the & shown, the lookups answered, the bank asked) and pass now. crafter-build test (17 tests), lint for the library, the app and the fake system, and tests/coverage.sh (every line, function and region) pass. Looked at on the made-up system, 360x760 dp at scale 2, dark, on KDE Wayland: the key form with a key typed, the request form with its wait and its result, a card frozen, and About. No picture in the README shows a screen that changed. Not tried: bunq's sandbox, a real polkit agent, the Flatpak builds. The README's example rule ran against a stand-in for polkit's rule engine only. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
2026-11-19 16:09:48 +01:00
const std::size_t characters = Ui::CountCodepoints(secret);
const std::string length = characters == 1 ? std::string("1 character") : std::format("{} characters", characters);
// How it begins: up to its first underscore, which is where a bunq key says what it is for ("sandbox_"), and the
// four characters after that. Never how it ends: the end of what is in the field is what was typed last, so
// showing it would show every character of a key typed by hand, one after the other, to whoever watches.
const std::size_t mark = secret.find('_');
std::size_t begins = mark != std::string_view::npos && mark < 12 ? mark + 1 : 0;
for(std::size_t i = 0; i < 4; i++) {
begins = Ui::NextCodepoint(secret, begins);
}
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>
2026-11-19 12:27:14 +01:00
// Too short to show a part of without showing most of it.
fix: close what the security review before the first release found A review of the tree and its history before they are published found no key and no bank data in them. It did find these, each closed here. The password dialog could be emptied (daemon). Shown(), which makes a payee's name fit for polkit's dialog, let an & through. GNOME's older agent (polkit-gnome) and MATE's put the message into Pango markup unescaped, where a bare & fails to parse and leaves the dialog without a message: paying "Tom & Jerry", or an order an app names so at checkout, asked for the password and showed no amount and no payee. Line and paragraph separators passed too. Shown() now shows & as +, leaves out what draws nothing or places text (control and format characters, the separators, what Unicode ignores by default, private use) and makes any run of spaces one space. An address is held to it instead of made fit: an e-mail address the dialog could not show unchanged is refused before anyone is asked, since "a&b@..." shown as "a+b@..." is somebody else's address. A refused caller could look (daemon). A call that names an account, a card, a request, a draft or a connector had it looked up, at the bank where that takes it, before polkit was asked. So a caller polkit refused was told whether it was there ("no account is called ..."), and had the bank asked. Such a call now asks for View first (HandleLookup), a call that only sees looks its account up after its yes, and the connectors are read, which refreshes the accounts at the bank, on the first yes instead of on the first call. An app at checkout was told too much (checkout). The refusal of an order's reference with another amount named the amount on record, and a refusal by the bank carried the call it answered, whose path has the user's and the account's ids at bunq. Neither does now. A key typed by hand could be read off the screen (app). The line under a key field showed how the key begins and its last four characters, which is every character of it as it is typed. It shows how the key begins and how long it is. Every change asks for the password (packaging, app). Change, the action for what changes something and pays nobody, passed without a password in an active session, so any program of the user's could cancel a scheduled payment, ask for money in their name or freeze a card. It asks now (auth_self), a draft saved and a card frozen included: only View passes as shipped, and loosening is an administrator's rule, of which the README has an example. The app says of every change where it is confirmed (AsksPassword is gone), and the request form sends on its button as the pay form does: its review sheet would be a second confirmation of what the dialog confirms. What is built is what was tested (build). Crafter.Network, Crafter.DB and Crafter.LintRules are named at the commits the tests ran against. Crafter.Thread still follows its branch, which Crafter.Network's own project file names, and so does Crafter.Network in the app's debug build, where Crafter.Debug names it too and crafter-build refuses a module built twice. lib/json.hpp was nlohmann/json's develop branch at 95e9a593 less its last newline, and called 3.12.0: it is that file byte for byte now, and called what it is. The published contract changes with this, before any release (design rule 10): an e-mail address the dialog cannot show as it is is refused, a call that looks something up needs View as well as its own action, the checkout's errors say less, and the policy asks for the password for Change. The XML, the policy and ShouldServeEveryUser, which now holds the policy to its defaults, change together. Reproduced and verified on the fake bus and the fake bunq. The new checks of ShouldServeEveryUser fail on the worker of before (50 of them: the & shown, the lookups answered, the bank asked) and pass now. crafter-build test (17 tests), lint for the library, the app and the fake system, and tests/coverage.sh (every line, function and region) pass. Looked at on the made-up system, 360x760 dp at scale 2, dark, on KDE Wayland: the key form with a key typed, the request form with its wait and its result, a card frozen, and About. No picture in the README shows a screen that changed. Not tried: bunq's sandbox, a real polkit agent, the Flatpak builds. The README's example rule ran against a stand-in for polkit's rule engine only. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
2026-11-19 16:09:48 +01:00
if(Ui::CountCodepoints(secret.substr(begins)) < 12) {
return length;
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>
2026-11-19 12:27:14 +01:00
}
fix: close what the security review before the first release found A review of the tree and its history before they are published found no key and no bank data in them. It did find these, each closed here. The password dialog could be emptied (daemon). Shown(), which makes a payee's name fit for polkit's dialog, let an & through. GNOME's older agent (polkit-gnome) and MATE's put the message into Pango markup unescaped, where a bare & fails to parse and leaves the dialog without a message: paying "Tom & Jerry", or an order an app names so at checkout, asked for the password and showed no amount and no payee. Line and paragraph separators passed too. Shown() now shows & as +, leaves out what draws nothing or places text (control and format characters, the separators, what Unicode ignores by default, private use) and makes any run of spaces one space. An address is held to it instead of made fit: an e-mail address the dialog could not show unchanged is refused before anyone is asked, since "a&b@..." shown as "a+b@..." is somebody else's address. A refused caller could look (daemon). A call that names an account, a card, a request, a draft or a connector had it looked up, at the bank where that takes it, before polkit was asked. So a caller polkit refused was told whether it was there ("no account is called ..."), and had the bank asked. Such a call now asks for View first (HandleLookup), a call that only sees looks its account up after its yes, and the connectors are read, which refreshes the accounts at the bank, on the first yes instead of on the first call. An app at checkout was told too much (checkout). The refusal of an order's reference with another amount named the amount on record, and a refusal by the bank carried the call it answered, whose path has the user's and the account's ids at bunq. Neither does now. A key typed by hand could be read off the screen (app). The line under a key field showed how the key begins and its last four characters, which is every character of it as it is typed. It shows how the key begins and how long it is. Every change asks for the password (packaging, app). Change, the action for what changes something and pays nobody, passed without a password in an active session, so any program of the user's could cancel a scheduled payment, ask for money in their name or freeze a card. It asks now (auth_self), a draft saved and a card frozen included: only View passes as shipped, and loosening is an administrator's rule, of which the README has an example. The app says of every change where it is confirmed (AsksPassword is gone), and the request form sends on its button as the pay form does: its review sheet would be a second confirmation of what the dialog confirms. What is built is what was tested (build). Crafter.Network, Crafter.DB and Crafter.LintRules are named at the commits the tests ran against. Crafter.Thread still follows its branch, which Crafter.Network's own project file names, and so does Crafter.Network in the app's debug build, where Crafter.Debug names it too and crafter-build refuses a module built twice. lib/json.hpp was nlohmann/json's develop branch at 95e9a593 less its last newline, and called 3.12.0: it is that file byte for byte now, and called what it is. The published contract changes with this, before any release (design rule 10): an e-mail address the dialog cannot show as it is is refused, a call that looks something up needs View as well as its own action, the checkout's errors say less, and the policy asks for the password for Change. The XML, the policy and ShouldServeEveryUser, which now holds the policy to its defaults, change together. Reproduced and verified on the fake bus and the fake bunq. The new checks of ShouldServeEveryUser fail on the worker of before (50 of them: the & shown, the lookups answered, the bank asked) and pass now. crafter-build test (17 tests), lint for the library, the app and the fake system, and tests/coverage.sh (every line, function and region) pass. Looked at on the made-up system, 360x760 dp at scale 2, dark, on KDE Wayland: the key form with a key typed, the request form with its wait and its result, a card frozen, and About. No picture in the README shows a screen that changed. Not tried: bunq's sandbox, a real polkit agent, the Flatpak builds. The README's example rule ran against a stand-in for polkit's rule engine only. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
2026-11-19 16:09:48 +01:00
return std::format("{}… {}", secret.substr(0, begins), length);
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>
2026-11-19 12:27:14 +01:00
}