docs: cut the README down to what a reader needs first
The README had grown to 2,940 words (`wc -w README.md`): a table of the app's screens with a list of notes on how the app behaves under it, the checkout's method with its rules, errors and examples, and a subsection on polkit rules with one written out. It is 1,170 words now. What stays is what a reader needs to choose, install and use Nostro, and what they must know for their money's sake: how nostrod keeps the bank connections, the app's pictures with four notes under them, installing, the CLI's commands, a paragraph on the checkout that points at the interface's XML, and "Security" as a list whose last line points at the polkit policy. The README's warning against a rule that keeps an authorization moves into the comment of that policy file, which already describes the rule the README wrote out. The guide's commit guidelines now say that the README is kept short, and where what does not go into it goes. Two of the guide's sentences spoke of what the README says of each screen: the one is gone, the other no longer names the README. A third cited the README for what an app with access to the checkout can learn of an order, which the README no longer says: it stands without the citation.
This commit is contained in:
parent
564fcdfe0e
commit
25d991658f
3 changed files with 25 additions and 108 deletions
|
|
@ -124,7 +124,7 @@ The app end to end:
|
|||
- Accounts go to nostrod by IBAN, by name where the bank gave none; a connection by name, or by its number from a fresh `Accounts` listing when two share a name.
|
||||
- Which bank an account is with makes no difference outside the settings. No screen there names a bank, or a way to connect to one, in the app's own words: it says "your bank". `ShouldDriveTheApp` fails on a frame that does, excepting what nostrod and the bank say themselves: a note about a connector, a refusal with the call it refused, a link the bank made. What does differ by bank is asked of `:Banks`: a connection that pays between the user's own accounts only, as bunq's through OAuth, is `Connection::ownAccountsOnly`. It is marked Limited, a payment from it to anyone else is saved as a draft, and it cannot pay a request or a shop.
|
||||
- Adding a connection is three pages, from the settings and from the welcome alike: the banks (`add`), the bank's ways (`add:bunq`) and the way's form (`add:bunq:key`). The first two are built from `:Banks`. The form is the bank's own to draw and to check, in a file of the bank's (`Nostro.App-Bunq.cpp`), and its button ends in `App::Connect`, which is every bank's.
|
||||
- **The screens** (`implementations/Nostro.App-Screens.cpp`, and a bank's own forms in that bank's file) are functions from that state to a frame. A window under 600 dp wide shows one page at a time, with the app's places along its bottom; a wider one has them down its left side, and from 900 dp the accounts too. A screen that shows the bank's own state (the accounts, an account, the cards) reads it again four ways, all one action (`Refresher`): Refresh in the bar, F5, Ctrl+R, and the page pulled down at its top. The README's "The app" says what each screen is for.
|
||||
- **The screens** (`implementations/Nostro.App-Screens.cpp`, and a bank's own forms in that bank's file) are functions from that state to a frame. A window under 600 dp wide shows one page at a time, with the app's places along its bottom; a wider one has them down its left side, and from 900 dp the accounts too. A screen that shows the bank's own state (the accounts, an account, the cards) reads it again four ways, all one action (`Refresher`): Refresh in the bar, F5, Ctrl+R, and the page pulled down at its top.
|
||||
- **The window** (`Nostro.Ui.Shell`) is one sd-event loop that carries the compositor's connection, nostrod's bus, the desktop portal's bus and the timers. `Window` turns Crafter.Graphics' events into the `Context`'s, bringing time up to each and building a stale frame again first, and does what the `Context` wants afterwards (`Settle`, which the loop calls from a post source after every source that ran). A frame is drawn only when the compositor asks for one after something changed, or when it waits for one itself, having asked for another size (`onFrameOwed`): an idle window draws nothing. `Canvas` turns a `DrawList` into Crafter.Graphics' items, one dispatch per batch, from a pool of buffers per frame in flight. `Portal` reads the desktop's colour scheme and accent, and asks the desktop to open an address.
|
||||
- **`nostro-app`** puts them together, and has what looking at the window without a hand on it takes: `--size`, `--scale` (a phone's density on a desktop's display), `--theme`, `--route`, `--screenshot`, `--poke` and `--gallery`. It makes itself undumpable once the portal has seen it. Closing the window while a change is under way takes the window down and keeps the process until the answer has come.
|
||||
|
||||
|
|
@ -231,7 +231,7 @@ The bunq sandbox is still the check for what a fake cannot show. Since nostrod (
|
|||
4. A new sandbox account holds €0 and no payments. Fund it with `nostro request <iban> sugardaddy@bunq.com "Sugar Daddy" 50000`: it is paid within seconds. A hundred rows at once: `POST …/payment-batch` with `{"payments": […]}` (more than 200 exercises the paging). `curl` can call as the same user with the `sessionToken` from the scratch file, and sign with `openssl dgst -sha256 -sign` over the body using its `privateKey` PEM, base64, in `X-Bunq-Client-Signature`. A sandbox card (`POST /v1/user/{id}/card-debit` with `type: MASTERCARD`, `product_type: MASTERCARD_DEBIT`, a `name_on_card` out of `GET /v1/user/{id}/card-name` and a `pin_code_assignment`) stays a virtual one, `DEACTIVATED` at `VIRTUAL_DELIVERY`, whatever it is set to: `nostro cards` lists it as `VIRTUAL`, `cards freeze` and `unfreeze` are refused for it, and `cards lost` and `stolen` can be tried on it. OAuth stops at the token exchange: approving needs a person and the bunq app.
|
||||
5. bunq allows 3 GETs, 5 POSTs and 2 PUTs per three seconds per endpoint and one session per 30 seconds; nostro waits a 429 out, so a burst of runs is slow rather than failing. Concurrent nostro processes queue on `connectors.lock`, so two never hold the same account's table.
|
||||
|
||||
The app against the sandbox takes both Flatpaks installed and a hand on the window: every row of the README's "The app" from the window, with real polkit dialogs. That had not been done on 2026-11-19; nor had anything on a phone.
|
||||
The app against the sandbox takes both Flatpaks installed and a hand on the window, with real polkit dialogs. That had not been done on 2026-11-19; nor had anything on a phone.
|
||||
|
||||
A bug fix comes with a test that fails without it, and states in its commit how it was reproduced; a new bank comes with tests against a fake of it and with the same check against its sandbox or live API.
|
||||
|
||||
|
|
@ -296,7 +296,7 @@ The checklist, from the bunq connector:
|
|||
|
||||
- Patches go by mail to jorijnvdgraaf@catcrafts.net, as the README says. Branch off `master`.
|
||||
- Take the commit voice from the sibling Crafter repositories: `type(scope): imperative summary` with `feat`, `fix`, `refactor`, `docs` or `build`, and the partition or the CLI as the scope (`bunq`, `account`, `currency`, `connector`, `file`, `bus`, `client`, `daemon`, `checkout`, `cli`, `ui`, `app`, `shell`, `debug`, `build`, `packaging`). The body says what was wrong, why, and how it was verified against the sandbox.
|
||||
- The README is the manual: keep its CLI section true to `main.cpp` and "The app" true to the screens: what the one can do, the other can. Update `AGENTS.consumer.md` in the same change when a signature, a path, a default, a file format or an error behaviour consumers lean on changes; consumers pick it up on their next build.
|
||||
- The README is the manual, and is kept short: keep its CLI section true to `main.cpp` and what it says of the app true to the screens, and give a new feature a line there, or none. What a standard says is linked, not retold. How a screen works goes into this guide, what a caller needs into `AGENTS.consumer.md`, and what an administrator needs into the comment of `packaging/system/net.catcrafts.Nostro1.policy`. Update `AGENTS.consumer.md` in the same change when a signature, a path, a default, a file format or an error behaviour consumers lean on changes; consumers pick it up on their next build.
|
||||
- A change to how the app looks or is laid out says in its commit how it was looked at: which screens, at which sizes, on what. When it changes a screen the README shows, the pictures are taken again (`docs/screenshots/take.sh`) in the same commit.
|
||||
- The app's version is `NOSTRO_VERSION` in `project.cpp`, and the newest release in `packaging/flatpak/net.catcrafts.Nostro.metainfo.xml` is the same: `packaging/flatpak/release-version.sh` fails on a tree where they differ, and CI runs it first.
|
||||
- A change to `Transaction` is a schema change (design rule 5), and the commit message says so.
|
||||
|
|
@ -310,11 +310,11 @@ The checklist, from the bunq connector:
|
|||
|
||||
- `connectors.json` is the crown jewels: the bunq API key or OAuth token, the installation and session tokens and the unencrypted RSA private key, as plain text. Its protection is `0600` in a `0700` directory, and installed, the directory of a system user of its own (`/var/lib/nostro`) under a service that keeps the rest of the system read-only to it; it is replaced by a synced rename, never rewritten in place. There is no encryption at rest: root, and a disk taken out of the machine, read it. Never print it, never log a token or a signature, never copy a real one into a scratch directory or a commit. The transaction tables are the user's financial history, kept private the same way by Crafter.DB.
|
||||
- What nostrod does not stop: a program running as the user can still draw a dialog that looks like polkit's and ask for the password; only the system's own agent is the real one. On a session without a polkit agent (SSH, a TTY without one) nothing can confirm, so every call that needs a password is `Cancelled`. polkit logs the calling process's command line, which is why no secret is ever an argument.
|
||||
- What the shipped policy leaves open is looking: `View` needs no password in an active session, so any program of the user's there can read the accounts, payments, requests and cards. Everything else asks, `Change` included since 2026-11-19 (design rule 9). The README's "How Nostro runs" and "Security" say both plainly, and how a rule loosens it. polkit cannot tell the app from another program of the user's, so a rule that loosens an action loosens it for all of them; neither can nostrod, since whatever marks a process as the app (its executable, its Flatpak id, a unit's name) another program of the same user can wear, by starting the real app with its own code in it or on a display of its own.
|
||||
- What the shipped policy leaves open is looking: `View` needs no password in an active session, so any program of the user's there can read the accounts, payments, requests and cards. Everything else asks, `Change` included since 2026-11-19 (design rule 9). The README's "How Nostro runs" and "Security" say both plainly, and the policy file's comment how a rule loosens it. polkit cannot tell the app from another program of the user's, so a rule that loosens an action loosens it for all of them; neither can nostrod, since whatever marks a process as the app (its executable, its Flatpak id, a unit's name) another program of the same user can wear, by starting the real app with its own code in it or on a display of its own.
|
||||
- A worker makes itself undumpable, and the service sets `LimitCORE=0`: a core dump would hold the keys. A text that reaches a dialog goes through `Shown()`, so neither a payee's name nor a description can fake another amount or payee in it, start a line of its own, or leave an agent that reads its message as markup with nothing to show. What it cannot stop is a name that reads like part of the sentence ("Bob) from NL00… (Savings"): the summary puts the amount first and the paying account last for that reason.
|
||||
- The app is one of the programs nostrod keeps the user's bank from: it sees accounts and payments, which `View` allows any program of the user's in an active session, and nothing that could pay or change anything at the bank without the dialog. Its Flatpak has the compositor, the graphics device and `net.catcrafts.Nostro1` on the system bus, and no network, no files and no session bus beyond the portals. It makes itself undumpable, so another program of the user's cannot read a key out of it while it is typed. It writes no amount, IBAN or name to its log, which lands in the user's journal.
|
||||
- A build with `--debug-api` is none of that: every program of the user's can drive it and read what it shows, it logs what it is told, and a debugger can attach to it. It is for the made-up system and bunq's sandbox. `Ui_Type` refuses to type into a field that hides what it holds unless the text is a sandbox key (`sandbox_…`); nothing stops a hand from typing a real one into such a build, so do not. No Flatpak is made of it.
|
||||
- The checkout answers a repeated order with its payment id without a dialog, so any app with access to the checkout can learn whether the user paid an order whose IBAN, reference and amount it knows (README, "Checkout for apps").
|
||||
- The checkout answers a repeated order with its payment id without a dialog, so any app with access to the checkout can learn whether the user paid an order whose IBAN, reference and amount it knows.
|
||||
- A connector's `environment` decides between `api.bunq.com`, where `send` moves real money, and the sandbox. An API key says itself which it is of: a sandbox key starts with `sandbox_`, and anything else is production. Nobody chooses it: nostrod takes the key's own, and refuses an environment named otherwise before the key goes anywhere, so a real key is not sent to the sandbox by a slip (`OnAddBunq`); the CLI has no flag for it and the app's form no choice. An OAuth client has no such mark, so there the environment is named (`--sandbox`, the form's Production or Sandbox). Since 2026-11-19 production has been used to connect and to read accounts, payments and cards; these notes record no payment made on it, so try that with small amounts first.
|
||||
- Request bodies are `nlohmann::json` values serialised once (`dump` with invalid UTF-8 replaced), and the signature covers those exact bytes; nothing is spliced into JSON text by hand. Responses are used only after their server signature verifies.
|
||||
- A write is never replayed by the transport (fresh connection) and only resent by nostro after a 429, which bunq refuses before acting. An IBAN's check digits are verified before anything is sent.
|
||||
|
|
|
|||
119
README.md
119
README.md
|
|
@ -6,18 +6,16 @@ By making a open source app that interfaces with bank APIs.
|
|||
|
||||
## How Nostro runs
|
||||
|
||||
Nostro keeps your bank connections out of reach of the programs you run. Its daemon, nostrod, runs as a system user of its own and holds the bank connections of every user of the machine, each user's in a process of its own. The Nostro app and the `nostro` command ask nostrod over the system bus, and nostrod asks polkit whether you may:
|
||||
Nostro keeps your bank connections out of reach of the programs you run. Its daemon, nostrod, runs as a system user of its own and holds them for every user of the machine. The Nostro app and the `nostro` command ask nostrod over the system bus, and nostrod asks polkit whether you may:
|
||||
|
||||
- Looking at accounts, transactions, requests and cards needs nothing more in your desktop session.
|
||||
- Everything else asks for your password every time. That is whatever pays: a payment, a scheduled payment, a request or a draft payment you accept. And it is whatever changes something without paying anyone: asking someone for money, saving a draft payment, cancelling a scheduled payment, revoking a request you sent, rejecting a request or a draft payment, freezing, unfreezing or blocking a card, and changing your bank connections.
|
||||
|
||||
Nostro ships that strict on purpose: no program does anything at your bank without you. Whoever administers the machine can loosen it, see Security.
|
||||
- Looking at accounts, payments, requests and cards needs nothing more in your desktop session.
|
||||
- Everything else asks for your password every time: whatever pays, and whatever changes something at your bank or in your bank connections.
|
||||
|
||||
Your desktop draws the password dialog, and it says what it is for: the amount, who is paid, and from which account. Nothing secret goes on the command line: Nostro asks for an API key at a prompt. The app holds none of your keys either: one you type into it goes to nostrod and is forgotten.
|
||||
|
||||
## The app
|
||||
|
||||
The app is a window for a phone or a desktop. On a phone it shows one page at a time, with Accounts, Cards and Settings along the bottom; in a wider window those are down the side, with your accounts beside them. It follows your desktop's light or dark look and its accent colour.
|
||||
A window for a phone or a desktop, in your desktop's light or dark look. It does everything the `nostro` command does.
|
||||
|
||||
On a phone, in the dark look:
|
||||
|
||||
|
|
@ -33,36 +31,14 @@ In a desktop window, in the light look and in the dark one:
|
|||
|
||||
The accounts and the people in these pictures are made up.
|
||||
|
||||
It does everything the `nostro` command does:
|
||||
|
||||
| In the app | What it is for |
|
||||
|---|---|
|
||||
| Accounts | Your accounts by bank connection, with their balances. Pay and Request start from any of them. |
|
||||
| An account, Activity | Its payments by day. Search a name, a description or an IBAN, or filter by an exact amount and by dates: that looks through the payments Nostro has read from the bank, as you type. A payment opens with all of its details, and can be paid again or asked back from there. |
|
||||
| An account, Requests and Incoming | The requests for money you sent, each with its link to copy or open, which you can revoke; and the ones you received, to pay or reject. |
|
||||
| An account, Scheduled and Drafts | The payments on a schedule, to cancel; and the draft payments, to accept or reject. |
|
||||
| Pay | From which account, to an IBAN, an e-mail address or a phone number, how much, and what for: now, on a schedule, or as a draft. Its button sends it, and your system's password dialog is where you confirm it. A draft is paid only once it is accepted, which is confirmed there again. |
|
||||
| Request | Ask someone for money. Its button sends it as Pay's does, confirmed in the same dialog, and the result has a link to send them. |
|
||||
| Cards | Your cards and the account each pays from. Freeze or unfreeze one, or report it lost or stolen, which blocks it for good and is asked twice. Each is confirmed with your password. |
|
||||
| Settings, Bank connections | Your connections and whether they work. Add one in three steps: your bank, how to connect to it, and what that asks for. bunq connects with an API key or through OAuth. Remove one, which logs it out and deletes its stored payments. |
|
||||
| Settings, Pay at checkout from | The account apps are paid from at their checkout, see Checkout for apps. |
|
||||
| Settings, About and security | What Nostro protects you from, and its version. |
|
||||
|
||||
- Which bank an account is with makes no difference to how the app shows it or pays from it. Only adding a connection, in the settings, is each bank's own. Until a bank is connected the app offers to connect one.
|
||||
- The Pay and Request forms send on their button, and your system's password dialog is where you confirm it: read what it says. Closing the dialog pays nothing.
|
||||
- A connection that its bank lets pay between your own accounts only, as bunq does one made through OAuth, is marked Limited. A payment from it to anyone else is saved as a draft, to approve in your bank's app.
|
||||
- The app asks no second question before a payment or a request for money: the form's button sends it, and your system's password dialog is where you confirm it. That dialog is your system's, not the app's, and says what is paid, to whom and from which account: read it. Closing it pays nothing, and leaves the form as you filled it in.
|
||||
- Every change is confirmed in that dialog. Where one press would do it, such as rejecting a request or cancelling a scheduled payment, the app asks first whether you mean it.
|
||||
- A card's status is what its bank reports of it. A virtual card is shown as Virtual, and no more: the bank does not report whether one is frozen, and does not freeze or unfreeze one when Nostro asks, so do that in your bank's app. It can be reported lost or stolen like any card. For a plastic card, Deactivated is the bank's word for one that is frozen and for one that was never activated: the card's own sheet says so, and shows how far the bank is with the card.
|
||||
- If the bank's answer to a payment gets lost on the way, the app says the payment may have been made and shows you the account's payments. It does not offer to try again.
|
||||
- The app asks a phone's on-screen keyboard for digits at an amount, and to show and learn nothing of a key you type. Of a key in its field the app itself shows how it begins and how long it is, and never how it ends.
|
||||
- Your accounts, an account's lists and your cards are read again when you pull the page down at its top and let go, or with Refresh in the bar at the top.
|
||||
- Press a line of a payment's, a request's or a card's details to copy what it says. An IBAN is copied without its spaces.
|
||||
- With a keyboard: Tab and Shift+Tab move between what can be pressed, Enter presses it, Escape goes back, F5 or Ctrl+R reads the screen again, and Ctrl+F goes to the search. A long press or the right mouse button on a field offers paste, copy and select all.
|
||||
- The app needs nostrod installed (see Installing). Without it, it says so and how to get it.
|
||||
- Press a line of a payment's, a request's or a card's details to copy it.
|
||||
- With a keyboard: Tab moves, Enter presses, Escape goes back, F5 reads the screen again and Ctrl+F searches.
|
||||
|
||||
## Installing
|
||||
|
||||
nostrod and the `nostro` command come as a Flatpak, `net.catcrafts.Nostrod`, installed for the whole system. A Flatpak cannot install a few system files Nostro needs: nostrod's user, its D-Bus and polkit policies, its systemd unit, and the `nostro` command. Install both as root. The Flatpak comes from the Catcrafts Flatpak repository, which the first line adds:
|
||||
nostrod and the `nostro` command come as a Flatpak, `net.catcrafts.Nostrod`, installed for the whole system. A Flatpak cannot install a few system files Nostro needs: nostrod's user, its D-Bus and polkit policies, its systemd unit, and the `nostro` command. Install both as root:
|
||||
|
||||
```
|
||||
flatpak remote-add --system --if-not-exists catcrafts https://flatpak.catcrafts.net/catcrafts.flatpakrepo
|
||||
|
|
@ -70,15 +46,13 @@ flatpak install --system catcrafts net.catcrafts.Nostrod # the Flatpak
|
|||
packaging/system/install.sh # the system files
|
||||
```
|
||||
|
||||
The app is a Flatpak of its own, `net.catcrafts.Nostro`, in the same repository, which each user can install for themselves:
|
||||
The app is a Flatpak of its own, `net.catcrafts.Nostro`, which each user can install for themselves; `install.sh --app` installs it for every user instead:
|
||||
|
||||
```
|
||||
flatpak remote-add --user --if-not-exists catcrafts https://flatpak.catcrafts.net/catcrafts.flatpakrepo
|
||||
flatpak install --user catcrafts net.catcrafts.Nostro
|
||||
```
|
||||
|
||||
`packaging/system/install.sh --app` installs it for every user instead, together with the rest. The app can reach your display, your graphics card and nostrod, and nothing else: no network and none of your files.
|
||||
|
||||
`packaging/system/uninstall.sh` removes everything again. Your bank connections stay in `/var/lib/nostro` until you give it `--purge`.
|
||||
|
||||
## CLI
|
||||
|
|
@ -102,11 +76,9 @@ nostro cards [freeze|unfreeze|lost|stolen {card id}]
|
|||
nostro checkout account [{account}] # the account apps may ask you to pay from, see Checkout
|
||||
```
|
||||
|
||||
- `{account}` is an account's name or its IBAN. Use the IBAN when two accounts share a name.
|
||||
- `{to}` and `{from}` are an IBAN, an e-mail address, or a phone number starting with `+`. IBANs are checked before anything is sent. An e-mail address is refused when the password dialog could not show it exactly as it is: one with an `&`, a `<` or a `>` in it, or one longer than 254 characters.
|
||||
- `{account}` is an account's name or its IBAN. `{to}` and `{from}` are an IBAN, an e-mail address, or a phone number starting with `+`.
|
||||
- Amounts are in the smallest unit of your currency, so for EUR `1250` is €12.50.
|
||||
- Dates are `YYYY-MM-DD` or `"YYYY-MM-DD hh:mm"`, in local time.
|
||||
- `nostro cards` lists a virtual card as `VIRTUAL`. bunq does not say whether one is frozen and does not freeze or unfreeze one when asked, so `freeze` and `unfreeze` refuse it; `lost` and `stolen` work.
|
||||
|
||||
## Supported banks
|
||||
|
||||
|
|
@ -114,39 +86,7 @@ nostro checkout account [{account}] # the account apps may ask y
|
|||
|
||||
## Checkout for apps
|
||||
|
||||
An app, such as a shop, can have the user's Nostro pay an order. Nostro pays it from the account the user chose once, in the app's settings or with `nostro checkout account {account}`, after the user has confirmed the payment with their password at a prompt that shows the amount, the payee, the reference and that account. The app never names or sees the account, and gets back only the payment's id. An account connected through OAuth cannot pay a shop, so it cannot be chosen.
|
||||
|
||||
Apps talk to `net.catcrafts.Nostro1.Checkout` on the system bus. A Flatpak app asks for it with `--system-talk-name=net.catcrafts.Nostro1.Checkout` in its finish-args, which reaches nothing else of Nostro. The interface is one method, documented in [packaging/dbus/net.catcrafts.Nostro1.Checkout.xml](packaging/dbus/net.catcrafts.Nostro1.Checkout.xml):
|
||||
|
||||
```
|
||||
Pay(payeeIban s, payeeName s, amount x, currency s, reference s, options a{sv}) -> (paymentId t, results a{sv})
|
||||
```
|
||||
|
||||
- The payee is an IBAN. The amount is in the currency's smallest unit (`1250` is €12.50), and the currency is `EUR`. The reference is your order number: it becomes the payment's description, and it tells orders apart.
|
||||
- Allow interactive authorization on the call, make the call asynchronously, and give it a timeout of minutes, because the user may take a while at the prompt.
|
||||
- An order is paid once. Calling `Pay` again with the same IBAN and reference, after a timeout or a crash, returns the first payment with `repeated` set to true in `results`, without asking the user. While the user is still at the prompt, the second call waits for the first. The same reference with another amount is refused.
|
||||
- `net.catcrafts.Nostro1.Error.Cancelled` means the user did not confirm, and `NoCheckoutAccount` that they have not chosen an account. `org.freedesktop.DBus.Error.ServiceUnknown` means Nostro is not installed. The XML lists the other errors.
|
||||
- Ignore keys you do not know in `results`, because later versions may add some. Nostro ignores options it does not know.
|
||||
- A payment id is not a receipt. Confirm the money arrived with your own bank.
|
||||
|
||||
From a shell:
|
||||
|
||||
```
|
||||
busctl call --system --timeout=10min net.catcrafts.Nostro1.Checkout /net/catcrafts/Nostro1 \
|
||||
net.catcrafts.Nostro1.Checkout Pay 'ssxssa{sv}' NL91ABNA0417164300 'Shop BV' 1250 EUR order-1234 0
|
||||
```
|
||||
|
||||
Generate a proxy from the XML with `gdbus-codegen` (GLib and GTK), `qdbusxml2cpp` (Qt) or `zbus-xmlgen` (Rust). A C++ app built with Crafter.Build can depend on Nostro with `--product=checkout` instead. That builds the `Nostro.Checkout` module alone, which links only libsystemd:
|
||||
|
||||
```cpp
|
||||
import Nostro.Checkout;
|
||||
|
||||
const Nostro::Checkout::Paid paid = Nostro::Checkout::Pay({.payeeIban = "NL91ABNA0417164300", .payeeName = "Shop BV", .amount = 1250, .reference = "order-1234"});
|
||||
```
|
||||
|
||||
`Pay` blocks until the user has answered, so call it off the UI thread. It throws `Nostro::Checkout::Cancelled`, `Nostro::Checkout::NoCheckoutAccount`, or `Nostro::Checkout::Error` with the D-Bus error name.
|
||||
|
||||
Any app the user runs with access to the checkout can ask whether an order was paid, by asking for it again with the same IBAN, reference and amount: it gets the payment id without a prompt. Nostro cannot tell which app is asking, so a reference should be hard to guess. With another amount it is refused without being told what the order was paid for, and an error from the bank says what the bank said, not which account it said it about.
|
||||
An app, such as a shop, can have Nostro pay an order from the account you chose for that, in the app's settings or with `nostro checkout account {account}`, once you confirm the payment with your password. It calls `Pay` of `net.catcrafts.Nostro1.Checkout` on the system bus, which [packaging/dbus/net.catcrafts.Nostro1.Checkout.xml](packaging/dbus/net.catcrafts.Nostro1.Checkout.xml) documents, or links the `Nostro.Checkout` module (`crafter-build --product=checkout`). It gets a payment id back, which is not a receipt: confirm the money arrived with your own bank.
|
||||
|
||||
## Contributing
|
||||
|
||||
|
|
@ -164,41 +104,16 @@ Please report security vuneribilities to jorijnvdgraaf@catcrafts.net before publ
|
|||
|
||||
What Nostro protects you from, and what it does not:
|
||||
|
||||
- Programs you run cannot read your bank connections, which belong to nostrod's own user, and cannot pay or change anything at your bank without your password. The Nostro app is one of those programs: it holds no key and no token.
|
||||
- What needs no password in your desktop session is looking. Any program you run there can read your accounts, payments, requests and cards.
|
||||
- The password dialog is your desktop's. A program running as you could still draw one that looks the same, so type your password only for something you asked for, and check what the dialog says. It shows the address that is paid whole and as it is. A name is cut off after 64 characters, and an `&` in one is shown as a `+`.
|
||||
- Programs you run cannot read your bank connections, and cannot pay or change anything at your bank without your password. They can look: in your desktop session any of them can read your accounts, payments, requests and cards.
|
||||
- The app is one of those programs. It holds no key, and its Flatpak has no network and none of your files.
|
||||
- The password dialog is your desktop's. A program could draw one that looks the same, so type your password only for something you asked for, and read what the dialog says.
|
||||
- Over SSH, or in any session without a polkit agent, nothing can ask for your password, so whatever needs it is refused.
|
||||
- The bank connections are not encrypted on disk: root, and anyone holding the disk, can read them. Use full-disk encryption.
|
||||
|
||||
### Asking for less, or for more
|
||||
|
||||
As shipped, everything but looking asks for your password, every time. That is the secure setting, and changing it is a choice for whoever administers the machine, made with polkit rules in `/etc/polkit-1/rules.d/`.
|
||||
|
||||
- The actions are `net.catcrafts.Nostro1.View` (looking), `Pay`, `Change` (what changes something and pays nobody: a request for money, a draft, a scheduled payment cancelled, a request revoked or rejected, a draft rejected, a card frozen), `UnfreezeCard`, `BlockCard`, `Connectors` and `Checkout`.
|
||||
- Each check gives rules what it is about: `amount_minor`, `currency`, `counterparty`, `account_iban` and `environment` for a payment, a draft or a request for money, `reference` at checkout, and `card` and `status` for a card.
|
||||
- A rule cannot tell the Nostro app from any other program you run. What it lets pass without a password, it lets pass for all of them.
|
||||
- A rule can also ask for more, such as an administrator's approval above an amount. Where one makes looking take a password, a payment asks twice, since nostrod looks an account up only for someone who may see it.
|
||||
|
||||
This rule lets one user freeze a card without a password, from their own desktop session, and leaves everything else as it is:
|
||||
|
||||
```js
|
||||
// /etc/polkit-1/rules.d/50-nostro.rules
|
||||
polkit.addRule(function(action, subject) {
|
||||
if (action.id == "net.catcrafts.Nostro1.Change" && action.lookup("status") == "DEACTIVATED" &&
|
||||
subject.user == "alice" && subject.local && subject.active) {
|
||||
return polkit.Result.YES;
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
Without the test of `status` it would let every change of that action pass. Do not have a rule keep an authorization (`AUTH_SELF_KEEP`): for some minutes polkit then lets the same program through for that action whatever it asks next, which under `Pay` is a payment to someone else.
|
||||
- The bank connections are not encrypted on disk: use full-disk encryption.
|
||||
- An administrator can change what asks for a password, with polkit rules for the actions in [the policy](packaging/system/net.catcrafts.Nostro1.policy). A rule cannot tell Nostro from any other program you run, and one that lets `Pay` or `Change` pass makes one press on a form a payment or a draft.
|
||||
|
||||
## License
|
||||
|
||||
Nostro has two licences, and each source file says in its first line which one it is under:
|
||||
|
||||
- The library, nostrod, the `nostro` command and the checkout library are LGPL-3.0-only, see [LICENSE](LICENSE). A program under another licence can be built on the library or the checkout.
|
||||
- The app is GPL-3.0-only, see [LICENSE.GPL](LICENSE.GPL): its screens, the toolkit they are built with and its window (the modules `Nostro.Ui`, `Nostro.App` and `Nostro.Ui.Shell`, and `nostro-app`). A program built from any of it is under the GPL as a whole.
|
||||
The library, nostrod, the `nostro` command and the checkout library are LGPL-3.0-only, see [LICENSE](LICENSE). The app is GPL-3.0-only, see [LICENSE.GPL](LICENSE.GPL): the modules `Nostro.Ui`, `Nostro.App` and `Nostro.Ui.Shell`, and `nostro-app`.
|
||||
|
||||
The app is set in Noto Sans, under the SIL Open Font License ([assets/OFL.txt](assets/OFL.txt)); [packaging/licenses/NOTICE](packaging/licenses/NOTICE) lists what else the Flatpaks carry.
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@
|
|||
without them. Loosening it is an administrator's choice, made with a rule, and polkit cannot tell one program of
|
||||
a user's from another, so a rule that lets an action pass lets it pass for all of them. A rule that lets a card
|
||||
be frozen without a password, for one, returns polkit.Result.YES for the action Change when
|
||||
action.lookup("status") is "DEACTIVATED".
|
||||
action.lookup("status") is "DEACTIVATED"; without that test of status it would let every change pass. Do not
|
||||
have a rule keep an authorization (AUTH_SELF_KEEP): for some minutes polkit then lets the same program through
|
||||
for that action whatever it asks next, which under Pay is a payment to someone else.
|
||||
|
||||
A call that names an account, a card, a request, a draft or a connector, and is not a call to see it, is checked
|
||||
twice: for View, before nostrod looks up what it names, and then for what it does. A caller who may not see the
|
||||
|
|
|
|||
Loading…
Reference in a new issue