* declare the separate kind of duplication
CHANGELOG_BEGIN
CHANGELOG_END
* move completely independent tests
* move many tests to 'QueryStoreIndependent'
* fix metering-report test to work with user tokens
* rename query-store/auth-dependent tests
- to QueryStoreAndAuthDependentIntegrationTest
- from AbstractHttpServiceIntegrationTestTokenIndependent
* security evidence moved
* introduce ForQuery to overload ActiveContract.fromLedgerApi
* remove booleans from ResolvedQuery.apply
* wrong error string
* use the fact that query is non-empty to hide the Empty case
* we definitely only need a Semigroup, which fixes the law violation
* remove Empty
CHANGELOG_BEGIN
CHANGELOG_END
Co-authored-by: Chun Lok Ling <110462561+chunlokling-da@users.noreply.github.com>
* use Consume.syntax
* added exercise in interface "sub query endpoint" test case. checked template id of archive. it is asserting to be template id but not interface id which is wrong. I will change it back to interface id after all CI passed
* test that the archive events have the interface ID; add the template-ID-to-interface-ID mapping to archive events in websocket result stream
* Add change log
CHANGELOG_BEGIM
CHANGELOG_END
* Add change log
CHANGELOG_BEGIN
CHANGELOG_END
* use JSON converter instead of hand-writing JSON
* factor assertions for created records
* combine value assertions
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* replace several TemplateId with ContractTypeId
* replace several TemplateId with ContractTypeId.Template
* deprecate, even though this misses so many usages
* link to #15098 for followups
CHANGELOG_BEGIN
CHANGELOG_END
* Remove reliance on implict party allocation in the authorization tests of the sandbox-on-x
CHANGELOG_BEGIN
CHANGELOG_END
* Remove the HOCON and cli config parameters
* Remove implicit party allocation from the Submission Service
* Remove support for implicit parties from the bridge
* Fix codegen reliance on implicit party allocation
* Fix daml script tests
* Fix trigger tests
* format security-evidence.md post rebase
* Fix json-api tests
* One more json-api test
* Fix haskell tests
* Corrections post-review
* Cosmetic improvements
* Fix race condition in party allocation handling
* a couple comparison query scenarios with nested position
* same JSON null test, but different
- 'gt string' (scenario 0) fails without this change
- 'gt int' (scenario 1) succeeds regardless of this change
CHANGELOG_BEGIN
- [JSON API with Oracle] Fix some nested queries that were returning no
data. DisableContractPayloadIndexing must be set to true to take
advantage of this fix.
CHANGELOG_END
* point to #14844 and #15040 for some TODOs
* duplicate the Oracle tests, disable large literals when indexing is on
* split test file for parallelization
CHANGELOG_BEGIN
CHANGELOG_END
* ensure Status is redundant for every parseResponse user
* make parseResponse test and discard the HTTP status
* use resultContractId more
CHANGELOG_BEGIN
CHANGELOG_END
Support /v1/query by interfaceID or a non-empty set of template ID's, fallback to in-memory for an interfaceId query.
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
CHANGELOG_BEGIN
- [JSON API] /v1/query with a non-empty set of template ID’s or one interface ID
CHANGELOG_END
* fixes#14821, added test case to ensure retroactive implements works in json-api
CHANGELOG_BEGIN
CHANGELOG_END
* address Stephen's comment
CHANGELOG_BEGIN
CHANGELOG_END
* new names in daml-script/runner
* new names in json-api
* new names in Scala bindings/codegen
* new names in Java bindings/codegen
* new names in daml-lf interpreter tests
* more new names in daml-script tests
* new names in navigator backend
* deprecate all iface symbols and old method names
CHANGELOG_BEGIN
- [Scala API] ``com.daml.lf.iface`` has been deprecated, as discussed
further in
`issue #14783 <https://github.com/digital-asset/daml/pull/14783>`__.
Use the deprecation warnings as guidance to the new names.
CHANGELOG_END
* prefix cases in OrderingSpec
- suggested by @remyhaemmerle-da; thanks
* percolate Resolved/Definite status
* propagate resolution through the queries, DB updates, and domain resolutions
* include Definite in the definition of Resolved, everywhere
CHANGELOG_BEGIN
CHANGELOG_END
* use new names in json-api
* use new names in java codegen
* use new names in Scala codegen
* use new names in TypedValueGenerators
CHANGELOG_BEGIN
CHANGELOG_END
* move interface directory to api-type-signature; change bazel target; move scala files
* rename iface package to typesig; rename EnvironmentInterface to EnvironmentSignature
* rename Interface to PackageSignature
* rename fromReaderInterfaces to fromPackageSignatures
* rename InterfaceReader to SignatureReader
* rename InterfaceReader to SignatureReader in deprecation note
* rename readInterface to readPackageSignature
* rename InterfaceReaderError to Error
* rename InterfaceReaderMain to SignatureReaderMain
* rename InterfaceType to PackageSignature.TypeDecl
* rename astInterfaces to interfaces
* rename astInterfaces to interfaces in PackageSignature
* rename findAstInterface to findInterface
* rename a couple arguments
CHANGELOG_BEGIN
- [Scala API] The "quasi-public" API in ``com.daml.lf.iface`` has moved
to the new ``com.daml.lf.typesig`` package, with many accompanying
name changes as documented in `issue #13669
<https://github.com/digital-asset/daml/issues/13669>`__.
Daml 2.5.0 or later will remove the old names, and also rename the
Maven artifact from ``daml-lf-interface`` to
``daml-lf-api-type-signature``. We recommend that users of this API
use the deprecation guidance in 2.4.0 to port their applications
before this happens.
CHANGELOG_END
* Added logging for time elapsed of ledger client call
CHANGELOG_BEGIN
CHANGELOG_END
fixes#14673
* rename logging def
* ADDED TODO
* ADDED TODO
* pass in boolean for determining if it should log based on the log level
* address Ray's comment. Wrong name Ledge -? Ledger
* make isEnable public and use it to determin whether it is debug level
* refactoring. put everything in a inner object LedgerClientRequestTimeLogger
* remove useless line
* address Ray's comment
* address Ray's comment
* log the time used for source as well
* address Stephen's address
* Extract qualifyLocally in LFConversion
* Update ghc rev
* Add parent type argument to interface instance desugaring types
* Check interface instance parent in LFConversion
* Convert interface instances in interface declarations
* Update daml-test-files to use 'interface instance' syntax
* Update other tests to use 'interface instance' syntax
* Update interface reference docs to use 'interface instance' syntax
* Update other files to use 'interface instance' syntax
* Add todo in DA.Daml.LF.Ast.Pretty
* Add daml-test-files for retroactive interface instances
changelog_begin
changelog_end
* Add DA_Internal_Interface to convertTypeDef exclusion check
* Move desugared types/values for interface views into DA.Internal.Desugar
* Convert viewtype and view method declarations
* Typecheck view types and view declarations
* Add unit viewtypes to InterfaceChoiceCollision tests
* Add unit viewtypes to more compiler/damlc tests
* Modify empty interfaces/implements to have viewtypes/views
* Add unit viewtypes to remaining Interface tests
* Test for error thrown when viewtype not specified
* Fix daml-lf/ interface tests to use new syntax / unit views
* Add placeholder view of type Unit to TestInterfaces
CHANGELOG_BEGIN
CHANGELOG_END
* Fix typescript interface tests with unit viewtype
* Add unit viewtype to Java & Scala codegen
* Add unit viewtype to triggers tests interface
* Add unit viewtypes to ledger/test-common
* Add unit viewtypes to ledger-service/http-json
* Fix some damlc tests
* Use viewtype syntax in InterfaceViewNonSerializable test
* Remove HasInferfaceView instances in convertBind
* Add unit view to QualifiedInterface.daml test
* Generate HasInterfaceView instances in DataDependencies
* Add unit viewtypes and views to compiler/damlc/tests
* Document reconstruction of HasInterfaceView
* Move desugared types/values for interface views into DA.Internal.Desugar
* Add desugarable function view w/ EViewInterface desugaring
* Remove templateName and viewtype from generated EViewInterface
* Update desugared-daml
* Proof of concept: use _view -> EViewInterface prim via HasInterfaceView
* Move view, HasInterfaceView to DA.Internal.Interface
* Update desugared-daml tests
* Stop removing and re-generating HasInterfaceView instances
* Do not generate docs for generated "_view_" methods
* Report errors with interface TypeConNames prettily
* Fix InterfaceViewNotSpecified @ERROR to reflect new error text
* Don't import magic `view` method from Prelude to avoid name clash
* Update shake interface goto definition test locations
* Temp disable view spec tests, will re-implement views in speedy
* Add unit viewtype to Java code snippet docs
* Update Interface syntax docs for views
* Add unit viewtype to Transferrable.daml
* Add back "empty" interface implementation to interfaces.rst
* Re-enable view tests by having _view methods on InterfaceViews.daml file
* Remove deprecated commented-out view desugaring code
CHANGELOG_BEGIN
- [JSON API] For exercise endpoints, when multiple choices with the same
name are defined, the one directly defined on the ``templateId``,
which may be a template or interface ID, will be selected; if a
template ID is specified that only inherits the choices with the same
name, the new ``choiceInterfaceId`` option must be specified to select
the source of the choice.
CHANGELOG_END
* 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
* Increase public key cache size for Jwks to decrease the risk of DDOS attack.
CHANGELOG_BEGIN
CHANGELOG_END
* Update ledger-service/jwt/src/main/scala/com/digitalasset/jwt/JwksVerifier.scala
Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
* 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
* Update kvutils Config and SandboxConfig
* Remove `eager-package-loading` and `scenario` from SandboxConfig
* Add `profile-dir` and `stackTraces` to kvutils Config
* Configurable authService in kvutils
changelog_begin
changelog_end
* Addressed Samir's review comments
* Add back Maximum supported deduplication duration enforcement of 1 hour
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
* Use fetchAndPersistBracket instead of fetchAndPersist
* add changelog
CHANGELOG_BEGIN
- [JSON API] Under rare conditions, a POST-style multi-template query backed by
database could have different template IDs appear to be queried at different
ledger times, if updated concurrently. This conditions is now checked and
accounted for. See `issue #12672
<https://github.com/digital-asset/daml/pull/12672>`__.
CHANGELOG_END
* add a searchQuery metric event for each fetch trial in sync search
* revert the contract ID and contract key fetches, and explain why
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* upgrade scalapb/netty/grpc/protobuf in proven combination
CHANGELOG_BEGIN
Upgrade scalapb, netty, grpc, protobuf and guava versions
CHANGELOG_END
* bazel reformat
* match grpc version in deps.bzl
* upgrade akka
* keep grpc version to 1.43 that is used in latest nixpkgs-unstable
* rebase and regen
* update SHA for scalapb tarball
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
For consistency with other APIs in this area.
Note that some pre-existing APIs use `List` instead of `Seq`,
but at least those use the same underlying implementation.
CHANGELOG_BEGIN
CHANGELOG_END
* Upgrade to Scala 2.13.8
changelog_begin
changelog_end
* Update hash for scala in nixpkgs
* update more hashes for scala upgrade
* Fix most warnings etc.
* Fix remaining errors etc.
* Fix formatting
* Resolve last errors hopefully
* Fix ledger api common build file
* Combine imports & revert accidental change that broke the CI run
* Rename exporting vals to scriptExport & minimize diff
* Remove more wrong changes
* moved warning around
* Return an empty object for deleteUser & createUser
* Make the field rights for creating a user optional & fix the tests
changelog_begin
- [HTTP-JSON] Adjusted the response for the createUser & deleteUser endpoint to an empty object instead of "true". This was done to allow possible future extensions to the return type without applying breaking changes.
- [HTTP-JSON] Made the field rights optional for the request body of the createUser endpoint. Now it is possible to create a user with just the userId (i.e. { "userId": "nice.user" }).
changelog_end
* Fixes OracleAround so it creates unique oracle users
* Fixes rouge connection pool in JdbcLedgerDaoTransactionsSpec
* Fixes cleanup in OracleAroundAll
* Introduces lockIdSeed for test frameworks
* Adapts usage
changelog_begin
changelog_end
* Add an endpoint used for querying user rights of a specific user
changelog_begin
- [HTTP-JSON] Added endpoint /user/rights that if called with POST will return user rights of the user specified via the payload
changelog_end
* Add grant&revoke user rights endpoint
changelog_begin
- [HTTP-JSON] Added endpoints user/rights/grant & user/rights/revoke which allow granting & revoking user rights for a specific user
changelog_end
* Switch to using the UserRights list instead of a case class with fields
* fix type annotation
* Rename allocateUser func to createUser to comform with the endpoint path
* Response format simplification & cleanup
* Add one last test that ensure that the JSON format of UserRight doesn't change without us noticing
* Apply suggestions from code review
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* Remove unnecessary conversations and also just use unwrap for tagged strings
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
Since Scala 2.13.2, Scala introduced built-in support to
manage warnings in a more granular fashion, thus making
the silencer plugin we are currently using no longer
strictly useful. Removing compiler plugins also removes
friction from migrating to Scala 3 in the future. As a
cherry on top, the built-in warning configuration also
allows to check whether a `@nowarn` actually does
anything, allowing us to proactively remove unused
warnings should the need arise.
[Here][1] is s a blog post by the Scala team about it.
Warnings have been either solved or preserved if useful,
trying to minimize the scope (keeping it at the single
expression scope if possible). In particular, all
remaining usages of the Scala Collection API compatibility
module have been removed.
Using the silencer plugin also apparently hid a few
remaining usages of compatibility libraries that were used
as part of the transition from Scala 2.12 to Scala 2.13
that are no longer needed. Removing those warnings
highlighted those.
changelog_begin
changelog_end
[1]: https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html
* Drop support for no seeding in sandbox-classic
Sandbox classic is going away in SDK 2.0 and so is support for v0
contract ids which is the only thing no seeding was used for.
This has been cleared by product.
I’ll drop v0 contract ids completely in #12464 as a follow-up. Just
wanted to factor this out for ease of review.
changelog_begin
changelog_end
* .
* .
changelog_begin
- [HTTP-JSON] Removed the /user/delete GET endpoint. Please use the /user/delete POST endpoint with the own user ID if you need to delete the user associated with the current token
changelog_end
* Split channel configuration from LedgerClientConfiguration
Fixes#12391
The channel configuration now has to be provided separately from the
configuration specific to the ledger client. In this way we avoid
situations where the builder is provided with some configuration
that gets overridden.
changelog_begin
[Scala bindings] The channel configuration has been split from the
LedgerClientConfiguration class. Provide the gRPC channel specific
configuration separately or use a builder. The channel configuration
no longer overrides the builder.
changelog_end
* Fix compilation issues in //ledger-service/...
changelog_begin
- [HTTP-JSON] Added endpoints:
- /user/delete that if called with GET will delete the current user & with POST will delete the user specified via the payload
- /user that if called with POST will now return user info about the user specified via the payload
changelog_end
* Add list users endpoint
changelog_begin
- [HTTP-JSON] Added an endpoint /users which returns the available users on the ledger.
changelog_end
* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/domain.scala
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* Change heartBeatPer to more intuitive naming of heartbeatPeriod
CHANGELOG_BEGIN
CHANGELOG_END
* Initial changes to add HOCON config for json_api
CHANGELOG_BEGIN
CHANGELOG_END
* avoid IllegalArgumentException noise
* use named arguments in big config conversion
* Changes include
- tests for a full http-json-api config file
- logging config and non-repudiation config is still specified via cli args.
- config readers for MetricsReporter
* Add defaults to WebsocketConfig case class to allow partially specifying fields on typeconf file
* changes to the JwtVerifierBase config reader and equivalent test
* message already describes the value
* replace manual succeed/fails with scalatest combinators
* use qualified imports for WebsocketConfig defaults
* add back autodeleted empty lines
* collapse two lists of token verifiers into one
* add new line to config files
* rename dbStartupMode to startMode to keep consistent with cli option and for easy documentation
* Changes to daml docs to specify ways to run JSON-API by supplying a HOCON config file.
CHANGELOG_BEGIN
JSON-API can now be started supplying a HOCON application config file using the `--config` option.
All CLI flags except `logging` and `non-repudiation` one's are now deprecated and will be cleaned up in some future releases.
CHANGELOG_END
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* WIP
* Adjust the format of the CreateUserRequest to be a nicer payload & add a simple test
changelog_begin
- [HTTP-JSON] An endpoint user/create has been added to be able to create a user via the json api
changelog_end
* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/Endpoints.scala
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* Changes to add a pureconfig-util module with some shared config readers, and cleanup some code from oauth2-middleware hocon
CHANGELOG_BEGIN
CHANGELOG_END
* Update triggers/service/auth/src/test/scala/com/daml/auth/middleware/oauth2/CliSpec.scala
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
Changelog entry and commit msg differ here because the bug described in
the changelog was already fixed by adding the user management support
because it caused for the affected endpoints that it will be interpret as
user token while only fetching the ledger id (without actually checking
that it is a user token).
changelog_begin
- [HTTP-JSON] Fixed a bug that caused jwt's without the daml namespace to be rejected for some endpoints (https://github.com/digital-asset/daml/issues/12215)
changelog_end
* Changes to add the option of starting trigger service with typeconf/HOCON config
CHANGELOG_BEGIN
CHANGELOG_END
* add tests for authorization config and fail on both config file and cli args
* refactor and cleanup config loading and tests
* Changes based on code review comments
* Daml doc changes and making sure that we have defaults for most fields to mirror cli args
CHANGELOG_BEGIN
Trigger Service can now be configured with HOCON config file.
- If a config file is provided we will choose to start the service using that, else we will fallback to cli arguments.
- If both config file and cli args are provided we will error out.
CHANGELOG_END
* addressing some more code review comments
* use scalatest inside properly
* Expose user management service over the HTTP-JSON API
Fixes#12078
Add user & user/rights endpoint which provide the current user id, primary party and the latter the user rights
Fix new endpoints for ledgers without auth and add test coverage for these
changelog_begin
- [HTTP-JSON] Added GET endpoint:
- /user which returns the current user id & primary party
- /user/rights which returns the user rights of the current user
changelog_end
* Update ledger-service/http-json/src/it/scala/http/HttpServiceIntegrationTestUserManagement.scala
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/Endpoints.scala
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* Apply review comments
* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/domain.scala
Co-authored-by: akshayshirahatti-da <86774832+akshayshirahatti-da@users.noreply.github.com>
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
Co-authored-by: akshayshirahatti-da <86774832+akshayshirahatti-da@users.noreply.github.com>
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.
I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.
CHANGELOG_BEGIN
CHANGELOG_END
* WIP
* Remove the dummy implementation and replace it with an actual working implementation
* Make it compile!
* Add working tests for the user management support in the json api
CHANGELOG_BEGIN
- [JSON-API] Added basic support for the new user management feature of the ledger such that user tokens are now accepted instead of the legacy tokens
CHANGELOG_END
* Simplify the create iou test case and adjust the test case name to be correct
* Add additional test that covers that the overwrite of actAs&readAs still works via the meta object
* Make it work with unauthenticated ledgers too
* Fix compile error & wrong behaviour & add test coverage for non auth ledgers
* Clean up the diff
* Address 66312e9940 (r770782884)
* Address 66312e9940 (r770750653)
* Addressing 66312e9940 (r770751958)
* Address 66312e9940 (r770736671)
* Address 66312e9940 (r770734395) and 66312e9940 (r770783237)
Co-authored-by: Stefano Baghino <stefano.baghino@digitalasset.com>
CHANGELOG_BEGIN
- [User Management]: add support for managing participant node users and authenticating
requests as these users using standard JWT tokens.
CHANGELOG_END
Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com>
Co-authored-by: Adriaan Moors <90182053+adriaanm-da@users.noreply.github.com>
* replace pour with a new, total, uncurried apply to create NonEmpty's
* use the new NonEmpty apply in place of pour
* non-empty cons, snoc, head, tail
* add map and flatMap for NonEmpty iterables
* remove scala-collection-compat from scalautils
* tests for map, flatMap, cons
* no changelog
CHANGELOG_BEGIN
CHANGELOG_END
* missing 'extends AnyVal'
* colliding map and flatMap for Maps
* Revert "colliding map and flatMap for Maps"
* more specific Map and Set return types
* type tests for map operations
* add 'to' conversions
* Add query store metrics
CHANGELOG_BEGIN
- [JSON-API] added metrics to separately track:
- time taken to update query-store ACS (from ledger)
- lookup times for the query store
CHANGELOG_END
* Apply review comment
* [Self-service error codes] Enabled by default
* Flag changed to `use-pre-1.18-error-codes` (disabled by default)
CHANGELOG_BEGIN
[Ledger API Specification] The Ledger API returns enriched error codes (see https://docs.daml.com/error-codes/self-service/index.html)
For backwards-compatibility, a new API flag `--use-pre-1.18-error-codes` is introduced for preserving the legacy behavior for
clients that want to migrate incrementally to the changed gRPC status code responses and error details format.
CHANGELOG_END
* Adapted HttpServiceIntegrationTest
* Renamed `Feature Flag` to `Configuration` in docs
* Fix Daml Script tests
changelog_begin
changelog_end
* Fix Repl functests
changelog_begin
changelog_end
* Fix haskell binding tests
changelog_begin
changelog_end
* Fix CommandClientIT test
* Fixed Sandbox and CommandServiceBackpressureIT tests
Please enter the commit message for your changes. Lines starting
* Adapt //compiler/damlc/tests:repl-functests again
* Fix more tests and address Miklos' comments
* Flag name changed to `grpc-status-codes-compatibility-mode`
* Remove useless flags sandbox-classic
* Sandbox-classic tests fix for ContractKeysIT and ExceptionsIT
* Created 2 deprecated test suites that have the more generic assertions as returned
by the deprecated in-memory backend
* More fixes for CommandServiceIT
* Fixes compilation issue with the deprecated exceptionsIT class for Sandbox-classic in-memory
* Compatibility mode for old test tools
* Change flag name to `use-pre-1.18-error-codes`
* Apply suggestions from code review
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
* Update to Java 11
changelog_begin
changelog_end
* Fix RoundingMode deprecation warnings
* Fix dep-ann warning
* Integer constructor
* JavaX annotation dependency
* javax.xml.bind was removed in Java 11
Using Guava as a replacement, since it is already a project dependency.
* JDK 11 no longer has a separate JRE tree
* Remove unused jdk_nix import
* remove now redundant jdk11_nix
* Java 8 --> 9 increased Instant.now() precision
See https://bugs.openjdk.java.net/browse/JDK-8068730
The precision of `Instant.now()` increased between Java 8 and Java 9.
On Linux and MacOS this doesn't seem to be a problem, as the precision
still seems to be at micro seconds. However, on Windows this now causes
errors of the following form:
```
java.lang.IllegalArgumentException: Conversion of Instant
2021-11-05T13:58:56.726875100Z to microsecond granularity would result
in loss of precision.
```
Suggesting that it now offers sub-microsecond precision.
`TimestampConversion.instantToMicros` had a check to fail if the
conversion lead to a loss of precision. In the specific failing test
case this is not a concern, so this adds a `roundInstantToMicros`
variant that avoids this kind of error.
* TMP round timestamps
* Revert "TMP round timestamps"
This reverts commit af8e261278.
* Skip versions before 1.6.0 in migration tests
changelog_begin
changelog_end
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
I’ve kept the infrastructure for versioned_scala_deps around because
I’m optimistic and hope that eventually we’ll do another Scala upgrade.
changelog_begin
changelog_end
* Changes to port JMH benchmark tests for contract dao to be be run against postgres db.
CHANGELOG_BEGIN
CHANGELOG_END
* add missing libs-scala/ports depenency to ledger-on-sql test suite
* changes based on codereview comments
* make http-json:integration-tests into test suites
* make http-json-oracle:integration-tests into test suite
* no changelog
CHANGELOG_BEGIN
CHANGELOG_END
* remove commented libraries
* Changes to renable ws multiplexing
CHANGELOG_BEGIN
[TS-BINDINGS] Re-enable ws multiplexing for stream queries after resolving the reconnect connection close bug associated with ws state and liveness.
CHANGELOG_END
* websocket is passed as an argument to the onMessage handler
* consistently use 'manager' reference instead of 'this' in the handleQueries change method
* 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>
* Changes to make certain hikari cp connection pool properties configurable via jdbc conf string
CHANGELOG_BEGIN
[JSON-API] Make certain Hikari cp connection pool properties configurable via jdbc conf string, the properties are listed below
poolSize -- specifies the max pool size for the database connection pool
minIdle -- specifies the min idle connections for database connection pool
connectionTimeout -- long value, specifies the connection timeout for database connection pool
idleTimeout -- long value, specifies the idle timeout for the database connection pool
CHANGELOG_END
* some missed changes for DbTriggerDao
* remove defaults for poolSize on JdbcConfig
* add constants for test defaults
* move contract insertion/deletion batching to separate function
* limit contract insertion/deletion batching on backpressure
* add changelog
CHANGELOG_BEGIN
- [JSON API] While updating the contract table for a query, if the DB appears to be slow,
JSON API will slow down its own inserts and deletes at some point rather than construct
ever-larger INSERT and DELETE batch commands.
See `issue #11589 <https://github.com/digital-asset/daml/pull/11589>`__.
CHANGELOG_END
* Changes to migrate http-perf-test back to sandbox with more parallelization for single user scenarios.
Increased parallelization is due to the architectural changes in sandbox where it uses
a tick every 100 millis to trigger stuff/data to be available on the read side
CHANGELOG_BEGIN
CHANGELOG_END
* Parallelization fixes for scenarios ExerciseCommand and SyncQueryNewAcs scenarios
* refactor sequential scenario run, make query part of SyncQueryVariableAcs run with single user
* add PartySet alias for db-backend
* add PartySet alias for fetch-contracts
* add PartySet alias for http-json
* deprecate old apply
* quick builder for NonEmpty collections
* replace PartySet in db-backend
* replace PartySet in fetch-contracts
* lar.Party is also domain.Party
* add incl1 operator
* replace PartySet in http-json
* port tests
* into with Scala 2.12 needs collection-compat
* no changelog
CHANGELOG_BEGIN
CHANGELOG_END
* simplify a couple functions that don't need so much data transformation now
* clean up some OneAnds and HKTs
* deal with Scala 2.12 without having warning suppression
* better, more obscure choice for Scala 2.12
* Changes to ensure matchedQueries are returned correctly when queries contain a mix of offsets and no offsets.
CHANGELOG_BEGIN
[JSON-API] fixes a bug related to the matchedQueries value returned for websocket multiqueries,
this only happens for patterns where the multiqueries contain a mixture of queries with and without
offsets.
CHANGELOG_END
* changes based on code review comments
* clean up some imports
* test case trying to find deadlock situation
* add deadlocks to causes of ContractsFetch retry for Oracle
* Revert "test case trying to find deadlock situation"
This reverts commit 9b19046b18.
* no changelog
CHANGELOG_BEGIN
CHANGELOG_END
* trying to reliably reproduce the template ID constraint error
* tentative fix for template ID constraint error
* sequential simulation
* successfully reproduce the error pre-4633c3137a
- Batch entry 0
INSERT INTO some_fancy_prefix_contract
VALUES ('foo', 1, 'null'::jsonb, NULL, '{}'::jsonb, ?, ?, '')
ON CONFLICT (contract_id) DO NOTHING
was aborted: ERROR: insert or update on table "some_fancy_prefix_contract" violates foreign key constraint "some_fancy_prefix_contract_tpid_fkey"
Detail: Key (tpid)=(1) is not present in table "some_fancy_prefix_template_id".
* also reproduced the error pre-4633c3137a on Oracle
- ORA-02291: integrity constraint (UNA3GOHUV7YMSKT0MQXJKLKD9HKKAZ.SYS_C007859)
violated - parent key not found
* add changelog
CHANGELOG_BEGIN
- [JSON API] Fixed a rare error that manifested as
‘violates foreign key constraint "contract_tpid_fkey"
Detail: Key (tpid)=(...) is not present in table’
when attempting to run queries and goes away on JSON API restart.
See `issue #11330 <https://github.com/digital-asset/daml/pull/11330>`__.
CHANGELOG_END
* clean up some now-unneeded printlns
* a model for trapping client errors in Scala bindings shim and reporting correctly
* clean up some nesting with an alias
* filter out client-side command service errors
* fix flattening error propagation of CommandService errors in endpoints
* remove todo
* Daml evaluation triggers INVALID_ARGUMENT; handle this for creates/exercises
* clean up lookupResult
* remove stripLeft utility; it is unused
* proper error propagation for /parties endpoint
* map grpc status codes to HTTP error codes
* add a case to pass-through gRPC errors in Endpoints errors
* handle gRPC status in all explicit top-level catches
* pass through gRPC errors in CommandService as well
* treat a gRPC status anywhere in the causal chain as indicating participant-server error
* propagate ContractsService errors without assuming they will always be ServerErrors
* filter ServerErrors' contents when rendering errorful streams
* log errors from websocket output instead of rendering full messages
* hide message in ServerError case
* remove Aborted
* transfer with bad contract ID now returns 409
* mention new error codes
* add changelog
CHANGELOG_BEGIN
- [JSON API] Several kinds of gRPC server errors are now reported with
associated HTTP statuses; for example, a Daml-LF interpreter error now
returns a 400 instead of a 500, and an exercise on an archived contract
returns a 409 Conflict instead of a 500. Errors internal to JSON API
(e.g. internal assertion failures) are no longer detailed in the HTTP
response; their details are only logged.
See `issue #11184 <https://github.com/digital-asset/daml/pull/11184>`__.
CHANGELOG_END
* remove unused Show and liftErr utility
* adapt daml-script to new error codes
* adapt typescript tests to new error codes
* adapt json-api failure tests to new error codes
* Moved ErrorCodesVersionSwitcher to //ledger/error
CHANGELOG_BEGIN
CHANGELOG_END
* Rename ErrorCodeLoggingContext to ContextualizedErrorLogger
* Refactored ErrorFactories
* All error factories use ContextualizedErrorLogger for being able to dispatch self-service error codes.
* The ContextualizedErrorLogger is passed down from the dispatching Ledger API services.
* ErrorFactoriesSpec asserts both legacy (V1) and self-service error codes (V2).
* Adapted ApiSubmissionService
* Addressed Marcin's review comments