* add resolveRetroImplements to EnvironmentInterface
* test that resolveRetroImplements does nothing with no data
* resolve retroactive interfaces in Java codegen
* resolve retroactive interfaces in Scala codegen
* resolve retroactive interfaces in json-api
CHANGELOG_BEGIN
CHANGELOG_END
* Add completion offset to cmd submission responses
changelog_begin
- [HTTP-JSON] there is now a new meta field called deduplicationPeriod for cmd submissions with which one can specify the deduplication period. Moreover there also is another new meta field submissionId for the cmd submissions.
- [HTTP-JSON] Calls to endpoints for command submission now include the completion offset
changelog_end
Co-authored-by: Raymond Roestenburg <98821776+ray-roestenburg-da@users.noreply.github.com>
* introduce TemplateChoices to mediate template choice resolution
* if any resolutions fail in EnvironmentInterface, discard the template's resolution
* if any resolutions fail in Interface, discard the remaining unresolved
CHANGELOG_BEGIN
CHANGELOG_END
* make postJsonRequestWithMinimumAuth parse, and make all its callers declarative
* make getRequestWithMinimumAuth parse, and make all its callers declarative
* note about further cleanup
CHANGELOG_BEGIN
CHANGELOG_END
* move fetch, retrieveAll, query to separate module
* move parties endpoints to separate module
* narrow some access as all endpoint functions have moved
CHANGELOG_BEGIN
CHANGELOG_END
* move where ContractId arbitrary instance passes into ValueAddend
* adjust ValueAddend users to deal with moved Arbitrary instance
CHANGELOG_BEGIN
CHANGELOG_END
* Use deriveFormat for ErrorDetailsFormat instead of hand written JsonFormat
changelog_begin
- [HTTP-JSON] The field "@type" was renamed to "type" for encoding the ErrorDetails case
changelog_end
* Use moar types! :)
* Use proper tags, not aliases
* Add optional ledgerApiError details to responses
* Finally get some proper error details
* Cleaning up the code
* Less bad words in the code
* Better deserialization error msg
changelog_begin
- [JSON-API] The response of the json api now includes a field ledgerApiError that contains extended information in the case of ledger errors. See issue https://github.com/digital-asset/daml/issues/9834 for more details.
changelog_end
* Reformat!
* Remove debug logging statements
* also update security evidence file
* more cleanup
* Improve Json decoder & encoder
* Add test for json encoder&decoder
* Add test which ensures that the LedgerApiError field in the response is filled with valid information
* Fix failing failure tests
* replace NoCid with Aux
* xmap on ValueAddend, a way to e.g. let users "pun" on scalars
* nicer party specifications
- suggested by @realvictorprm; thanks
CHANGELOG_BEGIN
CHANGELOG_END
- double the resolveTemplateId interface and use the "contract type" for
exercise-by-id only
- lookup for template ID only
- 400 + error message test
- move query test to also run on PG/oracle
CHANGELOG_BEGIN
CHANGELOG_END
* WIP
* First working version of java codegen daml interface support
* Update language-support/java/codegen/BUILD.bazel
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Fix compile errors
* Simplify code massivly, enjoy less duplication
changelog_begin
- The Java codegen now has basic support for daml interface definitions. Converting a contract id of a template implementing an interface to a contract id of the interface is possible and both executing interface choices is possible on the contract id of the interface and implementing template.
changelog_end
* Rename the test file to reflect it is a test file & enhance the inner test name & extend it further
* Fix test
* Refactor parts of TemplateClass.scala into multiple files
* Format that files!
* Minimize duplication further
* Remove unused comment
* Simplify code
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* Update language-support/java/codegen/src/main/scala/com/digitalasset/daml/lf/codegen/CodeGenRunner.scala
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* Further refactoring and renaming of the TemplateClassSpec to ContractIdClassBuilderSpec
* Fix formatting
* Add interface docs
* Remove unnecessary code generation of the Contract class for interface types
* Use less bool flags and more good function names :)
* Fix build
Co-authored-by: Remy <remy.haemmerle@daml.com>
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
changelog_begin
- [HTTP-JSON] If information about a package is requested that doesn't exist on the ledger you will now get a 404 instead of a 500 as response.
changelog_end
This expands the domain of the exercise endpoint to accept interface IDs
instead of template IDs when exercising by contract ID. The argument is
still [compatibly] called templateId; interface IDs are accepted nowhere
else.
CHANGELOG_BEGIN
- [JSON API] Supports interface choices, including exercise by contract
ID accompanied by an interface ID.
See `issue #13301 <https://github.com/digital-asset/daml/pull/13301>`__.
CHANGELOG_END
This adds the presence of interface names, as well as lists of choices
and their argument/return types for each interface.
It also changes the semantics of DefTemplate and EnvironmentInterface:
each may contain "unresolved choices", which are the choices inherited
from interfaces for each implementing template;
EnvironmentInterface#resolveChoices will copy the full type information
as a concrete choice for each implementing template, which should be
much simpler for codegen and json-api.
A type generator should take account of the astInterfaces as well as
typeDecls in EnvironmentInterface; interfaces aren't included in
typeDecls because where I is an interface only ContractId I is
serializable.
* Ast.DataInterface is empty, just use the interfaces map directly
* port json-api for interface API changes; does not solve #12689
* port Scala codegen for interface API changes; does not add support
* port Java codegen for interface API changes; does not solve #11350
CHANGELOG_BEGIN
CHANGELOG_END
changelog_begin
[Trigger Service] Spurious logging warnings will not be printed when running `daml trigger-service`
[Oauth2 Middleware] Spurious logging warnings will not be printed when running `daml oauth2-middleware`
changelog_end
Removed references to a missing `stderr-appender` in several configuration file.
This removes warnings when running `daml trigger-service` and `daml oauth2-middleware`.
This will also remove those same warnings from several tests (HTTP JSON API and Trigger Service).
Saves about 90 seconds in test wallclock time. Other tests considered
either ran too short to bother splitting, or were Oracle and thus won't
affect the main run at all.
CHANGELOG_BEGIN
CHANGELOG_END
* move ImplicitPreference to scala-utils
- test it
- use it instead of tags for json-api testing
- fix a somewhat nonsensical type therein
* several new tests for the NonEmpty Foldable instances
CHANGELOG_BEGIN
CHANGELOG_END
New instances and collection methods, many of which included
as-is from @andreaslochbihler-da's experiments downstream.
* mk, a version of apply with special inference
* new names for the conversion functions suggested by
@andreaslochbihler-da
* groupBy1, zipWithIndex, reduceLeft, last1, distinct, toVector1
* a derived Semigroup instance
* a more explicit subtyping utility to specify implicit preference than
what we get with shapeless @@
* from method, alias for unapply
* cats functorial, foldable instances in the new nonempty-cats library
* new NonEmpty utilities
CHANGELOG_BEGIN
CHANGELOG_END
Co-authored-by: Andreas Lochbihler <36634420+andreaslochbihler-da@users.noreply.github.com>
* Improve MessageDigest and Mac instance creation to solve lock contention problem [DPP-956]
changelog_begin
Scalability bottleneck in regard to hashing has been fixed in multiple places.
changelog_end
Refactors a bunch of AbstractHttpServiceIntegrationTestFuns and
elements of #12922's JWT function abstractions into a new
HttpFailureUserFixture, using that split to split the
FailureTests as well.
Fixes#13112.
* restore failure test porting from #12922
This reverts b4942defa4.
* move token-relevant utilities to http-json-testing lib
* replace custom actorsystem setup with AkkaBeforeAndAfter
- suggested by @ray-roestenburg-da; thanks
CHANGELOG_BEGIN
CHANGELOG_END
Co-authored-by: Victor Peter Rouven Müller <mueller.vpr@gmail.com>
Use a package instead of object for organization so the namespace
remains open. Note that in Scala 3, the val/type aliases in this diff
can become export statements.
CHANGELOG_BEGIN
CHANGELOG_END
Co-authored-by: Stewart Stewart <stewart.stewart@digitalasset.com>
* Normalize token parsing & remove custom parsing code
changelog_begin
- [HTTP-JSON] custom claim tokens without ledger id are now correctly recognized as such and not as user tokens
changelog_end
* Add test to check that tokens without ledger id work correctly
* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/endpoints/UserManagement.scala
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/EndpointsCompanion.scala
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Remove the overload of jwtForParties & change how the wihtoutNamespace JWT is constructed
* Remove unnecessary code line
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Don't error when user tokens are provided for the perf runner
changelog_begin
changelog_end
* Better token parsing error handling & extract user id to allocate the user if so
* make the code prettier
* Fix & simplify token parsing
* fix formatting of bazel file
* Update ledger-service/http-json-perf/src/main/scala/com/daml/http/perf/Main.scala
Co-authored-by: Raymond Roestenburg <98821776+ray-roestenburg-da@users.noreply.github.com>
* correctly handle the response of createUser & don't throw if no LedgerId was found in the token
* Wrap exceptions in Futures
* Refactor Main.scala of the perf runner completely & remove dependency on user provided JWT's
* Minimize diff
* simplify code further
* Update ledger-service/http-json-perf/src/main/scala/com/daml/http/perf/Main.scala
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Update ledger-service/http-json-perf/src/main/scala/com/daml/http/perf/Main.scala
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Update ledger-service/http-json-perf/src/main/scala/com/daml/http/perf/Main.scala
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Fix build
* Don't pass a jwt to the perf runner anymore everywhere it was used & fix ledger id to be right
* Minimize diff
Co-authored-by: Raymond Roestenburg <98821776+ray-roestenburg-da@users.noreply.github.com>
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* WIP
* First version that compiles (with debug print statements)
* Revert changes on the failure tests
* Make all tests pass with some major cleanup of the new code
* Remove debug prints & outcommented code
* Make decoding / encoding test also compatible with user token tests
changelog_begin
changelog_end
* Minimize diff
* Fix oracle tests
* leave note for followup
* Update ledger-service/http-json/src/itlib/scala/http/AbstractHttpServiceIntegrationTest.scala
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* Fix duplicate calls to the command service while debug logging is enabled
changelog_begin
- [HTTP-JSON] Fixed duplicate calls to the command service while debug logging is enabled.
- [HTTP-JSON] Fixed internal server errors which can occur while debug logging is enabled.
changelog_end
* Cleanup the code a bit, test still failing tho :(
* Finally fix the bug for real now
* Address review comments
* don't cast
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* move user management endpoint functions to separate module
* no changelog
CHANGELOG_BEGIN
CHANGELOG_END
* move create and exercise endpoints to separate module
* fix copyright headers
* mark the helpers package-private
* more privacy modifiers
* import cleanup
* move Forwarded header test to unit tests
* move decodeAndParseUserIdFromToken to UserManagement
* move package endpoints to separate module
Enriches #12766 with a chunked, lazy internal approach to
aggregating pages from the participant server, rather than
aggregating all users directly in memory before returning them.
CHANGELOG_BEGIN
- [JSON API] If ``/v1/users`` fails while retrieving users from the participant,
it will be reported as a warning, with a partial set of users, rather than
failing.
See `issue #12777 <https://github.com/digital-asset/daml/pull/12777>`__.
CHANGELOG_END
* SandboxNextFixture replaced by Sandbox-on-X based SandboxFixture
changelog_begin
changelog_end
* Some fixed tests
* No direct dependencies on //ledger/sandbox:sandbox and //ledger/sandbox:sandbox-scala-tests-lib
* Fix after rebase
* Rename SandboxFixture and add a missing dep
* Generate valid party names if hint is empty
* Smaller maxInboundMessageSize
* Added test for empty display name
* SandboxServer is a ResourceOwner
* Uses execution context passed as an input for resource management
* Fixes flaky FlywayMigrations issue with null Thread.currentThread.currentClassLoader
* SandboxServer simplification returns Port instead of ApiServer
* Dedicated PMAllocateWithoutDisplayName for non-Canton ledgers
* Created since Canton does not return empty display names
* Return all users from `GET /v1/users/`, paginating 1k at a time
The test runs overall for ~30 seconds, mostly due to the time required to
create 20k users.
changelog_begin
[HTTP-JSON API] Previously, a 10k limit was in place on the number of users returned by
`GET /v1/users/`. This limit has been removed and users are retrieved in chunks from the ledger
changelog_end
As of now, this builds the response in-memory, which is likely not what we want to
support long-term.
* Relax test condition due to interference with other test setups