daml/libs-scala/scala-utils
Stephen Compall 22d916baed
party-set arguments for JSON API (#11454)
* add actAs, readAs to `meta` for create, exercise, createAndExercise endpoints

* use meta actAs, readAs to control how contract IDs are looked up for exercise

* outdated comments on JwtWritePayload and JwtPayload

* toSet1 operator to clean up some NEL manipulation

* take optional readAs argument for query endpoint

* use readAs for query POST

* check whether readAs is safe in query endpoint

* missed CommandMeta args in tests

* FetchRequest, a domain model to layer on "fetch" endpoint's ContractLocator

- ContractLocator was overloaded as a domain request model *and* a component
  of other domain request models; the addition of new arguments means it can
  no longer exactly meet the former, and adding "readAs" to it would poison it
  for the latter cases.

* take readAs argument from fetch endpoint

* add readAs security check from query to fetch

* move jwt parties functions to util

* testing the party-set/JWT functions

* missing headers

* caught boolean blindness in readAs security checks

* test that meta params are used for commands

* make resolveRefParties do a subset check, too

* Revert "make resolveRefParties do a subset check, too"

This reverts commit 40a66f102c.

* test that the readAs auth check actually applies

* test that command service uses meta readAs, actAs

* note on test coverage

* add changelog

CHANGELOG_BEGIN
- [JSON API] ``actAs`` and ``readAs`` may be specified for create, exercise,
  create-and-exercise, non-WS fetch, and non-WS query.
  See `issue #11454 <https://github.com/digital-asset/daml/pull/11454>`__.
CHANGELOG_END

* no saving mallocs

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* untabify

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* move design comment to comment from function name

- suggested by @cocreature; thanks

* remove unneeded variable

* refactor single-key callers of requestJsonReader

- suggested by @cocreature; thanks

* build error in ce

* diagnose Windows failure

* add missed http-json-testing requirement

* use readers as fetch/query party-set name

- suggested by @cocreature and @realvictorprm, thanks

* extra import

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2021-11-12 02:10:15 +00:00
..
src party-set arguments for JSON API (#11454) 2021-11-12 02:10:15 +00:00
BUILD.bazel detect unsynchronized contract table and retry (#10617) 2021-09-28 20:47:42 +00:00