Commit Graph

88 Commits

Author SHA1 Message Date
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
1046102779 203c6c7757 feature: add context to state API
Signed-off-by: 1046102779 <seachen@tencent.com>
2022-10-25 07:21:35 +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 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
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
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
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
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
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
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
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
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
Dmitry Shmulevich c7adb917f3
update license to Apache v2.0 (#1406) 2022-01-04 19:53:31 -08: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
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
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
문찬용 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
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
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
Yaron Schneider 3ef025c604
change headers (#679) 2021-02-09 18:57:55 -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 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
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
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
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
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
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