anastasis.texi (224291B)
1 \input texinfo @c -*-texinfo-*- 2 @c %**start of header 3 @setfilename anastasis.info 4 @documentencoding UTF-8 5 @ifinfo 6 @*Generated by Sphinx 4.3.2.@* 7 @end ifinfo 8 @settitle Anastasis Manual 9 @defindex ge 10 @paragraphindent 0 11 @exampleindent 4 12 @finalout 13 @dircategory CATEGORY 14 @direntry 15 * MENU ENTRY: (anastasis.info). DESCRIPTION 16 @end direntry 17 18 @definfoenclose strong,`,' 19 @definfoenclose emph,`,' 20 @c %**end of header 21 22 @copying 23 @quotation 24 Anastasis 0.0.0pre0, Aug 12, 2023 25 26 Anastasis SARL 27 28 Copyright @copyright{} 2020-2021 Anastasis SARL (AGPLv3+ or GFDL 1.3+) 29 @end quotation 30 31 @end copying 32 33 @titlepage 34 @title Anastasis Manual 35 @insertcopying 36 @end titlepage 37 @contents 38 39 @c %** start of user preamble 40 41 @c %** end of user preamble 42 43 @ifnottex 44 @node Top 45 @top Anastasis Manual 46 @insertcopying 47 @end ifnottex 48 49 @c %**start of body 50 @anchor{index doc}@anchor{0} 51 @c This file is part of GNU Anastasis. 52 @c Copyright (C) 2020-2021 Anastasis SARL 53 @c 54 @c Anastasis is free software; you can redistribute it and/or modify it under the 55 @c terms of the GNU Affero General Public License as published by the Free Software 56 @c Foundation; either version 2.1, or (at your option) any later version. 57 @c 58 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY 59 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 60 @c A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 61 @c 62 @c You should have received a copy of the GNU Affero General Public License along with 63 @c Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 64 @c 65 @c @author Christian Grothoff 66 67 Anastasis is a Free Software protocol and implementation that allows 68 users to securely deposit @strong{core secrets} with an open set of escrow 69 providers and to recover these secrets if their original copies are 70 lost. 71 72 Anastasis is intended for users that want to make backups of key 73 material, such as OpenPGP encryption keys, hard disk encryption keys 74 or master keys of electronic wallets. Anastasis is NOT intended to 75 store large amounts of secret data, it is only designed to safeguard 76 key material. 77 78 Anastasis solves the issue of keeping key material both available 79 to the authorized user(s), and confidential from anyone else. 80 81 With Anastasis, the @strong{core secrets} are protected from the Anastasis 82 escrow providers by encrypting each with a @strong{master key}. The 83 @strong{master key} can be split and distributed across the escrow 84 providers to ensure that no single escrow provider can recover the 85 @strong{master key} on its own. Which subset(s) of Anastasis providers 86 must be contacted to recover a @strong{master key} is freely configurable. 87 88 With Anastasis, users can reliably recover their @strong{core secret}, 89 while Anastasis makes this difficult for everyone else. This is even 90 true if the user is unable to reliably remember any secret with 91 sufficiently high entropy: Anastasis does not simply reduce the 92 problem to encrypting the @strong{core secret} using some other key 93 material in possession of the user. 94 95 @menu 96 * Documentation Overview:: 97 98 @detailmenu 99 --- The Detailed Node Listing --- 100 101 Documentation Overview 102 103 * Introduction:: 104 * Installation:: 105 * Configuration:: 106 * Cryptography:: 107 * REST API:: 108 * Reducer API:: 109 * Authentication Methods:: 110 * DB Schema:: 111 * Anastasis licensing information:: 112 * Man Pages:: 113 * Complete Index:: 114 * GNU Free Documentation License:: 115 116 Introduction 117 118 * User Identifiers:: 119 * Adversary models:: 120 * The recovery document:: 121 122 Installation 123 124 * Installing from source:: 125 * Installing Anastasis binary packages on Debian:: 126 * Installing Anastasis binary packages on Ubuntu:: 127 128 Installing from source 129 130 * Installing GNUnet:: 131 * Installing the Taler Exchange:: 132 * Installing the Taler Merchant:: 133 * Installing Anastasis:: 134 * Installing GNUnet-gtk:: 135 * Installing Anastasis-gtk:: 136 137 Installing Anastasis binary packages on Debian 138 139 * Installing the graphical front-end:: 140 * Installing the backend:: 141 142 Installing Anastasis binary packages on Ubuntu 143 144 * Installing the graphical front-end: Installing the graphical front-end<2>. 145 * Installing the backend: Installing the backend<2>. 146 147 Configuration 148 149 * Configuration format:: 150 * Using anastasis-config:: 151 * Terms of Service:: 152 * Privacy Policy:: 153 * Legal policies directory layout:: 154 * Generating the Legal Terms:: 155 * Adding translations:: 156 * Updating legal documents:: 157 158 Legal policies directory layout 159 160 * Example:: 161 162 Cryptography 163 164 * Key derivations:: 165 * Key Usage:: 166 * Availability Considerations:: 167 168 Key derivations 169 170 * Verification:: 171 * Encryption:: 172 173 Key Usage 174 175 * Encryption: Encryption<2>. 176 * Signatures:: 177 178 REST API 179 180 * HTTP Request and Response:: 181 * Protocol Version Ranges:: 182 * Common encodings:: 183 * Receiving Configuration:: 184 * Receiving Terms of Service:: 185 * Managing policy:: 186 * Managing truth:: 187 188 Common encodings 189 190 * Binary Data:: 191 * Hash codes:: 192 * Large numbers:: 193 * Timestamps:: 194 * Integers:: 195 * Objects:: 196 * Keys:: 197 * Signatures: Signatures<2>. 198 * Amounts:: 199 * Time:: 200 * Cryptographic primitives:: 201 * Signatures: Signatures<3>. 202 203 Reducer API 204 205 * States:: 206 * Backup Reducer:: 207 * Recovery Reducer:: 208 * Reducer transitions:: 209 210 Reducer transitions 211 212 * Initial state:: 213 * Common transitions:: 214 * Backup transitions:: 215 * Recovery transitions:: 216 217 Authentication Methods 218 219 * SMS (sms): SMS sms. 220 * Email verification (email): Email verification email. 221 * Video identification (vid): Video identification vid. 222 * Security question (qa): Security question qa. 223 * Snail mail verification (post): Snail mail verification post. 224 225 Anastasis licensing information 226 227 * Anastasis (git;//git.taler.net/anastasis): Anastasis git //git taler net/anastasis. 228 * Anastasis-gtk (git;//git.taler.net/anastasis-gtk): Anastasis-gtk git //git taler net/anastasis-gtk. 229 * Documentation:: 230 231 Anastasis (git://git.taler.net/anastasis) 232 233 * Runtime dependencies:: 234 235 Anastasis-gtk (git://git.taler.net/anastasis-gtk) 236 237 * Runtime dependencies: Runtime dependencies<2>. 238 239 Man Pages 240 241 * anastasis-config(1): anastasis-config 1. 242 * anastasis-dbconfig(1): anastasis-dbconfig 1. 243 * anastasis-dbinit(1): anastasis-dbinit 1. 244 * anastasis-gtk(1): anastasis-gtk 1. 245 * anastasis-helper-authorization-iban(1): anastasis-helper-authorization-iban 1. 246 * anastasis-httpd(1): anastasis-httpd 1. 247 * anastasis-reducer(1): anastasis-reducer 1. 248 * anastasis.conf(5): anastasis conf 5. 249 250 anastasis-config(1) 251 252 * Synopsis:: 253 * Description:: 254 * See Also:: 255 * Bugs:: 256 257 anastasis-dbconfig(1) 258 259 * Synopsis: Synopsis<2>. 260 * Description: Description<2>. 261 * See Also: See Also<2>. 262 * Bugs: Bugs<2>. 263 264 anastasis-dbinit(1) 265 266 * Synopsis: Synopsis<3>. 267 * Description: Description<3>. 268 * See Also: See Also<3>. 269 * Bugs: Bugs<3>. 270 271 anastasis-gtk(1) 272 273 * Synopsis: Synopsis<4>. 274 * Description: Description<4>. 275 * See Also: See Also<4>. 276 * Bugs: Bugs<4>. 277 278 anastasis-helper-authorization-iban(1) 279 280 * Synopsis: Synopsis<5>. 281 * Description: Description<5>. 282 * See Also: See Also<5>. 283 * Bugs: Bugs<5>. 284 285 anastasis-httpd(1) 286 287 * Synopsis: Synopsis<6>. 288 * Description: Description<6>. 289 * Signals:: 290 * See also:: 291 * Bugs: Bugs<6>. 292 293 anastasis-reducer(1) 294 295 * Synopsis: Synopsis<7>. 296 * Description: Description<7>. 297 * See Also: See Also<6>. 298 * Bugs: Bugs<7>. 299 300 anastasis.conf(5) 301 302 * Description: Description<8>. 303 * SEE ALSO:: 304 * BUGS:: 305 306 Description 307 308 * GLOBAL OPTIONS:: 309 * Backend options:: 310 * Authorization options:: 311 * Postgres database configuration:: 312 313 Authorization options 314 315 * SMS Authorization options:: 316 * Email Authorization options:: 317 * Post Authorization options:: 318 * IBAN Authorization options:: 319 320 GNU Free Documentation License 321 322 * 0. PREAMBLE: 0 PREAMBLE. 323 * 1. APPLICABILITY AND DEFINITIONS: 1 APPLICABILITY AND DEFINITIONS. 324 * 2. VERBATIM COPYING: 2 VERBATIM COPYING. 325 * 3. COPYING IN QUANTITY: 3 COPYING IN QUANTITY. 326 * 4. MODIFICATIONS: 4 MODIFICATIONS. 327 * 5. COMBINING DOCUMENTS: 5 COMBINING DOCUMENTS. 328 * 6. COLLECTIONS OF DOCUMENTS: 6 COLLECTIONS OF DOCUMENTS. 329 * 7. AGGREGATION WITH INDEPENDENT WORKS: 7 AGGREGATION WITH INDEPENDENT WORKS. 330 * 8. TRANSLATION: 8 TRANSLATION. 331 * 9. TERMINATION: 9 TERMINATION. 332 * 10. FUTURE REVISIONS OF THIS LICENSE: 10 FUTURE REVISIONS OF THIS LICENSE. 333 * 11. RELICENSING: 11 RELICENSING. 334 * ADDENDUM; How to use this License for your documents: ADDENDUM How to use this License for your documents. 335 336 @end detailmenu 337 @end menu 338 339 @node Documentation Overview,,Top,Top 340 @anchor{index anastasis-documentation}@anchor{1}@anchor{index documentation-overview}@anchor{2} 341 @chapter Documentation Overview 342 343 344 @c This file is part of Anastasis 345 @c Copyright (C) 2019-2021 Anastasis SARL 346 @c 347 @c Anastasis is free software; you can redistribute it and/or modify it under the 348 @c terms of the GNU Affero General Public License as published by the Free Software 349 @c Foundation; either version 2.1, or (at your option) any later version. 350 @c 351 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY 352 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 353 @c A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 354 @c 355 @c You should have received a copy of the GNU Affero General Public License along with 356 @c Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 357 @c 358 @c @author Christian Grothoff 359 @c @author Dominik Meister 360 @c @author Dennis Neufeld 361 362 @menu 363 * Introduction:: 364 * Installation:: 365 * Configuration:: 366 * Cryptography:: 367 * REST API:: 368 * Reducer API:: 369 * Authentication Methods:: 370 * DB Schema:: 371 * Anastasis licensing information:: 372 * Man Pages:: 373 * Complete Index:: 374 * GNU Free Documentation License:: 375 376 @end menu 377 378 @node Introduction,Installation,,Documentation Overview 379 @anchor{introduction doc}@anchor{3}@anchor{introduction introduction}@anchor{4} 380 @section Introduction 381 382 383 To understand how Anastasis works, you need to understand three key 384 concepts: user identifiers, our adversary model and the role of the 385 recovery document. 386 387 @menu 388 * User Identifiers:: 389 * Adversary models:: 390 * The recovery document:: 391 392 @end menu 393 394 @node User Identifiers,Adversary models,,Introduction 395 @anchor{introduction user-identifiers}@anchor{5} 396 @subsection User Identifiers 397 398 399 To uniquely identify users, an “unforgettable” @strong{identifier} is used. This 400 identifier should be difficult to guess for anybody but the user. However, the 401 @strong{identifier} is not expected to have sufficient entropy or secrecy to be 402 cryptographically secure. Examples for such identifier would be a 403 concatenation of the full name of the user and their social security or 404 passport number(s). For Swiss citizens, the AHV number could also be used. 405 406 @node Adversary models,The recovery document,User Identifiers,Introduction 407 @anchor{introduction adversary-models}@anchor{6} 408 @subsection Adversary models 409 410 411 The adversary model of Anastasis has two types of adversaries: weak 412 adversaries which do not know the user’s @strong{identifier}, and strong 413 adversaries which somehow do know a user’s @strong{identifier}. For weak 414 adversaries the system guarantees full confidentiality. For strong 415 adversaries, breaking confidentiality additionally requires that Anastasis 416 escrow providers must have colluded. The user is able to specify a set of 417 @strong{policies} which determine which Anastasis escrow providers would need to 418 collude to break confidentiality. These policies also set the bar for the user 419 to recover their core secret. 420 421 @node The recovery document,,Adversary models,Introduction 422 @anchor{introduction the-recovery-document}@anchor{7} 423 @subsection The recovery document 424 425 426 A @strong{recovery document} includes all of the information a user needs 427 to recover access to their core secret. It specifies a set of 428 @strong{escrow methods}, which specify how the user should convince the 429 Anastasis server that they are “real”. Escrow methods can for example 430 include SMS-based verification, video identification or a security 431 question. For each escrow method, the Anastasis server is provided 432 with @strong{truth}, that is data the Anastasis operator may learn during 433 the recovery process. Truth always consists of an encrypted key share 434 and associated data to authenticate the user. Examples for truth 435 would be a phone number (for SMS), a picture of the user (for video 436 identification), or the (hash of) a security answer. A strong 437 adversary is assumed to be able to learn the truth, while weak 438 adversaries must not. In addition to a set of escrow methods and 439 associated Anastasis server operators, the @strong{recovery document} also 440 specifies @strong{policies}, which describe the combination(s) of the 441 escrow methods that suffice to obtain access to the core secret. For 442 example, a @strong{policy} could say that the escrow methods (A and B) 443 suffice, and a second policy may permit (A and C). A different user 444 may choose to use the policy that (A and B and C) are all required. 445 Anastasis imposes no limit on the number of policies in a @strong{recovery 446 document}, or the set of providers or escrow methods involved in 447 guarding a user’s secret. Weak adversaries must not be able to deduce 448 information about a user’s @strong{recovery document} (except for its 449 length, which may be exposed to an adversary which monitors the user’s 450 network traffic). 451 452 @c This file is part of Anastasis 453 @c Copyright (C) 2019-2021 Anastasis SARL 454 @c 455 @c Anastasis is free software; you can redistribute it and/or modify it under the 456 @c terms of the GNU Affero General Public License as published by the Free Software 457 @c Foundation; either version 2.1, or (at your option) any later version. 458 @c 459 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY 460 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 461 @c A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 462 @c 463 @c You should have received a copy of the GNU Affero General Public License along with 464 @c Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 465 @c 466 @c @author Christian Grothoff 467 @c @author Dominik Meister 468 @c @author Dennis Neufeld 469 470 @node Installation,Configuration,Introduction,Documentation Overview 471 @anchor{installation doc}@anchor{8}@anchor{installation installation}@anchor{9} 472 @section Installation 473 474 475 @cartouche 476 @quotation Note 477 Currently, GNU Anastasis is released as alpha-quality software. 478 When testing Anastasis, please choose @code{demoland} as 479 your country of residence! 480 @strong{It is not yet production ready! You cannot rely on it to keep 481 your secrets recoverable today!} In particular, we need to 482 still review the various country-specific questions used to create 483 unique user identifiers at the beginning of the backup and 484 recovery process. Community feedback on those inputs would be 485 particularly welcome! 486 @end quotation 487 @end cartouche 488 489 Please install the following packages before proceeding with the 490 exchange compilation. 491 492 493 @itemize - 494 495 @item 496 libsqlite3 >= 3.16.2 497 498 @item 499 GNU libunistring >= 0.9.3 500 501 @item 502 libcurl >= 7.26 (or libgnurl >= 7.26) 503 504 @item 505 libqrencode >= 4.0.0 506 507 @item 508 GNU libgcrypt >= 1.6 509 510 @item 511 libsodium >= 1.0 512 513 @item 514 libargon2 >= 20171227 515 516 @item 517 libjansson >= 2.7 518 519 @item 520 Postgres >= 9.6, including libpq 521 522 @item 523 GNU libmicrohttpd >= 0.9.71 524 525 @item 526 GNUnet >= 0.14.0 (from source tarball@footnote{http://ftpmirror.gnu.org/gnunet/}) 527 528 @item 529 GNU Taler exchange 530 531 @item 532 GNU Taler merchant backend 533 @end itemize 534 535 Except for the last two, these are available in most GNU/Linux distributions 536 and should just be installed using the respective package manager. 537 538 @menu 539 * Installing from source:: 540 * Installing Anastasis binary packages on Debian:: 541 * Installing Anastasis binary packages on Ubuntu:: 542 543 @end menu 544 545 @node Installing from source,Installing Anastasis binary packages on Debian,,Installation 546 @anchor{installation installing-from-source}@anchor{a} 547 @subsection Installing from source 548 549 550 The following instructions will show how to install libgnunetutil and 551 the GNU Taler exchange from source. 552 553 @menu 554 * Installing GNUnet:: 555 * Installing the Taler Exchange:: 556 * Installing the Taler Merchant:: 557 * Installing Anastasis:: 558 * Installing GNUnet-gtk:: 559 * Installing Anastasis-gtk:: 560 561 @end menu 562 563 @node Installing GNUnet,Installing the Taler Exchange,,Installing from source 564 @anchor{installation installing-gnunet}@anchor{b} 565 @subsubsection Installing GNUnet 566 567 568 Before you install GNUnet, you must download and install the dependencies 569 mentioned in the previous section, otherwise the build may succeed, but could 570 fail to export some of the tooling required by GNU Taler. 571 572 To install GNUnet, unpack the tarball and change 573 into the resulting directory, then proceed as follows: 574 575 @example 576 $ ./configure [--prefix=GNUNETPFX] 577 $ # Each dependency can be fetched from non standard locations via 578 $ # the '--with-<LIBNAME>' option. See './configure --help'. 579 $ make 580 # make install 581 # ldconfig 582 @end example 583 584 If you did not specify a prefix, GNUnet will install to @code{/usr/local}, 585 which requires you to run the last step as @code{root}. 586 The @code{ldconfig} command (also run as @code{root}) makes the 587 shared object libraries (@code{.so} files) 588 visible to the various installed programs. 589 590 @node Installing the Taler Exchange,Installing the Taler Merchant,Installing GNUnet,Installing from source 591 @anchor{installation installing-the-taler-exchange}@anchor{c} 592 @subsubsection Installing the Taler Exchange 593 594 595 After installing GNUnet, unpack the GNU Taler exchange tarball, 596 change into the resulting directory, and proceed as follows: 597 598 @example 599 $ ./configure [--prefix=EXCHANGEPFX] \ 600 [--with-gnunet=GNUNETPFX] 601 $ # Each dependency can be fetched from non standard locations via 602 $ # the '--with-<LIBNAME>' option. See './configure --help'. 603 $ make 604 # make install 605 @end example 606 607 If you did not specify a prefix, the exchange will install to @code{/usr/local}, 608 which requires you to run the last step as @code{root}. You have to specify 609 @code{--with-gnunet=/usr/local} if you installed GNUnet to @code{/usr/local} in the 610 previous step. 611 612 @node Installing the Taler Merchant,Installing Anastasis,Installing the Taler Exchange,Installing from source 613 @anchor{installation installing-the-taler-merchant}@anchor{d} 614 @subsubsection Installing the Taler Merchant 615 616 617 GNU Taler merchant has these additional dependencies: 618 619 620 @itemize - 621 622 @item 623 libqrencode >= 4.0.0 624 @end itemize 625 626 The following steps assume all dependencies are installed. 627 628 First, unpack the GNU Taler merchant tarball and change into 629 the resulting directory. 630 Then, use the following commands to build and install the merchant backend: 631 632 @example 633 $ ./configure [--prefix=PFX] \ 634 [--with-gnunet=GNUNETPFX] \ 635 [--with-exchange=EXCHANGEPFX] 636 $ # Each dependency can be fetched from non standard locations via 637 $ # the '--with-<LIBNAME>' option. See './configure --help'. 638 $ make 639 # make install 640 @end example 641 642 If you did not specify a prefix, the exchange will install to 643 @code{/usr/local}, which requires you to run the last step as @code{root}. 644 645 You have to specify @code{--with-exchange=/usr/local} and/or 646 @code{--with-gnunet=/usr/local} if you installed the exchange and/or 647 GNUnet to @code{/usr/local} in the previous steps. 648 649 Depending on the prefixes you specified for the installation and the 650 distribution you are using, you may have to edit @code{/etc/ld.so.conf}, adding 651 lines for @code{GNUNETPFX/lib/} and @code{EXCHANGEPFX/lib/} and @code{PFX/lib/} 652 (replace the prefixes with the actual paths you used). Afterwards, you should 653 run @code{ldconfig}. Without this step, it is possible that the linker may not 654 find the installed libraries and launching the Taler merchant backend would 655 then fail. 656 657 @node Installing Anastasis,Installing GNUnet-gtk,Installing the Taler Merchant,Installing from source 658 @anchor{installation installing-anastasis}@anchor{e} 659 @subsubsection Installing Anastasis 660 661 662 The following steps assume all dependencies are installed. 663 664 First, unpack the Anastasis tarball and change into 665 the resulting directory. 666 Then, use the following commands to build and install Anastasis: 667 668 @example 669 $ ./configure [--prefix=PFX] \ 670 [--with-gnunet=GNUNETPFX] \ 671 [--with-exchange=EXCHANGEPFX] 672 $ # Each dependency can be fetched from non standard locations via 673 $ # the '--with-<LIBNAME>' option. See './configure --help'. 674 $ make 675 # make install 676 @end example 677 678 If you did not specify a prefix, Anastasis will be installed to 679 @code{/usr/local}, which requires you to run the last step as @code{root}. 680 681 You have to specify @code{--with-exchange=/usr/local} and/or 682 @code{--with-gnunet=/usr/local} if you installed the exchange and/or 683 GNUnet to @code{/usr/local} in the previous steps. 684 685 Depending on the prefixes you specified for the installation and the 686 distribution you are using, you may have to edit @code{/etc/ld.so.conf}, adding 687 lines for @code{GNUNETPFX/lib/} and @code{EXCHANGEPFX/lib/} and @code{PFX/lib/} 688 (replace the prefixes with the actual paths you used). Afterwards, you should 689 run @code{ldconfig}. Without this step, it is possible that the linker may not 690 find the installed libraries and launching the Anastasis backend would 691 then fail. 692 693 @node Installing GNUnet-gtk,Installing Anastasis-gtk,Installing Anastasis,Installing from source 694 @anchor{installation installing-gnunet-gtk}@anchor{f} 695 @subsubsection Installing GNUnet-gtk 696 697 698 The following steps assume at least the GNUnet and Gtk+ dependencies are installed. 699 700 First, unpack the gnunet-gtk tarball and change into the resulting directory. 701 Then, use the following commands to build and install gnunet-gtk: 702 703 @example 704 $ ./configure [--prefix=$PFX] \ 705 [--with-gnunet=$GNUNETPFX] 706 $ # Each dependency can be fetched from non standard locations via 707 $ # the '--with-<LIBNAME>' option. See './configure --help'. 708 $ make 709 # make install 710 @end example 711 712 It is highly recommended to use the same prefix ($PFX) for gnunet-gtk that was 713 used for GNUnet ($GNUNETPFX). If you did not specify a prefix, gnunet-gtk 714 will be installed to @code{/usr/local}, which requires you to run the last step 715 as @code{root}. 716 717 You have to specify @code{--with-gnunet=/usr/local} if you installed 718 GNUnet to @code{/usr/local} in the previous steps. 719 720 Depending on the prefixes you specified for the installation and the 721 distribution you are using, you may have to edit @code{/etc/ld.so.conf}, adding 722 lines for @code{$GNUNETPFX/lib/} and @code{$PFX/lib/} (replace the prefixes with the 723 actual paths you used). Afterwards, you should run @code{ldconfig}. Without this 724 step, it is possible that the linker may not find the installed libraries and 725 launching gnunet-gtk would then fail. 726 727 @node Installing Anastasis-gtk,,Installing GNUnet-gtk,Installing from source 728 @anchor{installation installing-anastasis-gtk}@anchor{10} 729 @subsubsection Installing Anastasis-gtk 730 731 732 The following steps assume at least the GNUnet, gnunet-gtk and Anastasis 733 dependencies are installed. 734 735 First, unpack the anastasis-gtk tarball and change into the resulting 736 directory. Then, use the following commands to build and install 737 anastasis-gtk: 738 739 @example 740 $ ./configure [--prefix=PFX] \ 741 [--with-gnunet=GNUNETPFX] \ 742 [--with-exchange=EXCHANGEPFX] \ 743 [--with-anastasis=ANASTASISPFX] 744 $ # Each dependency can be fetched from non standard locations via 745 $ # the '--with-<LIBNAME>' option. See './configure --help'. 746 $ make 747 # make install 748 @end example 749 750 If you did not specify a prefix, anastasis-gtk will be installed to 751 @code{/usr/local}, which requires you to run the last step as @code{root}. 752 753 You have to specify @code{-with-anastasis=/usr/local}, @code{--with-exchange=/usr/local} and/or 754 @code{--with-gnunet=/usr/local} if you installed the exchange and/or 755 GNUnet to @code{/usr/local} in the previous steps. 756 757 Depending on the prefixes you specified for the installation and the 758 distribution you are using, you may have to edit @code{/etc/ld.so.conf}, adding 759 lines for @code{GNUNETPFX/lib/} and @code{EXCHANGEPFX/lib/} and @code{PFX/lib/} 760 (replace the prefixes with the actual paths you used). Afterwards, you should 761 run @code{ldconfig}. Without this step, it is possible that the linker may not 762 find the installed libraries and launching anastasis-gtk would then fail. 763 764 @node Installing Anastasis binary packages on Debian,Installing Anastasis binary packages on Ubuntu,Installing from source,Installation 765 @anchor{installation installing-anastasis-binary-packages-on-debian}@anchor{11} 766 @subsection Installing Anastasis binary packages on Debian 767 768 769 To install the GNU Taler Debian packages, first ensure that you have 770 the right Debian distribution. At this time, the packages are built for 771 Bullseye. 772 773 You need to add a file to import the GNU Taler packages. Typically, 774 this is done by adding a file @code{/etc/apt/sources.list.d/taler.list} that 775 looks like this: 776 777 @example 778 deb https://deb.taler.net/apt/debian bullseye main 779 @end example 780 781 Next, you must import the Taler Systems SA public package signing key 782 into your keyring and update the package lists: 783 784 @example 785 # wget -O - https://taler.net/taler-systems.gpg.key | apt-key add - 786 # apt update 787 @end example 788 789 @cartouche 790 @quotation Note 791 You may want to verify the correctness of the Taler Systems key out-of-band. 792 @end quotation 793 @end cartouche 794 795 Now your system is ready to install the official GNU Taler binary packages 796 using apt. 797 798 @menu 799 * Installing the graphical front-end:: 800 * Installing the backend:: 801 802 @end menu 803 804 @node Installing the graphical front-end,Installing the backend,,Installing Anastasis binary packages on Debian 805 @anchor{installation installing-the-graphical-front-end}@anchor{12} 806 @subsubsection Installing the graphical front-end 807 808 809 To install the Anastasis Gtk+ frontend, you can simply run: 810 811 @example 812 # apt install anastasis-gtk 813 @end example 814 815 To use @code{anastasis-gtk}, you can simply run: 816 817 @example 818 $ anastasis-gtk 819 @end example 820 821 @node Installing the backend,,Installing the graphical front-end,Installing Anastasis binary packages on Debian 822 @anchor{installation installing-the-backend}@anchor{13} 823 @subsubsection Installing the backend 824 825 826 If you want to install the Anastasis backend-end (which normal users do not 827 need), you should run: 828 829 @example 830 # apt install -t sid anastasis-httpd 831 @end example 832 833 Note that the latter package does not perform all of the configuration work. 834 It does setup the user users and the systemd service scripts, but you still 835 must configure the database backup, HTTP reverse proxy (typically with TLS 836 certificates), Taler merchant backend for payments, authentication services, 837 prices and the terms of service. 838 839 Sample configuration files for the HTTP reverse proxy can be found in 840 @code{/etc/anastasis.conf}. 841 842 Note that the package does not complete the integration of the backend 843 with the HTTP reverse proxy (typically with TLS certificates). A 844 configuration fragment for Nginx or Apache will be placed in 845 @code{/etc/@{apache,nginx@}/conf-available/anastasis.conf}. 846 847 To operate an Anastasis backend with payments, you additionally 848 need to install a Taler merchant backend via: 849 850 @example 851 # apt install -t sid taler-merchant-httpd 852 @end example 853 854 @node Installing Anastasis binary packages on Ubuntu,,Installing Anastasis binary packages on Debian,Installation 855 @anchor{installation installing-anastasis-binary-packages-on-ubuntu}@anchor{14} 856 @subsection Installing Anastasis binary packages on Ubuntu 857 858 859 To install the GNU Taler Ubuntu packages, first ensure that you have 860 the right Ubuntu distribution. At this time, the packages are built for 861 Ubuntu 20.04 LTS (Focal Fossa). 862 863 A typical @code{/etc/apt/sources.list.d/taler.list} file for this setup 864 would look like this: 865 866 @example 867 deb https://deb.taler.net/apt/ubuntu/ focal-fossa main 868 @end example 869 870 The last line is crucial, as it adds the GNU Taler packages. 871 872 Next, you must import the Taler Systems SA public package signing key 873 into your keyring and update the package lists: 874 875 @example 876 # wget -O - https://taler.net/taler-systems.gpg.key | apt-key add - 877 # apt update 878 @end example 879 880 @cartouche 881 @quotation Note 882 You may want to verify the correctness of the Taler Systems key out-of-band. 883 @end quotation 884 @end cartouche 885 886 Now your system is ready to install the official GNU Taler binary packages 887 using apt. 888 889 @menu 890 * Installing the graphical front-end: Installing the graphical front-end<2>. 891 * Installing the backend: Installing the backend<2>. 892 893 @end menu 894 895 @node Installing the graphical front-end<2>,Installing the backend<2>,,Installing Anastasis binary packages on Ubuntu 896 @anchor{installation id1}@anchor{15} 897 @subsubsection Installing the graphical front-end 898 899 900 To install the Anastasis front-end, you can now simply run: 901 902 @example 903 # apt install -t focal-fossa anastasis-gtk 904 @end example 905 906 To use @code{anastasis-gtk}, you can simply run: 907 908 @example 909 $ anastasis-gtk 910 @end example 911 912 @node Installing the backend<2>,,Installing the graphical front-end<2>,Installing Anastasis binary packages on Ubuntu 913 @anchor{installation id2}@anchor{16} 914 @subsubsection Installing the backend 915 916 917 If you want to install the Anastasis backend-end (which normal users do not 918 need), you should run: 919 920 @example 921 # apt install -t focal-fossa anastasis-httpd 922 @end example 923 924 Note that the latter package does not perform all of the configuration work. 925 It does setup the user users and the systemd service scripts, but you still 926 must configure the database backup, HTTP reverse proxy (typically with TLS 927 certificates), Taler merchant backend for payments, authentication services, 928 prices and the terms of service. 929 930 Sample configuration files for the HTTP reverse proxy can be found in 931 @code{/etc/anastasis.conf}. 932 933 To operate an Anastasis backend with payments, you additionally 934 need to install a Taler merchant backend via: 935 936 @example 937 # apt install -t sid taler-merchant-httpd 938 @end example 939 940 @c This file is part of Anastasis 941 @c Copyright (C) 2019-2021 Anastasis SARL 942 @c 943 @c Anastasis is free software; you can redistribute it and/or modify it under the 944 @c terms of the GNU Affero General Public License as published by the Free Software 945 @c Foundation; either version 2.1, or (at your option) any later version. 946 @c 947 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY 948 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 949 @c A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 950 @c 951 @c You should have received a copy of the GNU Affero General Public License along with 952 @c Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 953 @c 954 @c @author Christian Grothoff 955 @c @author Dominik Meister 956 @c @author Dennis Neufeld 957 958 @node Configuration,Cryptography,Installation,Documentation Overview 959 @anchor{configuration doc}@anchor{17}@anchor{configuration configuration}@anchor{18} 960 @section Configuration 961 962 963 Details about the contents of the configuration file are describe in 964 the @code{anastasis.conf(5)} chapter. This chapter only describes the 965 configuration format. 966 967 @menu 968 * Configuration format:: 969 * Using anastasis-config:: 970 * Terms of Service:: 971 * Privacy Policy:: 972 * Legal policies directory layout:: 973 * Generating the Legal Terms:: 974 * Adding translations:: 975 * Updating legal documents:: 976 977 @end menu 978 979 @node Configuration format,Using anastasis-config,,Configuration 980 @anchor{configuration configuration-format}@anchor{19} 981 @subsection Configuration format 982 983 984 In Taler realm, any component obeys to the same pattern to get 985 configuration values. According to this pattern, once the component has 986 been installed, the installation deploys default values in 987 $@{prefix@}/share/taler/config.d/, in .conf files. In order to override 988 these defaults, the user can write a custom .conf file and either pass 989 it to the component at execution time, or name it taler.conf and place 990 it under $HOME/.config/. 991 992 A config file is a text file containing sections, and each section 993 contains its values. The right format follows: 994 995 @example 996 [section1] 997 value1 = string 998 value2 = 23 999 1000 [section2] 1001 value21 = string 1002 value22 = /path22 1003 @end example 1004 1005 Throughout any configuration file, it is possible to use @code{$}-prefixed 1006 variables, like @code{$VAR}, especially when they represent filesystem 1007 paths. It is also possible to provide defaults values for those 1008 variables that are unset, by using the following syntax: 1009 @code{$@{VAR:-default@}}. However, there are two ways a user can set 1010 @code{$}-prefixable variables: 1011 1012 by defining them under a @code{[paths]} section, see example below, 1013 1014 @example 1015 [paths] 1016 TALER_DEPLOYMENT_SHARED = $@{HOME@}/shared-data 1017 .. 1018 [section-x] 1019 path-x = $@{TALER_DEPLOYMENT_SHARED@}/x 1020 @end example 1021 1022 or by setting them in the environment: 1023 1024 @example 1025 $ export VAR=/x 1026 @end example 1027 1028 The configuration loader will give precedence to variables set under 1029 @code{[path]}, though. 1030 1031 The utility @code{taler-config}, which gets installed along with the 1032 exchange, serves to get and set configuration values without directly 1033 editing the .conf. The option @code{-f} is particularly useful to resolve 1034 pathnames, when they use several levels of @code{$}-expanded variables. See 1035 @code{taler-config --help}. 1036 1037 Note that, in this stage of development, the file 1038 @code{$HOME/.config/taler.conf} can contain sections for @emph{all} the 1039 component. For example, both an exchange and a bank can read values from 1040 it. 1041 1042 The repository @code{git://git.taler.net/deployment} contains examples of 1043 configuration file used in our demos. See under @code{deployment/config}. 1044 1045 @node Using anastasis-config,Terms of Service,Configuration format,Configuration 1046 @anchor{configuration using-anastasis-config}@anchor{1a} 1047 @subsection Using anastasis-config 1048 1049 1050 The tool @code{anastasis-config} can be used to extract or manipulate 1051 configuration values; however, the configuration use the well-known INI 1052 file format and can also be edited by hand. 1053 1054 Run 1055 1056 @example 1057 $ anastasis-config -s $SECTION 1058 @end example 1059 1060 to list all of the configuration values in section @code{$SECTION}. 1061 1062 Run 1063 1064 @example 1065 $ anastasis-config -s $section -o $option 1066 @end example 1067 1068 to extract the respective configuration value for option @code{$option} in 1069 section @code{$section}. 1070 1071 Finally, to change a setting, run 1072 1073 @example 1074 $ anastasis-config -s $section -o $option -V $value 1075 @end example 1076 1077 to set the respective configuration value to @code{$value}. Note that you 1078 have to manually restart the Taler backend after you change the 1079 configuration to make the new configuration go into effect. 1080 1081 Some default options will use $-variables, such as @code{$DATADIR} within 1082 their value. To expand the @code{$DATADIR} or other $-variables in the 1083 configuration, pass the @code{-f} option to @code{anastasis-config}. For example, 1084 compare: 1085 1086 @example 1087 $ anastasis-config -s ACCOUNT-bank \ 1088 -o WIRE_RESPONSE 1089 $ anastasis-config -f -s ACCOUNT-bank \ 1090 -o WIRE_RESPONSE 1091 @end example 1092 1093 While the configuration file is typically located at 1094 @code{$HOME/.config/taler.conf}, an alternative location can be specified 1095 to @code{taler-merchant-httpd} and @code{anastasis-config} using the @code{-c} 1096 option. 1097 1098 @c This file is part of GNU TALER. 1099 @c 1100 @c Copyright (C) 2014-2023 Taler Systems SA 1101 @c 1102 @c TALER is free software; you can redistribute it and/or modify it under the 1103 @c terms of the GNU Affero General Public License as published by the Free Software 1104 @c Foundation; either version 2.1, or (at your option) any later version. 1105 @c 1106 @c TALER is distributed in the hope that it will be useful, but WITHOUT ANY 1107 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 1108 @c A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 1109 @c 1110 @c You should have received a copy of the GNU Affero General Public License along with 1111 @c TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 1112 @c 1113 @c @author Christian Grothoff 1114 1115 The service has well-known API endpoints to return its legal conditions to the 1116 user in various languages and various formats. This section describes how to 1117 setup and configure the legal conditions. 1118 1119 @node Terms of Service,Privacy Policy,Using anastasis-config,Configuration 1120 @anchor{configuration terms-of-service}@anchor{1b} 1121 @subsection Terms of Service 1122 1123 1124 The service has an endpoint “/terms” to return the terms of service (in legal 1125 language) of the service operator. Client software show these terms of 1126 service to the user when the user is first interacting with the service. 1127 Terms of service are optional for experimental deployments, if none are 1128 configured, the service will return a simple statement saying that there are 1129 no terms of service available. 1130 1131 To configure the terms of service response, there are two options 1132 in the configuration file for the service: 1133 1134 1135 @itemize - 1136 1137 @item 1138 @code{TERMS_ETAG}: The current “Etag” to return for the terms of service. 1139 This value must be changed whenever the terms of service are 1140 updated. A common value to use would be a version number. 1141 Note that if you change the @code{TERMS_ETAG}, you MUST also provide 1142 the respective files in @code{TERMS_DIR} (see below). 1143 1144 @item 1145 @code{TERMS_DIR}: The directory that contains the terms of service. 1146 The files in the directory must be readable to the service 1147 process. 1148 @end itemize 1149 1150 @node Privacy Policy,Legal policies directory layout,Terms of Service,Configuration 1151 @anchor{configuration privacy-policy}@anchor{1c} 1152 @subsection Privacy Policy 1153 1154 1155 The service has an endpoint “/pp” to return the terms privacy policy (in legal 1156 language) of the service operator. Clients should show the privacy policy to 1157 the user when the user explicitly asks for it, but it should not be shown by 1158 default. Privacy policies are optional for experimental deployments, if none 1159 are configured, the service will return a simple statement saying that there 1160 is no privacy policy available. 1161 1162 To configure the privacy policy response, there are two options 1163 in the configuration file for the service: 1164 1165 1166 @itemize - 1167 1168 @item 1169 @code{PRIVACY_ETAG}: The current “Etag” to return for the privacy policy. 1170 This value must be changed whenever the privacy policy is 1171 updated. A common value to use would be a version number. 1172 Note that if you change the @code{PRIVACY_ETAG}, you MUST also provide 1173 the respective files in @code{PRIVACY_DIR} (see below). 1174 1175 @item 1176 @code{PRIVACY_DIR}: The directory that contains the privacy policy. 1177 The files in the directory must be readable to the service 1178 process. 1179 @end itemize 1180 1181 @node Legal policies directory layout,Generating the Legal Terms,Privacy Policy,Configuration 1182 @anchor{configuration legal-policies-directory-layout}@anchor{1d} 1183 @subsection Legal policies directory layout 1184 1185 1186 The @code{TERMS_DIR} and @code{PRIVACY_DIR} directory structures must follow a 1187 particular layout. You may use the same directory for both the terms of 1188 service and the privacy policy, as long as you use different ETAGs. Inside of 1189 the directory, there should be sub-directories using two-letter language codes 1190 like “en”, “de”, or “jp”. Each of these directories would then hold 1191 translations of the current terms of service into the respective language. 1192 Empty directories are permitted in case translations are not available. 1193 1194 Then, inside each language directory, files with the name of the value set as 1195 the @code{TERMS_ETAG} or @code{PRIVACY_ETAG} must be provided. The extension of each 1196 of the files should be typical for the respective mime type. The set of 1197 supported mime types is currently hard-coded in the service, and includes 1198 “.epub”, “.html”, “.md”, “.pdf” and “.txt” files. If other files are present, 1199 the service may show a warning on startup. 1200 1201 @menu 1202 * Example:: 1203 1204 @end menu 1205 1206 @node Example,,,Legal policies directory layout 1207 @anchor{configuration example}@anchor{1e} 1208 @subsubsection Example 1209 1210 1211 A sample file structure for a @code{TERMS_ETAG} of “tos-v0” would be: 1212 1213 1214 @itemize - 1215 1216 @item 1217 TERMS_DIR/en/tos-v0.txt 1218 1219 @item 1220 TERMS_DIR/en/tos-v0.html 1221 1222 @item 1223 TERMS_DIR/en/tos-v0.pdf 1224 1225 @item 1226 TERMS_DIR/en/tos-v0.epub 1227 1228 @item 1229 TERMS_DIR/en/tos-v0.md 1230 1231 @item 1232 TERMS_DIR/de/tos-v0.txt 1233 1234 @item 1235 TERMS_DIR/de/tos-v0.html 1236 1237 @item 1238 TERMS_DIR/de/tos-v0.pdf 1239 1240 @item 1241 TERMS_DIR/de/tos-v0.epub 1242 1243 @item 1244 TERMS_DIR/de/tos-v0.md 1245 @end itemize 1246 1247 If the user requests an HTML format with language preferences “fr” followed by 1248 “en”, the service would return @code{TERMS_DIR/en/tos-v0.html} lacking a version in 1249 French. 1250 1251 @node Generating the Legal Terms,Adding translations,Legal policies directory layout,Configuration 1252 @anchor{configuration generating-the-legal-terms}@anchor{1f} 1253 @subsection Generating the Legal Terms 1254 1255 1256 The @code{taler-terms-generator} script can be used to generate directories with 1257 terms of service and privacy policies in multiple languages and all required 1258 data formats from a single source file in @code{.rst} format and GNU gettext 1259 translations in @code{.po} format. 1260 1261 To use the tool, you need to first write your legal conditions in English in 1262 reStructuredText (rst). You should find a templates in 1263 @code{$PREFIX/share/terms/*.rst} where @code{$PREFIX} is the location where you 1264 installed the service to. Whenever you make substantive changes to the legal 1265 terms, you must use a fresh filename and change the respective @code{ETAG}. The 1266 resulting file must be called @code{$ETAG.rst} and the first line of the file should be the title of the document. 1267 1268 Once you have written the @code{$ETAG.rst} file in English, you can 1269 generate the first set of outputs: 1270 1271 @example 1272 $ taler-terms-generator -i $ETAG 1273 @end example 1274 1275 Afterwards, you should find the terms in various formats for all configured 1276 languages (initially only English) in @code{$PREFIX/share/terms/}. The generator 1277 has a few options which are documented in its man page. 1278 1279 @node Adding translations,Updating legal documents,Generating the Legal Terms,Configuration 1280 @anchor{configuration adding-translations}@anchor{20} 1281 @subsection Adding translations 1282 1283 1284 Translations must be available in subdirectories 1285 @code{locale/$LANGUAGE/LC_MESSAGES/$ETAG.po}. 1286 To start translating, you first need to add a new 1287 language: 1288 1289 @example 1290 $ taler-terms-generator -i $ETAG -l $LANGUAGE 1291 @end example 1292 1293 Here, @code{$LANGUAGE} should be a two-letter language 1294 code like @code{de} or @code{fr}. The command will generate 1295 a file @code{locale/$LANGUAGE/LC_MESSAGES/$ETAG.po} 1296 which contains each English sentence or paragraph 1297 in the original document and an initially empty 1298 translation. Translators should update the @code{.po} 1299 file. Afterwards, simply re-run 1300 1301 @example 1302 $ taler-terms-generator -i $ETAG 1303 @end example 1304 1305 to make the current translation(s) available to the 1306 service. 1307 1308 @cartouche 1309 @quotation Note 1310 You must restart the service whenever adding or updating legal documents or their translations. 1311 @end quotation 1312 @end cartouche 1313 1314 @node Updating legal documents,,Adding translations,Configuration 1315 @anchor{configuration updating-legal-documents}@anchor{21} 1316 @subsection Updating legal documents 1317 1318 1319 When making minor changes without legal implications, edit the @code{.rst} file, 1320 then re-run the step to add a new language for each existing translation to 1321 produce an updated @code{.po} file. Translate the sentences that have changed and 1322 finally run the generator (without @code{-l}) on the ETAG (@code{-i $ETAG}) to 1323 create the final files. 1324 1325 When making major changes with legal implications, you should first rename (or 1326 copy) the existing @code{.rst} file and the associated translation files to a new 1327 unique name. Afterwards, make the major changes, update the @code{.po} files, 1328 complete the translations and re-create the final files. Finally, do not 1329 forget to update the @code{ETAG} configuration option to the new name and to 1330 restart the service. 1331 1332 @c This file is part of Anastasis 1333 @c Copyright (C) 2019-2021 Anastasis SARL 1334 @c 1335 @c Anastasis is free software; you can redistribute it and/or modify it under the 1336 @c terms of the GNU Affero General Public License as published by the Free Software 1337 @c Foundation; either version 2.1, or (at your option) any later version. 1338 @c 1339 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY 1340 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 1341 @c A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 1342 @c 1343 @c You should have received a copy of the GNU Affero General Public License along with 1344 @c Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 1345 @c 1346 @c @author Christian Grothoff 1347 @c @author Dominik Meister 1348 @c @author Dennis Neufeld 1349 1350 @node Cryptography,REST API,Configuration,Documentation Overview 1351 @anchor{cryptography doc}@anchor{22}@anchor{cryptography cryptography}@anchor{23} 1352 @section Cryptography 1353 1354 1355 When a user needs to interact with Anastasis, the system first derives some key 1356 material, but not the master secret, from the user’s @strong{identifier} using 1357 different HKDFs. These HKDFs are salted using the respective escrow 1358 provider’s @strong{server salt}, which ensures that the accounts for the same user 1359 cannot be easily correlated across the various Anastasis servers. 1360 1361 Each Anastasis server uses an EdDSA @strong{account key} to identify the account of 1362 the user. The account private key is derived from the user’s @strong{identifier} using 1363 a computationally expensive cryptographic hash function. Using an 1364 expensive hash algorithm is assumed to make it infeasible for a weak adversary to 1365 determine account keys by brute force (without knowing the user’s identifier). 1366 However, it is assumed that a strong adversary performing a targeted attack can 1367 compute the account key pair. 1368 1369 The public account key is Crockford base32-encoded in the URI to identify the 1370 account, and used to sign requests. These signatures are also provided in 1371 base32-encoding and transmitted using the HTTP header 1372 @code{Anastasis-Account-Signature}. 1373 1374 When confidential data is uploaded to an Anastasis server, the respective 1375 payload is encrypted using AES-GCM with a symmetric key and initialization 1376 vector derived from the @strong{identifier} and a high-entropy @strong{nonce}. The 1377 nonce and the GCM tag are prepended to the ciphertext before being uploaded to 1378 the Anastasis server. This is done whenever confidential data is stored with 1379 the server. 1380 1381 The @strong{core secret} of the user is (AES) encrypted using a symmetric @strong{master 1382 key}. Recovering this master key requires the user to satisfy a particular 1383 @strong{policy}. Policies specify a set of @strong{escrow methods}, each of which leads 1384 the user to a @strong{key share}. Combining those key shares (by hashing) allows 1385 the user to obtain a @strong{policy key}, which can be used to decrypt the @strong{master 1386 key}. There can be many policies, satisfying any of these will allow the 1387 user to recover the master key. A @strong{recovery document} contains the 1388 encrypted @strong{core secret}, a set of escrow methods and a set of policies. 1389 1390 @menu 1391 * Key derivations:: 1392 * Key Usage:: 1393 * Availability Considerations:: 1394 1395 @end menu 1396 1397 @node Key derivations,Key Usage,,Cryptography 1398 @anchor{cryptography key-derivations}@anchor{24} 1399 @subsection Key derivations 1400 1401 1402 EdDSA and ECDHE public keys are always points on Curve25519 and represented 1403 using the standard 256 bit Ed25519 compact format. The binary representation 1404 is converted to Crockford Base32 when transmitted inside JSON or as part of 1405 URLs. 1406 1407 To start, a user provides their private, unique and unforgettable 1408 @strong{identifier} as a seed to identify their account. For example, this could 1409 be a social security number together with their full name. Specifics may 1410 depend on the cultural context, in this document we will simply refer to this 1411 information as the @strong{identifier}. 1412 1413 This identifier will be first hashed with Argon2, to provide a @strong{kdf_id} 1414 which will be used to derive other keys later. The Hash must also include the 1415 respective @strong{server_salt}. This also ensures that the @strong{kdf_id} is different 1416 on each server. The use of Argon2 and the respective @strong{server_salt} is intended 1417 to make it difficult to brute-force @strong{kdf_id} values and help protect the user’s 1418 privacy. Also this ensures that the @strong{kdf_id}s on every server differs. However, 1419 we do not assume that the @strong{identifier} or the @strong{kdf_id} cannot be 1420 determined by an adversary performing a targeted attack, as a user’s 1421 @strong{identifier} is likely to always be known to state actors and may 1422 likely also be available to other actors. 1423 1424 @example 1425 kdf_id := Argon2( identifier, server_salt, keysize ) 1426 @end example 1427 1428 @strong{identifier}: The secret defined from the user beforehand. 1429 1430 @strong{server_salt}: The salt from the Server. 1431 1432 @strong{keysize}: The desired output size of the KDF, here 32 bytes. 1433 1434 @menu 1435 * Verification:: 1436 * Encryption:: 1437 1438 @end menu 1439 1440 @node Verification,Encryption,,Key derivations 1441 @anchor{cryptography verification}@anchor{25} 1442 @subsubsection Verification 1443 1444 1445 For users to authorize “policy” operations we need an EdDSA key pair. As we 1446 cannot assure that the corresponding private key is truly secret, such policy 1447 operations must never be destructive: Should an adversary learn the private 1448 key, they could access (and with the @strong{kdf_id}, decrypt) the user’s policy (but 1449 not the core secret), or upload a new version of the 1450 @strong{encrypted recovery document} (but not delete an existing version). 1451 1452 For the generation of the private key we use the @strong{kdf_id} as the entropy source, 1453 hash it to derive a base secret which will then be processed to fit the 1454 requirements for EdDSA private keys. From the private key we can then 1455 generate the corresponding public key. Here, “ver” is used as a salt for the 1456 HKDF to ensure that the result differs from other cases where we hash 1457 @strong{kdf_id}. 1458 1459 @example 1460 ver_secret := HKDF(kdf_id, "ver", keysize) 1461 eddsa_priv := ver_secret 1462 eddsa_pub := get_EdDSA_Pub(eddsa_priv) 1463 @end example 1464 1465 @strong{HKDF()}: The HKDF-function uses two phases: First we use HMAC-SHA512 for the extraction phase, then HMAC-SHA256 is used for expansion phase. 1466 1467 @strong{kdf_id}: Hashed identifier. 1468 1469 @strong{key_size}: Size of the output, here 32 bytes. 1470 1471 @strong{ver_secret}: Derived key from the @code{kdf_id}, serves as intermediate step for the generation of the private key. 1472 1473 @strong{eddsa_priv}: The generated EdDSA private key. 1474 1475 @strong{eddsa_pub}: The generated EdDSA public key. 1476 1477 @node Encryption,,Verification,Key derivations 1478 @anchor{cryptography encryption}@anchor{26} 1479 @subsubsection Encryption 1480 1481 1482 For symmetric encryption of data we use AES256-GCM. For this we need a 1483 symmetric key and an initialization vector (IV). To ensure that the 1484 symmetric key changes for each encryption operation, we compute the 1485 key material using an HKDF over a @code{nonce} and the @code{kdf_id}. 1486 1487 @example 1488 (iv,key) := HKDF(kdf_id, nonce, keysize + ivsize) 1489 @end example 1490 1491 @strong{HKDF()}: The HKDF-function uses two phases: First we use HMAC-SHA512 for the extraction phase, then HMAC-SHA256 is used for expansion phase. 1492 1493 @strong{kdf_id}: Hashed identifier. 1494 1495 @strong{keysize}: Size of the AES symmetric key, here 32 bytes. 1496 1497 @strong{ivsize}: Size of the AES GCM IV, here 12 bytes. 1498 1499 @strong{prekey}: Original key material. 1500 1501 @strong{nonce}: 32-byte nonce, must never match “ver” (which it cannot as the length is different). Of course, we must 1502 avoid key reuse. So, we have to use different nonces to get different keys and IVs (see below). 1503 1504 @strong{key}: Symmetric key which is later used to encrypt the documents with AES256-GCM. 1505 1506 @strong{iv}: IV which will be used for AES-GCM. 1507 1508 @node Key Usage,Availability Considerations,Key derivations,Cryptography 1509 @anchor{cryptography key-usage}@anchor{27} 1510 @subsection Key Usage 1511 1512 1513 The keys we have generated are then used to encrypt the @strong{recovery document} and 1514 the @strong{key_share} of the user. 1515 1516 @menu 1517 * Encryption: Encryption<2>. 1518 * Signatures:: 1519 1520 @end menu 1521 1522 @node Encryption<2>,Signatures,,Key Usage 1523 @anchor{cryptography id1}@anchor{28} 1524 @subsubsection Encryption 1525 1526 1527 Before every encryption a 32-byte nonce is generated. 1528 From this the symmetric key is computed as described above. 1529 We use AES256-GCM for the encryption of the @strong{recovery document} and 1530 the @strong{key_share}. To ensure that the key derivation for the encryption 1531 of the @strong{recovery document} differs fundamentally from that of an 1532 individual @strong{key share}, we use different salts (“erd” and “eks”, respectively). 1533 1534 @example 1535 (iv0, key0) := HKDF(key_id, nonce0, "erd", keysize + ivsize) 1536 (encrypted_recovery_document, aes_gcm_tag) := AES256_GCM(recovery_document, key0, iv0) 1537 (iv_i, key_i) := HKDF(key_id, nonce_i, "eks", [optional data], keysize + ivsize) 1538 (encrypted_key_share_i, aes_gcm_tag_i) := AES256_GCM(key_share_i, key_i, iv_i) 1539 @end example 1540 1541 @strong{encrypted_recovery_document}: The encrypted @strong{recovery document} which contains the escrow methods, policies 1542 and the encrypted @strong{core secret}. 1543 1544 @strong{nonce0}: Nonce which is used to generate @emph{key0} and @emph{iv0} which are used for the encryption of the @emph{recovery document}. 1545 This key derivation must be done using the salt “erd”. 1546 1547 @strong{optional data}: Key material that optionally is contributed from the authentication method to further obfuscate the key share from the escrow provider. 1548 1549 @strong{encrypted_key_share_i}: The encrypted @strong{key_share} which the escrow provider must release upon successful authentication. 1550 Here, @strong{i} must be a positive number used to iterate over the various @strong{key shares} used for the various @strong{escrow methods} 1551 at the various providers. 1552 1553 @strong{nonce_i}: Nonce which is used to generate @emph{key_i} and @emph{iv_i} which are used for the encryption of the @strong{key share}. @strong{i} must be 1554 the same number as specified above for @emph{encrypted_key_share_i}. 1555 Key derivation must be done using the salt “eks”. 1556 1557 As a special rule, when a @strong{security question} is used to authorize access to an 1558 @strong{encrypted_key_share_i}, then the salt “eks” is replaced with an (expensive) hash 1559 of the answer to the security question as an additional way to make the key share 1560 inaccessible to those who do not have the answer: 1561 1562 @example 1563 powh := POW_HASH (qsalt, answer) 1564 ekss := HKDF("Anastasis-secure-question-uuid-salting", 1565 powh, 1566 uuid); 1567 (iv_i, key_i) := HKDF(key_id, nonce_i, ekss, [optional data], keysize + ivsize) 1568 @end example 1569 1570 @strong{qsalt}: Salt value used to hash answer to satisfy the challenge to prevent the provider from determining the answer via guessing. 1571 1572 @strong{answer}: Answer to the security question, in UTF-8, as entered by the user. 1573 1574 @strong{powh}: Result of the (expensive, proof-of-work) hash algorithm. 1575 1576 @strong{uuid}: UUID of the challenge associated with the security question and the encrypted key share. 1577 1578 @strong{ekss}: Replacement salt to be used instead of “eks” when deriving the key to encrypt/decrypt the key share. 1579 1580 @node Signatures,,Encryption<2>,Key Usage 1581 @anchor{cryptography signatures}@anchor{29} 1582 @subsubsection Signatures 1583 1584 1585 The EdDSA keys are used to sign the data sent from the client to the 1586 server. This signature ensures that an adversary that observes the upload is not 1587 able to upload a new version of the policy without knowing the user’s identity attributes. 1588 The signature is made over a hash of the request body. The following 1589 algorithm is equivalent for @strong{Anastasis-Policy-Signature}. 1590 1591 @example 1592 (anastasis-account-signature) := eddsa_sign(h_body, eddsa_priv) 1593 ver_res := eddsa_verifiy(h_body, anastasis-account-signature, eddsa_pub) 1594 @end example 1595 1596 @strong{anastasis-account-signature}: Signature over the SHA-512 hash of the body using the purpose code @code{TALER_SIGNATURE_ANASTASIS_POLICY_UPLOAD} (1400) (see GNUnet EdDSA signature API for the use of purpose). 1597 1598 @strong{h_body}: The hashed body. 1599 1600 @strong{ver_res}: A boolean value. True: Signature verification passed, False: Signature verification failed. 1601 1602 @node Availability Considerations,,Key Usage,Cryptography 1603 @anchor{cryptography availability-considerations}@anchor{2a} 1604 @subsection Availability Considerations 1605 1606 1607 Anastasis considers two main threats against availability. First, the 1608 Anastasis server operators must be protected against denial-of-service attacks 1609 where an adversary attempts to exhaust the operator’s resources. The API protects 1610 against these attacks by allowing operators to set fees for all 1611 operations. Furthermore, all data stored comes with an expiration logic, so an 1612 attacker cannot force servers to store data indefinitely. 1613 1614 A second availability issue arises from strong adversaries that may be able to 1615 compute the account keys of some user. While we assume that such an adversary 1616 cannot successfully authenticate against the truth, the account key does 1617 inherently enable these adversaries to upload a new policy for the account. 1618 This cannot be prevented, as the legitimate user must be able to set or change 1619 a policy using only the account key. To ensure that an adversary cannot 1620 exploit this, policy uploads first of all never delete existing policies, but 1621 merely create another version. This way, even if an adversary uploads a 1622 malicious policy, a user can still retrieve an older version of the policy to 1623 recover access to their data. This append-only storage for policies still 1624 leaves a strong adversary with the option of uploading many policies to 1625 exhaust the Anastasis server’s capacity. We limit this attack by requiring a 1626 policy upload to include a reference to a @strong{payment identifier} from a payment 1627 made by the user. Thus, a policy upload requires both knowledge of the 1628 @strong{identity} and making a payment. This effectively prevents an adversary 1629 from using the append-only policy storage from exhausting Anastasis server 1630 capacity. 1631 1632 @c This file is part of Anastasis 1633 @c Copyright (C) 2019-2022 Anastasis SARL 1634 @c 1635 @c Anastasis is free software; you can redistribute it and/or modify it under the 1636 @c terms of the GNU Affero General Public License as published by the Free Software 1637 @c Foundation; either version 2.1, or (at your option) any later version. 1638 @c 1639 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY 1640 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 1641 @c A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 1642 @c 1643 @c You should have received a copy of the GNU Affero General Public License along with 1644 @c Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 1645 @c 1646 @c @author Christian Grothoff 1647 @c @author Dominik Meister 1648 @c @author Dennis Neufeld 1649 1650 @node REST API,Reducer API,Cryptography,Documentation Overview 1651 @anchor{rest doc}@anchor{2b}@anchor{rest rest-api}@anchor{2c} 1652 @section REST API 1653 1654 1655 @c This file is part of Anastasis 1656 @c 1657 @c Copyright (C) 2014-2021 Anastasis SARL 1658 @c 1659 @c Anastasis is free software; you can redistribute it and/or modify it under the 1660 @c terms of the GNU Affero Public License as published by the Free Software 1661 @c Foundation; either version 2.1, or (at your option) any later version. 1662 @c 1663 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY 1664 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 1665 @c A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 1666 @c 1667 @c You should have received a copy of the GNU Affero General Public License along with 1668 @c Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 1669 @c 1670 @c @author Christian Grothoff 1671 1672 @menu 1673 * HTTP Request and Response:: 1674 * Protocol Version Ranges:: 1675 * Common encodings:: 1676 * Receiving Configuration:: 1677 * Receiving Terms of Service:: 1678 * Managing policy:: 1679 * Managing truth:: 1680 1681 @end menu 1682 1683 @node HTTP Request and Response,Protocol Version Ranges,,REST API 1684 @anchor{rest http-common}@anchor{2d}@anchor{rest http-request-and-response}@anchor{2e} 1685 @subsection HTTP Request and Response 1686 1687 1688 Certain response formats are common for all requests. They are documented here 1689 instead of with each individual request. Furthermore, we note that clients may 1690 theoretically fail to receive any response. In this case, the client should 1691 verify that the Internet connection is working properly, and then proceed to 1692 handle the error as if an internal error (500) had been returned. 1693 1694 @anchor{rest any--*}@anchor{2f} 1695 @deffn {HTTP Any} ANY /* 1696 1697 @strong{Request:} 1698 1699 Unless specified otherwise, HTTP requests that carry a message body must 1700 have the content type @code{application/json}. 1701 1702 @*Request Headers: 1703 1704 @itemize * 1705 1706 @item 1707 Content-Type@footnote{https://tools.ietf.org/html/rfc7231#section-3.1.1.5} – application/json 1708 @end itemize 1709 1710 1711 @strong{Response:} 1712 1713 @*Response Headers: 1714 1715 @itemize * 1716 1717 @item 1718 Content-Type@footnote{https://tools.ietf.org/html/rfc7231#section-3.1.1.5} – application/json 1719 @end itemize 1720 1721 1722 1723 @table @asis 1724 1725 @item 200 Ok@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1}: 1726 1727 The request was successful. 1728 1729 @item 400 Bad request@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1}: 1730 1731 One of the arguments to the request is missing or malformed. 1732 1733 @item 500 Internal server error@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1}: 1734 1735 This always indicates some serious internal operational error of the Anastasis 1736 provider, such as a program bug, database problems, etc., and must not be used for 1737 client-side problems. When facing an internal server error, clients should 1738 retry their request after some delay. We recommended initially trying after 1739 1s, twice more at randomized times within 1 minute, then the user should be 1740 informed and another three retries should be scheduled within the next 24h. 1741 If the error persists, a report should ultimately be made to the auditor, 1742 although the auditor API for this is not yet specified. However, as internal 1743 server errors are always reported to the exchange operator, a good operator 1744 should naturally be able to address them in a timely fashion, especially 1745 within 24h. 1746 @end table 1747 1748 Unless specified otherwise, all error status codes (4xx and 5xx) have a message 1749 body with an @ref{30,,ErrorDetail} JSON object. 1750 1751 @strong{Details:} 1752 1753 @example 1754 interface ErrorDetail @{ 1755 1756 // Numeric error code unique to the condition, see `@w{`}gnu-taler-error-codes`@w{`} in GANA. 1757 // The other arguments are specific to the error value reported here. 1758 code: number; 1759 1760 // Human-readable description of the error, i.e. "missing parameter", "commitment violation", ... 1761 // Should give a human-readable hint about the error's nature. Optional, may change without notice! 1762 hint?: string; 1763 1764 @} 1765 @end example 1766 @end deffn 1767 1768 @node Protocol Version Ranges,Common encodings,HTTP Request and Response,REST API 1769 @anchor{rest protocol-version-ranges}@anchor{31} 1770 @subsection Protocol Version Ranges 1771 1772 1773 Anastasis services expose the range of API versions they support. Clients in 1774 turn have an API version range they support. These version ranges are written 1775 down in the libtool version format@footnote{https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html}. 1776 1777 A protocol version is a positive, non-zero integer. A protocol version range consists of three components: 1778 1779 1780 @enumerate 1781 1782 @item 1783 The @code{current} version. This is the latest version of the protocol supported by the client or service. 1784 1785 @item 1786 The @code{revision} number. This value should usually not be interpreted by the client/server, but serves 1787 purely as a comment. Each time a service/client for a protocol is updated while supporting the same 1788 set of protocol versions, the revision should be increased. 1789 In rare cases, the revision number can be used to work around unintended breakage in deployed 1790 versions of a service. This is discouraged and should only be used in exceptional situations. 1791 1792 @item 1793 The @code{age} number. This non-zero integer identifies with how many previous protocol versions this 1794 implementation is compatible. An @code{age} of 0 implies that the implementation only supports 1795 the @code{current} protocol version. The @code{age} must be less or equal than the @code{current} protocol version. 1796 @end enumerate 1797 1798 To avoid confusion with semantic versions, the protocol version range is written down in the following format: 1799 1800 @example 1801 current[:revision[:age]] 1802 @end example 1803 1804 The angle brackets mark optional components. If either @code{revision} or @code{age} are omitted, they default to 0. 1805 1806 Examples: 1807 1808 1809 @itemize * 1810 1811 @item 1812 “1” and “1” are compatible 1813 1814 @item 1815 “1” and “2” are @strong{incompatible} 1816 1817 @item 1818 “2:0:1” and “1:0:0” are compatible 1819 1820 @item 1821 “2:5:1” and “1:10:0” are compatible 1822 1823 @item 1824 “4:0:1” and “2:0:0” are @strong{incompatible} 1825 1826 @item 1827 “4:0:1” and “3:0:0” are compatible 1828 @end itemize 1829 1830 @cartouche 1831 @quotation Note 1832 Semantic versions@footnote{https://semver.org/} are not a good tool for this job, as we concisely want to express 1833 that the client/server supports the last @code{n} versions of the protocol. 1834 Semantic versions don’t support this, and semantic version ranges are too complex for this. 1835 @end quotation 1836 @end cartouche 1837 1838 @cartouche 1839 @quotation Warning 1840 A client doesn’t have one single protocol version range. Instead, it has 1841 a protocol version range for each type of service it talks to. 1842 @end quotation 1843 @end cartouche 1844 1845 @cartouche 1846 @quotation Warning 1847 For privacy reasons, the protocol version range of a client should not be 1848 sent to the service. Instead, the client should just use the two version ranges 1849 to decide whether it will talk to the service. 1850 @end quotation 1851 @end cartouche 1852 1853 @node Common encodings,Receiving Configuration,Protocol Version Ranges,REST API 1854 @anchor{rest common-encodings}@anchor{32}@anchor{rest encodings-ref}@anchor{33} 1855 @subsection Common encodings 1856 1857 1858 This section describes how certain types of values are represented throughout the API. 1859 1860 @menu 1861 * Binary Data:: 1862 * Hash codes:: 1863 * Large numbers:: 1864 * Timestamps:: 1865 * Integers:: 1866 * Objects:: 1867 * Keys:: 1868 * Signatures: Signatures<2>. 1869 * Amounts:: 1870 * Time:: 1871 * Cryptographic primitives:: 1872 * Signatures: Signatures<3>. 1873 1874 @end menu 1875 1876 @node Binary Data,Hash codes,,Common encodings 1877 @anchor{rest base32}@anchor{34}@anchor{rest binary-data}@anchor{35} 1878 @subsubsection Binary Data 1879 1880 1881 @example 1882 type Base32 = string; 1883 @end example 1884 1885 Binary data is generally encoded using Crockford’s variant of Base32 1886 (@indicateurl{http://www.crockford.com/wrmg/base32.html}), except that “U” is not excluded 1887 but also decodes to “V” to make OCR easy. We will still simply use the JSON 1888 type “base32” and the term “Crockford Base32” in the text to refer to the 1889 resulting encoding. 1890 1891 @node Hash codes,Large numbers,Binary Data,Common encodings 1892 @anchor{rest hash-codes}@anchor{36} 1893 @subsubsection Hash codes 1894 1895 1896 Hash codes are strings representing base32 encoding of the respective 1897 hashed data. See @ref{34,,base32}. 1898 1899 @example 1900 // 64-byte hash code. 1901 type HashCode = string; 1902 @end example 1903 1904 @example 1905 // 32-byte hash code. 1906 type ShortHashCode = string; 1907 @end example 1908 1909 @node Large numbers,Timestamps,Hash codes,Common encodings 1910 @anchor{rest large-numbers}@anchor{37} 1911 @subsubsection Large numbers 1912 1913 1914 Large numbers such as 256 bit keys, are transmitted as other binary data in 1915 Crockford Base32 encoding. 1916 1917 @node Timestamps,Integers,Large numbers,Common encodings 1918 @anchor{rest timestamps}@anchor{38} 1919 @subsubsection Timestamps 1920 1921 1922 Timestamps are represented by the following structure: 1923 1924 @example 1925 interface Timestamp @{ 1926 // Milliseconds since epoch, or the special 1927 // value "never" to represent an event that will 1928 // never happen. 1929 t_ms: number | "never"; 1930 @} 1931 @end example 1932 1933 @example 1934 interface Duration @{ 1935 // Duration in milliseconds or "forever" 1936 // to represent an infinite duration. 1937 d_ms: number | "forever"; 1938 @} 1939 @end example 1940 1941 @node Integers,Objects,Timestamps,Common encodings 1942 @anchor{rest integers}@anchor{39}@anchor{rest publickey}@anchor{3a} 1943 @subsubsection Integers 1944 1945 1946 @example 1947 // JavaScript numbers restricted to integers. 1948 type Integer = number; 1949 @end example 1950 1951 @node Objects,Keys,Integers,Common encodings 1952 @anchor{rest objects}@anchor{3b} 1953 @subsubsection Objects 1954 1955 1956 @example 1957 // JavaScript objects, no further restrictions. 1958 type Object = object; 1959 @end example 1960 1961 @node Keys,Signatures<2>,Objects,Common encodings 1962 @anchor{rest keys}@anchor{3c} 1963 @subsubsection Keys 1964 1965 1966 @example 1967 // EdDSA and ECDHE public keys always point on Curve25519 1968 // and represented using the standard 256 bits Ed25519 compact format, 1969 // converted to Crockford `Base32`. 1970 type EddsaPublicKey = string; 1971 @end example 1972 1973 @example 1974 // EdDSA and ECDHE public keys always point on Curve25519 1975 // and represented using the standard 256 bits Ed25519 compact format, 1976 // converted to Crockford `Base32`. 1977 type EddsaPrivateKey = string; 1978 @end example 1979 1980 @node Signatures<2>,Amounts,Keys,Common encodings 1981 @anchor{rest signature}@anchor{3d}@anchor{rest signatures}@anchor{3e} 1982 @subsubsection Signatures 1983 1984 1985 @example 1986 // EdDSA signatures are transmitted as 64-bytes `base32` 1987 // binary-encoded objects with just the R and S values (base32_ binary-only). 1988 type EddsaSignature = string; 1989 @end example 1990 1991 @node Amounts,Time,Signatures<2>,Common encodings 1992 @anchor{rest amount}@anchor{3f}@anchor{rest amounts}@anchor{40} 1993 @subsubsection Amounts 1994 1995 1996 @example 1997 type Amount = string; 1998 @end example 1999 2000 Amounts of currency are serialized as a string of the format 2001 @code{<Currency>:<DecimalAmount>}. Taler treats monetary amounts as 2002 fixed-precision numbers, with 8 decimal places. Unlike floating point numbers, 2003 this allows accurate representation of monetary amounts. 2004 2005 The following constrains apply for a valid amount: 2006 2007 2008 @enumerate 2009 2010 @item 2011 The @code{<Currency>} part must be at most 11 characters long and may only consist 2012 of ASCII letters (@code{a-zA-Z}). 2013 2014 @item 2015 The integer part of @code{<DecimalAmount>} may be at most 2^52. 2016 2017 @item 2018 The fractional part of @code{<DecimalAmount>} may contain at most 8 decimal digits. 2019 @end enumerate 2020 2021 @cartouche 2022 @quotation Note 2023 “EUR:1.50” and “EUR:10” are valid amounts. These are all invalid amounts: “A:B:1.5”, “EUR:4503599627370501.0”, “EUR:1.”, “EUR:.1”. 2024 @end quotation 2025 @end cartouche 2026 2027 An amount that is prefixed with a @code{+} or @code{-} character is also used in certain contexts. 2028 When no sign is present, the amount is assumed to be positive. 2029 2030 @node Time,Cryptographic primitives,Amounts,Common encodings 2031 @anchor{rest time}@anchor{41} 2032 @subsubsection Time 2033 2034 2035 In signed messages, time is represented using 64-bit big-endian values, 2036 denoting microseconds since the UNIX Epoch. @code{UINT64_MAX} represents “never”. 2037 2038 @example 2039 struct GNUNET_TIME_Absolute @{ 2040 uint64_t timestamp_us; 2041 @}; 2042 struct GNUNET_TIME_AbsoluteNBO @{ 2043 uint64_t abs_value_us__; // in network byte order 2044 @}; 2045 struct GNUNET_TIME_Timestamp @{ 2046 // must be round value (multiple of seconds) 2047 struct GNUNET_TIME_Absolute abs_time; 2048 @}; 2049 struct GNUNET_TIME_TimestampNBO @{ 2050 // must be round value (multiple of seconds) 2051 struct GNUNET_TIME_AbsoluteNBO abs_time; 2052 @}; 2053 @end example 2054 2055 @node Cryptographic primitives,Signatures<3>,Time,Common encodings 2056 @anchor{rest cryptographic-primitives}@anchor{42} 2057 @subsubsection Cryptographic primitives 2058 2059 2060 All elliptic curve operations are on Curve25519. Public and private keys are 2061 thus 32 bytes, and signatures 64 bytes. For hashing, including HKDFs, Taler 2062 uses 512-bit hash codes (64 bytes). 2063 2064 @example 2065 struct GNUNET_HashCode @{ 2066 uint8_t hash[64]; // usually SHA-512 2067 @}; 2068 @end example 2069 @anchor{rest taler-ecdhephemeralpublickeyp}@anchor{43} 2070 @example 2071 struct TALER_EcdhEphemeralPublicKeyP @{ 2072 uint8_t ecdh_pub[32]; 2073 @}; 2074 @end example 2075 @anchor{rest anastasis-truthkeyp}@anchor{44} 2076 @example 2077 struct ANASTASIS_TruthKeyP @{ 2078 struct GNUNET_HashCode key; 2079 @}; 2080 @end example 2081 2082 @example 2083 struct UUID @{ 2084 uint32_t value[4]; 2085 @}; 2086 @end example 2087 2088 @node Signatures<3>,,Cryptographic primitives,Common encodings 2089 @anchor{rest id1}@anchor{45}@anchor{rest id2}@anchor{46} 2090 @subsubsection Signatures 2091 2092 2093 Any piece of signed data, complies to the abstract data structure given below. 2094 2095 @example 2096 struct Data @{ 2097 struct GNUNET_CRYPTO_EccSignaturePurpose purpose; 2098 type1_t payload1; 2099 type2_t payload2; 2100 ... 2101 @}; 2102 2103 /*From gnunet_crypto_lib.h*/ 2104 struct GNUNET_CRYPTO_EccSignaturePurpose @{ 2105 /** 2106 2107 The following constraints apply for a valid amount: 2108 2109 * This field is used to express the context in 2110 * which the signature is made, ensuring that a 2111 * signature cannot be lifted from one part of the protocol 2112 * to another. See `src/include/taler_signatures.h` within the 2113 * exchange's codebase (git://taler.net/exchange). 2114 */ 2115 uint32_t purpose; 2116 /** 2117 * This field equals the number of bytes being signed, 2118 * namely 'sizeof (struct Data)'. 2119 */ 2120 uint32_t size; 2121 @}; 2122 @end example 2123 @anchor{rest salt}@anchor{47} 2124 @node Receiving Configuration,Receiving Terms of Service,Common encodings,REST API 2125 @anchor{rest config}@anchor{48}@anchor{rest receiving-configuration}@anchor{49} 2126 @subsection Receiving Configuration 2127 2128 2129 @anchor{rest get--config}@anchor{4a} 2130 @deffn {HTTP Get} GET /config 2131 2132 Obtain the configuration details of the escrow provider. 2133 2134 @strong{Response:} 2135 2136 Returns an @ref{4b,,EscrowConfigurationResponse}. 2137 @anchor{rest escrowconfigurationresponse}@anchor{4b} 2138 @example 2139 interface EscrowConfigurationResponse @{ 2140 2141 // Protocol identifier, clarifies that this is an Anastasis provider. 2142 name: "anastasis"; 2143 2144 // libtool-style representation of the Exchange protocol version, see 2145 // https://www.gnu.org/software/libtool/manual/html_node/Versioning.html#Versioning 2146 // The format is "current:revision:age". 2147 version: string; 2148 2149 // Currency in which this provider processes payments. 2150 currency: string; 2151 2152 // Supported authorization methods. 2153 methods: AuthorizationMethodConfig[]; 2154 2155 // Maximum policy upload size supported. 2156 storage_limit_in_megabytes: number; 2157 2158 // Payment required to maintain an account to store policy documents for a year. 2159 // Users can pay more, in which case the storage time will go up proportionally. 2160 annual_fee: Amount; 2161 2162 // Payment required to upload truth. To be paid per upload. 2163 truth_upload_fee: Amount; 2164 2165 // Limit on the liability that the provider is offering with 2166 // respect to the services provided. 2167 liability_limit: Amount; 2168 2169 // Salt value with 128 bits of entropy. 2170 // Different providers 2171 // will use different high-entropy salt values. The resulting 2172 // **provider salt** is then used in various operations to ensure 2173 // cryptographic operations differ by provider. A provider must 2174 // never change its salt value. 2175 provider_salt: string; 2176 2177 @} 2178 @end example 2179 @anchor{rest authorizationmethodconfig}@anchor{4c} 2180 @example 2181 interface AuthorizationMethodConfig @{ 2182 // Name of the authorization method. 2183 type: string; 2184 2185 // Fee for accessing key share using this method. 2186 cost: Amount; 2187 2188 @} 2189 @end example 2190 @end deffn 2191 2192 @node Receiving Terms of Service,Managing policy,Receiving Configuration,REST API 2193 @anchor{rest receiving-terms-of-service}@anchor{4d}@anchor{rest terms}@anchor{4e} 2194 @subsection Receiving Terms of Service 2195 2196 2197 @anchor{rest get--terms}@anchor{4f} 2198 @deffn {HTTP Get} GET /terms 2199 2200 Obtain the terms of service provided by the escrow provider. 2201 2202 @strong{Response:} 2203 2204 Returns the terms of service of the provider, in the best language 2205 and format available based on the client’s request. 2206 @end deffn 2207 2208 @anchor{rest get--privacy}@anchor{50} 2209 @deffn {HTTP Get} GET /privacy 2210 2211 Obtain the privacy policy of the service provided by the escrow provider. 2212 2213 @strong{Response:} 2214 2215 Returns the privacy policy of the provider, in the best language 2216 and format available based on the client’s request. 2217 @end deffn 2218 2219 @node Managing policy,Managing truth,Receiving Terms of Service,REST API 2220 @anchor{rest manage-policy}@anchor{51}@anchor{rest managing-policy}@anchor{52} 2221 @subsection Managing policy 2222 2223 2224 This API is used by the Anastasis client to deposit or request encrypted 2225 recovery documents with the escrow provider. Generally, a client will deposit 2226 the same encrypted recovery document with each escrow provider, but provide 2227 a different truth to each escrow provider. 2228 2229 Operations by the client are identified and authorized by @code{$ACCOUNT_PUB}, which 2230 should be kept secret from third parties. @code{$ACCOUNT_PUB} should be an account 2231 public key using the Crockford base32-encoding. 2232 2233 In the following, UUID is always defined and used according to RFC 4122@footnote{https://tools.ietf.org/html/rfc4122}. 2234 2235 @anchor{rest get--policy-$ACCOUNT_PUB-meta[?max_version=$NUMBER]}@anchor{53} 2236 @deffn {HTTP Get} GET /policy/$ACCOUNT_PUB/meta[?max_version=$NUMBER] 2237 2238 Get meta data about a customer’s encrypted recovery documents. 2239 If @code{max_version} is specified, only return results up to the 2240 given version number. The response may not contain meta data 2241 for all versions if there are way too many. In this case, 2242 @code{max_version} must be used to incrementally fetch more versions. 2243 2244 @strong{Response}: 2245 2246 2247 @table @asis 2248 2249 @item 200 OK@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1}: 2250 2251 The escrow provider responds with a @ref{54,,RecoveryMetaSummary} object. 2252 2253 @item 400 Bad request@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1}: 2254 2255 The @code{$ACCOUNT_PUB} is not an EdDSA public key. 2256 2257 @item 402 Payment Required@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3}: 2258 2259 The account’s balance is too low for the specified operation. 2260 See the Taler payment protocol specification for how to pay. 2261 2262 @item 404 Not found@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5}: 2263 2264 The requested resource was not found. 2265 @end table 2266 2267 @strong{Details:} 2268 @anchor{rest recoverymetasummary}@anchor{54} 2269 @example 2270 interface RecoveryMetaSummary @{ 2271 // Version numbers as a string (!) are used as keys. 2272 "$VERSION": MetaData; 2273 @} 2274 2275 interface MetaData @{ 2276 // The meta value can be NULL if the document 2277 // exists but no meta data was provided. 2278 meta: string; 2279 2280 // Server-time indicative of when the recovery 2281 // document was uploaded. 2282 upload_time: Timestamp; 2283 @} 2284 @end example 2285 @end deffn 2286 2287 @anchor{rest get--policy-$ACCOUNT_PUB[?version=$NUMBER]}@anchor{55} 2288 @deffn {HTTP Get} GET /policy/$ACCOUNT_PUB[?version=$NUMBER] 2289 2290 Get the customer’s encrypted recovery document. If @code{version} 2291 is not specified, the server returns the latest available version. If 2292 @code{version} is specified, returns the policy with the respective 2293 @code{version}. The response must begin with the nonce and 2294 an AES-GCM tag and continue with the ciphertext. Once decrypted, the 2295 plaintext is expected to contain: 2296 2297 2298 @itemize * 2299 2300 @item 2301 the escrow policy 2302 2303 @item 2304 the separately encrypted master public key 2305 @end itemize 2306 2307 Note that the key shares required to decrypt the master public key are 2308 not included, as for this the client needs to obtain authorization. 2309 The policy does provide sufficient information for the client to determine 2310 how to authorize requests for @strong{truth}. 2311 2312 The client MAY provide an @code{If-None-Match} header with an Etag. 2313 In that case, the server MUST additionally respond with an @code{304} status 2314 code in case the resource matches the provided Etag. 2315 2316 @strong{Response}: 2317 2318 2319 @table @asis 2320 2321 @item 200 OK@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1}: 2322 2323 The escrow provider responds with an @ref{56,,EncryptedRecoveryDocument} object. 2324 2325 @item 304 Not modified@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5}: 2326 2327 The client requested the same resource it already knows. 2328 2329 @item 400 Bad request@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1}: 2330 2331 The @code{$ACCOUNT_PUB} is not an EdDSA public key. 2332 2333 @item 402 Payment Required@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3}: 2334 2335 The account’s balance is too low for the specified operation. 2336 See the Taler payment protocol specification for how to pay. 2337 2338 @item 404 Not found@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5}: 2339 2340 The requested resource was not found. 2341 @end table 2342 2343 @emph{Anastasis-Version}: $NUMBER — The server must return actual version of the encrypted recovery document via this header. 2344 If the client specified a version number in the header of the request, the server must return that version. If the client 2345 did not specify a version in the request, the server returns latest version of the @ref{56,,EncryptedRecoveryDocument}. 2346 2347 @emph{Etag}: Set by the server to the Base32-encoded SHA512 hash of the body. Used for caching and to prevent redundancies. The server MUST send the Etag if the status code is @code{200 OK}. 2348 2349 @emph{If-None-Match}: If this is not the very first request of the client, this contains the Etag-value which the client has received before from the server. 2350 The client SHOULD send this header with every request (except for the first request) to avoid unnecessary downloads. 2351 @end deffn 2352 2353 @anchor{rest post--policy-$ACCOUNT_PUB}@anchor{57} 2354 @deffn {HTTP Post} POST /policy/$ACCOUNT_PUB 2355 2356 Upload a new version of the customer’s encrypted recovery document. 2357 While the document’s structure is described in JSON below, the upload 2358 should just be the bytestream of the raw data (i.e. 32-byte nonce followed 2359 by 16-byte tag followed by the encrypted document). 2360 If the request has been seen before, the server should do nothing, and otherwise store the new version. 2361 The body must begin with a nonce, an AES-GCM tag and continue with the ciphertext. The format 2362 is the same as specified for the response of the GET method. The 2363 Anastasis server cannot fully validate the format, but MAY impose 2364 minimum and maximum size limits. 2365 2366 @strong{Request}: 2367 2368 @*Query Parameters: 2369 2370 @itemize * 2371 2372 @item 2373 @code{storage_duration=YEARS} – For how many years from now would the client like us to 2374 store the recovery document? Defaults to 0 (that is, do 2375 not extend / prolong existing storage contract). 2376 The server will respond with a @code{402 Payment required}, but only 2377 if the rest of the request is well-formed (account 2378 signature must match). Clients that do not actually 2379 intend to make a new upload but that only want to pay 2380 may attempt to upload the latest backup again, as this 2381 option will be checked before the @code{304 Not modified} 2382 case. 2383 2384 @item 2385 @code{timeout_ms=NUMBER} – @emph{Optional.} If specified, the Anastasis server will 2386 wait up to @code{timeout_ms} milliseconds for completion of the payment before 2387 sending the HTTP response. A client must never rely on this behavior, as the 2388 backend may return a response immediately. If a @code{timeout_ms} is not given, the Anastasis server may apply a default timeout (usually 30s) when talking to the merchant backend. 2389 @end itemize 2390 2391 2392 @emph{If-None-Match}: This header MUST be present and set to the SHA512 hash (Etag) of the body by the client. 2393 The client SHOULD also set the @code{Expect: 100-Continue} header and wait for @code{100 continue} 2394 before uploading the body. The server MUST 2395 use the Etag to check whether it already knows the encrypted recovery document that is about to be uploaded. 2396 The server MUST refuse the upload with a @code{304} status code if the Etag matches 2397 the latest version already known to the server. 2398 2399 @emph{Anastasis-Policy-Meta-Data}: Encrypted meta data to be stored by the server and returned with the respective endpoint to provide an overview of the available policies. Encrypted using a random nonce and a key derived from the user ID using the salt “rmd”. The plaintext metadata must consist of the policy hash (for deduplication) and the (human readable) secret name. 2400 2401 @emph{Anastasis-Policy-Signature}: The client must provide Base-32 encoded EdDSA signature over hash of body with @code{$ACCOUNT_PRIV}, affirming desire to upload an encrypted recovery document. 2402 2403 @emph{Payment-Identifier}: Base-32 encoded 32-byte payment identifier that was included in a previous payment (see @code{402} status code). Used to allow the server to check that the client paid for the upload (to protect the server against DoS attacks) and that the client knows a real secret of financial value (as the @strong{kdf_id} might be known to an attacker). If this header is missing in the client’s request (or the associated payment has exceeded the upload limit), the server must return a @code{402} response. When making payments, the server must include a fresh, randomly-generated payment-identifier in the payment request. If a payment identifier is given, the Anastasis backend may block for the payment to be confirmed by Taler as specified by the @code{timeout_ms} argument. 2404 2405 @strong{Response}: 2406 2407 2408 @table @asis 2409 2410 @item 204 No content@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5}: 2411 2412 The encrypted recovery document was accepted and stored. @code{Anastasis-Version} 2413 indicates what version was assigned to this encrypted recovery document upload by the server. 2414 @code{Anastasis-Policy-Expiration} indicates the time until the server promises to store the policy, 2415 in seconds since epoch. 2416 2417 @item 304 Not modified@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5}: 2418 2419 The same encrypted recovery document was previously accepted and stored. @code{Anastasis-Version} header 2420 indicates what version was previously assigned to this encrypted recovery document. 2421 2422 @item 400 Bad request@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1}: 2423 2424 The @code{$ACCOUNT_PUB} is not an EdDSA public key or mandatory headers are missing. 2425 The response body MUST elaborate on the error using a Taler error code in the typical JSON encoding. 2426 2427 @item 402 Payment required@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3}: 2428 2429 The account’s balance is too low for the specified operation. 2430 See the Taler payment protocol specification for how to pay. 2431 The response body MAY provide alternative means for payment. 2432 2433 @item 403 Forbidden@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4}: 2434 2435 The required account signature was invalid. The response body may elaborate on the error. 2436 2437 @item 413 Request entity too large@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.14}: 2438 2439 The upload is too large @emph{or} too small. The response body may elaborate on the error. 2440 @end table 2441 2442 @strong{Details:} 2443 @anchor{rest encryptedrecoverydocument}@anchor{56} 2444 @example 2445 interface EncryptedRecoveryDocument @{ 2446 // Nonce used to compute the (iv,key) pair for encryption of the 2447 // encrypted_compressed_recovery_document. 2448 nonce: [32]; //bytearray 2449 2450 // Authentication tag. 2451 aes_gcm_tag: [16]; //bytearray 2452 2453 // Variable-size encrypted recovery document. After decryption, 2454 // this contains a gzip compressed JSON-encoded `RecoveryDocument`. 2455 // The salt of the HKDF for this encryption must include the 2456 // string "erd". 2457 encrypted_compressed_recovery_document: []; //bytearray of undefined length 2458 2459 @} 2460 @end example 2461 @anchor{rest recoverydocument}@anchor{58} 2462 @example 2463 interface RecoveryDocument @{ 2464 // Human-readable name of the secret 2465 secret_name?: string; 2466 2467 // Encrypted core secret. 2468 encrypted_core_secret: string; // bytearray of undefined length 2469 2470 // List of escrow providers and selected authentication method. 2471 escrow_methods: EscrowMethod[]; 2472 2473 // List of possible decryption policies. 2474 policies: DecryptionPolicy[]; 2475 2476 @} 2477 @end example 2478 @anchor{rest escrowmethod}@anchor{59} 2479 @example 2480 interface EscrowMethod @{ 2481 // URL of the escrow provider (including possibly this Anastasis server). 2482 url : string; 2483 2484 // Type of the escrow method (e.g. security question, SMS etc.). 2485 escrow_type: string; 2486 2487 // UUID of the escrow method (see /truth/ API below). 2488 uuid: string; 2489 2490 // Key used to encrypt the `Truth` this `EscrowMethod` is related to. 2491 // Client has to provide this key to the server when using `@w{`}/truth/`@w{`}. 2492 truth_key: [32]; //bytearray 2493 2494 // Salt used to hash the security answer if appliccable. 2495 question_salt: [32]; //bytearray 2496 2497 // Salt from the provider to derive the user ID 2498 // at this provider. 2499 provider_salt: [32]; //bytearray 2500 2501 // The instructions to give to the user (i.e. the security question 2502 // if this is challenge-response). 2503 // (Q: as string in base32 encoding?) 2504 // (Q: what is the mime-type of this value?) 2505 // 2506 // The plaintext challenge is not revealed to the 2507 // Anastasis server. 2508 instructions: string; 2509 2510 @} 2511 @end example 2512 @anchor{rest decryptionpolicy}@anchor{5a} 2513 @example 2514 interface DecryptionPolicy @{ 2515 // Salt included to encrypt master key share when 2516 // using this decryption policy. 2517 master_salt: [32]; //bytearray 2518 2519 // Master key, AES-encrypted with key derived from 2520 // salt and keyshares revealed by the following list of 2521 // escrow methods identified by UUID. 2522 master_key: [32]; //bytearray 2523 2524 // List of escrow methods identified by their UUID. 2525 uuids: string[]; 2526 2527 @} 2528 @end example 2529 @end deffn 2530 2531 @node Managing truth,,Managing policy,REST API 2532 @anchor{rest managing-truth}@anchor{5b}@anchor{rest truth}@anchor{5c} 2533 @subsection Managing truth 2534 2535 2536 Truth always consists of an encrypted key share and encrypted 2537 authentication data. The key share and the authentication data 2538 are encrypted using different keys. Additionally, truth includes 2539 the name of the authentication method, the mime-type of the 2540 authentication data, and an expiration time in 2541 cleartext. 2542 2543 This API is used by the Anastasis client to deposit @strong{truth} or request a (encrypted) @strong{key share} with 2544 the escrow provider. 2545 2546 An @strong{escrow method} specifies an Anastasis provider and how the user should 2547 authorize themself. The @strong{truth} API allows the user to provide the 2548 (encrypted) key share to the respective escrow provider, as well as auxiliary 2549 data required for such a respective escrow method. 2550 2551 An Anastasis-server may store truth for free for a certain time period, or 2552 charge per truth operation using GNU Taler. 2553 2554 @anchor{rest post--truth-$UUID}@anchor{5d} 2555 @deffn {HTTP Post} POST /truth/$UUID 2556 2557 @strong{Request:} 2558 2559 Upload a @ref{5e,,TruthUploadRequest}-Object according to the policy the client created before (see @ref{58,,RecoveryDocument}). 2560 If request has been seen before, the server should do nothing, and otherwise store the new object. 2561 2562 @*Query Parameters: 2563 2564 @itemize * 2565 2566 @item 2567 @code{timeout_ms=NUMBER} – @emph{Optional.} If specified, the Anastasis server will 2568 wait up to @code{timeout_ms} milliseconds for completion of the payment before 2569 sending the HTTP response. A client must never rely on this behavior, as the 2570 backend may return a response immediately. 2571 @end itemize 2572 2573 2574 @strong{Response:} 2575 2576 2577 @table @asis 2578 2579 @item 204 No content@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5}: 2580 2581 Truth stored successfully. 2582 2583 @item 304 Not modified@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5}: 2584 2585 The same truth was previously accepted and stored under this UUID. The 2586 Anastasis server must still update the expiration time for the truth when returning 2587 this response code. 2588 2589 @item 402 Payment required@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3}: 2590 2591 This server requires payment to store truth per item. 2592 See the Taler payment protocol specification for how to pay. 2593 The response body MAY provide alternative means for payment. 2594 2595 @item 409 Conflict@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10}: 2596 2597 The server already has some truth stored under this UUID. The client should check that it 2598 is generating UUIDs with enough entropy. 2599 2600 @item 412 Precondition failed@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.13}: 2601 2602 The selected authentication method is not supported on this provider. 2603 @end table 2604 2605 @strong{Details:} 2606 @anchor{rest truthuploadrequest}@anchor{5e} 2607 @example 2608 interface TruthUploadRequest @{ 2609 // Contains the information of an interface `EncryptedKeyShare`, but simply 2610 // as one binary block (in Crockford Base32 encoding for JSON). 2611 key_share_data: []; //bytearray 2612 2613 // Key share method, i.e. "security question", "SMS", "e-mail", ... 2614 type: string; 2615 2616 // Variable-size truth. After decryption, 2617 // this contains the ground truth, i.e. H(challenge answer), 2618 // phone number, e-mail address, picture, fingerprint, ... 2619 // **base32 encoded**. 2620 // 2621 // The nonce of the HKDF for this encryption must include the 2622 // string "ECT". 2623 encrypted_truth: []; //bytearray 2624 2625 // MIME type of truth, i.e. text/ascii, image/jpeg, etc. 2626 truth_mime?: string; 2627 2628 // For how many years from now would the client like us to 2629 // store the truth? 2630 storage_duration_years: number; 2631 2632 @} 2633 @end example 2634 2635 @anchor{rest post--truth-$UUID-solve}@anchor{5f} 2636 @deffn {HTTP Post} POST /truth/$UUID/solve 2637 @end deffn 2638 2639 Solve the challenge and get the stored encrypted key share. 2640 Also, the user has to provide the correct @emph{truth_encryption_key} with the request (see below). 2641 The encrypted key share is returned simply as a byte array and not in JSON format. 2642 2643 @strong{Request}: 2644 2645 @quotation 2646 2647 Upload a @ref{60,,TruthSolutionRequest}-Object. 2648 2649 @*query timeout_ms=NUMBER: 2650 @emph{Optional.} If specified, the Anastasis server will 2651 wait up to @code{timeout_ms} milliseconds for completion of the payment or the 2652 challenge before sending the HTTP response. A client must never rely on this 2653 behavior, as the backend may return a response immediately. 2654 2655 @end quotation 2656 2657 @strong{Response}: 2658 2659 2660 @table @asis 2661 2662 @item 200 OK@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1}: 2663 2664 @ref{61,,EncryptedKeyShare} is returned in body (in binary). 2665 2666 @item 402 Payment required@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3}: 2667 2668 The service requires payment for access to truth. 2669 See the Taler payment protocol specification for how to pay. 2670 The response body MAY provide alternative means for payment. 2671 2672 @item 403 Forbidden@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4}: 2673 2674 The h_response provided is not a good response to the challenge associated 2675 with the UUID, or at least the answer is not valid yet. A generic 2676 response is provided with an error code. 2677 2678 @item 404 Not found@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5}: 2679 2680 The server does not know any truth under the given UUID. 2681 2682 @item 429 Too Many Requests@footnote{http://tools.ietf.org/html/rfc6585#section-4}: 2683 2684 The client exceeded the number of allowed attempts at providing 2685 a valid response for the given time interval. 2686 The response format is given by @ref{62,,RateLimitedMessage}. 2687 2688 @item 503 Service Unavailable@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4}: 2689 2690 Server is out of Service. 2691 @end table 2692 2693 @strong{Details:} 2694 @anchor{rest truthsolutionrequest}@anchor{60} 2695 @example 2696 interface TruthSolutionRequest @{ 2697 2698 // Hash over the response that solves the challenge 2699 // issued for this truth. This can be the 2700 // hash of the security question (as specified before by the client 2701 // within the `TruthUploadRequest`_ (see `@w{`}encrypted_truth`@w{`})), or the hash of the 2702 // PIN code sent via SMS, E-mail or postal communication channels. 2703 // Only when `@w{`}$H_RESPONSE`@w{`} is correct, the server responds with the encrypted key share. 2704 h_response: HashCode; 2705 2706 // Key that was used to encrypt the **truth** (see encrypted_truth within `TruthUploadRequest`_) 2707 // and which has to provided by the user. The key is stored with 2708 // the according `EscrowMethod`_. The server needs this key to get the 2709 // info out of `TruthUploadRequest`_ to verify the `@w{`}h_response`@w{`}. 2710 truth_decryption_key: ANASTASIS_TruthKeyP; 2711 2712 // Reference to a payment made by the client to 2713 // pay for this request. Optional. 2714 payment_secret?: ANASTASIS_PaymentSecretP; 2715 @} 2716 @end example 2717 @anchor{rest encryptedkeyshare}@anchor{61} 2718 @example 2719 interface EncryptedKeyShare @{ 2720 // Nonce used to compute the decryption (iv,key) pair. 2721 nonce_i: [32]; //bytearray 2722 2723 // Authentication tag. 2724 aes_gcm_tag_i: [16]; //bytearray 2725 2726 // Encrypted key-share in base32 encoding. 2727 // After decryption, this yields a `KeyShare`. Note that 2728 // the `KeyShare` MUST be encoded as a fixed-size binary 2729 // block (instead of in JSON encoding). 2730 // 2731 // HKDF for the key generation must include the 2732 // string "eks" as salt. 2733 // Depending on the method, 2734 // the HKDF may additionally include 2735 // bits from the response (i.e. some hash over the 2736 // answer to the security question). 2737 encrypted_key_share_i: [32]; //bytearray 2738 2739 @} 2740 2741 2742 interface KeyShare @{ 2743 // Key material to derive the key to decrypt the master key. 2744 key_share: [32]; //bytearray 2745 @} 2746 @end example 2747 @anchor{rest ratelimitedmessage}@anchor{62} 2748 @example 2749 interface RateLimitedMessage @{ 2750 2751 // Taler error code, TALER_EC_ANASTASIS_TRUTH_RATE_LIMITED. 2752 code: number; 2753 2754 // How many attempts are allowed per challenge? 2755 request_limit: number; 2756 2757 // At what frequency are new challenges issued? 2758 request_frequency: RelativeTime; 2759 2760 // The error message. 2761 hint: string; 2762 2763 @} 2764 @end example 2765 2766 @anchor{rest post--truth-$UUID-challenge}@anchor{63} 2767 @deffn {HTTP Post} POST /truth/$UUID/challenge 2768 @end deffn 2769 2770 NEW API (#7064): 2771 2772 Initiate process to solve challenge associated with the given truth object. 2773 2774 @strong{Request}: 2775 2776 @quotation 2777 2778 Upload a @ref{64,,TruthChallengeRequest}-Object. 2779 @end quotation 2780 2781 @strong{Response}: 2782 2783 2784 @table @asis 2785 2786 @item 200 Ok@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1}: 2787 2788 The escrow provider will respond out-of-band (i.e. SMS). 2789 The body may contain human- or machine-readable instructions on next steps. 2790 In case the response is in JSON, the format is given 2791 by @ref{65,,ChallengeInstructionMessage}. 2792 2793 @item 402 Payment required@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3}: 2794 2795 The service requires payment to issue a challenge. 2796 See the Taler payment protocol specification for how to pay. 2797 The response body MAY provide alternative means for payment. 2798 2799 @item 403 Forbidden@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4}: 2800 2801 This type of truth does not permit requests to trigger a challenge. 2802 This is the case for security questions and TOTP methods. 2803 2804 @item 404 Not found@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5}: 2805 2806 The server does not know any truth under the given UUID. 2807 2808 @item 424 Failed Dependency@footnote{http://tools.ietf.org/html/rfc4918#section-11.4}: 2809 2810 The decrypted @code{truth} does not match the expectations of the authentication 2811 backend, i.e. a phone number for sending an SMS is not a number, or 2812 an e-mail address for sending an E-mail is not a valid e-mail address. 2813 2814 @item 503 Service Unavailable@footnote{http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4}: 2815 2816 Server is out of Service. 2817 @end table 2818 2819 @strong{Details:} 2820 @anchor{rest truthchallengerequest}@anchor{64} 2821 @example 2822 interface TruthChallengeRequest @{ 2823 2824 // Key that was used to encrypt the **truth** (see encrypted_truth within `TruthUploadRequest`_) 2825 // and which has to provided by the user. The key is stored with 2826 // the according `EscrowMethod`_. The server needs this key to get the 2827 // info out of `TruthUploadRequest`_ to verify the `@w{`}h_response`@w{`}. 2828 truth_decryption_key: ANASTASIS_TruthKeyP; 2829 2830 // Reference to a payment made by the client to 2831 // pay for this request. Optional. 2832 payment_secret?: ANASTASIS_PaymentSecretP; 2833 @} 2834 @end example 2835 @anchor{rest challengeinstructionmessage}@anchor{65} 2836 @example 2837 type ChallengeInstructionMessage = 2838 | FileChallengeInstructionMessage 2839 | IbanChallengeInstructionMessage 2840 | PinChallengeInstructionMessage; 2841 2842 interface IbanChallengeInstructionMessage @{ 2843 2844 // What kind of challenge is this? 2845 method: "IBAN_WIRE"; 2846 2847 // How much should be wired? 2848 amount: Amount; 2849 2850 // What is the target IBAN? 2851 credit_iban: string; 2852 2853 // What is the receiver name? 2854 business_name: string; 2855 2856 // What is the expected wire transfer subject? 2857 wire_transfer_subject: string; 2858 2859 // What is the numeric code (also part of the 2860 // wire transfer subject) to be hashed when 2861 // solving the challenge? 2862 answer_code: number; 2863 2864 // Hint about the origin account that must be used. 2865 debit_account_hint: string; 2866 2867 @} 2868 2869 interface PinChallengeInstructionMessage @{ 2870 2871 // What kind of challenge is this? 2872 method: "TAN_SENT"; 2873 2874 // Where was the PIN code sent? Note that this 2875 // address will most likely have been obscured 2876 // to improve privacy. 2877 tan_address_hint: string; 2878 2879 @} 2880 2881 interface FileChallengeInstructionMessage @{ 2882 2883 // What kind of challenge is this? 2884 method: "FILE_WRITTEN"; 2885 2886 // Name of the file where the PIN code was written. 2887 filename: string; 2888 2889 @} 2890 @end example 2891 @end deffn 2892 2893 @c This file is part of Anastasis 2894 @c Copyright (C) 2019-2022 Anastasis SARL 2895 @c 2896 @c Anastasis is free software; you can redistribute it and/or modify it under the 2897 @c terms of the GNU Affero General Public License as published by the Free Software 2898 @c Foundation; either version 2.1, or (at your option) any later version. 2899 @c 2900 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY 2901 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 2902 @c A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 2903 @c 2904 @c You should have received a copy of the GNU Affero General Public License along with 2905 @c Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 2906 @c 2907 @c @author Christian Grothoff 2908 @c @author Dominik Meister 2909 @c @author Dennis Neufeld 2910 2911 @node Reducer API,Authentication Methods,REST API,Documentation Overview 2912 @anchor{reducer doc}@anchor{66}@anchor{reducer reducer-api}@anchor{67} 2913 @section Reducer API 2914 2915 2916 This section describes the Anastasis Reducer API which is used by client applications 2917 to store or load the different states the client application can have. 2918 The reducer takes a @ref{68,,state} in JSON syntax and returns the new state in JSON syntax. 2919 2920 For example a @strong{state} may take the following structure: 2921 2922 @example 2923 @{ 2924 "backup_state": "CONTINENT_SELECTING", 2925 "continents": [ 2926 "Europe", 2927 "North_America" 2928 ] 2929 @} 2930 @end example 2931 2932 The new state depends on the previous one and on the transition @ref{69,,action} with its 2933 arguments given to the reducer. A @strong{transition argument} also is a statement in JSON syntax: 2934 2935 @example 2936 @{ 2937 "continent": "Europe" 2938 @} 2939 @end example 2940 2941 The new state returned by the reducer with the state and transition argument defined 2942 above would look like following for the transition @ref{69,,action} @code{select_continent}: 2943 2944 @example 2945 @{ 2946 "backup_state": "COUNTRY_SELECTING", 2947 "continents": [ 2948 "Europe", 2949 "North_America" 2950 ], 2951 "selected_continent": "Europe", 2952 "countries": [ 2953 @{ 2954 "code": "ch", 2955 "name": "Switzerland", 2956 "continent": "Europe", 2957 "name_i18n": @{ 2958 "de_DE": "Schweiz", 2959 "de_CH": "Schwiiz", 2960 "fr": "Suisse", 2961 "en": "Swiss" 2962 @}, 2963 "currency": "CHF" 2964 @}, 2965 @{ 2966 "code": "de", 2967 "name": "Germany", 2968 "continent": "Europe", 2969 "continent_i18n": @{ 2970 "de": "Europa" 2971 @}, 2972 "name_i18n": @{ 2973 "de_DE": "Deutschland", 2974 "de_CH": "Deutschland", 2975 "fr": "Allemagne", 2976 "en": "Germany" 2977 @}, 2978 "currency": "EUR" 2979 @} 2980 ] 2981 @} 2982 @end example 2983 2984 An action may also result into an @emph{error response} instead of a new state. 2985 Clients should then render this error response to the user and allow the user 2986 to continue from the old state. An error response looks like this: 2987 2988 @example 2989 @{ 2990 "code": 123, 2991 "hint": "something went wrong", 2992 "details": "parameter foo failed to frobnify" 2993 @} 2994 @end example 2995 2996 @menu 2997 * States:: 2998 * Backup Reducer:: 2999 * Recovery Reducer:: 3000 * Reducer transitions:: 3001 3002 @end menu 3003 3004 @node States,Backup Reducer,,Reducer API 3005 @anchor{reducer states}@anchor{6a} 3006 @subsection States 3007 3008 3009 Overall, the reducer knows the following states: 3010 3011 @quotation 3012 3013 3014 @itemize - 3015 3016 @item 3017 3018 @table @asis 3019 3020 @item @strong{CONTINENT_SELECTING}: The user should specify the continent where they are living, 3021 3022 so that we can show a list of countries to choose from. 3023 @end table 3024 3025 @item 3026 3027 @table @asis 3028 3029 @item @strong{COUNTRY_SELECTING}: The user should specify the country where they are living, 3030 3031 so that we can determine appropriate attributes, currencies and Anastasis 3032 providers. 3033 @end table 3034 3035 @item 3036 3037 @table @asis 3038 3039 @item @strong{USER_ATTRIBUTES_COLLECTING}: The user should provide the country-specific personal 3040 3041 attributes. 3042 @end table 3043 3044 @item 3045 3046 @table @asis 3047 3048 @item @strong{AUTHENTICATIONS_EDITING}: The user should add authentication methods to be used 3049 3050 during recovery. 3051 @end table 3052 3053 @item 3054 @strong{POLICIES_REVIEWING}: The user should review the recovery policies. 3055 3056 @item 3057 @strong{SECRET_EDITING}: The user should edit the secret to be backed up. 3058 3059 @item 3060 3061 @table @asis 3062 3063 @item @strong{TRUTHS_PAYING}: The user needs to pay for one or more uploads of data associated 3064 3065 with an authentication method. 3066 @end table 3067 3068 @item 3069 @strong{POLICIES_PAYING}: The user needs to pay for storing the recovery policy document. 3070 3071 @item 3072 @strong{BACKUP_FINISHED}: A backup has been successfully generated. 3073 3074 @item 3075 3076 @table @asis 3077 3078 @item @strong{SECRET_SELECTING}: The user needs to select a recovery policy document with 3079 3080 the secret that is to be recovered. 3081 @end table 3082 3083 @item 3084 3085 @table @asis 3086 3087 @item @strong{CHALLENGE_SELECTING}: The user needs to select an authorization challenge to 3088 3089 proceed with recovery. 3090 @end table 3091 3092 @item 3093 @strong{CHALLENGE_PAYING}: The user needs to pay to proceed with the authorization challenge. 3094 3095 @item 3096 @strong{CHALLENGE_SOLVING}: The user needs to solve the authorization challenge. 3097 3098 @item 3099 @strong{RECOVERY_FINISHED}: The secret of the user has been recovered. 3100 @end itemize 3101 @end quotation 3102 3103 State names: 3104 3105 @quotation 3106 3107 3108 @itemize - 3109 3110 @item 3111 In SELECTING-states, the user has to choose one value out of a predefined set of values (for example a continent out of a set of continents). 3112 3113 @item 3114 In COLLECTING-states, the user has to give certain values. 3115 3116 @item 3117 In EDITING-states, the user is free to choose which values he wants to give. 3118 3119 @item 3120 In REVEIWING-states, the user may make a few choices, but primarily is expected to affirm something. 3121 3122 @item 3123 in PAYING-states, the user must make a payment. 3124 3125 @item 3126 in FINISHED-states, the operation has definitively concluded. 3127 @end itemize 3128 @end quotation 3129 3130 @node Backup Reducer,Recovery Reducer,States,Reducer API 3131 @anchor{reducer backup-reducer}@anchor{6b} 3132 @subsection Backup Reducer 3133 3134 @anchor{reducer state}@anchor{68}@anchor{reducer action}@anchor{69} 3135 3136 @float Figure 3137 3138 @image{anastasis-figures/anastasis_reducer_backup,,,fig-anastasis_reducer_backup,png} 3139 3140 @caption{Backup states and their transitions.} 3141 3142 @end float 3143 3144 3145 The illustration above shows the different states the reducer can have during a backup 3146 process. 3147 3148 @node Recovery Reducer,Reducer transitions,Backup Reducer,Reducer API 3149 @anchor{reducer recovery-reducer}@anchor{6c} 3150 @subsection Recovery Reducer 3151 3152 3153 3154 @float Figure 3155 3156 @image{anastasis-figures/anastasis_reducer_recovery,,,fig-anastasis_reducer_recovery,png} 3157 3158 @caption{Recovery states and their transitions.} 3159 3160 @end float 3161 3162 3163 The illustration above shows the different states the reducer can have during a recovery 3164 process. 3165 3166 @node Reducer transitions,,Recovery Reducer,Reducer API 3167 @anchor{reducer reducer-transitions}@anchor{6d} 3168 @subsection Reducer transitions 3169 3170 3171 In the following, the individual transitions will be specified in more detail. 3172 Note that we only show fields added by the reducer, typically the previous 3173 state is preserved to enable “back” transitions to function smoothly. 3174 3175 @menu 3176 * Initial state:: 3177 * Common transitions:: 3178 * Backup transitions:: 3179 * Recovery transitions:: 3180 3181 @end menu 3182 3183 @node Initial state,Common transitions,,Reducer transitions 3184 @anchor{reducer initial-state}@anchor{6e} 3185 @subsubsection Initial state 3186 3187 3188 The initial states for backup and recovery processes are: 3189 3190 @strong{Initial backup state:} 3191 3192 @example 3193 @{ 3194 "backup_state": "CONTINENT_SELECTING", 3195 "continents": [ 3196 "Europe", 3197 "North America" 3198 ] 3199 @} 3200 @end example 3201 3202 @strong{Initial recovery state:} 3203 3204 @example 3205 @{ 3206 "recovery_state": "CONTINENT_SELECTING", 3207 "continents": [ 3208 "Europe", 3209 "North America" 3210 ] 3211 @} 3212 @end example 3213 3214 Here, “continents” is an array of English strings with the names of the 3215 continents which contain countries for which Anastasis could function (based 3216 on having providers that are known to operate and rules being provided for 3217 user attributes from those countries). 3218 3219 For internationalization, another field @code{continents_i18n} may be present. 3220 This field would be a map of language names to arrays of translated 3221 continent names: 3222 3223 @example 3224 @{ 3225 "recovery_state": "CONTINENT_SELECTING", 3226 "continents": [ 3227 "Europe", 3228 "North America" 3229 ] 3230 "continents_i18n": 3231 @{ 3232 "de_DE" : [ 3233 "Europa", 3234 "Nordamerika" 3235 ], 3236 "de_CH" : [ 3237 "Europa", 3238 "Nordamerika" 3239 ] 3240 @} 3241 @} 3242 @end example 3243 3244 Translations must be given in the same order as the main English array. 3245 3246 @node Common transitions,Backup transitions,Initial state,Reducer transitions 3247 @anchor{reducer common-transitions}@anchor{6f} 3248 @subsubsection Common transitions 3249 3250 3251 @strong{select_continent:} 3252 3253 Here the user specifies the continent they live on. Arguments (example): 3254 3255 @example 3256 @{ 3257 "continent": "Europe" 3258 @} 3259 @end example 3260 3261 The continent must be given using the English name from the @code{continents} array. 3262 Using a translated continent name is invalid and may result in failure. 3263 3264 The reducer returns an updated state with a list of countries to choose from, 3265 for example: 3266 3267 @example 3268 @{ 3269 "backup_state": "COUNTRY_SELECTING", 3270 "selected_continent": "Europe", 3271 "countries": [ 3272 @{ 3273 "code": "ch", 3274 "name": "Switzerland", 3275 "continent": "Europe", 3276 "name_i18n": @{ 3277 "de_DE": "Schweiz", 3278 "de_CH": "Schwiiz", 3279 "fr": "Suisse", 3280 "en": "Swiss" 3281 @}, 3282 "currency": "CHF" 3283 @}, 3284 @{ 3285 "code": "de", 3286 "name": "Germany", 3287 "continent": "Europe", 3288 "continent_i18n": @{ 3289 "de": "Europa" 3290 @}, 3291 "name_i18n": @{ 3292 "de_DE": "Deutschland", 3293 "de_CH": "Deutschland", 3294 "fr": "Allemagne", 3295 "en": "Germany" 3296 @}, 3297 "currency": "EUR" 3298 @} 3299 ] 3300 @} 3301 @end example 3302 3303 Here @code{countries} is an array of countries on the @code{selected_continent}. For 3304 each country, the @code{code} is the ISO 3166-1 alpha-2 country code. The 3305 @code{continent} is only present because some countries span continents, the 3306 information is redundant and will always match @code{selected_continent}. The 3307 @code{name} is the name of the country in English, internationalizations of the 3308 name may be provided in @code{name_i18n}. The @code{currency} is @strong{an} official 3309 currency of the country, if a country has multiple currencies, it may appear 3310 multiple times in the list. In this case, the user should select the entry 3311 with the currency they intend to pay with. It is also possible for users 3312 to select a currency that does not match their country, but user interfaces 3313 should by default try to use currencies that match the user’s residence. 3314 3315 @strong{select_country:} 3316 3317 Selects the country (via the country code) and specifies the currency. 3318 The latter is needed as some countries have more than one currency, 3319 and some use-cases may also involve users insisting on paying with 3320 foreign currency. 3321 3322 Arguments (example): 3323 3324 @example 3325 @{ 3326 "country_code": "de", 3327 "currency": "EUR" 3328 @} 3329 @end example 3330 3331 The @code{country_code} must be an ISO 3166-1 alpha-2 country code from 3332 the array of @code{countries} of the reducer’s state. The @code{currency} 3333 field must be a valid currency accepted by the Taler payment system. 3334 3335 The reducer returns a new state with the list of attributes the 3336 user is expected to provide, as well as possible authentication 3337 providers that accept payments in the selected currency: 3338 3339 @example 3340 @{ 3341 "backup_state": "USER_ATTRIBUTES_COLLECTING", 3342 "selected_country": "de", 3343 "currency": "EUR", 3344 "required_attributes": [ 3345 @{ 3346 "type": "string", 3347 "name": "full_name", 3348 "label": "Full name", 3349 "label_i18n": @{ 3350 "de_DE": "Vollstaendiger Name", 3351 "de_CH": "Vollstaendiger. Name", 3352 "fr": "Nom complet", 3353 "en": "Full name" 3354 @}, 3355 "widget": "anastasis_gtk_ia_full_name", 3356 "uuid" : "9e8f463f-575f-42cb-85f3-759559997331" 3357 @}, 3358 @{ 3359 "type": "date", 3360 "name": "birthdate", 3361 "label": "Birthdate", 3362 "label_i18n": @{ 3363 "de_DE": "Geburtsdatum", 3364 "de_CH": "Geburtsdatum", 3365 "fr": "Date de naissance", 3366 "en": "Birthdate" 3367 @}, 3368 "uuid" : "83d655c7-bdb6-484d-904e-80c1058c8854" 3369 "widget": "anastasis_gtk_ia_birthdate" 3370 @}, 3371 @{ 3372 "type": "string", 3373 "name": "tax_number", 3374 "label": "Taxpayer identification number", 3375 "label_i18n":@{ 3376 "de_DE": "Steuerliche Identifikationsnummer", 3377 "de_CH": "Steuerliche Identifikationsnummer", 3378 "en": "German taxpayer identification number" 3379 @}, 3380 "widget": "anastasis_gtk_ia_tax_de", 3381 "uuid": "dae48f85-e3ff-47a4-a4a3-ed981ed8c3c6", 3382 "validation-regex": "^[0-9]@{11@}$", 3383 "validation-logic": "DE_TIN_check" 3384 @}, 3385 @{ 3386 "type": "string", 3387 "name": "social_security_number", 3388 "label": "Social security number", 3389 "label_i18n": @{ 3390 "de_DE": "Sozialversicherungsnummer", 3391 "de_CH": "Sozialversicherungsnummer", 3392 "fr": "Numéro de sécurité sociale", 3393 "en": "Social security number" 3394 @}, 3395 "widget": "anastasis_gtk_ia_ssn", 3396 "validation-regex": "^[0-9]@{8@}[[:upper:]][0-9]@{3@}$", 3397 "validation-logic": "DE_SVN_check" 3398 "optional" : true 3399 @} 3400 ], 3401 "authentication_providers": @{ 3402 "http://localhost:8089/": @{ 3403 "http_status": 200, 3404 "methods": [ 3405 @{ "type" : "question", 3406 "usage_fee" : "EUR:0.0" @}, 3407 @{ "type" : "sms", 3408 "usage_fee" : "EUR:0.5" @} 3409 ], 3410 "annual_fee": "EUR:4.99", 3411 "truth_upload_fee": "EUR:4.99", 3412 "liability_limit": "EUR:1", 3413 "currency": "EUR", 3414 "storage_limit_in_megabytes": 1, 3415 "provider_name": "Anastasis 4", 3416 "salt": "CXAPCKSH9D3MYJTS9536RHJHCW" 3417 @}, 3418 "http://localhost:8088/": @{ 3419 "http_status": 200, 3420 "methods": [ 3421 @{ "type" : "question", 3422 "usage_fee" : "EUR:0.01" @}, 3423 @{ "type" : "sms", 3424 "usage_fee" : "EUR:0.55" @} 3425 ], 3426 "annual_fee": "EUR:0.99", 3427 "truth_upload_fee": "EUR:3.99", 3428 "liability_limit": "EUR:1", 3429 "currency": "EUR", 3430 "storage_limit_in_megabytes": 1, 3431 "provider_name": "Anastasis 4", 3432 "salt": "CXAPCKSH9D3MYJTS9536RHJHCW" 3433 @} 3434 @} 3435 @} 3436 @end example 3437 3438 The array of @code{required_attributes} contains attributes about the user 3439 that must be provided includes: 3440 3441 @quotation 3442 3443 3444 @itemize - 3445 3446 @item 3447 @strong{type}: The type of the attribute, for now only @code{string} and @code{date} are 3448 supported. 3449 3450 @item 3451 @strong{name}: The name of the attribute, this is the key under which the 3452 attribute value must be provided later. The name must be unique per response. 3453 3454 @item 3455 @strong{label}: A human-readable description of the attribute in English. 3456 Translated descriptions may be provided under @strong{label_i18n}. 3457 3458 @item 3459 @strong{uuid}: A UUID that uniquely identifies identical attributes across 3460 different countries. Useful to preserve values should the user enter 3461 some attributes, and then switch to another country. Note that 3462 attributes must not be preserved if they merely have the same @strong{name}, 3463 only the @strong{uuid} will be identical if the semantics is identical. 3464 3465 @item 3466 @strong{widget}: An optional name of a widget that is known to nicely render 3467 the attribute entry in user interfaces where named widgets are 3468 supported. 3469 3470 @item 3471 @strong{validation-regex}: An optional extended POSIX regular expression 3472 that is to be used to validate (string) inputs to ensure they are 3473 well-formed. 3474 3475 @item 3476 @strong{validation-logic}: Optional name of a function that should be called 3477 to validate the input. If the function is not known to the particular 3478 client, the respective validation can be skipped (at the expense of 3479 typos by users not being detected, possibly rendering secrets 3480 irrecoverable). 3481 3482 @item 3483 @strong{optional}: Optional boolean field that, if @code{true}, indicates that 3484 this attribute is not actually required but optional and users MAY leave 3485 it blank in case they do not have the requested information. Used for 3486 common fields that apply to some large part of the population but are 3487 not sufficiently universal to be actually required. 3488 @end itemize 3489 @end quotation 3490 3491 The authentication providers are listed under a key that is the 3492 base URL of the service. For each provider, the following 3493 information is provided if the provider was successfully contacted: 3494 3495 @quotation 3496 3497 3498 @itemize - 3499 3500 @item 3501 @strong{http_status}: HTTP status code, always @code{200} on success. 3502 3503 @item 3504 @strong{methods}: Array of authentication methods supported by this 3505 provider. Includes the @strong{type} of the authentication method 3506 and the @strong{usage_fee} (how much the user must pay for authorization 3507 using this method during recovery). 3508 3509 @item 3510 @strong{annual_fee}: Fee the provider charges to store the recovery 3511 policy for one year. 3512 3513 @item 3514 @strong{truth_upload_fee}: Fee the provider charges to store a key share. 3515 3516 @item 3517 @strong{liability_limit}: Amount the provider can be held liable for in 3518 case a key share or recovery document cannot be recovered due to 3519 provider failures. 3520 3521 @item 3522 @strong{currency}: Currency in which the provider wants to be paid, 3523 will match all of the fees. 3524 3525 @item 3526 @strong{storage_limit_in_megabytes}: Maximum size of an upload (for 3527 both recovery document and truth data) in megabytes. 3528 3529 @item 3530 @strong{provider_name}: Human-readable name of the provider’s business. 3531 3532 @item 3533 @strong{salt}: Salt value used by the provider, used to derive the 3534 user’s identity at this provider. Should be unique per provider, 3535 and must never change for a given provider. The salt is 3536 base32 encoded. 3537 @end itemize 3538 @end quotation 3539 3540 If contacting the provider failed, the information returned is: 3541 3542 @quotation 3543 3544 3545 @itemize - 3546 3547 @item 3548 @strong{http_status}: HTTP status code (if available, possibly 0 if 3549 we did not even obtain an HTTP response). 3550 3551 @item 3552 @strong{error_code}: Taler error code, never 0. 3553 @end itemize 3554 @end quotation 3555 3556 @strong{add_provider}: 3557 3558 This operation can be performed in state @code{USER_ATTRIBUTES_COLLECTING}. 3559 It 3560 adds one or more Anastasis providers to the list of providers the reducer 3561 should henceforth consider. Note that removing providers is not possible at 3562 this time. 3563 3564 Here, the client must provide an object with the base URLs of the 3565 providers to add or disable. The object maps the 3566 URLs to status information about the provider to 3567 use. For example: 3568 3569 @example 3570 @{ 3571 "http://localhost:8088/" : @{ "disabled" : false @}, 3572 "http://localhost:8089/" : @{ "disabled" : false @}, 3573 "http://localhost:8090/" : @{ "disabled" : true @} 3574 @} 3575 @end example 3576 3577 Note that existing providers will remain in the state they were in. The following is an 3578 example for an expected new state where the service on port 8089 is 3579 unreachable, the services on port 8088 and 8888 were previously known, and service on 3580 port 8088 was now added, and on 8090 is disabled: 3581 3582 @example 3583 @{ 3584 "backup_state": "USER_ATTRIBUTES_COLLECTING", 3585 "authentication_providers": @{ 3586 "http://localhost:8089/": @{ 3587 "disabled": false, 3588 "error_code": 11, 3589 "http_status": 0 3590 @}, 3591 "http://localhost:8090/": @{ 3592 "disabled": true 3593 @}, 3594 "http://localhost:8088/": @{ 3595 "disabled": false, 3596 "http_status": 200, 3597 "methods": [ 3598 @{ "type" : "question", 3599 "usage_fee" : "EUR:0.01" @}, 3600 @{ "type" : "sms", 3601 "usage_fee" : "EUR:0.55" @} 3602 ], 3603 "annual_fee": "EUR:0.99", 3604 "truth_upload_fee": "EUR:3.99", 3605 "liability_limit": "EUR:1", 3606 "currency": "EUR", 3607 "storage_limit_in_megabytes": 1, 3608 "provider_name": "Anastasis 4", 3609 "salt": "CXAPCKSH9D3MYJTS9536RHJHCW" 3610 @} 3611 "http://localhost:8888/": @{ 3612 "methods": [ 3613 @{ "type" : "question", 3614 "usage_fee" : "EUR:0.01" @}, 3615 @{ "type" : "sms", 3616 "usage_fee" : "EUR:0.55" @} 3617 ], 3618 "annual_fee": "EUR:0.99", 3619 "truth_upload_fee": "EUR:3.99", 3620 "liability_limit": "EUR:1", 3621 "currency": "EUR", 3622 "storage_limit_in_megabytes": 1, 3623 "provider_name": "Anastasis 42", 3624 "salt": "BXAPCKSH9D3MYJTS9536RHJHCX" 3625 @} 3626 @} 3627 @} 3628 @end example 3629 3630 @node Backup transitions,Recovery transitions,Common transitions,Reducer transitions 3631 @anchor{reducer backup-transitions}@anchor{70} 3632 @subsubsection Backup transitions 3633 3634 3635 @strong{enter_user_attributes:} 3636 3637 This transition provides the user’s personal attributes. The specific set of 3638 attributes required depends on the country of residence of the user. Some 3639 attributes may be optional, in which case they should be omitted entirely 3640 (that is, not simply be set to @code{null} or an empty string). Example 3641 arguments would be: 3642 3643 @example 3644 @{ 3645 "identity_attributes": @{ 3646 "full_name": "Max Musterman", 3647 "social_security_number": "123456789", 3648 "birthdate": "2000-01-01", 3649 "birthplace": "Earth" 3650 @} 3651 @} 3652 @end example 3653 3654 Note that at this stage, the state machines between backup and 3655 recovery diverge and the @code{recovery_state} will begin to look 3656 very different from the @code{backup_state}. 3657 3658 For backups, if all required attributes are present, the reducer will 3659 transition to an @code{AUTHENTICATIONS_EDITING} state with the attributes added 3660 to it: 3661 3662 @example 3663 @{ 3664 "backup_state": "AUTHENTICATIONS_EDITING", 3665 "identity_attributes": @{ 3666 "full_name": "Max Musterman", 3667 "social_security_number": "123456789", 3668 "birthdate": "2000-01-01", 3669 "birthplace": "Earth" 3670 @} 3671 @} 3672 @end example 3673 3674 If required attributes are missing, do not match the required regular 3675 expression, or fail the custom validation logic, the reducer SHOULD return an 3676 error response indicating that the transition has failed and what is wrong about 3677 the input and not transition to a new state. A reducer that does not support 3678 some specific validation logic MAY accept the invalid input and proceed anyway. 3679 The error state will include a Taler error code that is specific to the 3680 failure, and optional details. 3681 3682 Example: 3683 3684 @example 3685 @{ 3686 "code": 8404, 3687 "hint": "An input did not match the regular expression.", 3688 "detail": "social_security_number" 3689 @} 3690 @end example 3691 3692 Clients may safely repeat this transition to validate the user’s inputs 3693 until they satisfy all of the constraints. This way, the user interface 3694 does not have to perform the input validation directly. 3695 3696 @strong{add_authentication}: 3697 3698 This transition adds an authentication method. The method must be supported 3699 by one or more providers that are included in the current state. Adding an 3700 authentication method requires specifying the @code{type} and @code{instructions} to 3701 be given to the user. The @code{challenge} is encrypted and stored at the 3702 Anastasis provider. The specific semantics of the value depend on the 3703 @code{type}. Typical challenges values are a phone number (to send an SMS to), 3704 an e-mail address (to send a PIN code to) or the answer to a security 3705 question. Note that these challenge values will still be encrypted (and 3706 possibly hashed) before being given to the Anastasis providers. 3707 3708 Note that the @code{challenge} must be given in Crockford Base32 encoding, as it 3709 MAY include binary data (such as a photograph of the user). In the latter 3710 case, the optional @code{mime_type} field must be provided to give the MIME type 3711 of the value encoded in @code{challenge}. 3712 3713 @example 3714 @{ 3715 "authentication_method": 3716 @{ 3717 "type": "question", 3718 "mime_type" : "text/plain", 3719 "instructions" : "What is your favorite GNU package?", 3720 "challenge" : "E1QPPS8A", 3721 @} 3722 @} 3723 @end example 3724 3725 If the information provided is valid, the reducer will add the new 3726 authentication method to the array of authentication methods: 3727 3728 @example 3729 @{ 3730 "backup_state": "AUTHENTICATIONS_EDITING", 3731 "authentication_methods": [ 3732 @{ 3733 "type": "question", 3734 "mime_type" : "text/plain", 3735 "instructions" : "What is your favorite GNU package?", 3736 "challenge" : "E1QPPS8A", 3737 @}, 3738 @{ 3739 "type": "email", 3740 "instructions" : "E-mail to user@@*le.com", 3741 "challenge": "ENSPAWJ0CNW62VBGDHJJWRVFDM50" 3742 @} 3743 ] 3744 @} 3745 @end example 3746 3747 @strong{delete_authentication}: 3748 3749 This transition can be used to remove an authentication method from the 3750 array of authentication methods. It simply requires the index of the 3751 authentication method to remove. Note that the array is 0-indexed: 3752 3753 @example 3754 @{ 3755 "authentication_method": 1 3756 @} 3757 @end example 3758 3759 Assuming we begin with the state from the example above, this would 3760 remove the @code{email} authentication method, resulting in the following 3761 response: 3762 3763 @example 3764 @{ 3765 "backup_state": "AUTHENTICATIONS_EDITING", 3766 "authentication_methods": [ 3767 @{ 3768 "type": "question", 3769 "mime_type" : "text/plain", 3770 "instructions" : "What is your favorite GNU package?", 3771 "challenge" : "gdb", 3772 @} 3773 ] 3774 @} 3775 @end example 3776 3777 If the index is invalid, the reducer will return an error 3778 response instead of making a transition. 3779 3780 @strong{next} (from @code{AUTHENTICATIONS_EDITING}): 3781 3782 This transition confirms that the user has finished adding (or removing) 3783 authentication methods, and that the system should now automatically compute 3784 a set of reasonable recovery policies. 3785 3786 This transition does not take any mandatory arguments. Optional arguments can 3787 be provided to upload the recovery document only to a specific subset of the 3788 providers: 3789 3790 @example 3791 @{ 3792 "providers": [ 3793 "http://localhost:8088/", 3794 "http://localhost:8089/" 3795 ] 3796 @} 3797 @end example 3798 3799 The resulting state provides the suggested recovery policies in a way suitable 3800 for presentation to the user: 3801 3802 @example 3803 @{ 3804 "backup_state": "POLICIES_REVIEWING", 3805 "policy_providers" : [ 3806 @{ "provider_url" : "http://localhost:8088/" @}, 3807 @{ "provider_url" : "http://localhost:8089/" @} 3808 ], 3809 "policies": [ 3810 @{ 3811 "methods": [ 3812 @{ 3813 "authentication_method": 0, 3814 "provider": "http://localhost:8088/" 3815 @}, 3816 @{ 3817 "authentication_method": 1, 3818 "provider": "http://localhost:8089/" 3819 @}, 3820 @{ 3821 "authentication_method": 2, 3822 "provider": "http://localhost:8087/" 3823 @} 3824 ] 3825 @}, 3826 @{ 3827 "methods": [ 3828 @{ 3829 "authentication_method": 0, 3830 "provider": "http://localhost:8088/" 3831 @}, 3832 @{ 3833 "authentication_method": 1, 3834 "provider": "http://localhost:8089/" 3835 @}, 3836 @{ 3837 "authentication_method": 3, 3838 "provider": "http://localhost:8089/" 3839 @} 3840 ] 3841 @} 3842 ] 3843 @} 3844 @end example 3845 3846 For each recovery policy, the state includes the specific details of which 3847 authentication @code{methods} must be solved to recovery the secret using this 3848 policy. The @code{methods} array specifies the index of the 3849 @code{authentication_method} in the @code{authentication_methods} array, as well as 3850 the provider that was selected to supervise this authentication. 3851 3852 If no authentication method was provided, the reducer will 3853 return an error response instead of making a transition. 3854 3855 @strong{add_policy}: 3856 3857 Using this transition, the user can add an additional recovery policy to the 3858 state. The argument format is the same that is used in the existing state. 3859 An example for a possible argument would thus be: 3860 3861 @example 3862 @{ 3863 "policy": [ 3864 @{ 3865 "authentication_method": 1, 3866 "provider": "http://localhost:8088/" 3867 @}, 3868 @{ 3869 "authentication_method": 3, 3870 "provider": "http://localhost:8089/" 3871 @} 3872 ] 3873 @} 3874 @end example 3875 3876 Note that the specified providers must already be in the 3877 @code{authentication_providers} of the state. You cannot add new providers at 3878 this stage. The reducer will simply attempt to append the suggested policy to 3879 the “policies” array, returning an updated state: 3880 3881 @example 3882 @{ 3883 "backup_state": "POLICIES_REVIEWING", 3884 "policies": [ 3885 @{ 3886 "methods": [ 3887 @{ 3888 "authentication_method": 0, 3889 "provider": "http://localhost:8089/" 3890 @}, 3891 @{ 3892 "authentication_method": 1, 3893 "provider": "http://localhost:8088/" 3894 @} 3895 ] 3896 @}, 3897 @{ 3898 "methods": [ 3899 @{ 3900 "authentication_method": 0, 3901 "provider": "http://localhost:8089/" 3902 @}, 3903 @{ 3904 "authentication_method": 2, 3905 "provider": "http://localhost:8088/" 3906 @} 3907 ] 3908 @}, 3909 @{ 3910 "methods": [ 3911 @{ 3912 "authentication_method": 1, 3913 "provider": "http://localhost:8089/" 3914 @}, 3915 @{ 3916 "authentication_method": 2, 3917 "provider": "http://localhost:8088/" 3918 @} 3919 ] 3920 @}, 3921 @{ 3922 "methods": [ 3923 @{ 3924 "authentication_method": 1, 3925 "provider": "http://localhost:8088/" 3926 @}, 3927 @{ 3928 "authentication_method": 3, 3929 "provider": "http://localhost:8089/" 3930 @} 3931 ] 3932 @} 3933 ] 3934 @} 3935 @end example 3936 3937 If the new policy is invalid, for example because it adds an unknown 3938 authentication method, or the selected provider does not support the type of 3939 authentication, the reducer return an error response instead of 3940 adding the new policy. 3941 3942 @strong{update_policy}: 3943 3944 Using this transition, the user can modify an existing recovery policy 3945 in the state. 3946 The argument format is the same that is used in @strong{add_policy}, 3947 except there is an additional key @code{policy_index} which 3948 identifies the policy to modify. 3949 An example for a possible argument would thus be: 3950 3951 @example 3952 @{ 3953 "policy_index" : 1, 3954 "policy": [ 3955 @{ 3956 "authentication_method": 1, 3957 "provider": "http://localhost:8088/" 3958 @}, 3959 @{ 3960 "authentication_method": 3, 3961 "provider": "http://localhost:8089/" 3962 @} 3963 ] 3964 @} 3965 @end example 3966 3967 If the new policy is invalid, for example because it adds an unknown 3968 authentication method, or the selected provider does not support the type of 3969 authentication, the reducer will return an error response instead of 3970 modifying the policy. 3971 3972 @strong{delete_policy:} 3973 3974 This transition allows the deletion of a recovery policy. The argument 3975 simply specifies the index of the policy to delete, for example: 3976 3977 @example 3978 @{ 3979 "policy_index": 3 3980 @} 3981 @end example 3982 3983 Given as input the state from the example above, the expected new state would 3984 be: 3985 3986 @example 3987 @{ 3988 "backup_state": "POLICIES_REVIEWING", 3989 "policies": [ 3990 @{ 3991 "methods": [ 3992 @{ 3993 "authentication_method": 0, 3994 "provider": "http://localhost:8089/" 3995 @}, 3996 @{ 3997 "authentication_method": 1, 3998 "provider": "http://localhost:8088/" 3999 @} 4000 ] 4001 @}, 4002 @{ 4003 "methods": [ 4004 @{ 4005 "authentication_method": 0, 4006 "provider": "http://localhost:8089/" 4007 @}, 4008 @{ 4009 "authentication_method": 2, 4010 "provider": "http://localhost:8088/" 4011 @} 4012 ] 4013 @}, 4014 @{ 4015 "methods": [ 4016 @{ 4017 "authentication_method": 1, 4018 "provider": "http://localhost:8089/" 4019 @}, 4020 @{ 4021 "authentication_method": 2, 4022 "provider": "http://localhost:8088/" 4023 @} 4024 ] 4025 @} 4026 ] 4027 @} 4028 @end example 4029 4030 If the index given is invalid, the reducer will return an error response 4031 instead of deleting a policy. 4032 4033 @strong{delete_challenge:} 4034 4035 This transition allows the deletion of an individual 4036 challenge from a recovery policy. The argument 4037 simply specifies the index of the policy and challenge 4038 to delete, for example: 4039 4040 @example 4041 @{ 4042 "policy_index": 1, 4043 "challenge_index" : 1 4044 @} 4045 @end example 4046 4047 Given as input the state from the example above, the expected new state would 4048 be: 4049 4050 @example 4051 @{ 4052 "backup_state": "POLICIES_REVIEWING", 4053 "policies": [ 4054 @{ 4055 "methods": [ 4056 @{ 4057 "authentication_method": 0, 4058 "provider": "http://localhost:8089/" 4059 @}, 4060 @{ 4061 "authentication_method": 1, 4062 "provider": "http://localhost:8088/" 4063 @} 4064 ] 4065 @}, 4066 @{ 4067 "methods": [ 4068 @{ 4069 "authentication_method": 0, 4070 "provider": "http://localhost:8089/" 4071 @} 4072 ] 4073 @}, 4074 @{ 4075 "methods": [ 4076 @{ 4077 "authentication_method": 1, 4078 "provider": "http://localhost:8089/" 4079 @}, 4080 @{ 4081 "authentication_method": 2, 4082 "provider": "http://localhost:8088/" 4083 @} 4084 ] 4085 @} 4086 ] 4087 @} 4088 @end example 4089 4090 If the index given is invalid, the reducer will return an error response 4091 instead of deleting a challenge. 4092 4093 @strong{next} (from @code{POLICIES_REVIEWING}): 4094 4095 Using this transition, the user confirms that the policies in the current 4096 state are acceptable. The transition does not take any arguments. 4097 4098 The reducer will simply transition to the @code{SECRET_EDITING} state: 4099 4100 @example 4101 @{ 4102 "backup_state": "SECRET_EDITING", 4103 "upload_fees" : [ @{ "fee": "KUDOS:42" @} ], 4104 "expiration" : @{ "t_ms" : 1245362362 @} 4105 @} 4106 @end example 4107 4108 Here, @code{upload_fees} is an array of applicable upload fees for the 4109 given policy expiration time. This is an array because fees could 4110 be in different currencies. The final cost may be lower if the 4111 user already paid for some of the time. 4112 4113 If the array of @code{policies} is currently empty, the reducer will 4114 return an error response instead of allowing the user to continue. 4115 4116 @strong{enter_secret:} 4117 4118 This transition provides the reducer with the actual core @code{secret} of the user 4119 that Anastasis is supposed to backup (and possibly recover). The argument is 4120 simply the Crockford-Base32 encoded @code{value} together with its @code{mime} type, or a @code{text} field with a human-readable secret text. 4121 For example: 4122 4123 @example 4124 @{ 4125 "secret": @{ 4126 "value": "EDJP6WK5EG50", 4127 "mime" : "text/plain" 4128 @}, 4129 "expiration" : @{ "t_ms" : 1245362362 @} 4130 @} 4131 @end example 4132 4133 If the application is unaware of the format, it set the @code{mime} field to @code{null}. 4134 The @code{expiration} field is optional. 4135 4136 The reducer remains in the @code{SECRET_EDITING} state, but now the secret and 4137 updated expiration time are part of the state and the cost calculations will 4138 be updated. 4139 4140 @example 4141 @{ 4142 "backup_state": "SECRET_EDITING", 4143 "core_secret" : @{ 4144 "value": "EDJP6WK5EG50", 4145 "mime" : "text/plain" 4146 @}, 4147 "expiration" : @{ "t_ms" : 1245362362 @}, 4148 "upload_fees" : [ @{ "fee": "KUDOS:42" @} ] 4149 @} 4150 @end example 4151 4152 @strong{clear_secret:} 4153 4154 This transition removes the core secret from the state. It is simply a 4155 convenience function to undo @code{enter_secret} without providing a new value 4156 immediately. The transition takes no arguments. The resuting state will no 4157 longer have the @code{core_secret} field, and be otherwise unchanged. Calling 4158 @strong{clear_secret} on a state without a @code{core_secret} will result in an error. 4159 4160 @strong{enter_secret_name:} 4161 4162 This transition provides the reducer with a name for the core @code{secret} of the user. This name will be given to the user as a hint when seleting a recovery policy document during recovery, prior to satisfying any of the challenges. The argument simply contains the name for the secret. 4163 Applications that have built-in support for Anastasis MUST prefix the 4164 secret name with an underscore and an application-specific identifier 4165 registered in GANA so that they can use recognize their own backups. 4166 An example argument would be: 4167 4168 @example 4169 @{ 4170 "name": "_TALERWALLET_MyPinePhone", 4171 @} 4172 @end example 4173 4174 Here, @code{MyPinePhone} might be chosen by the user to identify the 4175 device that was being backed up. 4176 4177 The reducer remains in the @code{SECRET_EDITING} state, but now the 4178 secret name is updated: 4179 4180 @example 4181 @{ 4182 "secret_name" : "_TALERWALLET_MyPinePhone" 4183 @} 4184 @end example 4185 4186 @strong{update_expiration:} 4187 4188 This transition asks the reducer to change the desired expiration time 4189 and to update the associated cost. For example: 4190 4191 @example 4192 @{ 4193 "expiration" : @{ "t_ms" : 1245362362 @} 4194 @} 4195 @end example 4196 4197 The reducer remains in the @code{SECRET_EDITING} state, but the 4198 expiration time and cost calculation will be updated. 4199 4200 @example 4201 @{ 4202 "backup_state": "SECRET_EDITING", 4203 "expiration" : @{ "t_ms" : 1245362362 @}, 4204 "upload_fees" : [ @{ "fee": "KUDOS:43" @} ] 4205 @} 4206 @end example 4207 4208 @strong{next} (from @code{SECRET_EDITING}): 4209 4210 Using this transition, the user confirms that the secret and expiration 4211 settings in the current state are acceptable. The transition does not take any 4212 arguments. 4213 4214 If the secret is currently empty, the reducer will return an 4215 error response instead of allowing the user to continue. 4216 4217 After adding a secret, the reducer may transition into different states 4218 depending on whether payment(s) are necessary. If payments are needed, the 4219 @code{secret} will be stored in the state under @code{core_secret}. Applications 4220 should be careful when persisting the resulting state, as the @code{core_secret} 4221 is not protected in the @code{PAYING} states. The @code{PAYING} states only differ 4222 in terms of what the payments are for (key shares or the recovery document), 4223 in all cases the state simply includes an array of Taler URIs that refer to 4224 payments that need to be made with the Taler wallet. 4225 4226 If all payments are complete, the reducer will transition into the 4227 @code{BACKUP_FINISHED} state and (if applicable) delete the @code{core_secret} as an 4228 additional safety measure. 4229 4230 Example results are thus: 4231 4232 @example 4233 @{ 4234 "backup_state": "TRUTHS_PAYING", 4235 "secret_name" : "$NAME", 4236 "core_secret" : @{ "$anything":"$anything" @}, 4237 "payments": [ 4238 "taler://pay/...", 4239 "taler://pay/..." 4240 ] 4241 @} 4242 @end example 4243 4244 @example 4245 @{ 4246 "backup_state": "POLICIES_PAYING", 4247 "secret_name" : "$NAME", 4248 "core_secret" : @{ "$anything":"$anything" @}, 4249 "payments": [ 4250 "taler://pay/...", 4251 "taler://pay/..." 4252 ] 4253 @} 4254 @end example 4255 4256 @example 4257 @{ 4258 "backup_state": "BACKUP_FINISHED", 4259 "success_details": @{ 4260 "http://localhost:8080/" : @{ 4261 "policy_version" : 1, 4262 "policy_expiration" : @{ "t_ms" : 1245362362000 @} 4263 @}, 4264 "http://localhost:8081/" : @{ 4265 "policy_version" : 3, 4266 "policy_expiration" : @{ "t_ms" : 1245362362000 @} 4267 @} 4268 @} 4269 @} 4270 @end example 4271 4272 @strong{pay:} 4273 4274 This transition suggests to the reducer that a payment may have been made or 4275 is immanent, and that the reducer should check with the Anastasis service 4276 provider to see if the operation is now possible. The operation takes one 4277 optional argument, which is a @code{timeout} value that specifies how long the 4278 reducer may wait (in long polling) for the payment to complete: 4279 4280 @example 4281 @{ 4282 "timeout": @{ "d_ms" : 5000 @}, 4283 @} 4284 @end example 4285 4286 The specified timeout is passed on to the Anastasis service provider(s), which 4287 will wait this long before giving up. If no timeout is given, the check is 4288 done as quickly as possible without additional delays. The reducer will continue 4289 to either an updated state with the remaining payment requests, to the 4290 @code{BACKUP_FINISHED} state (if all payments have been completed and the backup 4291 finished), or return an error response in case there was an irrecoverable error, 4292 indicating the specific provider and how it failed. An example for this 4293 final error state would be: 4294 4295 @example 4296 @{ 4297 "http_status" : 500, 4298 "upload_status" : 52, 4299 "provider_url" : "https://bad.example.com/", 4300 @} 4301 @end example 4302 4303 Here, the fields have the following meaning: 4304 4305 @quotation 4306 4307 4308 @itemize - 4309 4310 @item 4311 @strong{http_status} is the HTTP status returned by the Anastasis provider. 4312 4313 @item 4314 @strong{upload_status} is the Taler error code return by the provider. 4315 4316 @item 4317 @strong{provider_url} is the base URL of the failing provider. 4318 @end itemize 4319 @end quotation 4320 4321 In the above example, 52 would thus imply that the Anastasis provider failed to 4322 store information into its database. 4323 4324 @node Recovery transitions,,Backup transitions,Reducer transitions 4325 @anchor{reducer recovery-transitions}@anchor{71} 4326 @subsubsection Recovery transitions 4327 4328 4329 @strong{enter_user_attributes:} 4330 4331 This transition provides the user’s personal attributes. The specific set of 4332 attributes required depends on the country of residence of the user. Some 4333 attributes may be optional, in which case they should be omitted entirely 4334 (that is, not simply be set to @code{null} or an empty string). The 4335 arguments are identical to the @strong{enter_user_attributes} transition from 4336 the backup process. Example arguments would thus be: 4337 4338 @example 4339 @{ 4340 "identity_attributes": @{ 4341 "full_name": "Max Musterman", 4342 "social_security_number": "123456789", 4343 "birthdate": "2000-01-01", 4344 "birthplace": "Earth" 4345 @} 4346 @} 4347 @end example 4348 4349 Afterwards, the reducer transitions into the @code{SECRET_SELECTING} state: 4350 4351 @example 4352 @{ 4353 "recovery_state": "SECRET_SELECTING", 4354 "identity_attributes": @{ 4355 "full_name": "Max Musterman", 4356 "social_security_number": "123456789", 4357 "birthdate": "2000-01-01", 4358 "birthplace": "Earth" 4359 @} 4360 @} 4361 @end example 4362 4363 Typically, the special policy discovery process (outside of the state 4364 machine) is expected to be run in this state. The discovery process 4365 will use the state (and in particular the identity attributes and the 4366 list of active providers) to discover a set of possible recovery 4367 documents with their respective provider URLs, policy version and 4368 identity attribute mask. An identity attribute mask is a bitmask that 4369 describes which of the optional attributes from the identity 4370 attributes should be omitted to recover this backup. Once the user 4371 has selected a backup providing this triplet, it is possible to 4372 proceed using @code{next}. 4373 4374 Especially if the discovered policies are inadequate, it is again 4375 possible to add providers using @code{add_provider}. 4376 4377 @strong{add_provider}: 4378 4379 This operation can be performed in state @code{SECRET_SELECTING}. It 4380 adds one additional Anastasis provider to the list of providers that 4381 the discovery process should henceforth consider. Note that removing 4382 providers is not possible at this time. 4383 4384 Here, the client must provide an object with the base URL of the 4385 providers to add, for example: 4386 4387 @example 4388 @{ 4389 "provider_url" : "http://localhost:8088/" 4390 @} 4391 @end example 4392 4393 @strong{select_version}: 4394 4395 Using the @code{select_version} transition in the @code{SECRET_SELECTING} state, 4396 it is possible to trigger the download and decryption of a recovery 4397 policy document. Here, the arguments specify which provider, version 4398 and mask should be used to download the document: 4399 4400 @example 4401 @{ 4402 "providers" : [ @{ 4403 "url": "https://localhost:8088/", 4404 "version": 0 4405 @} ], 4406 "attribute_mask": 0 4407 @} 4408 @end example 4409 4410 The reducer will attempt to retrieve the specified recovery document 4411 from that provider. If a recovery document was found, the reducer 4412 will attempt to load it and transition to a state where the user can 4413 choose which challenges to satisfy: 4414 4415 @example 4416 @{ 4417 "recovery_state": "CHALLENGE_SELECTING", 4418 "recovery_information": @{ 4419 "challenges": [ 4420 @{ 4421 "uuid": "MW2R3RCBZPHNC78AW8AKWRCHF9KV3Y82EN62T831ZP54S3K5599G", 4422 "uuid-display": "MW2R3RC", 4423 "type": "question", 4424 "instructions": "q1" 4425 @}, 4426 @{ 4427 "uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0", 4428 "uuid-display": "TXYKGE", 4429 "type": "email", 4430 "instructions": "e-mail address m?il@@f*.bar" 4431 @}, 4432 ], 4433 "policies": [ 4434 [ 4435 @{ 4436 "uuid": "MW2R3RCBZPHNC78AW8AKWRCHF9KV3Y82EN62T831ZP54S3K5599G" 4437 @}, 4438 @{ 4439 "uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0" 4440 @}, 4441 ], 4442 ], 4443 "provider_url": "http://localhost:8088/", 4444 "version": 1, 4445 @}, 4446 "recovery_document": @{ 4447 "...": "..." 4448 @} 4449 @} 4450 @end example 4451 4452 The @code{recovery_document} is an internal representation of the recovery 4453 information and of no concern to the user interface. The pertinent information 4454 is in the @code{recovery_information}. Here, the @code{challenges} array is a list 4455 of possible challenges the user could attempt to solve next, while @code{policies} 4456 is an array of policies, with each policy being an array of challenges. 4457 Satisfying all of the challenges of one of the policies will enable the secret 4458 to be recovered. The @code{provider_url} from where the recovery document was 4459 obtained and its @code{version} are also provided. Each challenge comes with 4460 four mandatory fields: 4461 4462 @quotation 4463 4464 4465 @itemize - 4466 4467 @item 4468 @strong{uuid}: A unique identifier of the challenge; this is what the 4469 UUIDs in the policies array refer to. 4470 4471 @item 4472 @strong{uuid-display}: Shortened idenfier which is included in messages 4473 send to the user. Allows the user to 4474 distinguish different PIN/TANs should say the same phone number be 4475 used for SMS-authentication with different providers. 4476 4477 @item 4478 @strong{type}: This is the type of the challenge, as a string. 4479 4480 @item 4481 @strong{instructions}: Contains additional important hints for the user 4482 to allow the user to satisfy the challenge. It typically includes 4483 an abbreviated form of the contact information or the security 4484 question. Details depend on @code{type}. 4485 @end itemize 4486 @end quotation 4487 4488 If a recovery document was not found, either the user never performed 4489 a backup, entered incorrect attributes, or used a provider not yet in 4490 the list of Anastasis providers. Hence, the user must now either 4491 select a different provider, or go @code{back} and update the identity 4492 attributes. In the case a recovery document was not found, the 4493 transition fails, returning the error code and a human-readable error 4494 message together with a transition failure: 4495 4496 @example 4497 @{ 4498 "error_message": "account unknown to Anastasis server", 4499 "error_code": 9, 4500 @} 4501 @end example 4502 4503 Here, the @code{error_code} is from the @code{enum ANASTASIS_RecoveryStatus} 4504 and describes precisely what failed about the download, while the 4505 @code{error_message} is a human-readable (English) explanation of the code. 4506 Applications may want to translate the message using GNU gettext; 4507 translations should be available in the @code{anastasis} text domain. 4508 However, in general it should be sufficient to display the slightly 4509 more generic Taler error code that is returned with the new state. 4510 4511 @strong{sync_providers} 4512 4513 The downloaded policy may include secrets from providers for which 4514 we do not (yet) have the cost structure or even the salt. So here 4515 an application can use the @code{sync_providers} request to download 4516 @code{/config} from providers that are in the challenge list but not 4517 yet known with their salt and other attributes in the provider list. 4518 4519 The transition fails if all providers relevant for the selected 4520 policy are already downloaded. Applications may either internally 4521 check the state for this, or call @code{sync_providers} until it fails 4522 with this error: 4523 4524 @example 4525 @{ 4526 "detail": "already in sync", 4527 "code": 8400, 4528 "hint": "The given action is invalid for the current state of the reducer." 4529 @} 4530 @end example 4531 4532 As providers may fail to respond, this action may need to be called 4533 repeatedly. The action will block until progress is made on any provider. 4534 As some providers may never respond, the application should disable 4535 challenge buttons for challenges where providers are down. However, 4536 users should be able to solve challenges where the provider is up while 4537 the reducer is polling for @code{/config} in the background. 4538 4539 @strong{select_challenge:} 4540 4541 Selecting a challenge takes different, depending on the state of the payment. 4542 A comprehensive example for @code{select_challenge} would be: 4543 4544 @example 4545 @{ 4546 "uuid": "80H646H5ZBR453C02Y5RT55VQSJZGM5REWFXVY0SWXY1TNE8CT30" 4547 "timeout" : @{ "d_ms" : 5000 @}, 4548 "payment_secret": "3P4561HAMHRRYEYD6CM6J7TS5VTD5SR2K2EXJDZEFSX92XKHR4KG" 4549 @} 4550 @end example 4551 4552 The @code{uuid} field is mandatory and specifies the selected challenge. 4553 The other fields are optional, and are needed in case the user has 4554 previously been requested to pay for the challenge. In this case, 4555 the @code{payment_secret} identifies the previous payment request, and 4556 @code{timeout} says how long the Anastasis service should wait for the 4557 payment to be completed before giving up (long polling). 4558 4559 Depending on the type of the challenge and the need for payment, the 4560 reducer may transition into @code{CHALLENGE_SOLVING} or @code{CHALLENGE_PAYING} 4561 states. In @code{CHALLENGE_SOLVING}, the new state will primarily specify 4562 the selected challenge: 4563 4564 @example 4565 @{ 4566 "backup_state": "CHALLENGE_SOLVING", 4567 "selected_challenge_uuid": "80H646H5ZBR453C02Y5RT55VQSJZGM5REWFXVY0SWXY1TNE8CT30" 4568 @} 4569 @end example 4570 4571 In @code{CHALLENGE_PAYING}, the new state will include instructions for payment 4572 in the @code{challenge_feedback}. In general, @code{challenge_feedback} includes 4573 information about attempted challenges, with the final state being @code{solved}: 4574 4575 @example 4576 @{ 4577 "recovery_state": "CHALLENGE_SELECTING", 4578 "recovery_information": @{ 4579 "...": "..." 4580 @} 4581 "challenge_feedback": @{ 4582 "80H646H5ZBR453C02Y5RT55VQSJZGM5REWFXVY0SWXY1TNE8CT30" : @{ 4583 "state" : "solved" 4584 @} 4585 @} 4586 @} 4587 @end example 4588 4589 Challenges feedback for a challenge can have many different @code{state} values 4590 that applications must all handle. States other than @code{solved} are: 4591 4592 4593 @itemize - 4594 4595 @item 4596 @strong{payment}: Here, the user must pay for a challenge. An example would be: 4597 4598 @example 4599 @{ 4600 "backup_state": "CHALLENGE_PAYING", 4601 "selected_challenge_uuid": "80H646H5ZBR453C02Y5RT55VQSJZGM5REWFXVY0SWXY1TNE8CT30", 4602 "challenge_feedback": @{ 4603 "80H646H5ZBR453C02Y5RT55VQSJZGM5REWFXVY0SWXY1TNE8CT30" : @{ 4604 "state" : "payment", 4605 "taler_pay_uri" : "taler://pay/...", 4606 "provider" : "https://localhost:8080/", 4607 "payment_secret" : "3P4561HAMHRRYEYD6CM6J7TS5VTD5SR2K2EXJDZEFSX92XKHR4KG" 4608 @} 4609 @} 4610 @} 4611 @end example 4612 4613 @item 4614 @strong{body}: Here, the server provided an HTTP reply for 4615 how to solve the challenge, but the reducer could not parse 4616 them into a known format. A mime-type may be provided and may 4617 help parse the details. 4618 4619 @example 4620 @{ 4621 "recovery_state": "CHALLENGE_SOLVING", 4622 "recovery_information": @{ 4623 "...": "..." 4624 @} 4625 "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0", 4626 "challenge_feedback": @{ 4627 "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{ 4628 "state": "body", 4629 "body": "CROCKFORDBASE32ENCODEDBODY", 4630 "http_status": 403, 4631 "mime_type" : "anything/possible" 4632 @} 4633 @} 4634 @} 4635 @end example 4636 4637 @item 4638 @strong{hint}: Here, the server provided human-readable hint for 4639 how to solve the challenge. Note that the @code{hint} provided this 4640 time is from the Anastasis provider and may differ from the @code{instructions} 4641 for the challenge under @code{recovery_information}: 4642 4643 @example 4644 @{ 4645 "recovery_state": "CHALLENGE_SOLVING", 4646 "recovery_information": @{ 4647 "...": "..." 4648 @} 4649 "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0", 4650 "challenge_feedback": @{ 4651 "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{ 4652 "state": "hint", 4653 "hint": "Recovery TAN send to email mail@@DOMAIN", 4654 "http_status": 403 4655 @} 4656 @} 4657 @} 4658 @end example 4659 4660 @item 4661 @strong{details}: Here, the server provided a detailed JSON status response 4662 related to solving the challenge: 4663 4664 @example 4665 @{ 4666 "recovery_state": "CHALLENGE_SOLVING", 4667 "recovery_information": @{ 4668 "...": "..." 4669 @} 4670 "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0", 4671 "challenge_feedback": @{ 4672 "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{ 4673 "state": "details", 4674 "details": @{ 4675 "code": 8111, 4676 "hint": "The client's response to the challenge was invalid.", 4677 "detail" : null 4678 @}, 4679 "http_status": 403 4680 @} 4681 @} 4682 @} 4683 @end example 4684 4685 @item 4686 @strong{redirect}: To solve the challenge, the user must visit the indicated 4687 Web site at @code{redirect_url}, for example to perform video authentication: 4688 4689 @example 4690 @{ 4691 "recovery_state": "CHALLENGE_SOLVING", 4692 "recovery_information": @{ 4693 "...": "..." 4694 @} 4695 "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0", 4696 "challenge_feedback": @{ 4697 "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{ 4698 "state": "redirect", 4699 "redirect_url": "https://videoconf.example.com/", 4700 "http_status": 303 4701 @} 4702 @} 4703 @} 4704 @end example 4705 4706 @item 4707 @strong{server-failure}: This indicates that the Anastasis provider encountered 4708 a failure and recovery using this challenge cannot proceed at this time. 4709 Examples for failures might be that the provider is unable to send SMS 4710 messages at this time due to an outage. The body includes details about 4711 the failure. The user may try again later or continue with other challenges. 4712 4713 @example 4714 @{ 4715 "recovery_state": "CHALLENGE_SELECTING", 4716 "recovery_information": @{ 4717 "...": "..." 4718 @} 4719 "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0", 4720 "challenge_feedback": @{ 4721 "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{ 4722 "state": "server-failure", 4723 "http_status": "500", 4724 "error_code": 52 4725 @} 4726 @} 4727 @} 4728 @end example 4729 4730 @item 4731 @strong{truth-unknown}: This indicates that the Anastasis provider is unaware of 4732 the specified challenge. This is typically a permanent failure, and user 4733 interfaces should not allow users to re-try this challenge. 4734 4735 @example 4736 @{ 4737 "recovery_state": "CHALLENGE_SELECTING", 4738 "recovery_information": @{ 4739 "...": "..." 4740 @} 4741 "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0", 4742 "challenge_feedback": @{ 4743 "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{ 4744 "state": "truth-unknown", 4745 "error_code": 8108 4746 @} 4747 @} 4748 @} 4749 @end example 4750 4751 @item 4752 @strong{rate-limit-exceeded}: This indicates that the user has made too many invalid attempts in too short an amount of time. 4753 4754 @example 4755 @{ 4756 "recovery_state": "CHALLENGE_SELECTING", 4757 "recovery_information": @{ 4758 "...": "..." 4759 @} 4760 "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0", 4761 "challenge_feedback": @{ 4762 "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{ 4763 "state": "rate-limit-exceeded", 4764 "error_code": 8121 4765 @} 4766 @} 4767 @} 4768 @end example 4769 4770 @item 4771 @strong{authentication-timeout}: This indicates that the challenge is awaiting for some external authentication process to complete. The application should @code{poll} for it to complete, or proceed with selecting other challenges. 4772 4773 @example 4774 @{ 4775 "recovery_state": "CHALLENGE_SELECTING", 4776 "recovery_information": @{ 4777 "...": "..." 4778 @} 4779 "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0", 4780 "challenge_feedback": @{ 4781 "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{ 4782 "state": "authentication-timeout", 4783 "error_code": 8122 4784 @} 4785 @} 4786 @} 4787 @end example 4788 4789 @item 4790 @strong{external-instructions}: This indicates that the challenge requires the user to perform some authentication method-specific actions. Details about what the user should do are provided. 4791 4792 @example 4793 @{ 4794 "recovery_state": "CHALLENGE_SELECTING", 4795 "recovery_information": @{ 4796 "...": "..." 4797 @} 4798 "selected_challenge_uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0", 4799 "challenge_feedback": @{ 4800 "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0": @{ 4801 "state": "external-instructions", 4802 "method": "iban", 4803 "async": true, // optional 4804 "answer_code": 987654321, // optional 4805 "details": @{ 4806 "...": "..." 4807 @} 4808 @} 4809 @} 4810 @} 4811 @end example 4812 4813 If “async” is “true”, then the client should 4814 poll for the challenge being satisfied using 4815 the “answer_code” that has been provided. 4816 4817 The specific instructions on how to satisfy 4818 the challenge depend on the @code{method}. 4819 They include: 4820 4821 4822 @itemize - 4823 4824 @item 4825 @strong{iban}: The user must perform a wire transfer from their account to the Anastasis provider. 4826 4827 @example 4828 @{ 4829 "challenge_amount": "EUR:1", 4830 "credit_iban": "DE12345789000", 4831 "business_name": "Data Loss Incorporated", 4832 "wire_transfer_subject": "Anastasis 987654321" 4833 @} 4834 @end example 4835 4836 Note that the actual wire transfer subject must contain both 4837 the numeric @code{answer_code} as well as 4838 the string @code{Anastasis}. 4839 @end itemize 4840 @end itemize 4841 4842 @strong{poll:} 4843 4844 With a @code{poll} transition, the application indicates that it wants to wait longer for one or more of the challenges that are awaiting some external authentication (state @code{external-instructions}) or experienced some kind of timeout (state @code{authentication-timeout}) to possibly complete. While technically optional, the @code{timeout} argument should really be provided to enable long-polling, for example: 4845 4846 @example 4847 @{ 4848 "timeout" : @{ "d_ms" : 5000 @}, 4849 @} 4850 @end example 4851 4852 @strong{pay:} 4853 4854 With a @code{pay} transition, the application indicates to the reducer that 4855 a payment may have been made. Here, it is again possible to specify an 4856 optional @code{timeout} argument for long-polling, for example: 4857 4858 @example 4859 @{ 4860 "payment_secret": "ABCDADF242525AABASD52525235ABABFDABABANALASDAAKASDAS" 4861 "timeout" : @{ "d_ms" : 5000 @}, 4862 @} 4863 @end example 4864 4865 Depending on the type of the challenge and the result of the operation, the 4866 new state may be @code{CHALLENGE_SOLVING} (if say the SMS was now sent to the 4867 user), @code{CHALLENGE_SELECTING} (if the answer to the security question was 4868 correct), @code{RECOVERY_FINISHED} (if this was the last challenge that needed to 4869 be solved) or still @code{CHALLENGE_PAYING} (if the challenge was not actually 4870 paid for). For sample messages, see the different types of 4871 @code{challenge_feedback} in the section about @code{select_challenge}. 4872 4873 @strong{solve_challenge:} 4874 4875 Solving a challenge takes various formats, depending on the type of the 4876 challenge and what is known about the answer. The different supported 4877 formats are: 4878 4879 @example 4880 @{ 4881 "answer": "answer to security question" 4882 @} 4883 @end example 4884 4885 @example 4886 @{ 4887 "pin": 1234 4888 @} 4889 @end example 4890 4891 @example 4892 @{ 4893 "hash": "SOMEBASE32ENCODEDHASHVALUE" 4894 @} 4895 @end example 4896 4897 @c This file is part of Anastasis 4898 @c Copyright (C) 2019-2021 Anastasis SARL 4899 @c 4900 @c Anastasis is free software; you can redistribute it and/or modify it under the 4901 @c terms of the GNU Affero General Public License as published by the Free Software 4902 @c Foundation; either version 2.1, or (at your option) any later version. 4903 @c 4904 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY 4905 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 4906 @c A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 4907 @c 4908 @c You should have received a copy of the GNU Affero General Public License along with 4909 @c Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 4910 @c 4911 @c @author Christian Grothoff 4912 @c @author Dominik Meister 4913 @c @author Dennis Neufeld 4914 4915 @node Authentication Methods,DB Schema,Reducer API,Documentation Overview 4916 @anchor{authentication doc}@anchor{72}@anchor{authentication anastasis-auth-methods}@anchor{73}@anchor{authentication authentication-methods}@anchor{74} 4917 @section Authentication Methods 4918 4919 4920 This section describes the supported authentication methods in detail. We 4921 note that the server implements rate limiting for all authentication methods 4922 to ensure that malicious strong attackers cannot guess the values by 4923 brute-force. Typically, a user is given three attempts per hour to enter the 4924 correct code from 2^63 possible values. Transmitted codes also come with an 4925 expiration date. If the user re-requests a challenge to be sent, the same 4926 challenge may be transmitted (with the three attempts counter not increasing!) 4927 for a limited period of time (depending on the authentication method) before 4928 the service eventually rotates to a fresh random code with a fresh retry 4929 counter. Given the default value range and time intervals (which providers are 4930 at liberty to adjust), brute-force attacks against this are expected to 4931 succeed with a 50% probability after about 200000 years of attempts at the 4932 maximum permissible frequency. 4933 4934 @menu 4935 * SMS (sms): SMS sms. 4936 * Email verification (email): Email verification email. 4937 * Video identification (vid): Video identification vid. 4938 * Security question (qa): Security question qa. 4939 * Snail mail verification (post): Snail mail verification post. 4940 4941 @end menu 4942 4943 @node SMS sms,Email verification email,,Authentication Methods 4944 @anchor{authentication sms-sms}@anchor{75} 4945 @subsection SMS (sms) 4946 4947 4948 Sends an SMS with a code (prefixed with @code{A-}) to the user’s phone, including 4949 a UUID which identifies the challenge the code is for. The user must send 4950 this code back with his request (see @code{$RESPONSE} under @ref{5c,,Managing truth}). 4951 If the transmitted code is correct, the server responses with the requested 4952 encrypted key share. 4953 4954 @node Email verification email,Video identification vid,SMS sms,Authentication Methods 4955 @anchor{authentication email-verification-email}@anchor{76} 4956 @subsection Email verification (email) 4957 4958 4959 Sends an email with a code (prefixed with @code{A-}) to the user’s mail address, 4960 including a UUID which identifies the challenge the code is for. The user 4961 must send this code back with his request (see @code{$RESPONSE} under @ref{5c,,Managing truth}). 4962 If the transmitted code is correct, the server responses with the 4963 requested encrypted key share. 4964 4965 @node Video identification vid,Security question qa,Email verification email,Authentication Methods 4966 @anchor{authentication video-identification-vid}@anchor{77} 4967 @subsection Video identification (vid) 4968 4969 4970 Requires the user to identify via video-call. In the video-call, the 4971 user is told the code (prefixed with @code{A-}) needed to authenticate. 4972 4973 The user is expected to delete all metadata revealing personal information 4974 from the images before uploading them. Since the respective images must be 4975 passed on to the video identification service in the event of password 4976 recovery, it should be ensured that no further information about the user can 4977 be derived from them. 4978 4979 Video identification will typically result in the Anastasis provider 4980 requesting the user to be redirected to a Web site (or other URL) for the 4981 video-call. 4982 4983 @node Security question qa,Snail mail verification post,Video identification vid,Authentication Methods 4984 @anchor{authentication security-question-qa}@anchor{78} 4985 @subsection Security question (qa) 4986 4987 4988 Asks the user a security question. The user sends back a @strong{salted} 4989 hash over the answer. The @strong{question-salt} is stored encrypted as 4990 part of the recovery document and never revealed to the providers. This 4991 ensures that providers cannot derive the answer from the hash value. 4992 Furthermore, the security question itself is also only in the recovery 4993 document and never given to the Anastasis provider. A moderately expensive 4994 hash function is used to further limit strong attackers that have obtained 4995 the recovery document from brute-forcing the answer. 4996 4997 If the hash value matches with the one the server is expecting, the server 4998 answers with the requested encrypted key share. However, unlike other 4999 encrypted key shares, the encrypted key share of a security question uses a 5000 special variation of the Anastasis encryption: Here, a different hash function 5001 over the security answer is used to provide an additional @strong{key-salt} for the 5002 decryption of the (encrypted) @strong{key share}. This ensures that the key share 5003 remains irrecoverable without the answer even if the Anastasis provider 5004 storing the security question is malicious. 5005 5006 @node Snail mail verification post,,Security question qa,Authentication Methods 5007 @anchor{authentication snail-mail-verification-post}@anchor{79} 5008 @subsection Snail mail verification (post) 5009 5010 5011 Sends physical mail (snail mail) with a code (prefixed with @code{A-}) to the 5012 user’s mail address, including a UUID which identifies the challenge the code 5013 is for. The user must send this code back with their request (see 5014 @code{$RESPONSE} under @ref{5c,,Managing truth}). If the transmitted code is correct, 5015 the server responds with the requested encrypted key share. 5016 5017 @c This file is part of Anastasis 5018 @c Copyright (C) 2019-2021 Anastasis SARL 5019 @c 5020 @c Anastasis is free software; you can redistribute it and/or modify it under the 5021 @c terms of the GNU Affero General Public License as published by the Free Software 5022 @c Foundation; either version 2.1, or (at your option) any later version. 5023 @c 5024 @c Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY 5025 @c WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 5026 @c A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 5027 @c 5028 @c You should have received a copy of the GNU Affero General Public License along with 5029 @c Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 5030 @c 5031 @c @author Christian Grothoff 5032 @c @author Dominik Meister 5033 @c @author Dennis Neufeld 5034 5035 @node DB Schema,Anastasis licensing information,Authentication Methods,Documentation Overview 5036 @anchor{db doc}@anchor{7a}@anchor{db db-schema}@anchor{7b} 5037 @section DB Schema 5038 5039 5040 @image{anastasis-figures/anastasis-db,,,,png} 5041 5042 @image{anastasis-figures/anastasis_challengecode,,,,png} 5043 5044 @image{anastasis-figures/anastasis_challenge_payment,,,,png} 5045 5046 @image{anastasis-figures/anastasis_truth,,,,png} 5047 5048 @image{anastasis-figures/anastasis_truth_payment,,,,png} 5049 5050 @node Anastasis licensing information,Man Pages,DB Schema,Documentation Overview 5051 @anchor{global-licensing doc}@anchor{7c}@anchor{global-licensing anastasis-licensing-information}@anchor{7d} 5052 @section Anastasis licensing information 5053 5054 5055 This file gives an overview of all Anastasis component’s licensing and 5056 of runtime dependencies thereof. For “component” here is meant a set 5057 of source files which can be retrieved from a single repository. If 5058 components consist of sources under different licensing regimes, i.e. 5059 because we want to enable third party developments to easily integrate 5060 with Taler, those are described as well. 5061 5062 All Anastasis components are generally released under the Affero 5063 GPL. 5064 5065 @menu 5066 * Anastasis (git;//git.taler.net/anastasis): Anastasis git //git taler net/anastasis. 5067 * Anastasis-gtk (git;//git.taler.net/anastasis-gtk): Anastasis-gtk git //git taler net/anastasis-gtk. 5068 * Documentation:: 5069 5070 @end menu 5071 5072 @node Anastasis git //git taler net/anastasis,Anastasis-gtk git //git taler net/anastasis-gtk,,Anastasis licensing information 5073 @anchor{global-licensing anastasis-git-git-taler-net-anastasis}@anchor{7e}@anchor{global-licensing exchange-repo}@anchor{7f} 5074 @subsection Anastasis (git://git.taler.net/anastasis) 5075 5076 5077 Anastasis core logic is under AGPL. 5078 5079 @menu 5080 * Runtime dependencies:: 5081 5082 @end menu 5083 5084 @node Runtime dependencies,,,Anastasis git //git taler net/anastasis 5085 @anchor{global-licensing runtime-dependencies}@anchor{80} 5086 @subsubsection Runtime dependencies 5087 5088 5089 The following list encompasses all the runtime dependencies for this 5090 project, and gives the copyright holder for each of them: 5091 5092 5093 @itemize * 5094 5095 @item 5096 libjansson: MIT License, AGPL- and LGPL-Compatible, owned by Petri Lehtinen and other individuals 5097 5098 @item 5099 libgcrypt: LGPL, owned by Free Software Foundation 5100 5101 @item 5102 postgresql: PostgreSQL License, AGPL- and LGPL-Compatible, owned by The PostgreSQL Global Development Group 5103 5104 @item 5105 libgnunetutil (in all of its variants): GPLv3+, owned by GNUnet e.V. 5106 5107 @item 5108 libgnunetjson: GPLv3+, GNUnet e.V. 5109 5110 @item 5111 GNU Taler: LGPLv3+ / GPLv3+ / AGPLv3+: owned by Taler Systems SA 5112 @end itemize 5113 5114 @node Anastasis-gtk git //git taler net/anastasis-gtk,Documentation,Anastasis git //git taler net/anastasis,Anastasis licensing information 5115 @anchor{global-licensing anastasis-gtk-git-git-taler-net-anastasis-gtk}@anchor{81} 5116 @subsection Anastasis-gtk (git://git.taler.net/anastasis-gtk) 5117 5118 5119 Anastasis-gtk is under AGPL. 5120 5121 @menu 5122 * Runtime dependencies: Runtime dependencies<2>. 5123 5124 @end menu 5125 5126 @node Runtime dependencies<2>,,,Anastasis-gtk git //git taler net/anastasis-gtk 5127 @anchor{global-licensing id1}@anchor{82} 5128 @subsubsection Runtime dependencies 5129 5130 5131 The following list encompasses all the runtime dependencies for this 5132 project, and gives the copyright holder for each of them: 5133 5134 5135 @itemize * 5136 5137 @item 5138 libjansson: MIT License, AGPL- and LGPL-Compatible, owned by Petri Lehtinen and other individuals 5139 5140 @item 5141 libgcrypt: LGPL, owned by Free Software Foundation 5142 5143 @item 5144 postgresql: PostgreSQL License, AGPL- and LGPL-Compatible, owned by The PostgreSQL Global Development Group 5145 5146 @item 5147 libgnunetutil (in all of its variants): GPLv3+, owned by GNUnet e.V. 5148 5149 @item 5150 libgnunetjson: GPLv3+, GNUnet e.V. 5151 5152 @item 5153 libgnunetgtk: GPLv3+, GNUnet e.V. 5154 5155 @item 5156 GNU Taler: LGPLv3+ / GPLv3+ / AGPLv3+: owned by Taler Systems SA 5157 @end itemize 5158 5159 @node Documentation,,Anastasis-gtk git //git taler net/anastasis-gtk,Anastasis licensing information 5160 @anchor{global-licensing documentation}@anchor{83} 5161 @subsection Documentation 5162 5163 5164 The documentation is licensed under the GNU Free Documentation License Version 1.3 or later. 5165 5166 @node Man Pages,Complete Index,Anastasis licensing information,Documentation Overview 5167 @anchor{manindex doc}@anchor{84}@anchor{manindex man-pages}@anchor{85} 5168 @section Man Pages 5169 5170 5171 @menu 5172 * anastasis-config(1): anastasis-config 1. 5173 * anastasis-dbconfig(1): anastasis-dbconfig 1. 5174 * anastasis-dbinit(1): anastasis-dbinit 1. 5175 * anastasis-gtk(1): anastasis-gtk 1. 5176 * anastasis-helper-authorization-iban(1): anastasis-helper-authorization-iban 1. 5177 * anastasis-httpd(1): anastasis-httpd 1. 5178 * anastasis-reducer(1): anastasis-reducer 1. 5179 * anastasis.conf(5): anastasis conf 5. 5180 5181 @end menu 5182 5183 @node anastasis-config 1,anastasis-dbconfig 1,,Man Pages 5184 @anchor{manpages/anastasis-config 1 doc}@anchor{86}@anchor{manpages/anastasis-config 1 anastasis-config-1}@anchor{87} 5185 @subsection anastasis-config(1) 5186 5187 5188 5189 @menu 5190 * Synopsis:: 5191 * Description:: 5192 * See Also:: 5193 * Bugs:: 5194 5195 @end menu 5196 5197 @node Synopsis,Description,,anastasis-config 1 5198 @anchor{manpages/anastasis-config 1 synopsis}@anchor{88} 5199 @subsubsection Synopsis 5200 5201 5202 @strong{anastasis-config} 5203 [@strong{-b} @emph{backend} | @strong{––supported-backend=}@emph{backend}] 5204 [@strong{-c} @emph{filename} | @strong{––config=}@emph{filename}] 5205 [@strong{-f} | @strong{––filename}] 5206 [@strong{-F} | @strong{––full}] 5207 [@strong{-h} | @strong{––help}] 5208 [@strong{-L} @emph{loglevel} | @strong{––loglevel=}@emph{loglevel}] 5209 [@strong{-l} @emph{filename} | @strong{––logfile=}@emph{filename}] 5210 [@strong{-o} @emph{option} | @strong{––option=}@emph{option}] 5211 [@strong{-r} | @strong{––rewrite}] 5212 [@strong{-S} | @strong{––list-sections}] 5213 [@strong{-s} @emph{section} | @strong{––section=}@emph{section}] 5214 [@strong{-V} @emph{value} | @strong{––value=}@emph{value}] 5215 [@strong{-v} | @strong{––version}] 5216 5217 @node Description,See Also,Synopsis,anastasis-config 1 5218 @anchor{manpages/anastasis-config 1 description}@anchor{89} 5219 @subsubsection Description 5220 5221 5222 @strong{anastasis-config} can be used to read or modify Anastasis configuration files. 5223 5224 5225 @table @asis 5226 5227 @item @strong{-b} @emph{BACKEND} | @strong{––supported-backend=}@emph{BACKEND} 5228 5229 Tests whether the specified @emph{BACKEND} is supported by the current installation. 5230 The backend must match the name of a plugin, i.e. “namestore_postgres” for 5231 the Postgres database backend of the “NAMESTORE” service. If @emph{BACKEND} is 5232 supported, anastasis-config will return a status code of 0 (success), otherwise 5233 77 (unsupported). When this option is specified, no other options may be 5234 specified. Specifying this option together with other options will cause 5235 anastasis-config to return a status code of 1 (error). 5236 5237 @item @strong{-c} @emph{FILENAME} | @strong{––config=}@emph{FILENAME} 5238 5239 Use the configuration file @emph{FILENAME}. 5240 5241 @item @strong{-f} | @strong{––filename} 5242 5243 Try to perform expansions as if the option values represent filenames (will 5244 also be applied even if the option is not really a filename). 5245 5246 @item @strong{-F} | @strong{––full} 5247 5248 Write the full configuration file, not just the differences to the defaults. 5249 5250 @item @strong{-h} | @strong{––help} 5251 5252 Print short help on options. 5253 5254 @item @strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}@emph{LOGLEVEL} 5255 5256 Use @emph{LOGLEVEL} for logging. 5257 Valid values are @code{DEBUG}, @code{INFO}, @code{WARNING}, and @code{ERROR}. 5258 5259 @item @strong{-l} @emph{FILENAME} | @strong{––logfile=}@emph{FILENAME} 5260 5261 Send logging output to @emph{FILENAME}. 5262 5263 @item @strong{-o} @emph{OPTION} | @strong{––option=}@emph{OPTION} 5264 5265 Which configuration option should be accessed or edited. Required to set a 5266 value. If not given, all values of a given section will be printed in the 5267 format “OPTION = VALUE”. 5268 5269 @item @strong{-r} | @strong{––rewrite} 5270 5271 Write the configuration file even if nothing changed. Will remove all comments! 5272 5273 @item @strong{-S} | @strong{––list-sections} 5274 5275 List available configuration sections for use with @code{--section}. 5276 5277 @item @strong{-s} @emph{SECTION} | @strong{––section=}@emph{SECTION} 5278 5279 Which configuration section should be accessed or edited. 5280 Required option. 5281 5282 @item @strong{-V} @emph{VALUE} | @strong{––value=}@emph{VALUE} 5283 5284 Configuration value to store in the given section under the given option. 5285 Must only be given together with @code{-s} and @code{-o} options. 5286 5287 5288 @table @asis 5289 5290 @item Note: 5291 5292 Changing the configuration file with @code{-V} will remove comments 5293 and may reorder sections and remove @code{@@INLINE@@} directives. 5294 @end table 5295 5296 @item @strong{-v} | @strong{––version} 5297 5298 Print Anastasis version number. 5299 @end table 5300 5301 @node See Also,Bugs,Description,anastasis-config 1 5302 @anchor{manpages/anastasis-config 1 see-also}@anchor{8a} 5303 @subsubsection See Also 5304 5305 5306 anastasis.conf(5) 5307 5308 @node Bugs,,See Also,anastasis-config 1 5309 @anchor{manpages/anastasis-config 1 bugs}@anchor{8b} 5310 @subsubsection Bugs 5311 5312 5313 Report bugs by using @indicateurl{https://bugs.anastasis.lu} or by sending electronic 5314 mail to <@email{contact@@anastasis.lu}>. 5315 5316 @node anastasis-dbconfig 1,anastasis-dbinit 1,anastasis-config 1,Man Pages 5317 @anchor{manpages/anastasis-dbconfig 1 doc}@anchor{8c}@anchor{manpages/anastasis-dbconfig 1 anastasis-dbconfig-1}@anchor{8d} 5318 @subsection anastasis-dbconfig(1) 5319 5320 5321 5322 @menu 5323 * Synopsis: Synopsis<2>. 5324 * Description: Description<2>. 5325 * See Also: See Also<2>. 5326 * Bugs: Bugs<2>. 5327 5328 @end menu 5329 5330 @node Synopsis<2>,Description<2>,,anastasis-dbconfig 1 5331 @anchor{manpages/anastasis-dbconfig 1 synopsis}@anchor{8e} 5332 @subsubsection Synopsis 5333 5334 5335 @strong{anastasis-dbconfig} 5336 [@strong{-c} @emph{FILENAME} @emph{] 5337 [*}-h**] 5338 [@strong{-n} @emph{NAME} @emph{] 5339 [*}-r**] 5340 [@strong{-s}] 5341 [@strong{-u} @emph{USER} >>*<<] 5342 5343 @node Description<2>,See Also<2>,Synopsis<2>,anastasis-dbconfig 1 5344 @anchor{manpages/anastasis-dbconfig 1 description}@anchor{8f} 5345 @subsubsection Description 5346 5347 5348 @strong{anastasis-dbconfig} is a simple shell script that configures 5349 a Postgresql database for use by the GNU Anastasis servers. 5350 5351 Its options are as follows: 5352 5353 5354 @table @asis 5355 5356 @item @strong{-c} @emph{FILENAME} 5357 5358 Write the database configuration to FILENAME. The tool 5359 will append the required @code{CONFIG} option for the 5360 Postgresql access to the respective file. 5361 5362 @item @strong{-h} 5363 5364 Print short help on options. 5365 5366 @item @strong{-n} @emph{DBNAME} 5367 5368 Use DBNAME for the name of the created database. 5369 5370 @item @strong{-r} 5371 5372 Reset any existing database. Looses all existing data. DANGEROUS. 5373 5374 @item @strong{-s} 5375 5376 Skip database initialization. Useful if you want to run 5377 @code{anastasis-dbinit} manually. 5378 5379 @item @strong{-u} @emph{USER} 5380 5381 Specifies the (main) Anastasis user that will access the database. 5382 @end table 5383 5384 @node See Also<2>,Bugs<2>,Description<2>,anastasis-dbconfig 1 5385 @anchor{manpages/anastasis-dbconfig 1 see-also}@anchor{90} 5386 @subsubsection See Also 5387 5388 5389 anastassis-dbinit(1), anastasis.conf(5). 5390 5391 @node Bugs<2>,,See Also<2>,anastasis-dbconfig 1 5392 @anchor{manpages/anastasis-dbconfig 1 bugs}@anchor{91} 5393 @subsubsection Bugs 5394 5395 5396 Report bugs by using @indicateurl{https://bugs.taler.net} or by sending electronic 5397 mail to <@email{taler@@gnu.org}>. 5398 5399 @node anastasis-dbinit 1,anastasis-gtk 1,anastasis-dbconfig 1,Man Pages 5400 @anchor{manpages/anastasis-dbinit 1 doc}@anchor{92}@anchor{manpages/anastasis-dbinit 1 anastasis-dbinit-1}@anchor{93} 5401 @subsection anastasis-dbinit(1) 5402 5403 5404 5405 @menu 5406 * Synopsis: Synopsis<3>. 5407 * Description: Description<3>. 5408 * See Also: See Also<3>. 5409 * Bugs: Bugs<3>. 5410 5411 @end menu 5412 5413 @node Synopsis<3>,Description<3>,,anastasis-dbinit 1 5414 @anchor{manpages/anastasis-dbinit 1 synopsis}@anchor{94} 5415 @subsubsection Synopsis 5416 5417 5418 @strong{anastasis-dbinit} 5419 [@strong{-c} @emph{FILENAME} | @strong{–config=}@emph{FILENAME}] 5420 [@strong{-g} | @strong{–gc}] 5421 [@strong{-h} | @strong{–help}] 5422 [@strong{-L} @emph{LOGLEVEL} | @strong{–loglevel=}@emph{LOGLEVEL}] 5423 [@strong{-l} @emph{FILENAME} | @strong{–logfile=}@emph{FILENAME}] 5424 [@strong{-r} | @strong{–reset}] 5425 [@strong{-v} | @strong{–version}] 5426 5427 @node Description<3>,See Also<3>,Synopsis<3>,anastasis-dbinit 1 5428 @anchor{manpages/anastasis-dbinit 1 description}@anchor{95} 5429 @subsubsection Description 5430 5431 5432 @strong{anastasis-dbinit} is a command-line tool to initialize the GNU 5433 Anastasis database. It creates the necessary tables and indices for 5434 an Anastasis server to operate. 5435 5436 Its options are as follows: 5437 5438 5439 @table @asis 5440 5441 @item @strong{-c} @emph{FILENAME} | @strong{–config=}@emph{FILENAME} 5442 5443 Use the configuration and other resources for the exchange to operate 5444 from @emph{FILENAME}. 5445 5446 @item @strong{-g} | @strong{–gc} 5447 5448 Garbage collect database. Deletes all unnecessary data in the 5449 database. 5450 5451 @item @strong{-h} | @strong{–help} 5452 5453 Print short help on options. 5454 5455 @item @strong{-L} @emph{LOGLEVEL} | @strong{–loglevel=}@emph{LOGLEVEL} 5456 5457 Specifies the log level to use. Accepted values are: @code{DEBUG}, @code{INFO}, 5458 @code{WARNING}, @code{ERROR}. 5459 5460 @item @strong{-l} @emph{FILENAME} | @strong{–logfile=}@emph{FILENAME} 5461 5462 Send logging output to @emph{FILENAME}. 5463 5464 @item @strong{-r} | @strong{–reset} 5465 5466 Drop tables. Dangerous, will delete all existing data in the database 5467 before creating the tables. 5468 5469 @item @strong{-v} | @strong{–version} 5470 5471 Print version information. 5472 @end table 5473 5474 @node See Also<3>,Bugs<3>,Description<3>,anastasis-dbinit 1 5475 @anchor{manpages/anastasis-dbinit 1 see-also}@anchor{96} 5476 @subsubsection See Also 5477 5478 5479 anastasis-httpd(1), anastasis.conf(5). 5480 5481 @node Bugs<3>,,See Also<3>,anastasis-dbinit 1 5482 @anchor{manpages/anastasis-dbinit 1 bugs}@anchor{97} 5483 @subsubsection Bugs 5484 5485 5486 Report bugs by using @indicateurl{https://bugs.taler.net} or by sending electronic 5487 mail to <@email{taler@@gnu.org}>. 5488 5489 @node anastasis-gtk 1,anastasis-helper-authorization-iban 1,anastasis-dbinit 1,Man Pages 5490 @anchor{manpages/anastasis-gtk 1 doc}@anchor{98}@anchor{manpages/anastasis-gtk 1 anastasis-gtk-1}@anchor{99} 5491 @subsection anastasis-gtk(1) 5492 5493 5494 5495 @menu 5496 * Synopsis: Synopsis<4>. 5497 * Description: Description<4>. 5498 * See Also: See Also<4>. 5499 * Bugs: Bugs<4>. 5500 5501 @end menu 5502 5503 @node Synopsis<4>,Description<4>,,anastasis-gtk 1 5504 @anchor{manpages/anastasis-gtk 1 synopsis}@anchor{9a} 5505 @subsubsection Synopsis 5506 5507 5508 @strong{anastasis-gtk} 5509 [@strong{-A**_*ID*_|_}–application=**@emph{ID}] 5510 [@strong{-c} @emph{FILENAME} | @strong{––config=}@emph{FILENAME}] 5511 [@strong{-h} | @strong{––help}] 5512 [@strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}@emph{LOGLEVEL}] 5513 [@strong{-l} @emph{FILENAME} | @strong{––logfile=}@emph{FILENAME}] 5514 [@strong{-v} | @strong{––version}] 5515 5516 @node Description<4>,See Also<4>,Synopsis<4>,anastasis-gtk 1 5517 @anchor{manpages/anastasis-gtk 1 description}@anchor{9b} 5518 @subsubsection Description 5519 5520 5521 @strong{anastasis-gtk} is a graphical tool to run Anastasis 5522 key recover and backup operations. 5523 5524 5525 @table @asis 5526 5527 @item @strong{-A} @emph{ID} | @strong{–application=}@emph{ID} 5528 5529 Set the application ID to @emph{ID}. Default is @code{anastasis-gtk}. Used 5530 to store different types of secrets from different applications 5531 while using the same user attributes. Basically the application ID 5532 is included in the user attributes. Not changable by the GUI as 5533 only advanced users should even known about this. Applications that 5534 tightly integrate Anastasis should set the application ID to their 5535 respective unique name, for example the GNU Taler wallet may use 5536 @code{gnu-taler-wallet} for the application ID. If anastasis-gtk is 5537 to be used to recover such a secret, the respective application ID 5538 must be provided on the command-line. Users that only use 5539 anastasis-gtk to backup and restore secrets should not set the 5540 application ID, as forgetting the ID makes the secrets irrecoverable. 5541 5542 @item @strong{-c} @emph{FILENAME} | @strong{––config=}@emph{FILENAME} 5543 5544 Use the configuration from @emph{FILENAME}. 5545 5546 @item @strong{-h} | @strong{––help} 5547 5548 Print short help on options. 5549 5550 @item @strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}@emph{LOGLEVEL} 5551 5552 Specifies the log level to use. Accepted values are: @code{DEBUG}, @code{INFO}, 5553 @code{WARNING}, @code{ERROR}. 5554 5555 @item @strong{-l} @emph{FILENAME} | @strong{––logfile=}@emph{FILENAME} 5556 5557 Send logging output to @emph{FILENAME}. 5558 5559 @item @strong{-v} | @strong{––version} 5560 5561 Print version information. 5562 @end table 5563 5564 @node See Also<4>,Bugs<4>,Description<4>,anastasis-gtk 1 5565 @anchor{manpages/anastasis-gtk 1 see-also}@anchor{9c} 5566 @subsubsection See Also 5567 5568 5569 anastasis-reducer(1), anastasis-httpd(1), anastasis.conf(5). 5570 5571 @node Bugs<4>,,See Also<4>,anastasis-gtk 1 5572 @anchor{manpages/anastasis-gtk 1 bugs}@anchor{9d} 5573 @subsubsection Bugs 5574 5575 5576 Report bugs by using @indicateurl{https://bugs.anastasis.lu/} or by sending electronic 5577 mail to <@email{contact@@anastasis.lu}>. 5578 5579 @node anastasis-helper-authorization-iban 1,anastasis-httpd 1,anastasis-gtk 1,Man Pages 5580 @anchor{manpages/anastasis-helper-authorization-iban 1 doc}@anchor{9e}@anchor{manpages/anastasis-helper-authorization-iban 1 anastasis-helper-authorization-iban-1}@anchor{9f} 5581 @subsection anastasis-helper-authorization-iban(1) 5582 5583 5584 5585 @menu 5586 * Synopsis: Synopsis<5>. 5587 * Description: Description<5>. 5588 * See Also: See Also<5>. 5589 * Bugs: Bugs<5>. 5590 5591 @end menu 5592 5593 @node Synopsis<5>,Description<5>,,anastasis-helper-authorization-iban 1 5594 @anchor{manpages/anastasis-helper-authorization-iban 1 synopsis}@anchor{a0} 5595 @subsubsection Synopsis 5596 5597 5598 @strong{anastasis-helper-authorization-iban} 5599 [@strong{-c} @emph{FILENAME} | @strong{––config=}@emph{FILENAME}] 5600 [@strong{-h} | @strong{––help}] 5601 [@strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}@emph{LOGLEVEL}] 5602 [@strong{-l} @emph{FILENAME} | @strong{––logfile=}@emph{FILENAME}] 5603 [@strong{-t} | @strong{––test}] 5604 [@strong{-v} | @strong{––version}] 5605 5606 @node Description<5>,See Also<5>,Synopsis<5>,anastasis-helper-authorization-iban 1 5607 @anchor{manpages/anastasis-helper-authorization-iban 1 description}@anchor{a1} 5608 @subsubsection Description 5609 5610 5611 @strong{anastasis-helper-authorization-iban} monitors the Anastasis provider’s bank account for incoming wire transfers. This process supports the IBAN authentication method. It must be configured with the respective wire configuration to talk to LibEuFin/Nexus. 5612 5613 5614 @table @asis 5615 5616 @item @strong{-c} @emph{FILENAME} | @strong{––config=}@emph{FILENAME} 5617 5618 Use the configuration from @emph{FILENAME}. 5619 5620 @item @strong{-h} | @strong{––help} 5621 5622 Print short help on options. 5623 5624 @item @strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}@emph{LOGLEVEL} 5625 5626 Specifies the log level to use. Accepted values are: @code{DEBUG}, @code{INFO}, 5627 @code{WARNING}, @code{ERROR}. 5628 5629 @item @strong{-l} @emph{FILENAME} | @strong{––logfile=}@emph{FILENAME} 5630 5631 Send logging output to @emph{FILENAME}. 5632 5633 @item @strong{-t} | @strong{––test} 5634 5635 Run in test mode. Causes the process to terminate after importing current wire transfers instead of running forever in the background. 5636 5637 @item @strong{-v} | @strong{––version} 5638 5639 Print version information. 5640 @end table 5641 5642 @node See Also<5>,Bugs<5>,Description<5>,anastasis-helper-authorization-iban 1 5643 @anchor{manpages/anastasis-helper-authorization-iban 1 see-also}@anchor{a2} 5644 @subsubsection See Also 5645 5646 5647 anastasis-httpd(1), anastasis.conf(5). 5648 5649 @node Bugs<5>,,See Also<5>,anastasis-helper-authorization-iban 1 5650 @anchor{manpages/anastasis-helper-authorization-iban 1 bugs}@anchor{a3} 5651 @subsubsection Bugs 5652 5653 5654 Report bugs by using @indicateurl{https://bugs.anastasis.lu/} or by sending electronic 5655 mail to <@email{contact@@anastasis.lu}>. 5656 5657 @node anastasis-httpd 1,anastasis-reducer 1,anastasis-helper-authorization-iban 1,Man Pages 5658 @anchor{manpages/anastasis-httpd 1 doc}@anchor{a4}@anchor{manpages/anastasis-httpd 1 anastasis-httpd-1}@anchor{a5} 5659 @subsection anastasis-httpd(1) 5660 5661 5662 5663 @menu 5664 * Synopsis: Synopsis<6>. 5665 * Description: Description<6>. 5666 * Signals:: 5667 * See also:: 5668 * Bugs: Bugs<6>. 5669 5670 @end menu 5671 5672 @node Synopsis<6>,Description<6>,,anastasis-httpd 1 5673 @anchor{manpages/anastasis-httpd 1 synopsis}@anchor{a6} 5674 @subsubsection Synopsis 5675 5676 5677 @strong{anastasis-httpd} 5678 5679 @node Description<6>,Signals,Synopsis<6>,anastasis-httpd 1 5680 @anchor{manpages/anastasis-httpd 1 description}@anchor{a7} 5681 @subsubsection Description 5682 5683 5684 Banastasis-httpd is a command line tool to run the Anastasis (HTTP 5685 backend). The required configuration and database must exist before 5686 running this command. 5687 5688 Its options are as follows: 5689 5690 5691 @table @asis 5692 5693 @item @strong{-C} | @strong{–connection-close} 5694 5695 Force each HTTP connection to be closed after each request. 5696 5697 @item @strong{-c} @emph{FILENAME} | @strong{––config=}@emph{FILENAME} 5698 5699 Use the configuration and other resources for the merchant to operate 5700 from FILENAME. 5701 5702 @item @strong{-h} | @strong{––help} 5703 5704 Print short help on options. 5705 5706 @item @strong{-v} | @strong{––version} 5707 5708 Print version information. 5709 @end table 5710 5711 @node Signals,See also,Description<6>,anastasis-httpd 1 5712 @anchor{manpages/anastasis-httpd 1 signals}@anchor{a8} 5713 @subsubsection Signals 5714 5715 5716 @strong{anastasis-httpd} responds to the following signals: 5717 5718 5719 @table @asis 5720 5721 @item @code{SIGTERM} 5722 5723 Sending a SIGTERM to the process will cause it to shutdown cleanly. 5724 @end table 5725 5726 @node See also,Bugs<6>,Signals,anastasis-httpd 1 5727 @anchor{manpages/anastasis-httpd 1 see-also}@anchor{a9} 5728 @subsubsection See also 5729 5730 5731 anastasis-dbinit(1), anastasis-config(1), anastasis-gtk(1), anastasis-reducer(1) 5732 5733 @node Bugs<6>,,See also,anastasis-httpd 1 5734 @anchor{manpages/anastasis-httpd 1 bugs}@anchor{aa} 5735 @subsubsection Bugs 5736 5737 5738 Report bugs by using @indicateurl{https://bugs.anastasis.lu} or by sending 5739 electronic mail to <@email{contact@@anastasis.lu}>. 5740 5741 @node anastasis-reducer 1,anastasis conf 5,anastasis-httpd 1,Man Pages 5742 @anchor{manpages/anastasis-reducer 1 doc}@anchor{ab}@anchor{manpages/anastasis-reducer 1 anastasis-reducer-1}@anchor{ac} 5743 @subsection anastasis-reducer(1) 5744 5745 5746 5747 @menu 5748 * Synopsis: Synopsis<7>. 5749 * Description: Description<7>. 5750 * See Also: See Also<6>. 5751 * Bugs: Bugs<7>. 5752 5753 @end menu 5754 5755 @node Synopsis<7>,Description<7>,,anastasis-reducer 1 5756 @anchor{manpages/anastasis-reducer 1 synopsis}@anchor{ad} 5757 @subsubsection Synopsis 5758 5759 5760 @strong{anastasis-reducer} 5761 [@strong{-A**_*ID*_|_}–application=**@emph{ID}] 5762 [@strong{-a**_*JSON*_|_}–arguments=@emph{JSON}] 5763 [@strong{-b**_|_}–backup] 5764 [@strong{-c} @emph{FILENAME} | @strong{––config=}@emph{FILENAME}] 5765 [@strong{-h} | @strong{––help}] 5766 [@strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}@emph{LOGLEVEL}] 5767 [@strong{-l} @emph{FILENAME} | @strong{––logfile=}@emph{FILENAME}] 5768 [@strong{-r**_|_}–restore] 5769 [@strong{-v} | @strong{––version}] COMMAND 5770 5771 @node Description<7>,See Also<6>,Synopsis<7>,anastasis-reducer 1 5772 @anchor{manpages/anastasis-reducer 1 description}@anchor{ae} 5773 @subsubsection Description 5774 5775 5776 @strong{anastasis-reducer} is a command-line tool to run Anastasis 5777 key recover and backup operations using a reducer-style interface. 5778 The reducer will read the current state from standard input and 5779 write the resulting state to standard output. A COMMAND must 5780 be given on the command line. The arguments (if any) are to 5781 be given in JSON format to the @strong{-a} option. A list of 5782 commands can be found in the @ref{66,,Reducer API} 5783 chapter. 5784 5785 5786 @table @asis 5787 5788 @item @strong{-a} @emph{JSON} | @strong{––arguments=}@emph{JSON} 5789 5790 Provide JSON inputs for the given command. 5791 5792 @item @strong{-A} @emph{ID} | @strong{–application=}@emph{ID} 5793 5794 Set the application ID to @emph{ID}. Default is empty, which means the application-id must be explicitly provided 5795 as part of the JSON inputs or it will be omitted. 5796 The @strong{-A} option overrides any application ID that 5797 may be given in the @strong{-a} arguments. Application IDs 5798 are used to store different types of secrets from different applications 5799 while using the same user attributes. Basically the application ID 5800 is included in the user attributes. Applications that 5801 tightly integrate Anastasis should set the application ID to their 5802 respective unique name, for example the GNU Taler wallet may use 5803 @code{gnu-taler-wallet} for the application ID. 5804 Forgetting the application ID makes the secrets irrecoverable. 5805 5806 @item @strong{-b} | @strong{–backup} 5807 5808 Begin fresh reducer operation for a back up operation. 5809 5810 @item @strong{-c} @emph{FILENAME} | @strong{––config=}@emph{FILENAME} 5811 5812 Use the configuration from @emph{FILENAME}. 5813 5814 @item @strong{-h} | @strong{––help} 5815 5816 Print short help on options. 5817 5818 @item @strong{-L} @emph{LOGLEVEL} | @strong{––loglevel=}@emph{LOGLEVEL} 5819 5820 Specifies the log level to use. Accepted values are: @code{DEBUG}, @code{INFO}, 5821 @code{WARNING}, @code{ERROR}. 5822 5823 @item @strong{-l} @emph{FILENAME} | @strong{––logfile=}@emph{FILENAME} 5824 5825 Send logging output to @emph{FILENAME}. 5826 5827 @item @strong{-r} | @strong{–restore} 5828 5829 Begin fresh reducer operation for a restore operation. 5830 5831 @item @strong{-v} | @strong{––version} 5832 5833 Print version information. 5834 @end table 5835 5836 @node See Also<6>,Bugs<7>,Description<7>,anastasis-reducer 1 5837 @anchor{manpages/anastasis-reducer 1 see-also}@anchor{af} 5838 @subsubsection See Also 5839 5840 5841 anastasis-gtk(1), anastasis-httpd(1), anastasis.conf(5). 5842 5843 @node Bugs<7>,,See Also<6>,anastasis-reducer 1 5844 @anchor{manpages/anastasis-reducer 1 bugs}@anchor{b0} 5845 @subsubsection Bugs 5846 5847 5848 Report bugs by using @indicateurl{https://bugs.anastasis.lu/} or by sending electronic 5849 mail to <@email{contact@@anastasis.lu}>. 5850 5851 @node anastasis conf 5,,anastasis-reducer 1,Man Pages 5852 @anchor{manpages/anastasis conf 5 doc}@anchor{b1}@anchor{manpages/anastasis conf 5 anastasis-conf-5}@anchor{b2} 5853 @subsection anastasis.conf(5) 5854 5855 5856 5857 @menu 5858 * Description: Description<8>. 5859 * SEE ALSO:: 5860 * BUGS:: 5861 5862 @end menu 5863 5864 @node Description<8>,SEE ALSO,,anastasis conf 5 5865 @anchor{manpages/anastasis conf 5 description}@anchor{b3} 5866 @subsubsection Description 5867 5868 5869 The configuration file is line-oriented. 5870 Blank lines and whitespace at the beginning and end of a line are ignored. 5871 Comments start with @code{#} or @code{%} in the first column 5872 (after any beginning-of-line whitespace) and go to the end of the line. 5873 5874 The file is split into sections. 5875 Every section begins with “[SECTIONNAME]” and 5876 contains a number of options of the form “OPTION=VALUE”. 5877 There may be whitespace around the @code{=} (equal sign). 5878 Section names and options are @emph{case-insensitive}. 5879 5880 The values, however, are @emph{case-sensitive}. 5881 In particular, boolean values are one of @code{YES} or @code{NO}. 5882 Values can include whitespace by surrounding 5883 the entire value with @code{"} (double quote). 5884 Note, however, that there are no escape characters in such strings; 5885 all characters between the double quotes (including other double quotes) 5886 are taken verbatim. 5887 5888 Values that represent filenames can begin with a @code{/bin/sh}-like 5889 variable reference. 5890 This can be simple, such as @code{$TMPDIR/foo}, or complex, 5891 such as @code{$@{TMPDIR:-$@{TMP:-/tmp@}@}/foo}. 5892 See @code{[PATHS]} (below). 5893 5894 Values that represent a time duration are represented as a series of one or 5895 more @code{NUMBER UNIT} pairs, e.g. @code{60 s}, @code{4 weeks 1 day}, @code{5 years 2 minutes}. 5896 5897 Values that represent an amount are in the usual amount syntax: 5898 @code{CURRENCY:VALUE.FRACTION}, e.g. @code{EUR:1.50}. 5899 The @code{FRACTION} portion may extend up to 8 places. 5900 5901 Files containing default values for many of the options described below 5902 are installed under @code{$ANASTASIS_PREFIX/share/taler/config.d/}. 5903 The configuration file given with @strong{-c} to Anastasis binaries 5904 overrides these defaults. 5905 5906 A configuration file may include another, by using the @code{@@INLINE@@} directive, 5907 for example, in @code{main.conf}, you could write @code{@@INLINE@@ sub.conf} to 5908 include the entirety of @code{sub.conf} at that point in @code{main.conf}. 5909 .. TODO: Document ‘anastasis-config -V’ in light of ‘@@INLINE@@’ in taler-config(1). 5910 5911 @menu 5912 * GLOBAL OPTIONS:: 5913 * Backend options:: 5914 * Authorization options:: 5915 * Postgres database configuration:: 5916 5917 @end menu 5918 5919 @node GLOBAL OPTIONS,Backend options,,Description<8> 5920 @anchor{manpages/anastasis conf 5 global-options}@anchor{b4} 5921 @subsubsection GLOBAL OPTIONS 5922 5923 5924 The following options are from the @code{[anastasis]} section and used by 5925 the @strong{anastasis-httpd} service. 5926 5927 5928 @table @asis 5929 5930 @item ANNUAL_FEE 5931 5932 Annual fee to be paid for policy uploads, i.e. “EUR:1.5”. 5933 5934 @item TRUTH_UPLOAD_FEE 5935 5936 Annual fee to be paid for truth uploads, i.e. “EUR:1.5”. 5937 5938 @item INSURANCE 5939 5940 Amount up to which key shares are warranted, i.e. “EUR:1000000”. 5941 5942 @item DB 5943 5944 Database backend to use, only @code{postgres} is supported right now. 5945 5946 @item UPLOAD_LIMIT_MB 5947 5948 Maximum upload size for policy uploads in megabytes. Default is 1. 5949 5950 @item ANNUAL_POLICY_UPLOAD_LIMIT 5951 5952 Maximum number of policies uploaded per year of service. Default is 42. 5953 5954 @item BUSINESS_NAME 5955 5956 Name of the business. 5957 5958 @item SERVER_SALT 5959 5960 Must be set to a high-entropy random server salt that the provider must never 5961 change after the initial configuration. 5962 5963 @item PORT 5964 5965 TCP port on which the HTTP service should listen on. 5966 @end table 5967 5968 @node Backend options,Authorization options,GLOBAL OPTIONS,Description<8> 5969 @anchor{manpages/anastasis conf 5 backend-options}@anchor{b5} 5970 @subsubsection Backend options 5971 5972 5973 The following options are from the @code{[anastasis-merchant-backend]} section and used by 5974 the @strong{anastasis-httpd} service. 5975 5976 5977 @table @asis 5978 5979 @item PAYMENT_BACKEND_URL 5980 5981 Base-URL of the Taler merchant backend instance to use for payments. 5982 5983 @item API_KEY 5984 5985 API key to transmit to the merchant backend for authentication. 5986 @end table 5987 5988 @node Authorization options,Postgres database configuration,Backend options,Description<8> 5989 @anchor{manpages/anastasis conf 5 authorization-options}@anchor{b6} 5990 @subsubsection Authorization options 5991 5992 5993 For each active authorization plugin, options must be configured in a 5994 section called @code{[authorization-$PLUGIN]} where @code{$PLUGIN} is the 5995 name of the authorization plugin. Specific plugins may require 5996 additional options, which are described in the respective sections 5997 below. 5998 5999 6000 @table @asis 6001 6002 @item COST 6003 6004 Fee the user has to pay to obtain a challenge from this 6005 authorization plugin during recovery. 6006 6007 @item ENABLED 6008 6009 @code{yes} to enable this plugin, @code{no} to disable. 6010 @end table 6011 6012 @menu 6013 * SMS Authorization options:: 6014 * Email Authorization options:: 6015 * Post Authorization options:: 6016 * IBAN Authorization options:: 6017 6018 @end menu 6019 6020 @node SMS Authorization options,Email Authorization options,,Authorization options 6021 @anchor{manpages/anastasis conf 5 sms-authorization-options}@anchor{b7} 6022 @subsubsection SMS Authorization options 6023 6024 6025 6026 @table @asis 6027 6028 @item COMMAND 6029 6030 Helper command to run to send SMS. The command will be given the phone number as its first argument. The message to be transmitted will be passed via STDIN. 6031 @end table 6032 6033 @node Email Authorization options,Post Authorization options,SMS Authorization options,Authorization options 6034 @anchor{manpages/anastasis conf 5 email-authorization-options}@anchor{b8} 6035 @subsubsection Email Authorization options 6036 6037 6038 6039 @table @asis 6040 6041 @item COMMAND 6042 6043 Helper command to run to send E-mail. The command will be given the e-mail address as its first argument. The message to be transmitted will be passed via STDIN. 6044 @end table 6045 6046 @node Post Authorization options,IBAN Authorization options,Email Authorization options,Authorization options 6047 @anchor{manpages/anastasis conf 5 post-authorization-options}@anchor{b9} 6048 @subsubsection Post Authorization options 6049 6050 6051 6052 @table @asis 6053 6054 @item COMMAND 6055 6056 Helper command to run to send physical mail. The command will be given the mailing address address as its first argument in JSON object fields ‘full_name’, ‘street’, ‘city’, ‘postcode’ and ‘country’. The message to be transmitted will be passed via STDIN. 6057 @end table 6058 6059 @node IBAN Authorization options,,Post Authorization options,Authorization options 6060 @anchor{manpages/anastasis conf 5 iban-authorization-options}@anchor{ba} 6061 @subsubsection IBAN Authorization options 6062 6063 6064 6065 @table @asis 6066 6067 @item CREDIT_IBAN 6068 6069 IBAN number where the consumers must 6070 wire the money to for authentication. 6071 6072 @item BUSINESS_NAME 6073 6074 Name of the account holder. 6075 6076 @item WIRE_GATEWAY_URL 6077 6078 Base URL of the LibEuFin wire gateway (Anastasis facade). 6079 6080 @item WIRE_GATEWAY_AUTH_METHOD 6081 6082 Authentication method used to talk to the LibEuFin wire gateway, i.e. ‘basic’ for HTTP basic authentication. 6083 6084 @item USERNAME 6085 6086 Username to use when using HTTP basic authentication. 6087 6088 @item PASSWORD 6089 6090 Password to use when using HTTP basic authentication. 6091 @end table 6092 6093 @node Postgres database configuration,,Authorization options,Description<8> 6094 @anchor{manpages/anastasis conf 5 postgres-database-configuration}@anchor{bb} 6095 @subsubsection Postgres database configuration 6096 6097 6098 The following options must be in the section @code{[statis-postgres]} if 6099 @code{postgres} was used for the database under @code{DB} in the 6100 @code{[anastasis]} section. 6101 6102 6103 @table @asis 6104 6105 @item CONFIG 6106 6107 Path under which the Postgres database is that the service 6108 should use, i.e. @code{postgres://anastasis}. 6109 @end table 6110 6111 @node SEE ALSO,BUGS,Description<8>,anastasis conf 5 6112 @anchor{manpages/anastasis conf 5 see-also}@anchor{bc} 6113 @subsubsection SEE ALSO 6114 6115 6116 anastasis-httpd(1), anastasis-config(1) 6117 6118 @node BUGS,,SEE ALSO,anastasis conf 5 6119 @anchor{manpages/anastasis conf 5 bugs}@anchor{bd} 6120 @subsubsection BUGS 6121 6122 6123 Report bugs by using @indicateurl{https://bugs.anastasis.lu/} or by sending electronic 6124 mail to <@email{contact@@anastasis.lu}>. 6125 6126 @node Complete Index,GNU Free Documentation License,Man Pages,Documentation Overview 6127 @anchor{genindex doc}@anchor{be}@anchor{genindex complete-index}@anchor{bf} 6128 @section Complete Index 6129 6130 6131 @node GNU Free Documentation License,,Complete Index,Documentation Overview 6132 @anchor{fdl-1 3 doc}@anchor{c0}@anchor{fdl-1 3 gnu-fdl-1-3}@anchor{c1}@anchor{fdl-1 3 gnu-free-documentation-license}@anchor{c2} 6133 @section GNU Free Documentation License 6134 6135 6136 Version 1.3, 3 November 2008 6137 6138 Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, 6139 Inc. @indicateurl{https://fsf.org/} 6140 6141 Everyone is permitted to copy and distribute verbatim copies of this 6142 license document, but changing it is not allowed. 6143 6144 @menu 6145 * 0. PREAMBLE: 0 PREAMBLE. 6146 * 1. APPLICABILITY AND DEFINITIONS: 1 APPLICABILITY AND DEFINITIONS. 6147 * 2. VERBATIM COPYING: 2 VERBATIM COPYING. 6148 * 3. COPYING IN QUANTITY: 3 COPYING IN QUANTITY. 6149 * 4. MODIFICATIONS: 4 MODIFICATIONS. 6150 * 5. COMBINING DOCUMENTS: 5 COMBINING DOCUMENTS. 6151 * 6. COLLECTIONS OF DOCUMENTS: 6 COLLECTIONS OF DOCUMENTS. 6152 * 7. AGGREGATION WITH INDEPENDENT WORKS: 7 AGGREGATION WITH INDEPENDENT WORKS. 6153 * 8. TRANSLATION: 8 TRANSLATION. 6154 * 9. TERMINATION: 9 TERMINATION. 6155 * 10. FUTURE REVISIONS OF THIS LICENSE: 10 FUTURE REVISIONS OF THIS LICENSE. 6156 * 11. RELICENSING: 11 RELICENSING. 6157 * ADDENDUM; How to use this License for your documents: ADDENDUM How to use this License for your documents. 6158 6159 @end menu 6160 6161 @node 0 PREAMBLE,1 APPLICABILITY AND DEFINITIONS,,GNU Free Documentation License 6162 @anchor{fdl-1 3 preamble}@anchor{c3} 6163 @subsection 0. PREAMBLE 6164 6165 6166 The purpose of this License is to make a manual, textbook, or other 6167 functional and useful document “free” in the sense of freedom: to assure 6168 everyone the effective freedom to copy and redistribute it, with or 6169 without modifying it, either commercially or noncommercially. 6170 Secondarily, this License preserves for the author and publisher a way 6171 to get credit for their work, while not being considered responsible for 6172 modifications made by others. 6173 6174 This License is a kind of “copyleft”, which means that derivative works 6175 of the document must themselves be free in the same sense. It 6176 complements the GNU General Public License, which is a copyleft license 6177 designed for free software. 6178 6179 We have designed this License in order to use it for manuals for free 6180 software, because free software needs free documentation: a free program 6181 should come with manuals providing the same freedoms that the software 6182 does. But this License is not limited to software manuals; it can be 6183 used for any textual work, regardless of subject matter or whether it is 6184 published as a printed book. We recommend this License principally for 6185 works whose purpose is instruction or reference. 6186 6187 @node 1 APPLICABILITY AND DEFINITIONS,2 VERBATIM COPYING,0 PREAMBLE,GNU Free Documentation License 6188 @anchor{fdl-1 3 applicability-and-definitions}@anchor{c4} 6189 @subsection 1. APPLICABILITY AND DEFINITIONS 6190 6191 6192 This License applies to any manual or other work, in any medium, that 6193 contains a notice placed by the copyright holder saying it can be 6194 distributed under the terms of this License. Such a notice grants a 6195 world-wide, royalty-free license, unlimited in duration, to use that 6196 work under the conditions stated herein. The “Document”, below, refers 6197 to any such manual or work. Any member of the public is a licensee, and 6198 is addressed as “you”. You accept the license if you copy, modify or 6199 distribute the work in a way requiring permission under copyright law. 6200 6201 A “Modified Version” of the Document means any work containing the 6202 Document or a portion of it, either copied verbatim, or with 6203 modifications and/or translated into another language. 6204 6205 A “Secondary Section” is a named appendix or a front-matter section of 6206 the Document that deals exclusively with the relationship of the 6207 publishers or authors of the Document to the Document’s overall subject 6208 (or to related matters) and contains nothing that could fall directly 6209 within that overall subject. (Thus, if the Document is in part a 6210 textbook of mathematics, a Secondary Section may not explain any 6211 mathematics.) The relationship could be a matter of historical 6212 connection with the subject or with related matters, or of legal, 6213 commercial, philosophical, ethical or political position regarding them. 6214 6215 The “Invariant Sections” are certain Secondary Sections whose titles are 6216 designated, as being those of Invariant Sections, in the notice that 6217 says that the Document is released under this License. If a section does 6218 not fit the above definition of Secondary then it is not allowed to be 6219 designated as Invariant. The Document may contain zero Invariant 6220 Sections. If the Document does not identify any Invariant Sections then 6221 there are none. 6222 6223 The “Cover Texts” are certain short passages of text that are listed, as 6224 Front-Cover Texts or Back-Cover Texts, in the notice that says that the 6225 Document is released under this License. A Front-Cover Text may be at 6226 most 5 words, and a Back-Cover Text may be at most 25 words. 6227 6228 A “Transparent” copy of the Document means a machine-readable copy, 6229 represented in a format whose specification is available to the general 6230 public, that is suitable for revising the document straightforwardly 6231 with generic text editors or (for images composed of pixels) generic 6232 paint programs or (for drawings) some widely available drawing editor, 6233 and that is suitable for input to text formatters or for automatic 6234 translation to a variety of formats suitable for input to text 6235 formatters. A copy made in an otherwise Transparent file format whose 6236 markup, or absence of markup, has been arranged to thwart or discourage 6237 subsequent modification by readers is not Transparent. An image format 6238 is not Transparent if used for any substantial amount of text. A copy 6239 that is not “Transparent” is called “Opaque”. 6240 6241 Examples of suitable formats for Transparent copies include plain ASCII 6242 without markup, Texinfo input format, LaTeX input format, SGML or XML 6243 using a publicly available DTD, and standard-conforming simple HTML, 6244 PostScript or PDF designed for human modification. Examples of 6245 transparent image formats include PNG, XCF and JPG. Opaque formats 6246 include proprietary formats that can be read and edited only by 6247 proprietary word processors, SGML or XML for which the DTD and/or 6248 processing tools are not generally available, and the machine-generated 6249 HTML, PostScript or PDF produced by some word processors for output 6250 purposes only. 6251 6252 The “Title Page” means, for a printed book, the title page itself, plus 6253 such following pages as are needed to hold, legibly, the material this 6254 License requires to appear in the title page. For works in formats which 6255 do not have any title page as such, “Title Page” means the text near the 6256 most prominent appearance of the work’s title, preceding the beginning 6257 of the body of the text. 6258 6259 The “publisher” means any person or entity that distributes copies of 6260 the Document to the public. 6261 6262 A section “Entitled XYZ” means a named subunit of the Document whose 6263 title either is precisely XYZ or contains XYZ in parentheses following 6264 text that translates XYZ in another language. (Here XYZ stands for a 6265 specific section name mentioned below, such as “Acknowledgements”, 6266 “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of 6267 such a section when you modify the Document means that it remains a 6268 section “Entitled XYZ” according to this definition. 6269 6270 The Document may include Warranty Disclaimers next to the notice which 6271 states that this License applies to the Document. These Warranty 6272 Disclaimers are considered to be included by reference in this License, 6273 but only as regards disclaiming warranties: any other implication that 6274 these Warranty Disclaimers may have is void and has no effect on the 6275 meaning of this License. 6276 6277 @node 2 VERBATIM COPYING,3 COPYING IN QUANTITY,1 APPLICABILITY AND DEFINITIONS,GNU Free Documentation License 6278 @anchor{fdl-1 3 verbatim-copying}@anchor{c5} 6279 @subsection 2. VERBATIM COPYING 6280 6281 6282 You may copy and distribute the Document in any medium, either 6283 commercially or noncommercially, provided that this License, the 6284 copyright notices, and the license notice saying this License applies to 6285 the Document are reproduced in all copies, and that you add no other 6286 conditions whatsoever to those of this License. You may not use 6287 technical measures to obstruct or control the reading or further copying 6288 of the copies you make or distribute. However, you may accept 6289 compensation in exchange for copies. If you distribute a large enough 6290 number of copies you must also follow the conditions in section 3. 6291 6292 You may also lend copies, under the same conditions stated above, and 6293 you may publicly display copies. 6294 6295 @node 3 COPYING IN QUANTITY,4 MODIFICATIONS,2 VERBATIM COPYING,GNU Free Documentation License 6296 @anchor{fdl-1 3 copying-in-quantity}@anchor{c6} 6297 @subsection 3. COPYING IN QUANTITY 6298 6299 6300 If you publish printed copies (or copies in media that commonly have 6301 printed covers) of the Document, numbering more than 100, and the 6302 Document’s license notice requires Cover Texts, you must enclose the 6303 copies in covers that carry, clearly and legibly, all these Cover Texts: 6304 Front-Cover Texts on the front cover, and Back-Cover Texts on the back 6305 cover. Both covers must also clearly and legibly identify you as the 6306 publisher of these copies. The front cover must present the full title 6307 with all words of the title equally prominent and visible. You may add 6308 other material on the covers in addition. Copying with changes limited 6309 to the covers, as long as they preserve the title of the Document and 6310 satisfy these conditions, can be treated as verbatim copying in other 6311 respects. 6312 6313 If the required texts for either cover are too voluminous to fit 6314 legibly, you should put the first ones listed (as many as fit 6315 reasonably) on the actual cover, and continue the rest onto adjacent 6316 pages. 6317 6318 If you publish or distribute Opaque copies of the Document numbering 6319 more than 100, you must either include a machine-readable Transparent 6320 copy along with each Opaque copy, or state in or with each Opaque copy a 6321 computer-network location from which the general network-using public 6322 has access to download using public-standard network protocols a 6323 complete Transparent copy of the Document, free of added material. If 6324 you use the latter option, you must take reasonably prudent steps, when 6325 you begin distribution of Opaque copies in quantity, to ensure that this 6326 Transparent copy will remain thus accessible at the stated location 6327 until at least one year after the last time you distribute an Opaque 6328 copy (directly or through your agents or retailers) of that edition to 6329 the public. 6330 6331 It is requested, but not required, that you contact the authors of the 6332 Document well before redistributing any large number of copies, to give 6333 them a chance to provide you with an updated version of the Document. 6334 6335 @node 4 MODIFICATIONS,5 COMBINING DOCUMENTS,3 COPYING IN QUANTITY,GNU Free Documentation License 6336 @anchor{fdl-1 3 modifications}@anchor{c7} 6337 @subsection 4. MODIFICATIONS 6338 6339 6340 You may copy and distribute a Modified Version of the Document under the 6341 conditions of sections 2 and 3 above, provided that you release the 6342 Modified Version under precisely this License, with the Modified Version 6343 filling the role of the Document, thus licensing distribution and 6344 modification of the Modified Version to whoever possesses a copy of it. 6345 In addition, you must do these things in the Modified Version: 6346 6347 6348 @itemize - 6349 6350 @item 6351 A. Use in the Title Page (and on the covers, if any) a title distinct 6352 from that of the Document, and from those of previous versions (which 6353 should, if there were any, be listed in the History section of the 6354 Document). You may use the same title as a previous version if the 6355 original publisher of that version gives permission. 6356 6357 @item 6358 B. List on the Title Page, as authors, one or more persons or 6359 entities responsible for authorship of the modifications in the 6360 Modified Version, together with at least five of the principal 6361 authors of the Document (all of its principal authors, if it has 6362 fewer than five), unless they release you from this requirement. 6363 6364 @item 6365 C. State on the Title page the name of the publisher of the Modified 6366 Version, as the publisher. 6367 6368 @item 6369 6370 @enumerate 4 6371 6372 @item 6373 Preserve all the copyright notices of the Document. 6374 @end enumerate 6375 6376 @item 6377 E. Add an appropriate copyright notice for your modifications 6378 adjacent to the other copyright notices. 6379 6380 @item 6381 F. Include, immediately after the copyright notices, a license notice 6382 giving the public permission to use the Modified Version under the 6383 terms of this License, in the form shown in the Addendum below. 6384 6385 @item 6386 G. Preserve in that license notice the full lists of Invariant 6387 Sections and required Cover Texts given in the Document’s license 6388 notice. 6389 6390 @item 6391 6392 @enumerate 8 6393 6394 @item 6395 Include an unaltered copy of this License. 6396 @end enumerate 6397 6398 @item 6399 I. Preserve the section Entitled “History”, Preserve its Title, and 6400 add to it an item stating at least the title, year, new authors, and 6401 publisher of the Modified Version as given on the Title Page. If 6402 there is no section Entitled “History” in the Document, create one 6403 stating the title, year, authors, and publisher of the Document as 6404 given on its Title Page, then add an item describing the Modified 6405 Version as stated in the previous sentence. 6406 6407 @item 6408 J. Preserve the network location, if any, given in the Document for 6409 public access to a Transparent copy of the Document, and likewise the 6410 network locations given in the Document for previous versions it was 6411 based on. These may be placed in the “History” section. You may omit 6412 a network location for a work that was published at least four years 6413 before the Document itself, or if the original publisher of the 6414 version it refers to gives permission. 6415 6416 @item 6417 K. For any section Entitled “Acknowledgements” or “Dedications”, 6418 Preserve the Title of the section, and preserve in the section all 6419 the substance and tone of each of the contributor acknowledgements 6420 and/or dedications given therein. 6421 6422 @item 6423 L. Preserve all the Invariant Sections of the Document, unaltered in 6424 their text and in their titles. Section numbers or the equivalent are 6425 not considered part of the section titles. 6426 6427 @item 6428 M. Delete any section Entitled “Endorsements”. Such a section may not 6429 be included in the Modified Version. 6430 6431 @item 6432 N. Do not retitle any existing section to be Entitled “Endorsements” 6433 or to conflict in title with any Invariant Section. 6434 6435 @item 6436 6437 @enumerate 15 6438 6439 @item 6440 Preserve any Warranty Disclaimers. 6441 @end enumerate 6442 @end itemize 6443 6444 If the Modified Version includes new front-matter sections or appendices 6445 that qualify as Secondary Sections and contain no material copied from 6446 the Document, you may at your option designate some or all of these 6447 sections as invariant. To do this, add their titles to the list of 6448 Invariant Sections in the Modified Version’s license notice. These 6449 titles must be distinct from any other section titles. 6450 6451 You may add a section Entitled “Endorsements”, provided it contains 6452 nothing but endorsements of your Modified Version by various 6453 parties—for example, statements of peer review or that the text has 6454 been approved by an organization as the authoritative definition of a 6455 standard. 6456 6457 You may add a passage of up to five words as a Front-Cover Text, and a 6458 passage of up to 25 words as a Back-Cover Text, to the end of the list 6459 of Cover Texts in the Modified Version. Only one passage of Front-Cover 6460 Text and one of Back-Cover Text may be added by (or through arrangements 6461 made by) any one entity. If the Document already includes a cover text 6462 for the same cover, previously added by you or by arrangement made by 6463 the same entity you are acting on behalf of, you may not add another; 6464 but you may replace the old one, on explicit permission from the 6465 previous publisher that added the old one. 6466 6467 The author(s) and publisher(s) of the Document do not by this License 6468 give permission to use their names for publicity for or to assert or 6469 imply endorsement of any Modified Version. 6470 6471 @node 5 COMBINING DOCUMENTS,6 COLLECTIONS OF DOCUMENTS,4 MODIFICATIONS,GNU Free Documentation License 6472 @anchor{fdl-1 3 combining-documents}@anchor{c8} 6473 @subsection 5. COMBINING DOCUMENTS 6474 6475 6476 You may combine the Document with other documents released under this 6477 License, under the terms defined in section 4 above for modified 6478 versions, provided that you include in the combination all of the 6479 Invariant Sections of all of the original documents, unmodified, and 6480 list them all as Invariant Sections of your combined work in its license 6481 notice, and that you preserve all their Warranty Disclaimers. 6482 6483 The combined work need only contain one copy of this License, and 6484 multiple identical Invariant Sections may be replaced with a single 6485 copy. If there are multiple Invariant Sections with the same name but 6486 different contents, make the title of each such section unique by adding 6487 at the end of it, in parentheses, the name of the original author or 6488 publisher of that section if known, or else a unique number. Make the 6489 same adjustment to the section titles in the list of Invariant Sections 6490 in the license notice of the combined work. 6491 6492 In the combination, you must combine any sections Entitled “History” in 6493 the various original documents, forming one section Entitled “History”; 6494 likewise combine any sections Entitled “Acknowledgements”, and any 6495 sections Entitled “Dedications”. You must delete all sections Entitled 6496 “Endorsements”. 6497 6498 @node 6 COLLECTIONS OF DOCUMENTS,7 AGGREGATION WITH INDEPENDENT WORKS,5 COMBINING DOCUMENTS,GNU Free Documentation License 6499 @anchor{fdl-1 3 collections-of-documents}@anchor{c9} 6500 @subsection 6. COLLECTIONS OF DOCUMENTS 6501 6502 6503 You may make a collection consisting of the Document and other documents 6504 released under this License, and replace the individual copies of this 6505 License in the various documents with a single copy that is included in 6506 the collection, provided that you follow the rules of this License for 6507 verbatim copying of each of the documents in all other respects. 6508 6509 You may extract a single document from such a collection, and distribute 6510 it individually under this License, provided you insert a copy of this 6511 License into the extracted document, and follow this License in all 6512 other respects regarding verbatim copying of that document. 6513 6514 @node 7 AGGREGATION WITH INDEPENDENT WORKS,8 TRANSLATION,6 COLLECTIONS OF DOCUMENTS,GNU Free Documentation License 6515 @anchor{fdl-1 3 aggregation-with-independent-works}@anchor{ca} 6516 @subsection 7. AGGREGATION WITH INDEPENDENT WORKS 6517 6518 6519 A compilation of the Document or its derivatives with other separate and 6520 independent documents or works, in or on a volume of a storage or 6521 distribution medium, is called an “aggregate” if the copyright resulting 6522 from the compilation is not used to limit the legal rights of the 6523 compilation’s users beyond what the individual works permit. When the 6524 Document is included in an aggregate, this License does not apply to the 6525 other works in the aggregate which are not themselves derivative works 6526 of the Document. 6527 6528 If the Cover Text requirement of section 3 is applicable to these copies 6529 of the Document, then if the Document is less than one half of the 6530 entire aggregate, the Document’s Cover Texts may be placed on covers 6531 that bracket the Document within the aggregate, or the electronic 6532 equivalent of covers if the Document is in electronic form. Otherwise 6533 they must appear on printed covers that bracket the whole aggregate. 6534 6535 @node 8 TRANSLATION,9 TERMINATION,7 AGGREGATION WITH INDEPENDENT WORKS,GNU Free Documentation License 6536 @anchor{fdl-1 3 translation}@anchor{cb} 6537 @subsection 8. TRANSLATION 6538 6539 6540 Translation is considered a kind of modification, so you may distribute 6541 translations of the Document under the terms of section 4. Replacing 6542 Invariant Sections with translations requires special permission from 6543 their copyright holders, but you may include translations of some or all 6544 Invariant Sections in addition to the original versions of these 6545 Invariant Sections. You may include a translation of this License, and 6546 all the license notices in the Document, and any Warranty Disclaimers, 6547 provided that you also include the original English version of this 6548 License and the original versions of those notices and disclaimers. In 6549 case of a disagreement between the translation and the original version 6550 of this License or a notice or disclaimer, the original version will 6551 prevail. 6552 6553 If a section in the Document is Entitled “Acknowledgements”, 6554 “Dedications”, or “History”, the requirement (section 4) to Preserve its 6555 Title (section 1) will typically require changing the actual title. 6556 6557 @node 9 TERMINATION,10 FUTURE REVISIONS OF THIS LICENSE,8 TRANSLATION,GNU Free Documentation License 6558 @anchor{fdl-1 3 termination}@anchor{cc} 6559 @subsection 9. TERMINATION 6560 6561 6562 You may not copy, modify, sublicense, or distribute the Document except 6563 as expressly provided under this License. Any attempt otherwise to copy, 6564 modify, sublicense, or distribute it is void, and will automatically 6565 terminate your rights under this License. 6566 6567 However, if you cease all violation of this License, then your license 6568 from a particular copyright holder is reinstated (a) provisionally, 6569 unless and until the copyright holder explicitly and finally terminates 6570 your license, and (b) permanently, if the copyright holder fails to 6571 notify you of the violation by some reasonable means prior to 60 days 6572 after the cessation. 6573 6574 Moreover, your license from a particular copyright holder is reinstated 6575 permanently if the copyright holder notifies you of the violation by 6576 some reasonable means, this is the first time you have received notice 6577 of violation of this License (for any work) from that copyright holder, 6578 and you cure the violation prior to 30 days after your receipt of the 6579 notice. 6580 6581 Termination of your rights under this section does not terminate the 6582 licenses of parties who have received copies or rights from you under 6583 this License. If your rights have been terminated and not permanently 6584 reinstated, receipt of a copy of some or all of the same material does 6585 not give you any rights to use it. 6586 6587 @node 10 FUTURE REVISIONS OF THIS LICENSE,11 RELICENSING,9 TERMINATION,GNU Free Documentation License 6588 @anchor{fdl-1 3 future-revisions-of-this-license}@anchor{cd} 6589 @subsection 10. FUTURE REVISIONS OF THIS LICENSE 6590 6591 6592 The Free Software Foundation may publish new, revised versions of the 6593 GNU Free Documentation License from time to time. Such new versions will 6594 be similar in spirit to the present version, but may differ in detail to 6595 address new problems or concerns. See @indicateurl{https://www.gnu.org/licenses/}. 6596 6597 Each version of the License is given a distinguishing version number. If 6598 the Document specifies that a particular numbered version of this 6599 License “or any later version” applies to it, you have the option of 6600 following the terms and conditions either of that specified version or 6601 of any later version that has been published (not as a draft) by the 6602 Free Software Foundation. If the Document does not specify a version 6603 number of this License, you may choose any version ever published (not 6604 as a draft) by the Free Software Foundation. If the Document specifies 6605 that a proxy can decide which future versions of this License can be 6606 used, that proxy’s public statement of acceptance of a version 6607 permanently authorizes you to choose that version for the Document. 6608 6609 @node 11 RELICENSING,ADDENDUM How to use this License for your documents,10 FUTURE REVISIONS OF THIS LICENSE,GNU Free Documentation License 6610 @anchor{fdl-1 3 relicensing}@anchor{ce} 6611 @subsection 11. RELICENSING 6612 6613 6614 “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any World 6615 Wide Web server that publishes copyrightable works and also provides 6616 prominent facilities for anybody to edit those works. A public wiki that 6617 anybody can edit is an example of such a server. A “Massive Multiauthor 6618 Collaboration” (or “MMC”) contained in the site means any set of 6619 copyrightable works thus published on the MMC site. 6620 6621 “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 6622 license published by Creative Commons Corporation, a not-for-profit 6623 corporation with a principal place of business in San Francisco, 6624 California, as well as future copyleft versions of that license 6625 published by that same organization. 6626 6627 “Incorporate” means to publish or republish a Document, in whole or in 6628 part, as part of another Document. 6629 6630 An MMC is “eligible for relicensing” if it is licensed under this 6631 License, and if all works that were first published under this License 6632 somewhere other than this MMC, and subsequently incorporated in whole or 6633 in part into the MMC, (1) had no cover texts or invariant sections, and 6634 (2) were thus incorporated prior to November 1, 2008. 6635 6636 The operator of an MMC Site may republish an MMC contained in the site 6637 under CC-BY-SA on the same site at any time before August 1, 2009, 6638 provided the MMC is eligible for relicensing. 6639 6640 @node ADDENDUM How to use this License for your documents,,11 RELICENSING,GNU Free Documentation License 6641 @anchor{fdl-1 3 addendum-how-to-use-this-license-for-your-documents}@anchor{cf} 6642 @subsection ADDENDUM: How to use this License for your documents 6643 6644 6645 To use this License in a document you have written, include a copy of 6646 the License in the document and put the following copyright and license 6647 notices just after the title page: 6648 6649 @example 6650 Copyright (C) YEAR YOUR NAME. 6651 Permission is granted to copy, distribute and/or modify this document 6652 under the terms of the GNU Free Documentation License, Version 1.3 6653 or any later version published by the Free Software Foundation; 6654 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. 6655 A copy of the license is included in the section entitled "GNU 6656 Free Documentation License". 6657 @end example 6658 6659 If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, 6660 replace the “with … Texts.” line with this: 6661 6662 @example 6663 with the Invariant Sections being LIST THEIR TITLES, with the 6664 Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. 6665 @end example 6666 6667 If you have Invariant Sections without Cover Texts, or some other 6668 combination of the three, merge those two alternatives to suit the 6669 situation. 6670 6671 If your document contains nontrivial examples of program code, we 6672 recommend releasing these examples in parallel under your choice of free 6673 software license, such as the GNU General Public License, to permit 6674 their use in free software. 6675 @anchor{30}@w{ } 6676 @anchor{rest tsref-type-ErrorDetail}@w{ } 6677 6678 @c %**end of body 6679 @bye