Commit Graph

28 Commits

Author SHA1 Message Date
Moritz Kiefer
4aca199bbd
Upgrade to Scala 2.13.5 (#9528)
changelog_begin
changelog_end
2021-04-29 13:05:57 +00:00
Moritz Kiefer
f0f8027a47
Set supported jdbc driver names at compile time (#9489)
* Set supported jdbc driver names at compile time

This is mainly to unblock the work on Oracle support in the Ledger API
but I think it’s a sensible thing in general. For the Ledger API,
moving the dependency to the top-level is apparently rather
tricky. Because the SDK bundles everything into a single megajar,
Sandbox depending on the oracle library does also result in the JSON
API and the trigger service will also have the oracle library in scope
and will support Oracle in CE which they should not.

This PR simply hardcodes the list of supported drivers to address
that. Not pretty but does the job.

changelog_begin
changelog_end

* format

* Address review comments

changelog_begin
changelog_end
2021-04-26 09:19:31 +02:00
Stefano Baghino
cbd76c3465
Publish non-repudiation-core to Artifactory as well (#9305)
changelog_begin
changelog_end
2021-03-31 11:23:24 +00:00
Stefano Baghino
4f0c72b0d8
Publish non-repudiation client libraries to Artifactory (#9282)
* Publish non-repudiation client libraries to Artifactory

changelog_begin
changelog_end

Closes #9097

* Address https://github.com/digital-asset/daml/pull/9282#discussion_r603875118
2021-03-30 12:18:07 +02:00
Stefano Baghino
63623dc9a4
Refactor TableSpec (#9088)
changelog_begin
changelog_end
2021-03-11 13:27:30 +00:00
Stefano Baghino
0e4af7418d
Add runner for non-repudiation (#9076)
* Add runner for non-repudiation

Closes #8633

changelog_begin
changelog_end

* Fix existing tests

* Add test for non-repudiation-app option parser

* Remove unnecessary dependencies from non-repudiation testing

* Fix Scala 2.13 build errors

* Fix help message for --api-address and --api-port
2021-03-11 10:57:50 +01:00
Stefano Baghino
f2b9f118cf
Check that only the command signed payload goes through (#9053)
Left over from https://github.com/digital-asset/daml/pull/9036

Addresses https://github.com/digital-asset/daml/pull/9036#pullrequestreview-606492151

changelog_begin
changelog_end
2021-03-08 21:34:10 +01:00
Stefano Baghino
1bec2116ba
Add tests for client bindings (#9036)
* Add tests for client bindings

changelog_begin
changelog_end

Closes #8636

* Address https://github.com/digital-asset/daml/pull/9036#discussion_r588332093
2021-03-08 16:32:23 +00:00
Stefano Baghino
45b33757b2
Introduce a helper to limit signing to commands (#9050)
This allows the signing interceptor to be generic for now (which
is useful to test), while allowing the users to use a simple
static method to only sign commands directed to the command and
command submittion services.

This is intended to address https://github.com/digital-asset/daml/pull/9036#discussion_r588332093

https://github.com/digital-asset/daml/pull/9036 should be rebased
on the main branch after this has been merged.

changelog_begin
changelog_end
2021-03-08 16:26:02 +01:00
Stefano Baghino
ae110361f0
Add more shared infrastructure for non-repudiation testing (#9035)
More dummy participant components, shared across the non-repudiation sub-tree.

These will also be used in client bindings tests.

changelog_begin
changelog_end
2021-03-05 14:48:03 +01:00
Stefano Baghino
d347934db3
Make non-repudiation PostgreSQL back-end certificate adding idempotent (#9024)
Closes #9021

changelog_begin
changelog_end
2021-03-04 13:26:39 +01:00
Stefano Baghino
eaf7fb6f63
Add non-repudiation API (#8982)
* Add non-repudiation API

The Web API for the non-repudiation proxy allows to retrieve the signed
payload for a given command, add a new certificate or query for an
existing one.

Closes #8658

changelog_begin
changelog_end

* Fix Scala 2.13 compilation error

* Test error conditions

* Add tests for errors and logging

* Fix Scala 2.13 compilation error

* Address https://github.com/digital-asset/daml/pull/8982#discussion_r585641768

* Address https://github.com/digital-asset/daml/pull/8982#discussion_r585674885

* Address https://github.com/digital-asset/daml/pull/8982#discussion_r585668733
2021-03-04 11:02:25 +00:00
Stefano Baghino
0b3758eda0
Move non-repudiation in-memory backend to testing module (#8981)
This will allow to share it with the non-repudiation API tests.

changelog_begin
changelog_end
2021-03-01 18:52:51 +01:00
Stefano Baghino
fe5dd5cd72
Fix issue in retrieving signed payloads from PostgreSQL (#8941)
Closes #8935

Also adds tests for it and factors out functions shared across tests and benchmarks.

changelog_begin
changelog_end
2021-02-25 10:06:50 +01:00
Stefano Baghino
ab86d3fe06
Add benchmarks for non-repudiation (#8916)
* Add benchmarks for non-repudiation

Closes #8635

changelog_begin
changelog_end

* Fix issue for Scala 2.13

* Address https://github.com/digital-asset/daml/pull/8916#discussion_r581257540

* Address https://github.com/digital-asset/daml/pull/8916#discussion_r581756830

* Address https://github.com/digital-asset/daml/pull/8916#discussion_r581766829

* Address https://github.com/digital-asset/daml/pull/8916#discussion_r581772257
2021-02-24 17:04:34 +01:00
Stefano Baghino
0191029d49
Factor out library to manage a transactor from CNR conformance tests (#8917)
changelog_begin
changelog_end
2021-02-23 16:25:26 +01:00
Remy
d92f2c7003
Ledger: refactor bazel packaging of tedger test tool (#8894)
improve previous generalization from #8695

- use lf version instead keyword (like 'stable', 'latest', 'dev') to
  tag actual target.  This will allow two keywords to map to the same
  versions without doing twice the compilation/test work.

- use alias to map keywords tag target to versioned tag target.

- move package manage dar to test_commong.

CHANGELOG_BEGIN
CHANGELOG_END
2021-02-22 11:41:19 +01:00
Moritz Kiefer
182eb825c8
Port Ledger API Test Tool to Scala 2.13 (#8875)
* Port Ledger API Test Tool to Scala 2.13

And with that we’re finally at //... building on Scala 2.13.

changelog_begin
changelog_end

* Fix build on 2.12

changelog_begin
changelog_end

* Fix kvutils export on 2.13

changelog_begin
changelog_end
2021-02-17 12:34:25 +01:00
Moritz Kiefer
f02b62a5e8
Port non-repudiation middleware to Scala 2.13 (#8853)
Tests are still missing and blocked on #8821.

The main change here is the switch from `ArraySeq[Byte]` to
`ArraySeq.ofByte`. `ArraySeq` allows for boxed and unboxed
representaitons. That means that `ArraySeq[Byte]unsafeArray` does not always return
an Array[Byte] (boxed version would be Array[AnyRef]).

Apparently collection-compat has taken the yolo approach and pretends
it can give you an Array[Byte] anyway 🤷 Scala 2.13 on the other
hand, does things properly in this regard which means the code relying
on `unsafeArray` fails to compile.

`ArraySeq.ofByte` is the specialized unboxed version where none of
this is an issue on both 2.13 and 2.12.

changelog_begin
changelog_end
2021-02-16 08:30:34 +01:00
Stefano Baghino
a2d87b9396
Add first metrics to non-repudiation proxy (#8766)
* Add first metrics to non-repudiation proxy

changelog_begin
changelog_end

Contributes to https://github.com/digital-asset/daml/issues/8635

Add a few key metrics for the non-repudiation proxy, with more to follow,
in particular keeping track of the performance overhead associated with
accessing the underlying database.

All metrics can be seen in com.daml.nonrepudiation.Metrics

Running the conformance tests successfully shows a summary of those
metrics with the expected period (five seconds).

* Address https://github.com/digital-asset/daml/pull/8766#discussion_r575044128
2021-02-15 13:02:35 +00:00
Samir Talwar
e2f5aa1b07
ledger-api-test-tool: Increase the dedup time in CommandDeduplicationIT. (#8765)
The deduplication time was hard-coded to 3 seconds, which can be too
short for some ledgers; the command may have expired by the time it gets
to the commit stage.

In order to avoid spurious errors, this multiplies the deduplication
time by the timeout scale factor, allowing the ledger operator to
control the deduplication timeouts in the same way as all test timeouts.

CHANGELOG_BEGIN
- [Ledger API Test Tool] The CommandDeduplicationIT now sets the
  deduplication timeout on commands using the parameter passed to
  `--timeout-scale-factor`, allowing it to run on ledger configurations
  that require more than 3 seconds to commit a submission.
CHANGELOG_END
2021-02-05 19:24:18 +00:00
Stefano Baghino
491a1b29f4
Non-repudiation: add persistent, SQL-backed signed commands repo (#8723)
* Non-repudiation: add persistent, SQL-backed signed commands repo

Closes https://github.com/digital-asset/daml/issues/8634

Contributes to https://github.com/digital-asset/daml/issues/8658

changelog_begin
changelog_end

* Address https://github.com/digital-asset/daml/pull/8723#discussion_r569228934

* Fix issues after rebase, address https://github.com/digital-asset/daml/pull/8723#discussion_r569227969

* Fix certificate table and column names, add timestamp to persistent store, address https://github.com/digital-asset/daml/pull/8723#discussion_r569223780

* Fix outstanding compilation errors

* Fix tests after rebase

* Address comments from https://github.com/digital-asset/daml/pull/8723#pullrequestreview-582106893

- Address https://github.com/digital-asset/daml/pull/8723#discussion_r569216711
- Address https://github.com/digital-asset/daml/pull/8723#discussion_r569217401

* Address https://github.com/digital-asset/daml/pull/8723#discussion_r569215383
2021-02-04 14:15:36 +00:00
Stefano Baghino
5a08c5276f
Switch from public keys to certificates for non-repudiation (#8739)
changelog_begin
changelog_end

Un-butchering the original design document
2021-02-04 08:27:37 +00:00
Stefano Baghino
6673efeb5c
Timestamp non-repudiation signed payloads (#8736)
Adds a timestamp when a payload signature has been verified.

This ensures that multiple commands sharing the same identifier can still be
told apart thanks to the signature.

changelog_begin
changelog_end
2021-02-04 08:56:09 +01:00
Stefano Baghino
5cea37f057
Revise signed payload repository (#8709)
* Review signed payload repository

A few improvements made as part of https://github.com/digital-asset/daml/issues/8634.

- revised signed payload repository to hold more relevant data on the signed payload
- more specific types when handling bytes and strings

changelog_begin
changelog_end

* Limit access of proxy to signed payload repository

* Address https://github.com/digital-asset/daml/pull/8709#discussion_r568395864

* Remove unused type parameter from NonRepudiationProxy.owner method
2021-02-02 09:25:19 +00:00
Stefano Baghino
ecf5f9b9c4
Enforce Java formatting style with google-java-format (#8686)
* Amend fmt.sh to check Java formatting with javafmt

changelog_begin
changelog_end

* Address https://github.com/digital-asset/daml/pull/8686#issuecomment-769740615

* Apply new formatting style to main code

* Apply new code style to docs code
2021-01-29 16:50:18 +00:00
Stefano Baghino
df692f42db
Non-repudiation: use binary headers for signature and fingerprint (#8672)
* Non-repudiation: use binary headers for signature and fingerprint

This should reduce the times we encode and decode to and from base64 strings.

changelog_begin
changelog_end

* Address https://github.com/digital-asset/daml/pull/8672#discussion_r566264693
2021-01-29 08:56:33 +00:00
Stefano Baghino
95874462b4
Add the first non-repudiation middleware prototype (#8608)
* Add the first non-repudiation middleware prototype, passing all conformance tests

Closes #8598

changelog_begin
changelog_end

* Address https://github.com/digital-asset/daml/pull/8608#discussion_r563780495

* Address https://github.com/digital-asset/daml/pull/8608#discussion_r563781026

* Address https://github.com/digital-asset/daml/pull/8608#discussion_r563795509

* Address https://github.com/digital-asset/daml/pull/8608#discussion_r563789111

* Address https://github.com/digital-asset/daml/pull/8608#discussion_r563792789

* Address https://github.com/digital-asset/daml/pull/8608#discussion_r563788373

* Address https://github.com/digital-asset/daml/pull/8608#discussion_r563789111
2021-01-26 15:08:41 +00:00