Commit Graph

508 Commits

Author SHA1 Message Date
Bernd Verst b76192b4f7
Merge branch 'master' into azblobbindingtrack2 2022-11-28 16:19:58 -08:00
Ryan Lettieri c736bcc506 Hotfix for StateTransactionRequest with etag crash
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-11-28 15:27:14 -08:00
Bernd Verst 2dc64721e8
Merge branch 'master' into azblobbindingtrack2 2022-11-22 16:14:06 -08:00
Alessandro (Ale) Segala b042e87127
Merge branch 'master' into postgres-ttl
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-21 21:57:57 -08:00
Alessandro (Ale) Segala 4dde34c2d1
Fix state.in-memory and enable conformance tests (#2303)
* Fix state.in-memory and enable conf tests

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Fixed unit tests

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* 💄

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-21 21:53:51 -08:00
ItalyPaleAle 15976110c6 💄
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-22 04:53:24 +00:00
ItalyPaleAle 1c3a0a1ea2 Fixed query
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-22 03:22:54 +00:00
ItalyPaleAle 2e7d5e7df6 Added garbage collection
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-22 02:05:07 +00:00
ItalyPaleAle c54286a60d Added TTL support for postgres
TODO: garbage collection
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-22 00:24:04 +00:00
ItalyPaleAle a6eb406fc2 Extracted common ParseTTL method
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-21 23:43:28 +00:00
ItalyPaleAle ca729de1a9 Add expiredate column to state table
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-21 23:22:57 +00:00
Bernd Verst 23d36a08d7 more refactoring and address code review
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-11-18 17:56:02 -08:00
Bernd Verst 8811d5e64f AzBlob components: Extract shared code
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-11-17 21:37:17 -08:00
Bernd Verst 70eb9f3a9c Address code review comments
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-11-17 20:35:05 -08:00
Bernd Verst 7ccca4def8 AzBlob State: Migrate to Track2 SDK
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-11-17 19:55:02 -08:00
ItalyPaleAle 1e728597b4 Misc refactorings
- Removed `state.DeleteWithOptions` and `state.SetWithOptions` which were useless at this point (likely a leftover from when there were retries)
- Some improvements in etag handling in postgres
- Other minor refactorings

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-17 16:29:29 +00:00
Bernd Verst b7d56fd7d6 Postgresql: allow custom table table
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-11-16 20:13:57 -08:00
Bernd Verst 3af0953516 Postgres State Store: Add Support for First-Write concurrency
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-11-16 20:13:57 -08:00
Bernd Verst 483e8b96bc Add user agent to table storage state store
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-11-15 16:49:56 -08:00
Bernd Verst 2698482f34 Add user agent back to Cosmos DB state store
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-11-15 14:55:20 -08:00
Bernd Verst 462e2faadc Upgrade linter and fix linter issues
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-11-11 13:19:57 -08:00
Bernd Verst ede060959a
Refactors all state store to standardize metadata parsing (#2257) 2022-11-05 15:36:44 -07:00
Alessandro (Ale) Segala ca3e80b76b
Updated depguard linter config (#2245)
* Updated depguard linter config

1. Add older (pre-v4) versions of `github.com/cenkalti/backoff` to the denylist
2. Add `github.com/agrea/ptr` to the denylist (use `github.com/dapr/kit/ptr` instead)
3. Fixed error messages for denied deps

Port of dapr/dapr#5438

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* ⚙️🧹

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Remove some github.com/pkg/errors

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* make modtidy-all after rebase

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2022-11-03 22:19:21 -07:00
ItalyPaleAle f7a01e65b0 Merge branch 'master' of https://github.com/dapr/components-contrib into feature/state_context1021
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-01 21:45:59 +00:00
ItalyPaleAle 5c65015987 Fixed unit tests
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-01 19:48:28 +00:00
ItalyPaleAle f412ecfbc9 Avoid logging PII
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-01 19:25:57 +00:00
ItalyPaleAle 8c617817a8 Fixed: MySQL was not actually using transactions
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-01 16:53:34 +00:00
ItalyPaleAle c5847890ee Added timeouts to operations
Using new metadata option timeoutInSeconds

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-01 16:43:22 +00:00
ItalyPaleAle 576c62b0f1 Added tests for metadata properties schemaName/tableName
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-01 16:27:16 +00:00
1046102779 d546dbd7b4 feature: add context to state API
Signed-off-by: 1046102779 <seachen@tencent.com>
2022-11-01 09:25:01 +08:00
1046102779 203c6c7757 feature: add context to state API
Signed-off-by: 1046102779 <seachen@tencent.com>
2022-10-25 07:21:35 +08:00
1046102779 8bc4286cdf feature: add context to state API
Signed-off-by: 1046102779 <seachen@tencent.com>
2022-10-24 11:04:48 +08:00
1046102779 1ed4c39d8c feature: add context to state API
Signed-off-by: 1046102779 <seachen@tencent.com>
2022-10-24 10:16:21 +08:00
1046102779 614a2d8c65 feature: add context to state API
Signed-off-by: 1046102779 <seachen@tencent.com>
2022-10-21 19:31:18 +08:00
1046102779 5a367b401a feature: add context to state API
Signed-off-by: 1046102779 <seachen@tencent.com>
2022-10-21 17:25:14 +08:00
Bernd Verst b9654bd979 upgrade to v5 of jackc/pgx
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-10-10 15:08:07 -07:00
Alessandro (Ale) Segala f15a50581d
Component metadata schema and tools (#2077)
* Component metadata schema and tools

Includes tools to generate and validate components' schema, and a CI check to ensure the schema is always up-to-date.

Also, includes schemas for 4 components as a starter

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Changed version as requested

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* fix workflow

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-09-27 10:44:54 -07:00
Dapr Bot 33ee68aee6
Merge branch 'master' into memcached_certification_i1929-rebased 2022-09-23 13:56:07 -07:00
Bernd Verst ea219576df
Apply suggestions from code review
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-09-23 13:42:45 -07:00
Ryan Lettieri 02645149b5 Changing greater than symbol to greater than or equals logic in cosmos statestore
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-09-23 14:27:06 -06:00
Ryan Lettieri 93708273d4 Removing page size option from cosmos statestore
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-09-23 14:15:41 -06:00
Ryan Lettieri 0b8d937ccd Fixing page limit on cosmosdb
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-09-23 14:04:15 -06:00
Tiago Alves Macambira 8e4af0a3a4 Certification tests for MemCached State Store component.
* Add network instability tests.
* Fixed gofumpt issues.
* Addresses TTL translation from Dapr and Memcache domains.

    Memcached uses `0` as the non-expiring marker TTL.
    [src](https://github.com/memcached/memcached/wiki/Commands#set).

    On the other hand, Dapr uses `-1` for that.
    [src](https://docs.dapr.io/developing-applications/building-blocks/state-management/state-store-ttl/)

    This PR updates certification and memcached code and tests so Dapr -1 (and negative)
    values are translated to Memcached's `0`.

Closes #1929

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>
2022-09-22 18:26:55 -07:00
Ryan Lettieri aa0228becd Cleaning up transactional code in cosmosdb statestore
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-09-16 15:04:30 -06:00
ItalyPaleAle 3c2e82a0e7 💄
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-09-16 20:49:14 +00:00
ItalyPaleAle cec34b9a95 💄
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-09-16 20:44:40 +00:00
ItalyPaleAle 0ed1a8acf0 Misc fixes
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-09-16 20:32:02 +00:00
ItalyPaleAle fd881e20f7 Use dapr/kit/ptr instead of old ptr
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-09-16 19:41:48 +00:00
Ryan Lettieri 79c039c08d Using helper method to grab partition key or default to empty string
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-09-16 12:44:06 -06:00
Ryan Lettieri 097737f6cd Adding timeout to transactional batch in comsosdb statestore
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-09-15 16:58:09 -06:00
Ryan Lettieri 705070036d Fixing conformance test for cosmosDB for track2sdk
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-09-15 14:58:58 -06:00
Ryan Lettieri 5d112f4d33 Fixing linter issues
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-09-14 15:58:57 -06:00
Ryan Lettieri 8a9b4b4986 Updated cosmos query to be compliant with new format/structure
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-09-14 15:50:58 -06:00
Bernd Verst b68448184b Merge remote-tracking branch 'upstream/master' into Cosmosdb_track2 2022-09-14 14:06:58 -07:00
Crypt Keeper b379f80b75
middleware: changes wasm basic to use waPC (#1833)
Updates wasm basic middleware and simplifies some code inside of it,
notably by using [waPC](https://github.com/wapc/wapc-go).

This changes the entrypoint function to be named "rewrite" and
uses a pool because known memory allocators are not goroutine
safe.

Signed-off-by: Adrian Cole <adrian@tetrate.io>

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2022-09-13 17:12:59 -07:00
Ryan Lettieri 8425950aac Temporary revert of cosmosdb item marshalling
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-09-13 11:19:22 -06:00
Ryan Lettieri 97a91c0b8f Changing cosmos header checks to lower case
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-09-09 14:08:45 -06:00
Ryan Lettieri 34c24ba994 Adding capability for cross partition query in cosmos with track2SDK
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-09-09 13:52:49 -06:00
Bernd Verst 5d7367c335 CosmosDB State: Use document enveloped, handle doc NotFound
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-09-09 00:24:48 +00:00
Bernd Verst f1a2dd75f5 Return CosmosDB State Features correctly
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-09-08 16:04:19 -07:00
Ryan Lettieri 8fd5822a5c Removing unncessary features from cosmosdb
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-09-08 15:25:34 -07:00
Ryan Lettieri 9189ddc4dc Adressing review comments for cosmosdb statestore track2sdk
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-09-08 15:25:34 -07:00
Ryan Lettieri e012a807b7 Upgrading cosmosdb statestore to track2SDK
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
2022-09-08 15:25:33 -07:00
Marcos Candeia b85ed188e8 Create QueryFields object to avoid multiples json unmarshalling
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
2022-08-31 19:47:27 -03:00
Marcos Candeia b1e1dc5043 Query API: Set filters when unmarshalling
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
2022-08-31 17:17:26 -03:00
Mike Brown 13cef6cba1
dymamodb state: add support for first write concurrency
The existing logic for the dymamodb state store does not respect the
FirstWrite concurrency option for a SetRequest when etags are not used
by the client. This commit fixes the issue by employing a conditional
expression to test for the existence of an item when FirstWrite is
specified and etags are not.

Signed-off-by: Mike Brown <github@torvosoft.com>
2022-08-30 12:11:45 -04:00
Mike Brown 964c208977 dynamodb state: add support for etags
In order to safely support concurrent updates to existing state items
clients should employ etags. (For reference please see
tinyurl.com/5n83tnfp). Existing support for AWS DynamoDB does not
include support for etags. This change introduces etag support for AWS
DynamoDB utilizing conditional expressions (reference
tinyurl.com/5du587m8).

Signed-off-by: Mike Brown <github@torvosoft.com>
2022-08-26 11:34:03 -07:00
Mike Brown ad84226cf4 dynamodb state: refactor common Set() & BulkSet() logic
Both Set() and BulkSet() contained duplicate logic to convert a dapr
state.SetRequest into a map[string]*dynamodb.AttributeValue. This
change refactors that logic into a new utility function
getItemFromReq(). This will ensure that subsequent changes to add
missing features (e.g. etag) will only have to be expressed once.

Signed-off-by: Mike Brown <github@torvosoft.com>
2022-08-26 11:34:03 -07:00
Bernd Verst 5aae9c1126
RethinkDB: Remove falsely advertised transation support. (#2020)
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-08-26 10:04:46 -07:00
Bernd Verst 587156bead
Enable conformance tests for rethink db. Make it Beta. Remove Etag feature. (#2015)
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-08-26 09:04:19 -07:00
Alessandro (Ale) Segala bcea284c7b
Components' init functions should return interfaces (#1997)
* Components' init functions should return interfaces

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* 💄

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* pin latest berndverst contrib fork

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Fixed component registration in tests

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Updated all cert tests

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-08-25 18:27:45 -07:00
addjuarez b9e1408d69
Fix typos in Apache Cassandra logs (#2010)
Signed-off-by: Addison Juarez <adjuarez@microsoft.com>

Signed-off-by: Addison Juarez <adjuarez@microsoft.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-08-25 17:28:07 -07:00
Marcos Candeia 8964d8bf41
Define common metadata across components (#1994)
* Add base metadata for all components

Signed-off-by: Marcos Candeia <marrcooos@gmail.com>

* Fix lint issues on consul and mysql tests

Signed-off-by: Marcos Candeia <marrcooos@gmail.com>

* Pin candeia/dapr runtime version

Signed-off-by: Marcos Candeia <marrcooos@gmail.com>

* Add replace directive to use mcandeia/dapr on all go submodules

Signed-off-by: Marcos Candeia <marrcooos@gmail.com>

* Fixed runtime config instantiation

Signed-off-by: Marcos Candeia <marrcooos@gmail.com>

Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
2022-08-25 10:10:53 -07:00
Alessandro (Ale) Segala 8b48210e3e
Fixes to MySQL state store (#1978) 2022-08-18 11:50:53 -07:00
Bernd Verst e87cd5e4cb
Go 1.19 support and linter fixes (#1975)
* Go 1.19 support and linter fixes

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Update workflows for Go1.19 and new linter version

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Remove unnecessary space in nolint directive

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* disable additional linters which aren't used because of Go generics

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* enable gosec linter again

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Update bindings/zeebe/command/publish_message_test.go

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Update bindings/output_binding.go

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Use prepared statement for mysql table creation

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Ping is not ping

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* c'mon linter

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Fix MySQL gosec issue

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* revert mysql to be fixed later

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-08-18 00:45:23 -07:00
Bernd Verst 1edd408b9b
Fix CosmosDB state store handling of nulls (#1974) 2022-08-17 21:20:25 -07:00
qiangmzsx 79a3cd990a
Removing the use of the ioutil package And Fix CVE-2021-42576 (#1954)
* fix CVE-2021-42576

Signed-off-by: qiangmzsx <qiangmzsx@gmail.com>

* Removing the use of the ioutil package

Signed-off-by: qiangmzsx <qiangmzsx@gmail.com>

* Update middleware/http/nethttpadaptor/nethttpadaptor.go

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

Signed-off-by: qiangmzsx <qiangmzsx@gmail.com>
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-08-10 13:45:00 -07:00
Bernd Verst e818de3590
Enable conformance test for memcached state store (#1949) 2022-08-09 16:12:33 -07:00
Alessandro (Ale) Segala 457d6c40b4
Ensure rethinkdb complies with state.TransactionalStore (#1930)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2022-08-05 14:09:44 -07:00
Alessandro (Ale) Segala d38c786771
Add contexts to input bindings (#1831)
This is the last part of the "shutdown sequence fix": it allows shutting down input bindings before output ones.

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-07-12 12:19:27 -07:00
ItalyPaleAle 3060cc7a42 Reporting ETag failures correctly in delete method
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-07-07 15:50:22 -07:00
ItalyPaleAle 6f00a83546 state.azure.blobstorage now passes conformance tests
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-07-07 15:50:22 -07:00
Alessandro (Ale) Segala a2f3a84b96
Moved authentication to be an internal pkg (#1855)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-07-06 11:05:34 -07:00
Alessandro (Ale) Segala a193cc1ede
Add support for AAD auth in Azure Storage Queues binding (#1842)
* Add support for AAD auth in Azure Storage Queues binding

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* 🧹

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-07-03 14:17:38 -07:00
Alessandro (Ale) Segala cedaacbb7c
Make metadata keys uniform for Azure Storage components (#1837)
* Make metadata keys uniform for Azure Storage components

By using aliases we are preserving backwards-compatibility

Fixes #1832

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Updated bindings.azure.storagequeues too

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Updated state.azure.tablestorage too

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* 💄

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* 🧹

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

Co-authored-by: Loong Dai <long.dai@intel.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2022-07-01 12:05:11 -07:00
Alessandro (Ale) Segala 4bf6cc4ca6
Updated development docs (#1835)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2022-06-30 22:23:41 -07:00
yellow chicks 7033c8f266
optimize: move logger from api to struct (#1818)
Signed-off-by: 1046102779 <seachen@tencent.com>
2022-06-28 19:30:13 -07:00
Bernd Verst f25b26fc0c
Upgrade to Azure Table Storage Track 2 SDK in State Store and add CosmosDB Table API support (#1792)
* Upgrade to Azure Table Storage Track 2 SDK in State Store

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* make modtidy-all

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* don't panic

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* fix error parsing

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Adds support for empty rowKeys again

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Pin aztables v1.0.1

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Add support for Cosmos DB Table API

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Add Azure Table Storage CosmosDB conformance test

Signed-off-by: GitHub <noreply@github.com>

* Address code review

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Create Table Storage State store subtests

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Address linter issue

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* context instead of ctx

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* load state store in conf tests

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* use cosmosDB mode in cosmosDB test

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Add Azure AD support for Table Storage

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* remove shadow declaration

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* make accountKey optional

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Add options to skip table creation

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-06-17 14:04:53 -07:00
deepanshuagarwal a0ef46265b
Adding Pinger interface and Removing mandatory nature of Ping fuction (#1784)
* add `Pinger` interface.

Signed-off-by: chanyong.moon <dev.chanyongmoon@gmail.com>

* Convert Ping fuction to optional

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Removing unrequired Ping implementations

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

* Addressing comments

Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>

Co-authored-by: chanyong.moon <dev.chanyongmoon@gmail.com>
2022-06-14 08:27:54 -07:00
Yaron Schneider 37693b8d63
Add postgresql certification test + connection idle time (#1778)
* Add postgresql certification test + connection idle time

Signed-off-by: yaron2 <schneider.yaron@live.com>

* change flow name

Signed-off-by: yaron2 <schneider.yaron@live.com>

* go mod tidy

Signed-off-by: yaron2 <schneider.yaron@live.com>

* add to workflow

Signed-off-by: yaron2 <schneider.yaron@live.com>
2022-06-10 11:07:26 -07:00
Pravin Pushkar 3f85dd6702
adding query api to the feature list (#1775)
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-06-07 08:38:02 -07:00
seeflood 948540e5a7
Add an in-memory state component (#1326)
* goimports -local github.com/dapr/ -w .

Signed-off-by: seeflood <349895584@qq.com>

* add

Signed-off-by: seeflood <349895584@qq.com>

* rename test cases

Signed-off-by: seeflood <349895584@qq.com>

* fix pointer check

Signed-off-by: seeflood <349895584@qq.com>

* add Close()

Signed-off-by: seeflood <349895584@qq.com>

* doGetWithWriteLock3

Signed-off-by: seeflood <349895584@qq.com>

* fix typo

Signed-off-by: seeflood <349895584@qq.com>

* fix ut

Signed-off-by: seeflood <349895584@qq.com>

* release memory reference

Signed-off-by: seeflood <349895584@qq.com>

* delete test

Signed-off-by: seeflood <349895584@qq.com>

* fix npe

Signed-off-by: seeflood <349895584@qq.com>

* fix

Signed-off-by: seeflood <349895584@qq.com>

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2022-05-15 19:36:02 -07:00
Eddie 785ed60ef4
GH-1609 : Fix for MongoDB Atlas conn strings (#1698)
* Update readme of bindings (#1690)

Signed-off-by: pigletfly <wangbing.adam@gmail.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
Signed-off-by: Eddie <eddie@wassef.com>

* Fixing includedHeaders problem with spaces (#1610)

Signed-off-by: Ben Kotvis <kotvisbj@gmail.com>

Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Co-authored-by: Looong Dai <long.dai@intel.com>
Signed-off-by: Eddie <eddie@wassef.com>

* Simplify vault token read (#1560)

* Simplify vault token get

Signed-off-by: zhangchao <zchao9100@gmail.com>

* fix lint

Signed-off-by: zhangchao <zchao9100@gmail.com>

* update tests

Signed-off-by: zhangchao <zchao9100@gmail.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Signed-off-by: Eddie <eddie@wassef.com>

* GH-1609 : Fix for MongoDB Atlas conn strings

Added recommended fix in the issue

Signed-off-by: Eddie <eddie@wassef.com>

* updating the comment based on PR feedback

Signed-off-by: Eddie <eddie@wassef.com>

* Initial Certification test for eventhubs binding [incomplete] (#1670)

* certification test for eventhubs binding

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* modified go.mod and go.sum

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* Add connection string testing

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* iothub testing

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* address feedback and run test

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* Install Azure CLI IOT hub extension

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* make modtidy-all

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* covering all eventhubs test cases

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* dependency changes after go modtidy-all

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Co-authored-by: Looong Dai <long.dai@intel.com>
Signed-off-by: Eddie <eddie@wassef.com>

* Use revive instead of golint (#1685)

Signed-off-by: pigletfly <wangbing.adam@gmail.com>

Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Signed-off-by: Eddie <eddie@wassef.com>

* Updated to Go 1.18 (#1697)

* Updated to Go 1.18

Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>

* Added go.work file
With Go 1.18, this allows gopls (the Go language server used for example in VS Code) to work inside test apps too.
See: https://go.dev/doc/tutorial/workspaces

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Removed go.work

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* 💄

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Signed-off-by: Eddie <eddie@wassef.com>

* Add metadata property to configure Batching in Pulsar (#1707)

* Add metadata property to configure BatchingMaxSize&batchingMaxMessages in Pulsar
Signed-off-by: saberwang <saberwang@hotmail.com>

* sort field
Signed-off-by: saberwang <saberwang@hotmail.com>

* [pubsub]fix unit test bug
Signed-off-by: saberwang <saberwang@hotmail.com>

* remove unrelated changes
Signed-off-by: saberwang <saberwang@hotmail.com>

* Delete hard coded Metadata
Signed-off-by: saberwang <saberwang@hotmail.com>

* remove  .history

Signed-off-by: saberwang <saberwang@hotmail.com>

* restore .gitignore

Signed-off-by: saberwang <saberwang@hotmail.com>

* Hard coding default values and adding 'BatchingMaxPublishDelay' metadata

Signed-off-by: saberwang <saberwang@hotmail.com>

* fix code format

Signed-off-by: saberwang <saberwang@hotmail.com>

* formatting code

Signed-off-by: saberwang <saberwang@hotmail.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Signed-off-by: Eddie <eddie@wassef.com>

* Fix 4529: Ignore Subscribe/Get wrong redis configuration type keys. (#1693)

* fix: 4529

Signed-off-by: LaurenceLiZhixin <382673304@qq.com>

* Fix: add test does not throw error for wrong type during get all test case of redis configuration

Signed-off-by: LaurenceLiZhixin <382673304@qq.com>

Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Co-authored-by: Ian Luo <ian.luo@gmail.com>
Signed-off-by: Eddie <eddie@wassef.com>

* Signed-off-by: Eddie Wassef <eddie@wassef.com>

Fixing leading newline in linter error

Signed-off-by: Eddie <eddie@wassef.com>

* Implment a secret store based on Huawei CSMS (#1710)

Signed-off-by: Chen Cong <chock-cong.chen@outlook.com>

Co-authored-by: Chen Cong <chock-cong.chen@outlook.com>
Signed-off-by: Eddie <eddie@wassef.com>

* Add yet another missing secret to eventhub binding cert test (#1713)

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Signed-off-by: Eddie <eddie@wassef.com>

* Support custom queueEndpoint in Azure Storage Queues (#1692)

* Support custom queueEndpoint in Azure Storage Queues

Signed-off-by: Janusz Dziurzynski <janusz@corechain.tech>

* run gofmt

Signed-off-by: Janusz Dziurzynski <janusz@corechain.tech>

* Add "Url" to JSON field name for clarity

Suggested by @msfussell in dapr/docs#2424

Signed-off-by: Janusz Dziurzynski <janusz@corechain.tech>
Signed-off-by: Eddie <eddie@wassef.com>

* Refactory kafka binding to reuse the kafka common code extracting from kafka pubsub component (#1696)

* refactory kafka pubsub code to extract common kafka code for reuse

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* fix lint;add unit test for subscribeAdapter

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* move topics filed from internal kafak struct to pubsub kafka struct, since in input binding the topics will confiured in metadata

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* reuse internal  kafka code for bindings

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* add redis standalone_test back which is delete by mistaken

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* small code improvement to trigger test

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* add license headers

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* try to set disbaleTls to true to verify the kafka connection fail

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* don't enable consum retry in kafka binding component;if authenticaion is disabled, need not set TLSDisable at the same time;

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

* fix lint

Signed-off-by: Sky Ao <aoxiaojian@gmail.com>

Co-authored-by: Loong Dai <long.dai@intel.com>
Signed-off-by: Eddie <eddie@wassef.com>

* Add topic metadata for mqtt input binding and support user defined topic for mqtt output binding (#1674)

* feat(bindings/mqtt): add data incoming topic to metadata

Signed-off-by: lotuc <lotu.c@outlook.com>

* feat(bindings/mqtt): support user defined topic on create action

Signed-off-by: lotuc <lotu.c@outlook.com>

* chore(bindings/mqtt): add integration test and topic response check test

Signed-off-by: lotuc <lotu.c@outlook.com>

* fix(bindings/mqtt): ignore misspell linting error for word mosquitto

Signed-off-by: lotuc <lotu.c@outlook.com>

Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Signed-off-by: Eddie <eddie@wassef.com>

* Expire -> ExpiryInSeconds (#1721)

Signed-off-by: seeflood <349895584@qq.com>
Signed-off-by: Eddie <eddie@wassef.com>

* running gofmt -s -w state/mongodb/mongodb.go

Signed-off-by: Eddie <eddie@wassef.com>

* Update mongodb.go

Co-authored-by: Wang Bing <wangbing.adam@gmail.com>
Co-authored-by: Looong Dai <long.dai@intel.com>
Co-authored-by: Ben Kotvis <kotvisbj@gmail.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Co-authored-by: Taction <zchao9100@gmail.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Co-authored-by: tanvigour <60332928+tanvigour@users.noreply.github.com>
Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: saber-wang <45062099+saber-wang@users.noreply.github.com>
Co-authored-by: Laurence <45508533+LaurenceLiZhixin@users.noreply.github.com>
Co-authored-by: Ian Luo <ian.luo@gmail.com>
Co-authored-by: Chock Chen <46557936+ChenCong0207@users.noreply.github.com>
Co-authored-by: Chen Cong <chock-cong.chen@outlook.com>
Co-authored-by: Janusz Dziurzynski <janusz@forserial.org>
Co-authored-by: Sky Ao <aoxiaojian@gmail.com>
Co-authored-by: lotuc <lotu.c@outlook.com>
Co-authored-by: seeflood <349895584@qq.com>
2022-05-13 16:13:13 -07:00
Alessandro (Ale) Segala e6c67356cd
Updated to Go 1.18 (#1697)
* Updated to Go 1.18

Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>

* Added go.work file
With Go 1.18, this allows gopls (the Go language server used for example in VS Code) to work inside test apps too.
See: https://go.dev/doc/tutorial/workspaces

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Removed go.work

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* 💄

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-05-06 13:44:45 -07:00
Wang Bing db99b43068
Use revive instead of golint (#1685)
Signed-off-by: pigletfly <wangbing.adam@gmail.com>

Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
2022-05-06 12:55:17 -07:00
seeflood dc849d40a0
feat: lock component (#1574)
* feat: lock store.
Signed-off-by: seeflood <349895584@qq.com>

* make modtidy-all

Signed-off-by: seeflood <349895584@qq.com>

* lock/redis/standalone.go

Signed-off-by: seeflood <349895584@qq.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
2022-04-24 18:11:13 -07:00
ItalyPaleAle 0bc35571a8 💄💄💄 #PickyLinter
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-04-08 11:45:39 -07:00
ItalyPaleAle 9a8aae1818 💄
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-04-08 11:42:30 -07:00
Alessandro (Ale) Segala 869d9712aa
Merge branch 'master' into cosmosdb-sproc-embed 2022-04-08 11:26:45 -07:00
Alessandro (Ale) Segala 661d1b38b5 💄
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2022-04-05 21:28:00 +00:00
Alessandro (Ale) Segala 612f6e6ec3
Cosmos DB: Delete does not need to query for the doc first
This, which is possible now because of improvements in the upstream SDK, should speed up delete operations significantly (and reducing RU usage).
Also, this should fix potential concurrency issues.

Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2022-04-05 21:20:57 +00:00
Alessandro (Ale) Segala 407936745e
Yet another Cosmos DB auth fix
This is fixed by upgrading the upstream SDK
Also added a missing handling of throttling in the Delete method

Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2022-04-05 21:01:22 +00:00
Alessandro (Ale) Segala 559e68daf4 Use Go Embed to include the Cosmos DB stored procedures code in the compiled app
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2022-04-05 01:46:26 +00:00
Alessandro (Ale) Segala fd7600cdde Added license headers
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2022-04-05 01:44:44 +00:00
Alessandro (Ale) Segala 650fac6da6 Adding Cosmos DB stored procedure files in the source tree
These are not included in the compiled app and have no effect (for now). However, we need these tagged together with the release so we can use them in docs.
A separate commit (not slated for 1.7) will use Go embed to actually use these in code

Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2022-04-05 01:44:44 +00:00
Alessandro (Ale) Segala 4ae8f5e978 Added license headers
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2022-04-05 01:41:44 +00:00
Alessandro (Ale) Segala 147addebe9 Adding Cosmos DB stored procedure files in the source tree
These are not included in the compiled app and have no effect (for now). However, we need these tagged together with the release so we can use them in docs.
A separate commit (not slated for 1.7) will use Go embed to actually use these in code

Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2022-04-05 01:38:11 +00:00
Alessandro (Ale) Segala ee59722971 Merge branch 'master' of https://github.com/dapr/components-contrib into fix-1611 2022-03-25 18:40:03 +00:00
Mukundan Sundararajan 80fda909e8 fix conf tests.
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2022-03-25 21:26:21 +05:30
Bernd Verst 8a3cd8446c fix mongodb get request
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-03-24 18:27:45 -07:00
Alessandro (Ale) Segala 9a28bb2f70 Added retry logic and back-off to Cosmos DB components
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2022-03-24 22:32:05 +00:00
Alessandro (Ale) Segala 4551449f0c Workaround for Cosmos DB state store unable to launch when using AAD auth
Fixes #1603

Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2022-03-24 20:55:09 +00:00
Ricardo Corrêa 4d44c2f04f
StateStore API implementation for CockroachDB (#1559)
* statestore for CockroachDB

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* Upgrade nacos sdk version to meet compliance (#1547)

* Upgrade nacos version

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Run go mod tidy all

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Add MaxSize to settings

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* conformance tests for CockroachDB

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* fix comment for internalNew func (CockroachDB)

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* remove metadata from log (CockroachDB)

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* removed unnecessary nil fields from GetResponse

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* Fix ordering in transaction API for CockroachDB

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* fix non-deterministic etag error (CockroachDB)

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* fix error message for delete operation without key (CockroachDB)

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

Co-authored-by: Shubham Sharma <shubhash@microsoft.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Co-authored-by: Taction <zchao9100@gmail.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Co-authored-by: Looong Dai <long.dai@intel.com>
2022-03-22 08:24:14 -07:00
Dmitry Shmulevich 6e504186a5
redis: fix querying numeric values (#1595)
Signed-off-by: Dmitry Shmulevich <dmitsh@users.noreply.github.com>

Co-authored-by: Dmitry Shmulevich <dmitsh@users.noreply.github.com>
2022-03-17 15:07:32 -07:00
Bernd Verst a569438523
Merge branch 'master' into fix-mongodb-canonical 2022-03-15 21:37:13 -07:00
Dmitry Shmulevich dcfb3454c1 mongodb: fix querying non-string values
Signed-off-by: Dmitry Shmulevich <dmitsh@users.noreply.github.com>
2022-03-15 19:05:53 -07:00
Mukundan Sundararajan 83914e8eed marshall mongodb bson into relaxed json
Signed-off-by: Mukundan Sundararajan <msundar.ms@outlook.com>
2022-03-16 02:21:53 +05:30
Shubham Sharma fc726adbbb
Fix ordering in transaction API for MySQL (#1523)
* fix transaction API ordering

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* refactor to an idiomatic way

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update transaction API to execute sequentially

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Fix MySql unit tests

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2022-03-14 16:39:32 -07:00
Shubham Sharma eecb3015c7
Update transaction API to execute sequentially (#1542) 2022-03-09 11:37:28 -08:00
Shubham Sharma 794e42225a
Fix ordering in transaction API for PostgreSQL (#1524)
* fix transaction API ordering

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update postgres transaction API and refactor tests

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Remove commented tests

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Add more tests

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Fix govet issue

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Fix goimports

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Fix golangci issues

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2022-03-08 21:46:32 -08:00
Shubham Sharma db670d26b9
Fix transaction API for Azure Cosmos DB (#1518)
* Fix cosmos transaction API to respect ordering

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* refactor to an idiomatic way

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update storedproc caller to pass list of operations

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update storedproc to operate sequentially

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Add doc

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update storedproc

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update storedproc to not throw error on delete failure due to missing document

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
2022-03-08 21:13:55 -08:00
Wim baada23d0d
Added TTL to state store binding for DynamoDB (#1512)
* Added TTL to state store binding for DynamoDB

Signed-off-by: wimvc <wim.vdc@hotmail.com>

* gofumpt dynmodb statestore files

Signed-off-by: wimvc <wim.vdc@hotmail.com>

* Fixed some godot issues

Signed-off-by: wimvc <wim.vdc@hotmail.com>

* Fixed typos and refactored IF in Get

Signed-off-by: wimvc <wim.vdc@hotmail.com>

Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Co-authored-by: Looong Dai <long.dai@intel.com>
Co-authored-by: Taction <zchao9100@gmail.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-03-04 08:18:33 -08:00
Dmitry Shmulevich f819b290f7
redis state store: implement state query API (#1488)
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2022-03-02 10:51:09 -08:00
Shubham Sharma acde0fb899 Update doc
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
2022-02-21 16:19:57 +05:30
Shubham Sharma a056a30e93 Refactor documentation
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
2022-02-21 15:54:25 +05:30
Shubham Sharma 487e8bc089 Change BulkDelete error handling in transaction
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
2022-02-21 15:40:58 +05:30
Shubham Sharma e703874f42 Add logic to fix transaction ordering
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
2022-02-21 12:41:03 +05:30
Gehhilfe 80c2bbe284
Jetstream KV state store component (#1501)
* Add support for nats jetstream kv state store

Add tests for jetstream state store

Update go mod

Signed-off-by: Tim Burkert <burkert.tim@gmail.com>

* Fix lint errors

Signed-off-by: Tim Burkert <burkert.tim@gmail.com>

* Mod tidy

Signed-off-by: Tim Burkert <burkert.tim@gmail.com>

* Mod tidy all

Signed-off-by: Tim Burkert <burkert.tim@gmail.com>

* Mod tidy all

Signed-off-by: Tim Burkert <burkert.tim@gmail.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
2022-02-17 10:19:03 -08:00
Looong Dai 0b1ba25e7f
Merge branch 'master' into postgres_state_store_set_with_etag_1497 2022-02-14 09:38:05 +08:00
Dmitry Shmulevich 7fdebda09b
state store query API: remove preceding '.' in key names (#1500)
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2022-02-11 15:00:43 -08:00
Phil Kedy d5b2ce5377 Bump version of github.com/jackc/pgx/v4 to v4.15.0.
Signed-off-by: Phil Kedy <phil.kedy@gmail.com>
2022-02-11 15:53:31 -05:00
Phil Kedy e4ad31d36c Postgres state: Convert etag to uint32 instead of int to fix conversion error
Signed-off-by: Phil Kedy <phil.kedy@gmail.com>
2022-02-11 08:49:21 -05:00
Dmitry Shmulevich 1cb659c0b8
update conformance tests (#1492)
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2022-02-09 17:58:48 -08:00
Dmitry Shmulevich eaecd4cb34
statestore query API: remove 'value' prefix from key names in query JSON object (#1491)
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2022-02-09 17:17:47 -08:00
Lucas Jellema 625f955fee
Introducing Oracle Database backed state store component (#1454)
* Introducing Oracle Database backed state store component

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* Implement Ping method with proper database ping

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* adding results from make modtidy-all - updated go.sum files
Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* etag only applied when first write policy requested - applied in integration test and component

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
2022-02-08 12:00:34 -08:00
Lucas Jellema a383697ef5
Add config file authentication to oci object storage state store (#1430)
* Improving testing - verify expected methods are invoked

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* Adding support for composite keys (mapped to directories in buckets)

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* Adding support for TTL - expired elements are not returned in Get

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* fixing linting issues

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* fixing linting issue

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* adding support for TTL == -1 (never expire)

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* fix linting issue

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* introducing Instance Principal authentication for OCI client

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* fix linting issue

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* adding support for oci config file based authentication for OCI bjectStorage state store

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* expand ~ to user home directory in config file path; fix linting findings

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* gofumpt file because of linting issue

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* Do not allow config file path to start with ~/

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* introducing integration test for oci objectstorage state store

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* Fixing linting issues in integration test

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* Fixing linting issues in integration test

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
2022-02-06 19:27:31 -08:00
Ricardo Corrêa 8297fc929b
Query StateStore API implementation for PostgreSQL StateStore (#1457)
* query state integration with dbaccess (postgresql)

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* query state integration with postgresql component

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* query state for postgresql

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* fix: linter error 'rowserrcheck'

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* query state integration with dbaccess (postgresql)

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* query state integration with postgresql component

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* fix: linter error 'rowserrcheck'

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* fix: linter error 'goimports -ed with -local github.com/dapr/'

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* performance improvementt in PosgreSQL Query API

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

* added conformance test for PostgreSQL Query API

Signed-off-by: Ricardo Corrêa <r.c.correa@outlook.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
2022-02-02 18:14:18 -08:00
Jigar 9078f11985
Added ContentType to pubsub/binding/state request-response (#1376)
Signed-off-by: jigargandhi <jigarr.gandhi@gmail.com>

Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Co-authored-by: Looong Dai <long.dai@intel.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2022-01-28 10:17:04 -08:00
Gehhilfe 44199ca4dc
Fix #1351 Fail with useful error message when an invalid account name is used (#1403)
* state azure blobstorage: fail for invalid account name

Signed-off-by: Tim Burkert <burkert.tim@gmail.com>

* state azure blobstorage: Remove duplicated code and add error check for common entpoint

Signed-off-by: Tim Burkert <burkert.tim@gmail.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
2022-01-13 09:02:07 -08:00
Lucas Jellema a013b58d6c
Implement State Store for OCI ObjectStorage service (#1401)
* Implement State Store for OCI ObjectStorage service

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* add go.mod and go.sum with dependencies on OCI SDK

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* Removed dependency in unit test on OCI account

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* Adding extensive unit test (coverage) using mock-OCI client

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

* Correcting linting issues and review requests

Signed-off-by: lucasjellema <lucasjellema@gmail.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
2022-01-04 23:18:50 -08:00
Dmitry Shmulevich c7adb917f3
update license to Apache v2.0 (#1406) 2022-01-04 19:53:31 -08:00
mbimbij 1389ae5937
Fix cassandra statestore error - "Bind variables cannot be used for table names" - Introduce `fmt.Sprintf` where applicable (#1388)
* - Introduce `fmt.Sprintf` where applicable
- Add conformance test for cassandra component.

Signed-off-by: mbimbij <joseph.mbimbi@gmail.com>

* Start cassandra via docker-compose for its conformance test

Signed-off-by: mbimbij <joseph.mbimbi@gmail.com>

* Apply `go fmt` on `tests/conformance/common.go` as part of PR correction

Signed-off-by: mbimbij <joseph.mbimbi@gmail.com>
2021-12-26 21:35:02 -08:00
Bernd Verst 175b09ea40
Adds retry on CosmosDB Init in case of TooManyRequests error (#1329)
* Adds retry on CosmosDB Init in case of TooManyRequests error

* Use backoff v4

* missed some permanent errors

* clean up go.mod

* fix error type casting

* Add constant for HTTP 429
2021-11-29 12:05:43 -08:00
Dmitry Shmulevich 3c52b73608
fixed typo in Query JSON (#1344) 2021-11-29 09:44:28 -08:00
Simon Leet dfe52cf88f
Remove Cloudstate component (#1303)
- Remove cloudstate state store component
- Update state/Readme.md

Fixes #1297

Co-authored-by: Long Dai <long.dai@intel.com>
2021-11-18 15:30:40 -08:00
Dmitry Shmulevich daf99fd3c2
add README for State Query API (#1258) 2021-11-02 16:46:03 -07:00
Dmitry Shmulevich ad9ebba204
update package name (#1267) 2021-11-02 15:47:07 -07:00
Artur Souza c4303d55db
Revert "Merge pull request #1143 from jigargandhi/content-type" (#1239)
This reverts commit e373b95489, reversing
changes made to 8505c1a1db.
2021-10-27 11:41:25 -07:00
Long Dai 67185db54e
Merge branch 'master' into content-type 2021-10-26 09:35:23 +08:00
Bernd Verst aa4f949838 Adds Dapr User Agent for Cosmos DB components 2021-10-25 17:59:34 -07:00
jigargandhi a5bb76bcfa fixing newline lint issue 2021-10-25 15:27:32 +05:30
jigargandhi 63f87f0641 Merge branch 'content-type' of github.com:jigargandhi/components-contrib into content-type 2021-10-25 15:13:50 +05:30
jigargandhi 54e2c1e01a Fix linting issues 2021-10-25 15:13:40 +05:30
Long Dai 89e6291d71
Merge branch 'master' into content-type 2021-10-25 09:31:29 +08:00
Dmitry Shmulevich 72754c6036
add missing license (#1226) 2021-10-22 10:39:56 -07:00
jigargandhi a09c7ade7b Added test for blob storage 2021-10-22 18:02:01 +05:30
Ian Luo e003319566
support json in mysql state #1168 (#1194)
* support json in mysql state #1168

* fmt, fix lint issue

* fix lint issue

* fix unit test failure

* add test against 'isbinary'

* fix lint issue

* enhance assertEquals

* remove unused 'expectedReadResponse' to fix lint issue

* go fmt to fix lint issue

* fix lint issue

Co-authored-by: Long Dai <long.dai@intel.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-10-21 15:05:39 -07:00
Ian Luo 117408f76d
add state conformance test for postgresql #1117 (#1118)
* add state conformance test for postgresql #1117

* make postgresql pass comformance test

* include postgresql to github's workflow

* add newline at end of file for Linux text file

* enhance return

* add newline at end of file for valid Linux text file

* fix lint issue

* handle byte[] in special way so that to stick to json type in DB

* use jsonb instead of json

* fix lint issue

* doesn't allow "", a special case

* enhance assertEquals

* remove unused 'expectedReadResponse' to fix lint issue

* go fmt to fix lint issue

* fix lint issue

Co-authored-by: Simon Leet <31784195+CodeMonkeyLeet@users.noreply.github.com>
Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Long Dai <long.dai@intel.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2021-10-21 14:56:14 -07:00
Jigar Gandhi 34c20b0c0f removed nil check 2021-10-21 18:32:48 +05:30
Jigar 1acb76ee1c
Merge branch 'master' into content-type 2021-10-21 12:10:08 +05:30
Dmitry Shmulevich f96a71e4d7
add metadata to query request/response (#1215) 2021-10-20 17:22:42 -07:00
Dmitry Shmulevich e369fec17e
Add StateStore query API (#1153)
Add StateStore query API implementation for MongoDB, CosmosDB
2021-10-18 13:55:26 -07:00
Bernd Verst 317db02783
version stored procedure due to previous changes made (#1176) 2021-09-29 18:16:16 -07:00
Simon Leet 9a075cb43a
Fix existing integration tests (#1173)
* Fix servicebusqueues_integration_test.go compile errors

* Fix postgresql_integration_test.go deleteItemThatDoesNotExist expectations

* Fix mysql_integration_test.go deleteItemThatDoesNotExist expectations

* Fix mysql_integration_test.go for bindings

* Increase TTL in ServiceBusQueues tests for stability
2021-09-28 19:17:44 -07:00
TheoneFx e41acc494c
Add state alicloud.tablestore (#1116)
* state alicloud.tablestore

* some bug fix

* gofumpt

* add unit test

* gofumpt

* golangci-lint

* code refactor

* goimports

* goimports

Co-authored-by: Simon Leet <31784195+CodeMonkeyLeet@users.noreply.github.com>
Co-authored-by: Long Dai <long0dai@foxmail.com>
Co-authored-by: Long Dai <long.dai@intel.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-09-27 17:27:20 -07:00
Bernd Verst ac85ba2a8e
Add dapr user agent for Azure Components (#1152)
* Add dapr useragent for Service Bus and EventHubs

* Add useragent for tablestorage

* send dapr useragent

* more user agents

* formatting
2021-09-27 17:04:27 -07:00
Bernd Verst 905cbc028d restructure code and add comments per code review 2021-09-22 15:51:15 -07:00
Bernd Verst 0bd6eb2e9a cover all concurrency + etag cases 2021-09-22 12:18:13 -07:00
Bernd Verst 0cd1c54ba0 Adds first-write conformance test 2021-09-21 16:33:04 -07:00
Bernd Verst 0e3dc3e79a fix linter warnings 2021-09-21 16:33:04 -07:00
Bernd Verst 90791a30fc TableStorage conformance tests pass 2021-09-21 16:33:04 -07:00
Long Dai 988fed05ab
ci: standard linter config (#1102)
* ci: standard linter config

Signed-off-by: Long <long.dai@intel.com>

* Update utils.go

* fix pulsar issue

Signed-off-by: Long <long.dai@intel.com>

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-09-21 15:21:59 -07:00
Jigar 4f27152ec9
Merge branch 'master' into content-type 2021-09-14 18:29:46 +05:30
jigargandhi ecfbbd58ad Added content type to SetRequest struct 2021-09-14 18:26:36 +05:30
Ian Luo b208d80055
Add mysql conformance test (#1124)
* Add mysql conformance test and fix mysql state to make it pass the test #1122

* remove unused code

* add newline at end of Linux text file

* enhance setValue and relevant unit tests

* fix lint issue

* fix lint issue
2021-09-11 08:00:25 -07:00
Simon Leet 4f3581377e
Support DefaultIdentificationHydrator in cosmosdb state component (#1121)
Follow-up to #1104 to support AD Auth codepath as well.

`NewConfig()` and `NewConfigWithServicePrincipal()` both set the
`Config.IdentificationHydrator` to the `DefaultIdentificationHydrator`
in the underlying a8m/documentdb library. That implementation ends up
calling `reflect.Value.Elem.FieldByName()`, which requires that the
value passed to it is an interface or pointer, otherwise the Elem()
call fails to dereference which causes a panic.

cosmosdb.go passes the input to `UpsertDocument` by value today,
which is eventually passed to the `DefaultIdentificationHydrator`,
so changing the value passed to a pointer resolves the failure.

Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2021-09-02 19:00:53 -07:00
Simon Leet 874d62f391
Patch regression in cosmosdb state component Init (#1119)
PR #1104 introduced a regression in cosmosdb state component `Init()`
by creating a `NewConfig()` which sets a new DefaultIdentificationHydrator,
which causes a panic later when invoked.

Patch this by restoring the configuration setting to use a struct with
`nil` `IdentificationHydrator`.
2021-09-02 10:50:10 -07:00
Simon Leet 52bac7be17
Fix parseErr return in blobstorage Init() (#1108)
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2021-09-01 13:05:32 -07:00
Alessandro (Ale) Segala a992cd19f0
Support Azure AD auth for Cosmos DB (#1104)
* Support Azure AD auth for Cosmos DB

* Fixed linting errors

* Tidying go.sum

* Removed the need for nolint:shadow

Co-authored-by: Simon Leet <31784195+CodeMonkeyLeet@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2021-09-01 12:44:05 -07:00
Bernd Verst 059dc8c0d2
Conformance tests & bugfixes for SQLServer (#1078)
* enable sqlserver conformance test

* Update SQL Server conformance test setup

* Fix sqlserver bug introduced in Go 1.16

* sqlserver almost conformant

* Fix conformance tests and stored procedure

* all sqlserver tests passing

* Minor touchup

* lint

* Remove unnecessary condition

* Add conformance test to GitHub workflow

* remove env variable

* Update stored procedure

* Simplify error handling

* Update state/sqlserver/sqlserver.go

Co-authored-by: Simon Leet <31784195+CodeMonkeyLeet@users.noreply.github.com>

* Update state/sqlserver/sqlserver.go

Co-authored-by: Simon Leet <31784195+CodeMonkeyLeet@users.noreply.github.com>

Co-authored-by: Bernd Verst <me@bernd.dev>
Co-authored-by: Simon Leet <31784195+CodeMonkeyLeet@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2021-08-19 17:47:56 -07:00
Simon Leet ce0674fb48
Patch cosmosdb first-write without etag state test (#1069)
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2021-08-17 15:47:28 -07:00
Alessandro (Ale) Segala d0816e32a8
Updated to use common Azure auth logic (#972)
* Common Azure auth logic
- Currently implemented on secretstores/azure/keyvault and state/azure/blobstorage
- Supports Azure AD via service principal (client credentials, client certificate, MSI) - based on the previous authorizer for AKV
- Allows using other Azure clouds (China, Germany, etc)
- For Blob Storage state, supports using custom endpoints (like emulators like Azurite)

* Add environment variable aliases

* Address linter warnings

* another lint thing

* Fixed typo in method description

* Updated metadata key names so they're more consistent

* Fix test

* Some more linter things

Co-authored-by: Bernd Verst <me@bernd.dev>
Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
Co-authored-by: Bernd Verst <berndverst@users.noreply.github.com>
2021-08-10 15:06:24 -07:00
Bernd Verst aa7d2ee1dd
Adds Default TTL Option for Redis State Store (#1059)
* Adds Default TTL Option for Redis State Store

* Add additional tests

* Parse correct property key

Co-authored-by: Bernd Verst <me@bernd.dev>
2021-08-09 18:06:59 -07:00
Donovan Brown 5f8cb50306
Darquewarrior issue798 (#819)
* Reduced cyclomatic complexity of Multi
There was a lint warning on this function.

* Reduced cyclomatic complexity of Init

* Updated existing unit tests.
Added test for default table and database names.
And invalid database name.

* Got all Integration tests passing after refactor.

* All tests passing.

* Increasing code coverage

* Creating db in sqlserver state store is complete.

* Fixing gofumpt issues

Co-authored-by: Phil Kedy <phil.kedy@gmail.com>
2021-08-04 14:05:18 -07:00
Long Dai 10a2e5ee85
state: correct FIRST_WRITE (#995)
* state: correct FIRST_WRITE

Signed-off-by: Long Dai <long0dai@foxmail.com>

* add a test case

Signed-off-by: Long <long0dai@foxmail.com>
2021-08-03 17:26:45 -07:00
Bernd Verst 7df53a1d76
Adds support for TTL in Redis State Store (#990)
* Adds support for TTL in Redis State Store

* return explicit errors

* Refactor Redis TTL

* reduce nestedness

* Changing if logic for ttl to fit lint

* Ignore lint for nestif

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-07-14 16:37:51 -07:00
Bernd Verst c930c973e9
Adds support for TTL in Memcached State Store (PR Fixup) (#1011)
* Adds support for TTL in Memcached State Store

* parseTTL return error

* memcached parseTTL return value changed int to int32

* Update state/memcached/memcached.go

Co-authored-by: Bernd Verst <berndverst@users.noreply.github.com>

* Update state/memcached/memcached.go

Co-authored-by: Bernd Verst <berndverst@users.noreply.github.com>

* Fix up memcache TTL PR

Co-authored-by: Umut <umut-776@hotmail.com>
Co-authored-by: Umut <umut.comlekcioglu@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-07-14 16:17:51 -07:00
Bernd Verst a072ff36b0
Adds support for TTL in Cassandra State Store (#996)
* Adds support for TTL in Cassandra State Store

* Update cassandra.go

* Update cassandra_test.go

* Update cassandra.go

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-07-14 16:02:19 -07:00
Bernd Verst 37309935ca
Adds support for TTL in CosmosDB State Store (#991)
* Adds support for TTL in CosmosDB State Store

* return explicit errors

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-07-13 19:38:19 -07:00
Dmitry Shmulevich 1ac87d93c5
Add more tests for MongoDB state store component (#948) 2021-06-16 13:51:35 -07:00
Dmitry Shmulevich 1580e4ab04
Add 'server' field to MongoDB metadata to support DNS seedlist connection format. (#947)
*  for non-empty `server` field, the connection URI is set to 'mongodb+srv://<server>/'

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-06-16 11:32:22 -07:00
Phil Kedy a28587ed98
Resolving gofumpt issues (#932) 2021-06-09 15:18:50 -07:00
Taction 464d53d94b
Move the common Redis code to internal (#859)
* Move pubsub redis client to internal

* Add failover for common redis. Refactor state redis.

* refactor binding redis

* fix lint

* Refactor to setting partten

* fix db and lint

* fix lint

* for backward compatibility

* Using a type alias to handle decoding duration values of -1 for Redis.

* Linter fixes

Co-authored-by: Phil Kedy <phil.kedy@gmail.com>
2021-06-06 23:24:36 -07:00
Long Dai 95cc3f9b81
fix a typo (#910)
Signed-off-by: Long Dai <long0dai@foxmail.com>
2021-06-04 12:08:40 -07:00
문찬용 b387fcdff3
add Ping operation to`store` interface. (#757)
* add `Ping` operation.

* add `Ping` implementation of GA components

* add context to an argument for Ping

* add `Ping` implementation of blobstorage

* fix error string for passing lint

* Update blobstorage.go

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-05-25 23:48:46 -07:00
Jony4 2892d6abfa
add BulkGetResponse comments (#845)
Co-authored-by: Phil Kedy <phil.kedy@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-05-13 23:10:09 -07:00
Charlie Stanley b4e5569c24 Update Aerospike to v4.5.0 2021-05-10 18:40:33 +00:00
zhangchao 69b24d0394 fix lint 2021-04-23 22:32:26 +08:00
zhangchao b1c81523c2 fix add add a ctx context variable in the Redis struct. And implement `Close() error` function. 2021-04-23 22:15:33 +08:00
zhangchao 5190fe4e7d Merge branch 'master' into upgrade_redis_client_to_v8
resolve conflict

* master:
  Increasing overall test timeout to allow for conformance tests to run (#834)
  Improve SMTP binding performance (#782)
  add redis cluter mode for pubsub (#823)
  downgrade the verbosity of lock renewal errors from warn to debug. This error is expected when messages are processed before beingrenewed (#803)
  Improve pulsar publisher performance. (#827)
  optimze(state/redis): output detail redis error (#825)
  Consul nameresolution component (#750)
  Add DNS name resolver. Add unit tests. (#743)
  Azure Service Bus: Changed log level of error on close to info (#830)
  Removed dependency on dapr/dapr in favor of dapr/kit. Fixed go mod dependencies afterwards. Go 1.16 in go.mod. Removed accidental log dependency. (#807)
  Update state/blobstorage.go to add metadata. (#786)
  Azure Service Bus publishing retries when server is "too busy" (#821)

# Conflicts:
#	bindings/redis/redis.go
#	go.mod
#	go.sum
#	pubsub/redis/redis.go
2021-04-22 09:13:01 +08:00
yellow chicks 2320824409
optimze(state/redis): output detail redis error (#825)
Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2021-04-21 10:43:05 -07:00
Phil Kedy 688df9bda4
Removed dependency on dapr/dapr in favor of dapr/kit. Fixed go mod dependencies afterwards. Go 1.16 in go.mod. Removed accidental log dependency. (#807) 2021-04-19 12:06:10 -07:00
Daniel Beall a35a715f9c
Update state/blobstorage.go to add metadata. (#786)
Co-authored-by: Phil Kedy <phil.kedy@gmail.com>
2021-04-15 21:40:09 -07:00
Phil Kedy 814145dca3
Merge branch 'master' into upgrade_redis_client_to_v8 2021-04-12 19:52:16 -04:00
zhangchao 3ec4b336a9 upgrade go-redis/redis to v8, and use context in pubsub/redis to cancel redis request. 2021-04-10 23:41:58 +08:00
Syuparn 760a4caccc fix password config for redis sentinel state 2021-03-27 19:21:45 +09:00
Artur Souza aed9b583d9
Merge branch 'master' into fix_cosmosdb_contenttype 2021-03-17 23:27:25 -07:00
yellow chicks c3b161ed83
fix(typo): state redis log (#761) 2021-03-17 23:14:56 -07:00
Artur Souza 683246700e Add error check for required fields in cosmosdb. 2021-03-16 15:21:13 -07:00
Artur Souza 4f8e7f3358 Defaults to application/json for cosmosdb in init() 2021-03-16 15:10:40 -07:00
Artur Souza 0d44da776c Fix cosmosdb state store to handle content-type, with JSON as default. 2021-03-16 12:39:16 -07:00
Artur Souza 931048aa60
Add Feature list for state store. (#744)
* Add Feature list for state store.

* List Transactional as a feature for state store.

* Fixing comments about etag.
2021-03-05 14:55:23 -08:00
Phil Kedy a15c616bb0
Make state.GetResponse ETag to a *string (#733)
* Make state.GetResponse ETag to a *string

* Small fixes post merge of #716

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-03-03 13:28:59 -08:00
halspang cb3c881d39
Add ETag operation to statestore conformance test (#716)
* Add ETag operation to statestore conformance test

ETags are used to enable concurrency guarantees and are part of the
statestore specification. Not all stores need to use them, however
if the store chooses to, it should be part of the certification
process. This commit adds a simple ETag test scenario that verifies
the basic behaviors of ETags.

https://github.com/dapr/components-contrib/issues/711

* Update tests.yml

* Error on mongodb when etag does not match on delete.

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-03-03 12:27:10 -08:00
Artur Souza a8de09faf4
Adds etag support to MongoDB. (#729)
* Adds etag support to MongoDB.

* Addressing PR comments.

* Remove empty etag check.
2021-03-01 15:02:28 -08:00
Artur Souza 2562908dee
Conf state trx + Change mongodb get result for key not found + Fix byte[] in cosmosdb (#680)
* Add state transaction conf test.

* Does not return error for key not found in mongodb.

* Rewrite state conf test.

* Handle []byte in cosmosdb state txn (#664)

Fixes: dapr/dotnet-sdk#579

The issue here is that we had missed the case of pre-marshaled bytes in
the state transaction code path, which would result in the encoding/json
package doing it's normal thing and base64 encoding the data as a JSON
string.

The fix is to use json.RawMessage to avoid that. Turns out this code can
be simplified a bit.

* Fix cosmosdb handling of byte[].

* Fix lint.

* Fix UT for cosmosdb.

* Remove config from state store conf test.

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2021-02-10 18:15:59 -08:00
Yaron Schneider 3ef025c604
change headers (#679) 2021-02-09 18:57:55 -08:00
Trond Hindenes 83975462bf
State:Dynamodb - Dont require access key/secret (#652)
* Dont require access key/secret

* Validate table name

* Fixed test issues

* Fix failing tests....?

* gofmt-ed files

* Remove unneeded fmt statement
2021-02-03 11:19:32 -08:00
Donovan Brown 5368d25951
Adding MySQL State Component (#612)
* Adding MySQL State Component

* Fixing File is not `gofumpt`-ed (gofumpt)

I believe the issue was No empty lines before a simple error check

* Fixing final lint errors that only showed up in CI

* gofumpt-ed in test files.

* Changing error for affected rows.
Want to distinguish database errors from application errors.

* The database (schema) can now be created for you.

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2021-01-26 12:29:57 -08:00
Yaron Schneider 99256e6bec
Provide distinction between missing and empty etags (#600)
* provide distinction between missing and empty etags

* linter

* linter 2
2021-01-14 10:41:38 -08:00
Yaron Schneider 37815ad9a5
export etag error kind (#585) 2021-01-11 12:40:35 -08:00
Yaron Schneider f44673c311
add missing error checks for etag errors (#584) 2021-01-11 10:15:47 -08:00
Yaron Schneider 4d3e1be105
Treat etag errors across all state stores (#579)
* treat etag errors across all state stores

* linter

* linter
2021-01-08 18:59:42 -08:00
Yaron Schneider 10b3dc16fe
fix couchbase serialization (#552) 2020-12-07 09:43:46 -08:00
Sky/敖小剑 5dc3587f7d
Add bulk get in state store - Plan B (#532)
* add BulkGet method on state store

* add a bool value in bulk get method to tell dapr if this store supports bulk get or not

* add  BulkGetResponse for bulk get; rollback GetResponse to remove new added filed key

* update to use BulkGetResponse for bulk get

* fix lint issues

* fix lint issues

* fix lnit issues
2020-11-26 23:07:27 -08:00
Trond Hindenes 8d6978372f
Various AWS improvements (#525)
* Support sessiontoken

* Fixed tests and other components

* Fixed tests and things

* fmt

* Fix lint errors

* gofmt

* Fixed lint bugs

* Remove unneeded parameter

* gofmt

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2020-11-23 13:21:29 -08:00
Aaron Crawfis a27e486ef9
Update docs with new docs links (#513) 2020-10-26 11:52:20 -07:00
Sky/敖小剑 4e77594a4d
remove etcd state store to prepare to update grpc to new version (#499)
* remove etcd state store to prepare to update grpc to new version

* update go.mod

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2020-10-15 09:53:49 -07:00
halspang f647d9eedb
Upgrade golang lint to 1.31 (#490)
Upgrade golang lint to 1.31.0

https://github.com/dapr/components-contrib/issues/439
2020-10-12 12:54:15 -07:00
Jack M 1a5a72e4a9
Fixed #488 - Update state store list in readme. (#489)
Co-authored-by: Jack M <root@exegete.me>
2020-10-06 11:16:44 -07:00
Artur Souza ab1ff1055a
Fixing bug where trx del in redis fails without etag. (#482) (#484) 2020-09-26 18:24:12 -07:00
Mark Chmarny fbc3a3dd87
RethinkDB state store support (#423)
* rethinkdb state store

* added actor state change binding

* updated db record

* reconnect

* passing lint

* updated binding repsonse keys

* rethinkdb load test

* lint validated tests

* updated comments

* updates TransactionalStateRequest

* parameterized table

* correct error message

Co-authored-by: Young Bu Park <youngp@microsoft.com>
2020-09-24 16:19:14 -07:00
Nghia Tran e51cff7fec
Use concurrency control in Multi() (#466)
Change Multi() to use same setQuery and delQuery mechanisms as Set() and Delete().
2020-09-22 15:13:39 -07:00
Mukundan Sundararajan d2ee3200cd
Properly handle serialization deserizliation for redis transaction api. (#460)
* Properly handle serialization deserizliation for redis, postgres transaction api.

* Convert marshaler to a utils function.

* Add license comment

* init error inline
2020-09-15 12:54:29 -07:00
AbserAri 2b1103ec9f
Redis failover feature (#459)
* update logger form nats-io's to dapr's

* run go mod tidy and go mod delete the nats-io gnatsd

* update rabbitmq prefetch feature because want to set each instance the number of messages could  hold in once until ack.

* update for parse int

* update parseMetadata of rabbitMQ to read prefetchCount by string.

* [update rabbitMQ binding parseMetadata] Make error clear

* update the redis failover metadata

* [in rabbitMQ metadata parse] fix the bug of golint

* [redis statestore failover feature] add new client logic.

* update redis metadata as advice.

maligned struct of size 80 bytes could be of size 72 bytes.

* update rabbitMQ with a new parseMetadata way.

* omit comparison to bool constant as golangci-lint.

* [typo] matser -> master

* Revert "Merge branch 'master' of https://github.com/dapr/components-contrib into dapr-master"

This reverts commit 9a91bccc4b, reversing
changes made to 7e0cb1fa2d.

* Revert "Revert "Merge branch 'master' of https://github.com/dapr/components-contrib into dapr-master""

This reverts commit 110ef82681.

* Revert "Merge branch 'master' of https://github.com/dapr/components-contrib into dapr-master"

This reverts commit 9a91bccc4b, reversing
changes made to 7e0cb1fa2d.

* solve the conflct

* merge from the master to accept the change

* remove the defaultFailover as the reviewed.

* move newclient to function

* Update state/redis/redis.go

Co-authored-by: Nghia Tran <tcnghia@gmail.com>

* update comment to /* #nosec  */

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
Co-authored-by: Nghia Tran <tcnghia@gmail.com>
2020-09-14 17:14:52 -07:00
Leon Mai 857d5652bd
Use metadata at top level instead of per request (#452)
Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2020-09-04 09:56:27 -07:00
Young Bu Park c69d5ea2ca
Add metadata property to TransactionalRequest (#430)
* Add Metadata to transactional request

* Use new transactional request strcut
2020-08-12 09:30:37 -07:00
Shalabh Mohan Shrivastava 42668a8ae1
State Store Components changes to adhere runtime changes for removing retry options (#426)
* State Store Components changes to adhere runtime changes for removing state retry options

* resolving code review comments - common method to CheckRequestOptions
2020-08-11 10:50:31 -07:00
Leon Mai 65575593c1
Sql component should save db object on Init instead of creating a new (#399)
one per operation.

Separately, if data arrives as []byte (as in grpc case) don't Marshal
it.

Co-authored-by: LM <lemai>
2020-07-29 15:26:07 -07:00
Sivamuthu Kumar 6085834d79
Add blob storage as state store (#348)
* Add blob storage as state store

* Updated comments for blob storage

Co-authored-by: Young Bu Park <youngp@microsoft.com>
Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2020-07-22 08:49:20 -07:00
LMWF 1983d86849 merge 2020-07-14 13:59:29 -07:00
Leon Mai 85aca5ac44
Merge branch 'master' into cosmos4 2020-07-14 13:45:03 -07:00
LMWF 15be14b9b3 cleaned up 2020-07-14 13:17:38 -07:00
LMWF 17d3d0b848 #377 - cosmos deserialization issue 2020-07-13 20:07:36 -07:00
Brooke Hamilton a0a293ca1b
[WIP] PostgreSQL State Store (#353)
* Added postgres state files

* Fix SQL Server integration tests. (#324)

* Initial unit and int tests for postgres

* Implemented dbaccess interface

* Formatting updates

* Create state table if not exists

* Initial set implementation

* Get and set with integration test

* Added delete

* Create date and update date in database

* Integration tests for bulk set and bulk delete

* Etag processing, test refactor

* Added tests for etag processing

* Updated const, removed public metadata fields

* Cleanup edits

* Fixed linting issues

* Ran go mod tidy

* Initial implementation of TransactionalStore

* Fixed linting issues

* Added tests and validation

* Test for creating the state table

* Fixed issue with parsing param value as string

* Update to integration tests

* Fixed linting issues

* Added retry logic from state

* Changed primary key to text

* Updated debug logging

* Review updates

Co-authored-by: Young Bu Park <youngp@microsoft.com>
Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2020-07-09 13:56:08 -07:00
Leon Mai a086a42f2b
Implement the Multi() interface method adding transaction support in … (#372)
* Implement the Multi() interface method adding transaction support in the cosmos db component.  The implementation
uses a stored procedure to do this.  The stored procedure is registered in Init().

* linter

* code review comments

* code review

* remove comment

* casing and de-dup

* use 'in' in query

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2020-06-30 13:32:41 -07:00
Shalabh Mohan Shrivastava 007dbd03b0
Fix for context deadline exceeded issue - use operation timeout (#370) 2020-06-25 15:11:56 -07:00
Shalabh Mohan Shrivastava 7b0fbe65cc
Setting URL correctly when username/password is not provided (#369)
* Adding Username/password optional

* fixing lint errors
2020-06-25 13:29:52 -07:00
Mukundan Sundararajan 5c62707aba
Upgrade go version to 1.14.3 and linter version to 1.26.0 (#352)
* Upgrade to go 1.14.3 and linter version to 1.26.0
2020-05-29 15:26:33 -07:00
Sashi Kumar 42a7af4c0c
[DynamoDB] Update BulkSet and BulkDelete with BatchWriteItem (#331)
* [DynamoDB] Update BulkSet and BulkDelete with BatchWriteItem

* Validate type of value

* Marshal value before setting for Set and BulkSet

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2020-05-27 15:12:34 -07:00