Civi::pipe - Convet from service-registry to negotation-flags
authorTim Otten <totten@civicrm.org>
Wed, 15 Dec 2021 07:47:00 +0000 (23:47 -0800)
committerTim Otten <totten@civicrm.org>
Thu, 13 Jan 2022 21:15:00 +0000 (13:15 -0800)
commit88d932658885d5027684eab2bf47802a297ad946
tree88659d5fcfc3e1b7c557017707957c2c5eb58978
parent4c5b744d940c41acb520606ef0943fa69bd4132d
Civi::pipe - Convet from service-registry to negotation-flags

How will the protocol evolve? This changes the planned mechanism that will allow evoluation.

_Previous/Original_: Protocol had a version number.

_Previous/Interm_: Any change to the protocol requires registering a new service.  New
connections must strictly choose between one service XOR another service.

_Now_: Any change to the protocol requires defining a flag.  There is a list
of default flags, but callers may request alternative flags.  The header
line indicates success or failure of these flags.

Comment: Handy characteristics of this design:

* Default info is generally more useful and skimmable.
* Addresses the current trusted/untrusted flag.
* Expands the default info to include (1) CiviCRM version and (2) whether logins are allowed.
* Allows augmenting or replacing jsonrpc-2.0 (if we don't like it).
* The `Civi::pipe()` shell statements remain pithy - even if they require extra flags.
Civi.php
Civi/Core/Container.php
Civi/Pipe/LineSessionTrait.php
Civi/Pipe/PipeSession.php
tests/phpunit/Civi/Pipe/JsonRpcSessionTest.php
tests/phpunit/E2E/Extern/CliRunnerTest.php