2026-11-01 18:35:23 +01:00
// SPDX-License-Identifier: LGPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
module ;
# include <systemd/sd-bus.h>
# include <systemd/sd-event.h>
# include <systemd/sd-id128.h>
# include <signal.h>
# include <sys/prctl.h>
# include <time.h>
# include <unistd.h>
module Nostro : DaemonWorker_impl ;
import std ;
import Crafter . DB ;
import Nostro . Checkout ;
import : Daemon ;
import : Bus ;
import : Account ;
import : Bunq ;
import : Connector ;
import : Currency ;
import : File ;
import : Transaction ;
import : Utils ;
using namespace Nostro ;
using namespace Nostro : : Bus ;
using namespace Crafter ;
namespace fs = std : : filesystem ;
// One user's worker. Every call is read and checked first (the account, the counterparty, what is to be paid), then
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
// polkit decides with a summary built from the worker's own data, and only then does the call run. On nostrod's own
// interface nothing of the user's is read, and the bank is asked nothing, for a caller polkit has not said yes to: a
// call that must look something up to word its question asks first whether the caller may see the accounts
// (HandleLookup). The checkout is the one that reads before it asks: an order it knows is answered from its record,
// and the account that pays a new one is chosen for the dialog to name (OnPay). The wire carries bunq's types, so the
// worker works with bunq's connector directly.
2026-11-01 18:35:23 +01:00
namespace {
using Work = std : : function < void ( sd_bus_message * reply ) > ;
// What runs once a call that went through polkit is answered, with the answer it got.
using After = std : : function < void ( sd_bus_message * answer ) > ;
// An order paid at checkout, or being paid, which makes a retry safe. It is written before the payment is sent,
// with no payment yet, so a worker that dies or a bank whose answer is lost leaves it saying the order may have been
// paid. This is the table's schema: a change to it bumps `version` (see the Crafter.DB notes).
struct CheckoutRecord {
std : : string payee ; // the payee's IBAN, without spaces
std : : string reference ; // the app's reference for the order
std : : int64_t amount = 0 ; // in the currency's minor unit
Currency currency = Currency : : Euro ;
std : : string account ; // the IBAN it is paid from
std : : uint64_t payment = 0 ; // the bank's id of the payment, 0 while the bank's answer is unknown
std : : chrono : : system_clock : : time_point time ;
static constexpr std : : uint32_t version = 1 ;
} ;
static_assert ( DB : : Layout < CheckoutRecord > : : rowSize = = 80 ) ;
static_assert ( DB : : Layout < CheckoutRecord > : : fingerprint = = 0x87a27f8a68f38c52 ) ;
// Orders are told apart by payee and reference: an app's references are its own.
using OrderKey = std : : pair < std : : string , std : : string > ;
// An order whose call is under way, and the calls for the same order that wait for its answer.
struct Paying {
std : : int64_t amount = 0 ;
Currency currency = Currency : : Euro ;
std : : vector < MessagePtr > waiting ;
} ;
struct Worker {
DaemonOptions options ;
std : : uint32_t uid = 0 ;
std : : string name ;
fs : : path directory ;
sd_event * event = nullptr ;
// Before the connection they are registered with, which then goes first however RunWorker ends.
std : : vector < sd_bus_vtable > vtable ;
std : : vector < sd_bus_vtable > checkoutVtable ;
BusPtr link ;
BusPtr system ;
sd_event_source * idle = nullptr ;
// Why every call is refused: the directory belongs to the user this uid had before.
std : : optional < std : : string > refusal ;
bool loaded = false ;
std : : size_t checking = 0 ;
std : : uint64_t checks = 0 ;
// The checkouts paid, opened with the first; and the orders being paid now.
std : : optional < DB : : Table < CheckoutRecord > > records ;
std : : map < OrderKey , Paying > paying ;
} ;
// Answered as AccessDenied.
struct Refused : std : : runtime_error {
using std : : runtime_error : : runtime_error ;
} ;
// bunq refusing a payment through an OAuth connector, which may only pay the user's own accounts.
struct OAuthPaymentRefused : std : : runtime_error {
using std : : runtime_error : : runtime_error ;
} ;
// A checkout, and no account to pay it from.
struct NoCheckoutAccount : std : : runtime_error {
using std : : runtime_error : : runtime_error ;
} ;
// The library's warnings, sent with the next answer that is not an error. The process's own, as noteSink is.
std : : vector < std : : string > notes ;
std : : uint64_t Microseconds ( std : : chrono : : seconds duration ) {
return static_cast < std : : uint64_t > ( std : : chrono : : duration_cast < std : : chrono : : microseconds > ( duration ) . count ( ) ) ;
}
void Touch ( Worker & worker ) {
sd_event_source_set_time_relative ( worker . idle , Microseconds ( worker . options . idle ) ) ;
sd_event_source_set_enabled ( worker . idle , SD_EVENT_ONESHOT ) ;
}
// Idle, and no password prompt open: the worker ends, and the front starts a new one for the next call.
std : : int32_t OnIdle ( sd_event_source * , std : : uint64_t , void * userdata ) {
Worker & worker = * static_cast < Worker * > ( userdata ) ;
if ( worker . checking = = 0 ) {
return sd_event_exit ( worker . event , 0 ) ;
}
Touch ( worker ) ;
return 0 ;
}
std : : int32_t OnFrontGone ( sd_bus_message * , void * userdata , sd_bus_error * ) {
sd_event_exit ( static_cast < Worker * > ( userdata ) - > event , 0 ) ;
return 0 ;
}
// An error answer to `call`. Making one fails only when memory runs out, and then the caller's own timeout answers.
MessagePtr ErrorReply ( sd_bus_message * call , std : : string_view name , const std : : string & message ) {
sd_bus_message * raw = nullptr ;
sd_bus_message_new_method_errorf ( call , & raw , std : : string ( name ) . c_str ( ) , " %s " , message . c_str ( ) ) ;
return MessagePtr ( raw ) ;
}
// The error a call is answered with, by what went wrong.
MessagePtr ErrorFor ( sd_bus_message * call , const std : : exception_ptr & error ) {
std : : string_view name = errorFailed ;
std : : string message ;
try {
std : : rethrow_exception ( error ) ;
} catch ( const Refused & e ) {
name = SD_BUS_ERROR_ACCESS_DENIED ;
message = e . what ( ) ;
} catch ( const NoCheckoutAccount & e ) {
name = errorNoCheckoutAccount ;
message = e . what ( ) ;
} catch ( const OAuthPaymentRefused & e ) {
name = errorOAuthCannotPay ;
message = e . what ( ) ;
} catch ( const BunqError & e ) {
name = errorBank ;
message = e . what ( ) ;
} catch ( const std : : invalid_argument & e ) {
name = errorInvalidArgument ;
message = e . what ( ) ;
} catch ( const std : : exception & e ) {
message = e . what ( ) ;
}
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
// The connector says which call went wrong, "bunq POST /user/…/monetary-account/…/payment: …", and that names
// the user and the account at the bank. An app at checkout never sees the account, so it is told what the bank
// said and whether the payment may have been made all the same, and not what was asked of the bank.
const std : : size_t said = message . find ( " : " ) ;
if ( Interface ( call ) = = Checkout : : interfaceName & & message . starts_with ( " bunq " ) & & said ! = std : : string : : npos ) {
message . replace ( 0 , said , " bunq " ) ;
}
2026-11-01 18:35:23 +01:00
return ErrorReply ( call , name , message ) ;
}
void Deliver ( const MessagePtr & answer ) {
sd_bus_send ( nullptr , answer . get ( ) , nullptr ) ;
}
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
// The most a password dialog shows of a name, a description or a reference, in characters; and of an address,
// which it shows whole: the longest an e-mail address gets.
constexpr std : : size_t shownLimit = 64 ;
constexpr std : : size_t addressLimit = 254 ;
using Range = std : : pair < std : : uint32_t , std : : uint32_t > ;
// What draws nothing, or tells the reader's own text where to go: control and format characters, the line and
// paragraph separators, what Unicode leaves out of a display by default (soft hyphens, joiners, fillers, variation
// selectors, tags), surrogates, private use, and what is no character at all.
constexpr std : : array < Range , 31 > unshown = { {
{ 0x0000 , 0x001F } , { 0x007F , 0x009F } , { 0x00AD , 0x00AD } , { 0x034F , 0x034F } , { 0x0600 , 0x0605 } , { 0x061C , 0x061C } , { 0x06DD , 0x06DD } , { 0x070F , 0x070F } ,
{ 0x0890 , 0x0891 } , { 0x08E2 , 0x08E2 } , { 0x115F , 0x1160 } , { 0x17B4 , 0x17B5 } , { 0x180B , 0x180F } , { 0x200B , 0x200F } , { 0x2028 , 0x202E } , { 0x2060 , 0x206F } ,
{ 0x3164 , 0x3164 } , { 0xD800 , 0xF8FF } , { 0xFDD0 , 0xFDEF } , { 0xFE00 , 0xFE0F } , { 0xFEFF , 0xFEFF } , { 0xFFA0 , 0xFFA0 } , { 0xFFF0 , 0xFFFC } , { 0xFFFE , 0xFFFF } ,
{ 0x110BD , 0x110BD } , { 0x110CD , 0x110CD } , { 0x13430 , 0x1343F } , { 0x1BCA0 , 0x1BCA3 } , { 0x1D173 , 0x1D17A } , { 0xE0000 , 0xE0FFF } , { 0xF0000 , 0xFFFFFFFF } ,
} } ;
// A space of any width, and the Braille pattern without a dot, which is one to the eye.
constexpr std : : array < Range , 8 > blank = { {
{ 0x0020 , 0x0020 } , { 0x00A0 , 0x00A0 } , { 0x1680 , 0x1680 } , { 0x2000 , 0x200A } , { 0x202F , 0x202F } , { 0x205F , 0x205F } , { 0x2800 , 0x2800 } , { 0x3000 , 0x3000 } ,
} } ;
bool Among ( std : : span < const Range > ranges , std : : uint32_t code ) {
return std : : ranges : : any_of ( ranges , [ code ] ( const Range & range ) { return code > = range . first & & code < = range . second ; } ) ;
}
// Text from a caller or a bank, made fit for a password dialog, which is where the user reads what a password is
// for. Nothing of `unshown`, so no text hides, turns around or starts a line of its own; a space of any kind is one
// plain space, and none leads or trails, so none pushes what follows onto another line; nothing a dialog could take
// for markup, or polkit for one of its $(…) fields; and at most `limit` characters, so a long name cannot push what
// matters out of sight. An & goes with < and >: an agent that reads its message as Pango markup, as GNOME's older
// one and MATE's do, shows nothing at all of a message with a bare & in it, the amount included.
std : : string Shown ( std : : string_view text , std : : size_t limit = shownLimit ) {
// Each character as it is shown, up to the first that does not fit, which is there to say that there is more.
std : : vector < std : : string_view > shown ;
bool spaced = false ;
2026-11-01 18:35:23 +01:00
std : : size_t i = 0 ;
// The text is UTF-8: D-Bus carries nothing else, and nlohmann's parser takes nothing else from the bank. A
// sequence is still never read past the end.
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
while ( i < text . size ( ) & & shown . size ( ) < = limit ) {
2026-11-01 18:35:23 +01:00
const std : : uint8_t lead = static_cast < std : : uint8_t > ( text [ i ] ) ;
const std : : size_t length = std : : min < std : : size_t > ( lead < 0x80 ? 1 : lead < 0xE0 ? 2 : lead < 0xF0 ? 3 : 4 , text . size ( ) - i ) ;
std : : uint32_t code = length = = 1 ? lead : lead & ( 0xFF > > ( length + 1 ) ) ;
for ( std : : size_t k = 1 ; k < length ; k + + ) {
code = ( code < < 6 ) | ( static_cast < std : : uint8_t > ( text [ i + k ] ) & 0x3F ) ;
}
const std : : string_view character = text . substr ( i , length ) ;
i + = length ;
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 ( Among ( unshown , code ) ) {
2026-11-01 18:35:23 +01:00
continue ;
}
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 ( Among ( blank , code ) ) {
spaced = ! shown . empty ( ) ;
continue ;
2026-11-01 18:35:23 +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
// The one space that stands for however many there were; and one that keeps a $ and a ( apart.
if ( std : : exchange ( spaced , false ) | | ( code = = ' ( ' & & ! shown . empty ( ) & & shown . back ( ) = = " $ " ) ) {
shown . emplace_back ( " " ) ;
2026-11-01 18:35:23 +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
shown . push_back ( code = = ' < ' ? " ‹ " : code = = ' > ' ? " › " : code = = ' & ' ? " + " : character ) ;
}
std : : string out ;
for ( const std : : string_view piece : shown | std : : views : : take ( limit ) ) {
out + = piece ;
}
if ( shown . size ( ) > limit ) {
out + = " … " ;
2026-11-01 18:35:23 +01:00
}
return out ;
}
std : : string_view EnvironmentName ( BunqEnvironment environment ) {
return environment = = BunqEnvironment : : Production ? " production " : " sandbox " ;
}
BunqEnvironment ParseEnvironment ( std : : string_view name ) {
if ( name = = " production " ) {
return BunqEnvironment : : Production ;
}
if ( name = = " sandbox " ) {
return BunqEnvironment : : Sandbox ;
}
throw std : : invalid_argument ( std : : format ( " unknown environment '{}': production or sandbox " , name ) ) ;
}
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
// Who a caller wants paid or asked. The address is what decides where the money goes, so the dialog shows it whole
// and as it is, or the call is refused before anyone is asked: an address that would read otherwise there than it
// is (one with an & reads as one with a +, which is somebody else's) could have the user confirm a payment to
// someone they did not mean. A name is only made fit to show.
BunqCounterparty Counterparty ( std : : string_view value , std : : string_view name ) {
BunqCounterparty party = BunqCounterparty : : Parse ( value , name ) ;
if ( Shown ( party . value , addressLimit ) ! = party . value ) {
throw std : : invalid_argument ( std : : format ( " '{}' cannot be paid or asked through nostro: the password dialog would not show that address as it is, since it holds an &, a <, a > or a $(, something that draws nothing, or more than {} characters " , Shown ( party . value ) , addressLimit ) ) ;
}
return party ;
}
2026-11-01 18:35:23 +01:00
// Who is paid or asked, as a dialog shows it: the address first, so a long name cannot hide it.
std : : string Party ( const BunqCounterparty & party ) {
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 party . name . empty ( ) ? Shown ( party . value , addressLimit ) : std : : format ( " {} ({}) " , Shown ( party . value , addressLimit ) , Shown ( party . name ) ) ;
2026-11-01 18:35:23 +01:00
}
std : : string Party ( const BunqLabel & label ) {
if ( label . iban . empty ( ) ) {
return Shown ( label . name ) ;
}
return label . name . empty ( ) ? Shown ( label . iban ) : std : : format ( " {} ({}) " , Shown ( label . iban ) , Shown ( label . name ) ) ;
}
std : : string Party ( const BunqAccount & account ) {
return std : : format ( " {} ({}) " , Shown ( account . iban ) , Shown ( account . name ) ) ;
}
std : : string Utc ( std : : chrono : : system_clock : : time_point time ) {
return std : : format ( " {:%Y-%m-%d %H:%M} UTC " , std : : chrono : : floor < std : : chrono : : minutes > ( time ) ) ;
}
// When a schedule pays, in words.
std : : string When ( const BunqSchedule & schedule ) {
const std : : map < std : : string_view , std : : pair < std : : string_view , std : : string_view > > units = {
{ " HOURLY " , { " hourly " , " hours " } } , { " DAILY " , { " daily " , " days " } } , { " WEEKLY " , { " weekly " , " weeks " } } , { " MONTHLY " , { " monthly " , " months " } } , { " YEARLY " , { " yearly " , " years " } } ,
} ;
std : : string when ;
if ( const auto unit = units . find ( schedule . unit ) ; unit ! = units . end ( ) ) {
when = schedule . every = = 1 ? std : : format ( " {} from {} " , unit - > second . first , Utc ( schedule . start ) ) : std : : format ( " every {} {} from {} " , schedule . every , unit - > second . second , Utc ( schedule . start ) ) ;
} else {
when = std : : format ( " once on {} " , Utc ( schedule . start ) ) ;
}
if ( schedule . end ) {
when + = std : : format ( " until {} " , Utc ( * schedule . end ) ) ;
}
return when ;
}
void RequirePositive ( std : : int64_t amount ) {
if ( amount < = 0 ) {
throw std : : invalid_argument ( " the amount must be more than zero " ) ;
}
}
// What the dialog says, and the details polkit rules can test.
struct Prompt {
std : : string_view action ;
std : : string summary ;
std : : vector < std : : pair < std : : string , std : : string > > details ;
} ;
// A payment's details for polkit rules: how much, in what, to whom, from where, at which bunq.
std : : vector < std : : pair < std : : string , std : : string > > PaymentDetails ( const BunqAccount & account , std : : int64_t amount , Currency currency , std : : string_view counterparty ) {
return {
{ " amount_minor " , std : : to_string ( amount ) } ,
{ " currency " , std : : string ( GetCurrencyCode ( currency ) ) } ,
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
{ " counterparty " , Shown ( counterparty , addressLimit ) } ,
2026-11-01 18:35:23 +01:00
{ " account_iban " , account . iban } ,
{ " environment " , std : : string ( EnvironmentName ( account . connector - > environment ) ) } ,
} ;
}
// Where an account is found again after the prompt, when the accounts may have been refreshed in between.
struct AccountKey {
std : : string connector ;
std : : uint64_t account = 0 ;
} ;
AccountKey KeyOf ( const BunqAccount & account ) {
return AccountKey { account . connector - > StorageKey ( ) , account . id } ;
}
BunqConnector & ConnectorBy ( const std : : string & storageKey ) {
const auto found = std : : ranges : : find_if ( BunqConnector : : connectors , [ & storageKey ] ( const BunqConnector & bank ) { return bank . StorageKey ( ) = = storageKey ; } ) ;
if ( found = = BunqConnector : : connectors . end ( ) ) {
throw std : : invalid_argument ( " that connector is no longer there " ) ;
}
return * found ;
}
BunqAccount & AccountBy ( const AccountKey & key ) {
BunqConnector & bank = ConnectorBy ( key . connector ) ;
const auto found = std : : ranges : : find ( bank . accounts , key . account , & BunqAccount : : id ) ;
if ( found = = bank . accounts . end ( ) ) {
throw std : : invalid_argument ( " that account is no longer there " ) ;
}
return * found ;
}
void RefreshAll ( ) {
for ( BunqConnector & bank : BunqConnector : : connectors ) {
try {
bank . RefreshAccounts ( ) ;
} catch ( const std : : exception & e ) {
Note ( std : : format ( " {} connector '{}' is unavailable: {} " , BunqConnector : : connectorId , bank . name , e . what ( ) ) ) ;
}
}
}
// The one account with this name or IBAN, across every connector. The accounts are refreshed once when none
// matches, for an account opened since they were read.
BunqAccount & FindAccount ( std : : string_view key ) {
for ( std : : size_t attempt = 0 ; attempt < 2 ; attempt + + ) {
std : : vector < BunqAccount * > matches ;
for ( BunqConnector & bank : BunqConnector : : connectors ) {
for ( BunqAccount & account : bank . accounts ) {
if ( account . name = = key | | account . iban = = key ) {
matches . push_back ( & account ) ;
}
}
}
if ( matches . size ( ) > 1 ) {
throw std : : invalid_argument ( std : : format ( " {} accounts are called '{}': use the IBAN " , matches . size ( ) , key ) ) ;
}
if ( matches . size ( ) = = 1 ) {
return * matches . front ( ) ;
}
if ( attempt = = 0 ) {
RefreshAll ( ) ;
}
}
throw std : : invalid_argument ( std : : format ( " no account is called or has IBAN '{}' " , key ) ) ;
}
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
// The user's connectors, read for the first call polkit says yes to, or the first new order at checkout: that call
// also records whose directory this is. Reading them refreshes each one's accounts, which asks the bank.
2026-11-01 18:35:23 +01:00
void Load ( Worker & worker ) {
if ( worker . loaded ) {
return ;
}
const fs : : path owner = worker . directory / " owner " ;
if ( ! fs : : exists ( owner ) ) {
CreatePrivateFile ( owner ) ;
std : : ofstream out ( owner ) ;
std : : println ( out , " {} " , worker . name ) ;
}
Connector : : LoadConnectors ( ) ;
worker . loaded = true ;
}
// Runs `work` and makes the answer to `call` of what it appended, and of the notes, which only nostrod's own
// interface carries: they are the user's, and an app at checkout is someone else.
MessagePtr Answer ( sd_bus_message * call , const Work & work ) {
sd_bus_message * raw = nullptr ;
ThrowOnSdBus ( sd_bus_message_new_method_return ( call , & raw ) , " answer a call " ) ;
MessagePtr reply ( raw ) ;
work ( raw ) ;
const std : : vector < std : : string > said = std : : exchange ( notes , { } ) ;
if ( Interface ( call ) = = interfaceName ) {
Append ( raw , said ) ;
}
return reply ;
}
struct Check {
Worker * worker = nullptr ;
MessagePtr call ;
Work work ;
After after ;
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
// What a yes is followed by in place of an answer: the rest of a call that asked before it looked (HandleLookup).
std : : function < void ( ) > next ;
2026-11-01 18:35:23 +01:00
std : : string action ;
bool interactive = false ;
std : : string cancellation ;
} ;
// polkit's answer: run the call, or say why not. Fails closed: no answer is no.
std : : int32_t OnChecked ( sd_bus_message * reply , void * userdata , sd_bus_error * ) {
const std : : unique_ptr < Check > check ( static_cast < Check * > ( userdata ) ) ;
Worker & worker = * check - > worker ;
worker . checking - - ;
Touch ( worker ) ;
sd_bus_message * call = check - > call . get ( ) ;
MessagePtr answer ;
try {
if ( sd_bus_message_is_method_error ( reply , nullptr ) ) {
const sd_bus_error * error = sd_bus_message_get_error ( reply ) ;
if ( sd_bus_error_has_names ( error , SD_BUS_ERROR_NO_REPLY , SD_BUS_ERROR_TIMEOUT ) ) {
// Leave no dialog open for an answer nobody waits for.
sd_bus_call_method_async ( worker . system . get ( ) , nullptr , " org.freedesktop.PolicyKit1 " , " /org/freedesktop/PolicyKit1/Authority " , " org.freedesktop.PolicyKit1.Authority " , " CancelCheckAuthorization " , nullptr , nullptr , " s " , check - > cancellation . c_str ( ) ) ;
}
throw Refused ( std : : format ( " polkit did not decide on {}: {} " , check - > action , ErrorMessage ( * error ) ) ) ;
}
Enter ( reply , ' r ' , " bba{ss} " ) ;
const bool authorized = Read < bool > ( reply ) ;
const bool challenge = Read < bool > ( reply ) ;
std : : map < std : : string , std : : string > details ;
Enter ( reply , ' a ' , " {ss} " ) ;
while ( ThrowOnSdBus ( sd_bus_message_at_end ( reply , 0 ) , " read polkit's answer " ) = = 0 ) {
Enter ( reply , ' e ' , " ss " ) ;
std : : string key = Read < std : : string > ( reply ) ;
details [ std : : move ( key ) ] = Read < std : : string > ( reply ) ;
Leave ( reply ) ;
}
Leave ( reply ) ;
Leave ( reply ) ;
if ( authorized ) {
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
// The connectors are read for a caller polkit said yes to, and for no other: reading them asks the bank.
Load ( worker ) ;
if ( check - > next ) {
// The call goes on to its own question, and is answered through that one.
check - > next ( ) ;
return 0 ;
}
2026-11-01 18:35:23 +01:00
answer = Answer ( call , check - > work ) ;
} else if ( challenge & & ! check - > interactive ) {
answer = ErrorReply ( call , SD_BUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED , std : : format ( " {} needs your password, and the call did not let nostrod ask for it " , check - > action ) ) ;
} else if ( check - > interactive & & ( details [ " polkit.dismissed " ] = = " true " | | details [ " polkit.result " ] . starts_with ( " auth_ " ) ) ) {
// Asked, and not authenticated: the dialog was closed, or no agent could ask.
answer = ErrorReply ( call , errorCancelled , " you did not authenticate, so nothing was done " ) ;
} else {
throw Refused ( std : : format ( " the system's policy does not allow {} " , check - > action ) ) ;
}
} catch ( . . . ) {
answer = ErrorFor ( call , std : : current_exception ( ) ) ;
}
Deliver ( answer ) ;
if ( check - > after ) {
check - > after ( answer . get ( ) ) ;
}
return 0 ;
}
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
// Asks polkit whether the caller may do what `prompt` says. On a yes it runs `next` when there is one, which
// answers the call itself, and else runs `work` and answers with what that appended; on anything else it answers
// why not. Then it runs `after` with the answer it gave. The check does not block: other calls are served while a
// password dialog is open.
std : : int32_t Ask ( Worker & worker , sd_bus_message * call , const Prompt & prompt , Work work , After after , std : : function < void ( ) > next ) {
2026-11-01 18:35:23 +01:00
const bool interactive = sd_bus_message_get_allow_interactive_authorization ( call ) > 0 ;
sd_bus_message * raw = nullptr ;
ThrowOnSdBus ( sd_bus_message_new_method_call ( worker . system . get ( ) , & raw , " org.freedesktop.PolicyKit1 " , " /org/freedesktop/PolicyKit1/Authority " , " org.freedesktop.PolicyKit1.Authority " , " CheckAuthorization " ) , " ask polkit " ) ;
const MessagePtr request ( raw ) ;
// The subject is the caller's connection, which polkit looks up itself.
Open ( raw , ' r ' , " sa{sv} " ) ;
Append ( raw , std : : string ( " system-bus-name " ) ) ;
Open ( raw , ' a ' , " {sv} " ) ;
Open ( raw , ' e ' , " sv " ) ;
Append ( raw , std : : string ( " name " ) ) ;
Open ( raw , ' v ' , " s " ) ;
Append ( raw , Sender ( call ) ) ;
Close ( raw ) ;
Close ( raw ) ;
Close ( raw ) ;
Close ( raw ) ;
Append ( raw , std : : string ( prompt . action ) ) ;
Open ( raw , ' a ' , " {ss} " ) ;
const auto detail = [ raw ] ( const std : : string & key , const std : : string & value ) {
Open ( raw , ' e ' , " ss " ) ;
Append ( raw , key ) ;
Append ( raw , value ) ;
Close ( raw ) ;
} ;
detail ( " summary " , prompt . summary ) ;
for ( const auto & [ key , value ] : prompt . details ) {
detail ( key , value ) ;
}
Close ( raw ) ;
Append ( raw , std : : uint32_t { interactive ? 1u : 0u } ) ;
std : : string cancellation = std : : format ( " nostro-{}-{} " , getpid ( ) , + + worker . checks ) ;
Append ( raw , cancellation ) ;
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
std : : unique_ptr < Check > check = std : : make_unique < Check > ( & worker , MessagePtr ( sd_bus_message_ref ( call ) ) , std : : move ( work ) , std : : move ( after ) , std : : move ( next ) , std : : string ( prompt . action ) , interactive , std : : move ( cancellation ) ) ;
2026-11-01 18:35:23 +01:00
ThrowOnSdBus ( sd_bus_call_async ( worker . system . get ( ) , nullptr , raw , OnChecked , check . get ( ) , Microseconds ( worker . options . promptTimeout ) ) , " ask polkit " ) ;
// OnChecked owns it now.
check . release ( ) ;
worker . checking + + ;
return 1 ;
}
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
// Asks polkit whether the caller may do what `prompt` says, then runs `work` and answers; or answers why not; and
// then runs `after` with the answer.
std : : int32_t Gate ( Worker & worker , sd_bus_message * call , const Prompt & prompt , Work work , After after = { } ) {
return Ask ( worker , call , prompt , std : : move ( work ) , std : : move ( after ) , { } ) ;
}
// Runs `body` for `call`: it answers through Gate, or throws, and then the call is answered with the error. Nothing
// of the user's is read here: a body reads its arguments and asks polkit, and what it then does runs after a yes.
2026-11-01 18:35:23 +01:00
template < typename Body >
std : : int32_t Handle ( sd_bus_message * call , void * userdata , Body & & body ) {
Worker & worker = * static_cast < Worker * > ( userdata ) ;
Touch ( worker ) ;
try {
if ( worker . refusal ) {
throw Refused ( * worker . refusal ) ;
}
return body ( worker ) ;
} catch ( . . . ) {
Deliver ( ErrorFor ( call , std : : current_exception ( ) ) ) ;
return 1 ;
}
}
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
// Runs `body` for a call that names something of the user's (an account, a card, a request, a draft, a connector)
// and is not a call to see it. Such a call's own question to polkit is worded from what was found, so the body
// looks it up first; and whether it is there is the user's to know, and finding it can take a question to the
// bank. Both are for a caller who may see the user's accounts: polkit is asked that first, as `seen` words it,
// and `body` runs on its yes. An active session has that yes without a dialog, as shipped; where seeing takes a
// password, such a call asks for it twice, once to look and once to act.
template < typename Body >
std : : int32_t HandleLookup ( sd_bus_message * call , void * userdata , std : : string_view seen , Body body ) {
return Handle ( call , userdata , [ call , seen , & body ] ( Worker & worker ) {
return Ask ( worker , call , Prompt { actionView , std : : string ( seen ) , { } } , { } , { } , [ & worker , body = std : : move ( body ) ] {
body ( worker ) ;
} ) ;
} ) ;
}
2026-11-01 18:35:23 +01:00
std : : int32_t OnConnectors ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
return Handle ( call , userdata , [ call ] ( Worker & worker ) {
return Gate ( worker , call , Prompt { actionView , " see your bank connectors " , { } } , [ ] ( sd_bus_message * reply ) {
std : : vector < ConnectorSummary > summaries ;
for ( BunqConnector & bank : BunqConnector : : connectors ) {
summaries . push_back ( ConnectorSummary { bank . name , std : : string ( BunqConnector : : connectorId ) , std : : string ( EnvironmentName ( bank . environment ) ) , bank . IsOAuth ( ) ? " oauth " : " api key " , bank . TestConnector ( ) } ) ;
}
Append ( reply , summaries ) ;
} ) ;
} ) ;
}
void AppendAdded ( sd_bus_message * reply , const BunqConnector & added ) {
Append ( reply , added . name ) ;
Append ( reply , std : : string ( EnvironmentName ( added . environment ) ) ) ;
Append ( reply , static_cast < std : : uint32_t > ( added . accounts . size ( ) ) ) ;
}
std : : int32_t OnAddBunq ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
return Handle ( call , userdata , [ call ] ( Worker & worker ) {
std : : string apiKey = Read < std : : string > ( call ) ;
std : : string allowedIps = Read < std : : string > ( call ) ;
const std : : string requested = Read < std : : string > ( call ) ;
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
// The key says itself which environment it is of, by how it starts. One the caller names is held to that,
// before anyone is asked and before the key goes anywhere: sent to the environment it is not of, a key
// would only be refused there, after a real one had been shown to the sandbox.
const BunqEnvironment environment = BunqConnector : : EnvironmentOfKey ( apiKey ) ;
if ( ! requested . empty ( ) & & ParseEnvironment ( requested ) ! = environment ) {
throw std : : invalid_argument ( std : : format ( " that API key is a {} key, not a {} one: a sandbox key starts with sandbox_, and no other key does " , EnvironmentName ( environment ) , requested ) ) ;
}
2026-11-01 18:35:23 +01:00
const Prompt prompt { actionConnectors , std : : format ( " add a bunq connector ({}) " , EnvironmentName ( environment ) ) , { { " environment " , std : : string ( EnvironmentName ( environment ) ) } } } ;
return Gate ( worker , call , prompt , [ apiKey = std : : move ( apiKey ) , allowedIps = std : : move ( allowedIps ) , environment ] ( sd_bus_message * reply ) {
AppendAdded ( reply , BunqConnector : : Create ( std : : string ( apiKey ) , allowedIps , environment ) ) ;
Connector : : SaveConnectors ( ) ;
} ) ;
} ) ;
}
std : : int32_t OnAddBunqOAuth ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
return Handle ( call , userdata , [ call ] ( Worker & worker ) {
const BunqEnvironment environment = ParseEnvironment ( Read < std : : string > ( call ) ) ;
std : : string clientId = Read < std : : string > ( call ) ;
std : : string clientSecret = Read < std : : string > ( call ) ;
std : : string redirectUri = Read < std : : string > ( call ) ;
std : : string code = Read < std : : string > ( call ) ;
const Prompt prompt { actionConnectors , std : : format ( " add a bunq connector through OAuth ({}) " , EnvironmentName ( environment ) ) , { { " environment " , std : : string ( EnvironmentName ( environment ) ) } } } ;
return Gate ( worker , call , prompt , [ environment , clientId = std : : move ( clientId ) , clientSecret = std : : move ( clientSecret ) , redirectUri = std : : move ( redirectUri ) , code = std : : move ( code ) ] ( sd_bus_message * reply ) {
AppendAdded ( reply , BunqConnector : : Create ( BunqConnector : : OAuthExchangeCode ( environment , clientId , clientSecret , redirectUri , code ) , " * " , environment ) ) ;
Connector : : SaveConnectors ( ) ;
} ) ;
} ) ;
}
std : : int32_t OnRemoveConnector ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
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 HandleLookup ( call , userdata , " see your bank connectors " , [ call ] ( Worker & worker ) {
2026-11-01 18:35:23 +01:00
const std : : string key = Read < std : : string > ( call ) ;
// By name, or by the number Connectors() lists it under.
std : : vector < BunqConnector * > matches ;
std : : size_t number = 1 ;
for ( BunqConnector & bank : BunqConnector : : connectors ) {
if ( bank . name = = key | | std : : to_string ( number + + ) = = key ) {
matches . push_back ( & bank ) ;
}
}
if ( matches . size ( ) ! = 1 ) {
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
throw std : : invalid_argument ( matches . empty ( ) ? std : : format ( " no connector is called or numbered '{}' " , key ) : std : : format ( " {} connectors are called '{}': use its number in the list of connectors " , matches . size ( ) , key ) ) ;
2026-11-01 18:35:23 +01:00
}
const std : : string storageKey = matches . front ( ) - > StorageKey ( ) ;
const Prompt prompt { actionConnectors , std : : format ( " remove the bunq connector '{}' and its stored transactions " , Shown ( matches . front ( ) - > name ) ) , { } } ;
return Gate ( worker , call , prompt , [ storageKey ] ( sd_bus_message * reply ) {
BunqConnector & bank = ConnectorBy ( storageKey ) ;
try {
bank . Logout ( ) ;
} catch ( const std : : exception & e ) {
Note ( std : : format ( " could not log out, forgetting the connector anyway: {} " , e . what ( ) ) ) ;
}
const std : : string removed = bank . name ;
BunqConnector : : Remove ( bank ) ;
Connector : : SaveConnectors ( ) ;
Append ( reply , removed ) ;
} ) ;
} ) ;
}
std : : int32_t OnAccounts ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
return Handle ( call , userdata , [ call ] ( Worker & worker ) {
return Gate ( worker , call , Prompt { actionView , " see your accounts and balances " , { } } , [ ] ( sd_bus_message * reply ) {
RefreshAll ( ) ;
std : : vector < ConnectorAccounts > listing ;
for ( const BunqConnector & bank : BunqConnector : : connectors ) {
listing . push_back ( ConnectorAccounts { bank . name , std : : string ( BunqConnector : : connectorId ) , std : : vector < Account > ( bank . accounts . begin ( ) , bank . accounts . end ( ) ) } ) ;
}
Append ( reply , listing ) ;
} ) ;
} ) ;
}
std : : int32_t OnTransactions ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
return Handle ( call , userdata , [ call ] ( Worker & worker ) {
const std : : string account = Read < std : : string > ( call ) ;
const TransactionQuery query = ReadQuery ( call ) ;
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
// The account is looked up once polkit has said yes: whether there is one of that name is for a caller who
// may see the accounts, and finding it can take a question to the bank.
return Gate ( worker , call , Prompt { actionView , " see your transactions " , { } } , [ account , query ] ( sd_bus_message * reply ) {
BunqAccount & found = FindAccount ( account ) ;
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
// What is new at the bank first: a call to it, which takes its time and which it counts. Not for a
// question about what is stored alone, as a search in a list just given is: that is answered at once.
if ( ! query . stored ) {
found . connector - > GetNewTransactions ( found ) ;
}
2026-11-01 18:35:23 +01:00
Append ( reply , found . FindTransactions ( found . StorageKey ( ) , query ) ) ;
} ) ;
} ) ;
}
// The arguments a payment, a draft, a schedule and a request share.
struct Payment {
std : : string account ;
std : : string counterparty ;
std : : string name ;
std : : int64_t amount = 0 ;
std : : string description ;
static Payment Read ( sd_bus_message * call ) {
Payment payment ;
payment . account = Bus : : Read < std : : string > ( call ) ;
payment . counterparty = Bus : : Read < std : : string > ( call ) ;
payment . name = Bus : : Read < std : : string > ( call ) ;
payment . amount = Bus : : Read < std : : int64_t > ( call ) ;
payment . description = Bus : : Read < std : : string > ( call ) ;
return payment ;
}
} ;
std : : int32_t OnSend ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
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 HandleLookup ( call , userdata , " see your accounts and balances " , [ call ] ( Worker & worker ) {
2026-11-01 18:35:23 +01:00
const Payment payment = Payment : : Read ( call ) ;
const BunqAccount & account = FindAccount ( payment . account ) ;
RequirePositive ( payment . amount ) ;
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 BunqCounterparty payee = Counterparty ( payment . counterparty , payment . name ) ;
2026-11-01 18:35:23 +01:00
const Prompt prompt { actionPay , std : : format ( " pay {} to {} from {} " , FormatMoney ( payment . amount , account . currency ) , Party ( payee ) , Party ( account ) ) , PaymentDetails ( account , payment . amount , account . currency , payee . value ) } ;
return Gate ( worker , call , prompt , [ key = KeyOf ( account ) , payment ] ( sd_bus_message * reply ) {
const BunqAccount & found = AccountBy ( key ) ;
std : : uint64_t id = 0 ;
try {
id = found . Send ( payment . counterparty , payment . name , payment . amount , found . currency , payment . description ) ;
} catch ( const BunqError & e ) {
// bunq lets an OAuth connection pay between the user's own accounts only.
if ( found . connector - > IsOAuth ( ) ) {
throw OAuthPaymentRefused ( e . what ( ) ) ;
}
throw ;
}
Append ( reply , id ) ;
Append ( reply , found . currency ) ;
} ) ;
} ) ;
}
std : : int32_t OnSchedule ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
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 HandleLookup ( call , userdata , " see your accounts and balances " , [ call ] ( Worker & worker ) {
2026-11-01 18:35:23 +01:00
const Payment payment = Payment : : Read ( call ) ;
const BunqSchedule schedule = Read < BunqSchedule > ( call ) ;
const BunqAccount & account = FindAccount ( payment . account ) ;
RequirePositive ( payment . amount ) ;
schedule . Check ( ) ;
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 BunqCounterparty payee = Counterparty ( payment . counterparty , payment . name ) ;
2026-11-01 18:35:23 +01:00
const Prompt prompt { actionPay , std : : format ( " schedule {} to {} from {}, {} " , FormatMoney ( payment . amount , account . currency ) , Party ( payee ) , Party ( account ) , When ( schedule ) ) , PaymentDetails ( account , payment . amount , account . currency , payee . value ) } ;
return Gate ( worker , call , prompt , [ key = KeyOf ( account ) , payment , schedule ] ( sd_bus_message * reply ) {
const BunqAccount & found = AccountBy ( key ) ;
Append ( reply , found . Schedule ( payment . counterparty , payment . name , payment . amount , found . currency , payment . description , schedule ) ) ;
Append ( reply , found . currency ) ;
} ) ;
} ) ;
}
std : : int32_t OnRequest ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
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 HandleLookup ( call , userdata , " see your accounts and balances " , [ call ] ( Worker & worker ) {
2026-11-01 18:35:23 +01:00
const Payment payment = Payment : : Read ( call ) ;
const BunqAccount & account = FindAccount ( payment . account ) ;
RequirePositive ( payment . amount ) ;
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 BunqCounterparty payer = Counterparty ( payment . counterparty , payment . name ) ;
2026-11-01 18:35:23 +01:00
const Prompt prompt { actionChange , std : : format ( " ask {} for {} into {} " , Party ( payer ) , FormatMoney ( payment . amount , account . currency ) , Party ( account ) ) , PaymentDetails ( account , payment . amount , account . currency , payer . value ) } ;
return Gate ( worker , call , prompt , [ key = KeyOf ( account ) , payment ] ( sd_bus_message * reply ) {
const BunqAccount & found = AccountBy ( key ) ;
Append ( reply , found . Request ( payment . counterparty , payment . name , payment . amount , found . currency , payment . description ) ) ;
} ) ;
} ) ;
}
// A listing of one account's requests, schedules or drafts.
template < typename List >
std : : int32_t Listing ( sd_bus_message * call , void * userdata , std : : string_view what , List list ) {
return Handle ( call , userdata , [ call , what , list ] ( Worker & worker ) {
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 : : string account = Read < std : : string > ( call ) ;
// Looked up once polkit has said yes, as in OnTransactions.
return Gate ( worker , call , Prompt { actionView , std : : format ( " see your {} " , what ) , { } } , [ account , list ] ( sd_bus_message * reply ) {
Append ( reply , list ( FindAccount ( account ) ) ) ;
2026-11-01 18:35:23 +01:00
} ) ;
} ) ;
}
std : : int32_t OnRequests ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
return Listing ( call , userdata , " requests for money " , [ ] ( const BunqAccount & account ) { return account . Requests ( ) ; } ) ;
}
std : : int32_t OnIncomingRequests ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
return Listing ( call , userdata , " incoming requests for money " , [ ] ( const BunqAccount & account ) { return account . IncomingRequests ( ) ; } ) ;
}
std : : int32_t OnScheduledPayments ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
return Listing ( call , userdata , " scheduled payments " , [ ] ( const BunqAccount & account ) { return account . ScheduledPayments ( ) ; } ) ;
}
std : : int32_t OnDraftPayments ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
return Listing ( call , userdata , " draft payments " , [ ] ( const BunqAccount & account ) { return account . DraftPayments ( ) ; } ) ;
}
// Revoking a request or cancelling a schedule: a change to one object of one account.
template < typename Act >
std : : int32_t Undo ( sd_bus_message * call , void * userdata , std : : string_view what , Act act ) {
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 HandleLookup ( call , userdata , " see your accounts and balances " , [ call , what , act ] ( Worker & worker ) {
2026-11-01 18:35:23 +01:00
const BunqAccount & account = FindAccount ( Read < std : : string > ( call ) ) ;
const std : : uint64_t id = Read < std : : uint64_t > ( call ) ;
const Prompt prompt { actionChange , std : : format ( " {} {} of {} " , what , id , Party ( account ) ) , { } } ;
return Gate ( worker , call , prompt , [ key = KeyOf ( account ) , id , act ] ( sd_bus_message * ) {
act ( AccountBy ( key ) , id ) ;
} ) ;
} ) ;
}
std : : int32_t OnRevokeRequest ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
return Undo ( call , userdata , " revoke request " , [ ] ( const BunqAccount & account , std : : uint64_t id ) { account . RevokeRequest ( id ) ; } ) ;
}
std : : int32_t OnCancelScheduledPayment ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
return Undo ( call , userdata , " cancel scheduled payment " , [ ] ( const BunqAccount & account , std : : uint64_t id ) { account . CancelScheduledPayment ( id ) ; } ) ;
}
std : : int32_t OnRespondToRequest ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
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 HandleLookup ( call , userdata , " see your incoming requests for money " , [ call ] ( Worker & worker ) {
2026-11-01 18:35:23 +01:00
const BunqAccount & account = FindAccount ( Read < std : : string > ( call ) ) ;
const std : : uint64_t id = Read < std : : uint64_t > ( call ) ;
const bool accept = Read < bool > ( call ) ;
// The request as bunq has it now, which is what the dialog shows and what accepting pays.
const BunqIncomingRequest shown = account . IncomingRequest ( id ) ;
const Prompt prompt = accept
? Prompt { actionPay , std : : format ( " pay {} to {} from {}, as asked in request {} " , FormatMoney ( shown . amount , shown . currency ) , Party ( shown . counterparty ) , Party ( account ) , shown . id ) , PaymentDetails ( account , shown . amount , shown . currency , shown . counterparty . iban ) }
: Prompt { actionChange , std : : format ( " reject request {} from {} " , shown . id , Party ( shown . counterparty ) ) , { } } ;
return Gate ( worker , call , prompt , [ key = KeyOf ( account ) , shown , accept ] ( sd_bus_message * ) {
AccountBy ( key ) . RespondToRequest ( shown , accept ) ;
} ) ;
} ) ;
}
std : : int32_t OnDraft ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
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 HandleLookup ( call , userdata , " see your accounts and balances " , [ call ] ( Worker & worker ) {
2026-11-01 18:35:23 +01:00
const Payment payment = Payment : : Read ( call ) ;
const BunqAccount & account = FindAccount ( payment . account ) ;
RequirePositive ( payment . amount ) ;
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 BunqCounterparty payee = Counterparty ( payment . counterparty , payment . name ) ;
2026-11-01 18:35:23 +01:00
const Prompt prompt { actionChange , std : : format ( " make a draft payment of {} to {} from {}, paid once someone accepts it " , FormatMoney ( payment . amount , account . currency ) , Party ( payee ) , Party ( account ) ) , PaymentDetails ( account , payment . amount , account . currency , payee . value ) } ;
return Gate ( worker , call , prompt , [ key = KeyOf ( account ) , payment ] ( sd_bus_message * reply ) {
const BunqAccount & found = AccountBy ( key ) ;
Append ( reply , found . Draft ( payment . counterparty , payment . name , payment . amount , found . currency , payment . description ) ) ;
Append ( reply , found . currency ) ;
} ) ;
} ) ;
}
std : : int32_t OnRespondToDraftPayment ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
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 HandleLookup ( call , userdata , " see your draft payments " , [ call ] ( Worker & worker ) {
2026-11-01 18:35:23 +01:00
const BunqAccount & account = FindAccount ( Read < std : : string > ( call ) ) ;
const std : : uint64_t id = Read < std : : uint64_t > ( call ) ;
const bool accept = Read < bool > ( call ) ;
// The draft as bunq has it now: the dialog shows it, and bunq refuses the answer if it changes after.
const BunqDraftPayment shown = account . DraftPayment ( id ) ;
std : : int64_t total = 0 ;
std : : vector < std : : string > payees ;
for ( const BunqDraftPayment : : Entry & entry : shown . entries ) {
total + = entry . amount ;
payees . push_back ( Party ( entry . counterparty ) ) ;
}
const Currency currency = shown . entries . empty ( ) ? account . currency : shown . entries . front ( ) . currency ;
const std : : string firstPayee = shown . entries . empty ( ) ? std : : string ( ) : shown . entries . front ( ) . counterparty . iban ;
std : : string to = payees . size ( ) < = 3 ? std : : string ( ) : std : : format ( " and {} more " , payees . size ( ) - 3 ) ;
payees . resize ( std : : min < std : : size_t > ( payees . size ( ) , 3 ) ) ;
to . insert ( 0 , payees . empty ( ) ? std : : string ( " no one " ) : std : : ranges : : to < std : : string > ( payees | std : : views : : join_with ( std : : string_view ( " , " ) ) ) ) ;
const Prompt prompt = accept
? Prompt { actionPay , std : : format ( " pay {} to {} from {}, as drafted in draft payment {} " , FormatMoney ( total , currency ) , to , Party ( account ) , shown . id ) , PaymentDetails ( account , total , currency , firstPayee ) }
: Prompt { actionChange , std : : format ( " reject draft payment {} of {} to {} " , shown . id , FormatMoney ( total , currency ) , to ) , { } } ;
return Gate ( worker , call , prompt , [ key = KeyOf ( account ) , shown , accept ] ( sd_bus_message * ) {
AccountBy ( key ) . RespondToDraftPayment ( shown , accept ) ;
} ) ;
} ) ;
}
std : : int32_t OnCards ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
return Handle ( call , userdata , [ call ] ( Worker & worker ) {
return Gate ( worker , call , Prompt { actionView , " see your cards " , { } } , [ ] ( sd_bus_message * reply ) {
std : : vector < ConnectorCards > listing ;
for ( BunqConnector & bank : BunqConnector : : connectors ) {
listing . push_back ( ConnectorCards { bank . name , std : : string ( BunqConnector : : connectorId ) , bank . Cards ( ) } ) ;
}
Append ( reply , listing ) ;
} ) ;
} ) ;
}
std : : int32_t OnSetCardStatus ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
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 HandleLookup ( call , userdata , " see your cards " , [ call ] ( Worker & worker ) {
2026-11-01 18:35:23 +01:00
const std : : uint64_t card = Read < std : : uint64_t > ( call ) ;
const std : : string status = Read < std : : string > ( call ) ;
// Unfreezing lets the card pay again; a card reported lost or stolen is blocked for good.
const std : : map < std : : string_view , std : : pair < std : : string_view , std : : string_view > > changes = {
{ " ACTIVE " , { actionUnfreezeCard , " unfreeze card **** {} " } } ,
{ " DEACTIVATED " , { actionChange , " freeze card **** {} " } } ,
{ " LOST " , { actionBlockCard , " report card **** {} lost, which blocks it for good " } } ,
{ " STOLEN " , { actionBlockCard , " report card **** {} stolen, which blocks it for good " } } ,
} ;
const auto change = changes . find ( status ) ;
if ( change = = changes . end ( ) ) {
throw std : : invalid_argument ( std : : format ( " unknown card status '{}': ACTIVE, DEACTIVATED, LOST or STOLEN " , status ) ) ;
}
for ( BunqConnector & bank : BunqConnector : : connectors ) {
for ( const BunqCard & found : bank . Cards ( ) ) {
if ( found . id = = card ) {
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
// bunq does not freeze or unfreeze a virtual card when asked, and answers as if nothing were
// wrong, with the card DEACTIVATED as it has it all along: a freeze answered so would look as
// if it had worked. Refused before anyone is asked for a password.
if ( found . Virtual ( ) & & change - > second . first ! = actionBlockCard ) {
throw std : : invalid_argument ( std : : format ( " card {} is a virtual card, which bunq does not freeze or unfreeze when asked: do that in the bunq app " , card ) ) ;
}
2026-11-01 18:35:23 +01:00
const std : : string lastFour = Shown ( found . lastFour ) ;
const Prompt prompt { change - > second . first , std : : vformat ( change - > second . second , std : : make_format_args ( lastFour ) ) , { { " card " , std : : to_string ( card ) } , { " status " , status } } } ;
return Gate ( worker , call , prompt , [ storageKey = bank . StorageKey ( ) , card , status ] ( sd_bus_message * reply ) {
Append ( reply , ConnectorBy ( storageKey ) . SetCardStatus ( card , status ) ) ;
} ) ;
}
}
}
throw std : : invalid_argument ( std : : format ( " no card has id {} " , card ) ) ;
} ) ;
}
// Checkout (Nostro.Checkout): an app has nostrod pay an order. The order is read and checked, the account that
// pays it is chosen, the user confirms both at a password prompt, and it is paid and recorded. The record answers a
// retry with the first payment, and a retry while the first call is still under way waits for its answer.
// The account chosen to pay checkouts from, kept beside connectors.json as its connector's storage key and its id:
// none when none is chosen, or it is gone.
const BunqAccount * CheckoutAccount ( const Worker & worker ) {
std : : ifstream in ( worker . directory / " checkout-account " ) ;
AccountKey key ;
const BunqAccount * found = nullptr ;
if ( std : : getline ( in , key . connector ) & & in > > key . account ) {
for ( const BunqConnector & bank : BunqConnector : : connectors ) {
for ( const BunqAccount & account : bank . accounts ) {
if ( bank . StorageKey ( ) = = key . connector & & account . id = = key . account ) {
found = & account ;
}
}
}
}
return found ;
}
std : : int32_t OnDefaultCheckoutAccount ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
return Handle ( call , userdata , [ call ] ( Worker & worker ) {
return Gate ( worker , call , Prompt { actionView , " see which account pays at checkout " , { } } , [ & worker ] ( sd_bus_message * reply ) {
const BunqAccount * chosen = CheckoutAccount ( worker ) ;
Append ( reply , chosen ? std : : optional < Account > ( * chosen ) : std : : nullopt ) ;
} ) ;
} ) ;
}
std : : int32_t OnSetDefaultCheckoutAccount ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
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 HandleLookup ( call , userdata , " see your accounts and balances " , [ call ] ( Worker & worker ) {
2026-11-01 18:35:23 +01:00
const BunqAccount & account = FindAccount ( Read < std : : string > ( call ) ) ;
// bunq lets an OAuth connection pay the user's own accounts only, so through one no shop could be paid.
if ( account . connector - > IsOAuth ( ) ) {
throw std : : invalid_argument ( std : : format ( " '{}' is reached through OAuth, which pays only your own accounts: checkouts need an account added with an API key " , account . name ) ) ;
}
const Prompt prompt { actionConnectors , std : : format ( " let apps ask you to pay from {} at checkout " , Party ( account ) ) , { { " account_iban " , account . iban } , { " environment " , std : : string ( EnvironmentName ( account . connector - > environment ) ) } } } ;
return Gate ( worker , call , prompt , [ & worker , key = KeyOf ( account ) ] ( sd_bus_message * reply ) {
const BunqAccount & chosen = AccountBy ( key ) ;
const fs : : path file = worker . directory / " checkout-account " ;
CreatePrivateFile ( file ) ;
std : : ofstream out ( file ) ;
std : : println ( out , " {} \n {} " , key . connector , key . account ) ;
Append ( reply , Account ( chosen ) ) ;
} ) ;
} ) ;
}
// An order, as Pay() reads and checks it. The options after its arguments are not read: there are none yet, and
// those of a later nostro this one does not know.
struct Order {
BunqCounterparty payee ; // an IBAN, and the name given
std : : int64_t amount = 0 ;
Currency currency = Currency : : Euro ;
std : : string reference ;
OrderKey Key ( ) const {
return { payee . value , reference } ;
}
static Order Read ( sd_bus_message * call ) {
const std : : string iban = Bus : : Read < std : : string > ( call ) ;
const std : : string name = Bus : : Read < std : : string > ( call ) ;
Order order ;
order . amount = Bus : : Read < std : : int64_t > ( call ) ;
const std : : string currency = Bus : : Read < std : : string > ( call ) ;
order . reference = Bus : : Read < std : : string > ( call ) ;
order . payee = BunqCounterparty : : Parse ( iban , name ) ;
if ( order . payee . type ! = " IBAN " ) {
throw std : : invalid_argument ( std : : format ( " checkout pays an IBAN, and '{}' is none " , iban ) ) ;
}
RequirePositive ( order . amount ) ;
try {
order . currency = GetCurrency ( currency ) ;
} catch ( const std : : runtime_error & e ) {
throw std : : invalid_argument ( e . what ( ) ) ;
}
if ( order . reference . empty ( ) ) {
throw std : : invalid_argument ( " an order needs a reference, such as its number: it is what keeps paying it again from paying twice " ) ;
}
return order ;
}
} ;
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
// One reference to one payee is one order, of one amount. Which amount the order has is not said: any app that
// knows the payee and the reference of an order another app had paid would learn from it what was paid for it.
2026-11-01 18:35:23 +01:00
void RequireSameOrder ( std : : int64_t amount , Currency currency , const Order & order ) {
if ( amount ! = order . amount | | currency ! = order . currency ) {
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
throw std : : invalid_argument ( std : : format ( " reference {} to {} is an order of another amount than {}: another order needs another reference " , Shown ( order . reference ) , order . payee . value , FormatMoney ( order . amount , order . currency ) ) ) ;
2026-11-01 18:35:23 +01:00
}
}
DB : : Table < CheckoutRecord > & Records ( Worker & worker ) {
if ( ! worker . records ) {
// A few rows per order: a reservation of a gigabyte, where the transaction tables take Crafter.DB's 32.
worker . records . emplace ( worker . directory / " checkouts.cdb " , DB : : OpenOptions { . reserveBytes = std : : uint64_t ( 1 ) < < 30 } ) ;
}
return * worker . records ;
}
// Pay()'s answer: the payment, and the results, of which `repeated` says the payment was made by an earlier call.
void AppendPaid ( sd_bus_message * reply , std : : uint64_t payment , bool repeated ) {
ThrowOnSdBus ( sd_bus_message_append ( reply , " ta{sv} " , payment , 1u , " repeated " , " b " , static_cast < std : : int32_t > ( repeated ) ) , " answer a call " ) ;
}
// Answers a call for an order paid before, or being paid, and returns true; false for an order not seen before.
bool AnswerKnownOrder ( Worker & worker , sd_bus_message * call , const Order & order ) {
static constexpr DB : : Column < & CheckoutRecord : : payee > payee { } ;
static constexpr DB : : Column < & CheckoutRecord : : reference > reference { } ;
if ( const std : : optional < DB : : Row < CheckoutRecord > > record = Records ( worker ) . Where ( payee = = order . payee . value & & reference = = order . reference ) . First ( ) ) {
RequireSameOrder ( ( * record ) [ & CheckoutRecord : : amount ] , ( * record ) [ & CheckoutRecord : : currency ] , order ) ;
const std : : uint64_t payment = ( * record ) [ & CheckoutRecord : : payment ] ;
if ( payment = = 0 ) {
throw std : : runtime_error ( std : : format ( " order {} to {} may have been paid already: the bank's answer to it was lost, so check whether the payment arrived before paying it under another reference " , Shown ( order . reference ) , order . payee . value ) ) ;
}
Deliver ( Answer ( call , [ payment ] ( sd_bus_message * reply ) { AppendPaid ( reply , payment , true ) ; } ) ) ;
return true ;
}
if ( const auto paying = worker . paying . find ( order . Key ( ) ) ; paying ! = worker . paying . end ( ) ) {
RequireSameOrder ( paying - > second . amount , paying - > second . currency , order ) ;
paying - > second . waiting . push_back ( MessagePtr ( sd_bus_message_ref ( call ) ) ) ;
return true ;
}
return false ;
}
// The order's call is answered: the calls that waited for it get the same answer, the payment marked as made by
// an earlier call. The order is there: it went in before its account was chosen, and only this takes it out.
// Answering fails only when memory runs out, and then the callers' own timeouts answer for them.
void Settle ( Worker & worker , const OrderKey & key , sd_bus_message * answer ) {
const std : : vector < MessagePtr > waiting = std : : move ( worker . paying . extract ( key ) . mapped ( ) . waiting ) ;
const bool paid = sd_bus_message_is_method_error ( answer , nullptr ) = = 0 ;
std : : uint64_t payment = 0 ;
sd_bus_message_rewind ( answer , 1 ) ;
sd_bus_message_read_basic ( answer , ' t ' , & payment ) ;
for ( const MessagePtr & call : waiting ) {
if ( paid ) {
sd_bus_reply_method_return ( call . get ( ) , " ta{sv} " , payment , 1u , " repeated " , " b " , 1 ) ;
} else {
sd_bus_reply_method_error ( call . get ( ) , sd_bus_message_get_error ( answer ) ) ;
}
}
}
// Pays an order the user confirmed, and records it. The record goes first, with no payment, so should the worker
// die or the bank's answer be lost, a retry finds it and is refused rather than paid twice. Only a refusal bunq
// gives before doing anything (below 500) takes it away again.
std : : uint64_t PayOrder ( Worker & worker , const BunqAccount & account , const Order & order ) {
DB : : Table < CheckoutRecord > & records = Records ( worker ) ;
const DB : : RowId row = records . Append ( CheckoutRecord { order . payee . value , order . reference , order . amount , order . currency , account . iban , 0 , std : : chrono : : system_clock : : now ( ) } ) ;
records . Flush ( ) ;
std : : uint64_t payment = 0 ;
try {
payment = account . Send ( order . payee . value , order . payee . name , order . amount , order . currency , order . reference ) ;
} catch ( const BunqError & e ) {
if ( e . status < 500 ) {
records . Erase ( row ) ;
records . Flush ( ) ;
}
throw ;
}
records . Set < & CheckoutRecord : : payment > ( row , payment ) ;
records . Flush ( ) ;
return payment ;
}
// Which account pays an order. Today the one the user chose for checkouts; an account picker, once nostro has a
// GUI, asks the user here instead, through an agent in their session, and may take its time. It answers through
// `then`, with the account or with what the call is to be refused with, and nothing else of a checkout changes with
// it. One that answers later keeps a reference to `call` until it does.
using Choice = std : : variant < AccountKey , std : : exception_ptr > ;
void ChooseAccount ( const Worker & worker , sd_bus_message * , const Order & , const std : : function < void ( const Choice & ) > & then ) {
if ( const BunqAccount * chosen = CheckoutAccount ( worker ) ) {
then ( KeyOf ( * chosen ) ) ;
} else {
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
then ( std : : make_exception_ptr ( NoCheckoutAccount ( " no account is chosen to pay checkouts from, or it is gone: choose one in Nostro's settings, or with `nostro checkout account` " ) ) ) ;
2026-11-01 18:35:23 +01:00
}
}
std : : int32_t OnPay ( sd_bus_message * call , void * userdata , sd_bus_error * ) {
return Handle ( call , userdata , [ call ] ( Worker & worker ) {
const Order order = Order : : Read ( call ) ;
if ( AnswerKnownOrder ( worker , call , order ) ) {
return 1 ;
}
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
// The account that pays is chosen before the user is asked, since the dialog names it: an order not seen
// before has the connectors read for it, which no call of nostrod's own interface does before polkit's yes.
Load ( worker ) ;
2026-11-01 18:35:23 +01:00
// From here on, a call for the same order waits for this one, and Settle answers it.
worker . paying [ order . Key ( ) ] = Paying { order . amount , order . currency , { } } ;
ChooseAccount ( worker , call , order , [ & worker , call , order ] ( const Choice & choice ) {
try {
if ( const std : : exception_ptr * refusal = std : : get_if < std : : exception_ptr > ( & choice ) ) {
std : : rethrow_exception ( * refusal ) ;
}
const AccountKey key = std : : get < AccountKey > ( choice ) ;
const BunqAccount & account = AccountBy ( key ) ;
std : : vector < std : : pair < std : : string , std : : string > > details = PaymentDetails ( account , order . amount , order . currency , order . payee . value ) ;
details . emplace_back ( " reference " , Shown ( order . reference ) ) ;
const Prompt prompt { actionCheckout , std : : format ( " pay {} to {} from {}, as an app asks at checkout, reference {} " , FormatMoney ( order . amount , order . currency ) , Party ( order . payee ) , Party ( account ) , Shown ( order . reference ) ) , std : : move ( details ) } ;
Gate ( worker , call , prompt , [ & worker , key , order ] ( sd_bus_message * reply ) {
AppendPaid ( reply , PayOrder ( worker , AccountBy ( key ) , order ) , false ) ;
} , [ & worker , settled = order . Key ( ) ] ( sd_bus_message * answer ) {
Settle ( worker , settled , answer ) ;
} ) ;
} catch ( . . . ) {
const MessagePtr answer = ErrorFor ( call , std : : current_exception ( ) ) ;
Deliver ( answer ) ;
Settle ( worker , order . Key ( ) , answer . get ( ) ) ;
}
} ) ;
return 1 ;
} ) ;
}
const std : : map < std : : string_view , sd_bus_message_handler_t > handlers = {
{ " Connectors " , OnConnectors } ,
{ " AddBunq " , OnAddBunq } ,
{ " AddBunqOAuth " , OnAddBunqOAuth } ,
{ " RemoveConnector " , OnRemoveConnector } ,
{ " Accounts " , OnAccounts } ,
{ " Transactions " , OnTransactions } ,
{ " Send " , OnSend } ,
{ " Schedule " , OnSchedule } ,
{ " Request " , OnRequest } ,
{ " Requests " , OnRequests } ,
{ " RevokeRequest " , OnRevokeRequest } ,
{ " IncomingRequests " , OnIncomingRequests } ,
{ " RespondToRequest " , OnRespondToRequest } ,
{ " ScheduledPayments " , OnScheduledPayments } ,
{ " CancelScheduledPayment " , OnCancelScheduledPayment } ,
{ " Draft " , OnDraft } ,
{ " DraftPayments " , OnDraftPayments } ,
{ " RespondToDraftPayment " , OnRespondToDraftPayment } ,
{ " Cards " , OnCards } ,
{ " SetCardStatus " , OnSetCardStatus } ,
{ " DefaultCheckoutAccount " , OnDefaultCheckoutAccount } ,
{ " SetDefaultCheckoutAccount " , OnSetDefaultCheckoutAccount } ,
} ;
}
std : : int32_t Nostro : : RunWorker ( std : : int32_t fd , std : : uint32_t uid , std : : string_view name , const DaemonOptions & options ) {
// No other process of this user, and no core dump, gets at the secrets this process holds.
prctl ( PR_SET_DUMPABLE , 0 ) ;
Worker worker ;
worker . options = options ;
worker . uid = uid ;
worker . name = std : : string ( name ) ;
worker . directory = options . state / " users " / std : : to_string ( uid ) ;
configPath = worker . directory ;
cachePath = worker . directory ;
// A directory made for the user this uid had before stays theirs: deleting a user and adding another hands out the
// same uid again.
const fs : : path owner = worker . directory / " owner " ;
if ( fs : : exists ( owner ) ) {
std : : ifstream in ( owner ) ;
std : : string recorded ;
std : : getline ( in , recorded ) ;
if ( recorded ! = worker . name ) {
worker . refusal = std : : format ( " {} holds the bank connections of '{}', who had uid {} before '{}': an administrator removes it, or moves it to that user's new uid, before nostrod serves this uid again " , worker . directory . string ( ) , recorded , uid , worker . name ) ;
}
}
noteSink = [ ] ( std : : string_view note ) {
notes . emplace_back ( note ) ;
} ;
ThrowOnSdBus ( sd_event_new ( & worker . event ) , " make an event loop " ) ;
// systemd stops the service with SIGTERM, which every process of it gets: the loop ends, and the tables are
// flushed and closed on the way out.
sigset_t terminate { } ;
sigemptyset ( & terminate ) ;
sigaddset ( & terminate , SIGTERM ) ;
sigprocmask ( SIG_BLOCK , & terminate , nullptr ) ;
ThrowOnSdBus ( sd_event_add_signal ( worker . event , nullptr , SIGTERM , nullptr , nullptr ) , " watch for SIGTERM " ) ;
sd_bus * link = nullptr ;
ThrowOnSdBus ( sd_bus_new ( & link ) , " serve the front " ) ;
worker . link . reset ( link ) ;
ThrowOnSdBus ( sd_bus_set_fd ( link , fd , fd ) , " serve the front " ) ;
sd_id128_t id { } ;
ThrowOnSdBus ( sd_id128_randomize ( & id ) , " serve the front " ) ;
ThrowOnSdBus ( sd_bus_set_server ( link , 1 , id ) , " serve the front " ) ;
ThrowOnSdBus ( sd_bus_start ( link ) , " serve the front " ) ;
worker . vtable = Vtable ( methods , [ ] ( std : : string_view member ) { return handlers . at ( member ) ; } ) ;
ThrowOnSdBus ( sd_bus_add_object_vtable ( link , nullptr , objectPath . data ( ) , interfaceName . data ( ) , worker . vtable . data ( ) , & worker ) , " serve the front " ) ;
worker . checkoutVtable = Vtable ( checkoutMethods , [ ] ( std : : string_view ) { return & OnPay ; } ) ;
ThrowOnSdBus ( sd_bus_add_object_vtable ( link , nullptr , objectPath . data ( ) , Checkout : : interfaceName . data ( ) , worker . checkoutVtable . data ( ) , & worker ) , " serve the front " ) ;
ThrowOnSdBus ( sd_bus_match_signal ( link , nullptr , " org.freedesktop.DBus.Local " , " /org/freedesktop/DBus/Local " , " org.freedesktop.DBus.Local " , " Disconnected " , OnFrontGone , & worker ) , " watch the front " ) ;
ThrowOnSdBus ( sd_bus_attach_event ( link , worker . event , SD_EVENT_PRIORITY_NORMAL ) , " serve the front " ) ;
sd_bus * system = nullptr ;
ThrowOnSdBus ( sd_bus_open_system_with_description ( & system , " nostrod worker " ) , " connect to the system bus " ) ;
worker . system . reset ( system ) ;
ThrowOnSdBus ( sd_bus_attach_event ( system , worker . event , SD_EVENT_PRIORITY_NORMAL ) , " connect to the system bus " ) ;
ThrowOnSdBus ( sd_event_add_time_relative ( worker . event , & worker . idle , CLOCK_MONOTONIC , Microseconds ( options . idle ) , 0 , OnIdle , & worker ) , " set the idle timer " ) ;
const std : : int32_t result = sd_event_loop ( worker . event ) ;
worker . link . reset ( ) ;
worker . system . reset ( ) ;
sd_event_source_unref ( worker . idle ) ;
sd_event_unref ( worker . event ) ;
ThrowOnSdBus ( result , " run the event loop " ) ;
return 0 ;
}