Commit Graph

104 Commits

Author SHA1 Message Date
ItalyPaleAle a458401391 Changed handling of multiple headers
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-10-06 19:58:45 +00:00
ItalyPaleAle 592b1dd86b Changed to use TODO per @mukundansundar's feedback
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-10-06 19:09:14 +00:00
ItalyPaleAle b59b443ffb Addressed @mukundansundar's review feedback
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-10-06 18:57:33 +00:00
ItalyPaleAle 8d839c4aff 💄
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-09-29 20:30:16 +00:00
ItalyPaleAle 8b8fcb4af6 Updated missing e2e tests
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-09-29 20:29:00 +00:00
ItalyPaleAle 7a1a623ea7 Updated the last middlewares
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-09-29 20:21:41 +00:00
ItalyPaleAle d24644b299 Fixes for routechecker to maintain previous behavior
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-09-29 19:58:31 +00:00
ItalyPaleAle 912f5ee055 wip
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-09-29 18:37:59 +00:00
ItalyPaleAle e3d2ada01c Updated more middlewares
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-09-29 18:25:52 +00:00
ItalyPaleAle 038bcf4666 Updated OAuth2 middleware
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-09-29 00:26:47 +00:00
ItalyPaleAle fb76c277af Started work on converting middlewares to net/http
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-09-28 23:25:58 +00:00
yellow chicks acf698ee4b
optimize(middleware): Middleware to middleware.Middleware API (#2039)
Signed-off-by: 1046102779 <seachen@tencent.com>

Signed-off-by: 1046102779 <seachen@tencent.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-09-23 10:13:54 -07:00
Bernd Verst 9725da7cc6 Use Go 1.19 everywhere
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-09-21 14:56:20 -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
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
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
Loong Dai 419e296d35
middleware: add wasm basic (#1747)
* middleware: add wasm basic

Signed-off-by: Loong <loong.dai@intel.com>

* Update middleware/http/wasm/basic/basic.go

* Update middleware/http/wasm/basic/basic.go

Co-authored-by: Taction <zchao9100@gmail.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-06-13 12:18:06 -07:00
Ben Kotvis 1ef6cc5cdc
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>
2022-04-28 13:53:15 -07:00
pigletfly 5673b28b13 Add context in bindings interface
Signed-off-by: pigletfly <wangbing.adam@gmail.com>
2022-04-25 14:16:15 +08:00
Artur Souza 339624b7a3
Update daprd in cert tests. (#1511)
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
2022-02-18 14:42:19 -08:00
Joni Collinge 3af57ca5b7
Fix not setting status code in nethttpadaptor on response (#1429)
* fix not setting status code in nethttpadaptor on response

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* make test name consistent

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* git mod tidy

Signed-off-by: Joni Collinge <jonathancollinge@live.com>
2022-01-13 07:31:29 -08:00
Dmitry Shmulevich c7adb917f3
update license to Apache v2.0 (#1406) 2022-01-04 19:53:31 -08:00
xj524598 3a7137f9a1
update some ratelimit_middleware.go comments (#1330)
Co-authored-by: xujie <xujie1@shein.com>
2021-11-24 16:16:57 +02:00
yellow chicks 0268491990
feature(middleware/routerchecker): avoid sending dirty data to opentelemetry system and logic servers. (#1155)
* feature/pubsub: add delay queue params for pulsar

* feature/pubsub: add delay queue params for pulsar

* feature/pubsub: add delay queue params for pulsar

* feature: add middleware/routerchecker to reduce dirty data report opentelemetry

* feature: add middleware/routerchecker to reduce dirty data report opentelemetry

* Update pulsar.go

* feature: add middleware/routerchecker to reduce dirty data report opentelemetry

* feature: add middleware/routerchecker to reduce dirty data report opentelemetry

Co-authored-by: Long Dai <long.dai@intel.com>
Co-authored-by: Simon Leet <31784195+CodeMonkeyLeet@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-11-09 18:49:29 -08:00
zhangchao 3dc1d962d7 add notes 2021-10-26 22:32:24 +08:00
zhangchao b02b06be09 fix tests 2021-10-26 22:17:54 +08:00
Long Dai dd81ef7e42
Merge branch 'master' into fix_opa_middleware 2021-10-26 09:34:14 +08:00
richgo 3df47a52bd
middleware opa add body (#1165)
* included body in opa middleware which is required to do graphql field level authorisation

* fix broken test and middleware

* Update middleware_test.go

* go fmt

* goimports + gofumpt

Co-authored-by: Simon Leet <31784195+CodeMonkeyLeet@users.noreply.github.com>
Co-authored-by: Long Dai <long.dai@intel.com>
Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2021-10-25 15:43:43 -07:00
zhangchao bf5d70f4b9 fix(opa middleware): fix termination judgment condition 2021-10-22 11:27:19 +08: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
Taction 3a109e2c74
fix http opa middleware status code parse (#1136)
* fix http opa middleware status code parse

* fix for review

* use json unmarshal to handle edge cases.

* fix review

Co-authored-by: Simon Leet <31784195+CodeMonkeyLeet@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-09-17 10:58:01 -07:00
Phil Kedy a28587ed98
Resolving gofumpt issues (#932) 2021-06-09 15:18:50 -07:00
Long Dai 4ee732e0bd
ci: enable gofumt linter (#887)
Signed-off-by: Long Dai <long0dai@foxmail.com>
2021-05-27 22:21:24 -07:00
Ian Luo 55ee03a5a0
Sentinel middleware support (#829)
* a prototype for sentinel middleware

* adapt sentinel's logger to dapr and optimize configs

* fix lint issue

* fix lint issues

* go mod tidy

* revise accoring to the review comments

* go mod tidy

* enhance unit tests

* fix lint issue

* fix go.sum

Co-authored-by: Phil Kedy <phil.kedy@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-05-13 12:11:24 -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
Yaron Schneider 3ef025c604
change headers (#679) 2021-02-09 18:57:55 -08:00
Stepan 5e9140f1db
Adding force https metadata key (#487)
* adding force https metadata and its handler code

* make https a const; change ForceHTTPS to lowercase before compare with true

* replacing strings.ToLower with strings.EqualFold due to lint error in Build linux_amd64 binaries check

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
Co-authored-by: Young Bu Park <youngp@microsoft.com>
2020-10-22 14:51:07 -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
Richard Simpson 775bbebc6a
feat(middleware): add opa middleware (#456)
* feat(middleware): add opa middleware

* address linting feedback

* unwind logic a little more

* are we gonna need to throw hands lint?

* remove accidental assertion lib include

* address pr feedback

* expand test suite to headers

* fix errors and moar test

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2020-09-12 12:29:42 -07:00
Florian Wagner e60fa843f2
Adding middleware component for non interactive oauth2 client credentials flow (#431)
* Initial commit with mock not working

Signed-off-by: Florian Wagner <flwagner@microsoft.com>

* changed structure for mocking, added first test

Signed-off-by: Florian Wagner <flwagner@microsoft.com>

* oauth2clientcredentials input checks and tests

Signed-off-by: Florian Wagner <flwagner@microsoft.com>

* rename metadata authHeaderName to HeaderName

Signed-off-by: Florian Wagner <flwagner@microsoft.com>

* Run 'go mod tidy'

Signed-off-by: Florian Wagner <flwagner@microsoft.com>

* use dapr logger from caller

Signed-off-by: Florian Wagner <flwagner@microsoft.com>

* Fix additional lint requirements by build pipeline

Signed-off-by: Florian Wagner <flwagner@microsoft.com>

Co-authored-by: Florian Wagner <flwagner@microsoft.com>
Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2020-08-16 11:05:24 -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
Joni Collinge aa4f9e8753
handle uservalues (#333) 2020-05-20 17:02:47 -07:00
Ben Coleman 1ab1a86a60
Small misspelling in error messages (#299) 2020-04-07 11:41:58 -07:00
Young Bu Park ee97c3c56a
Use dapr logger (#238)
* Use dapr logger

* skip linter false alarm
2020-02-28 15:49:49 -08:00
Joni Collinge 5b75f4d0fb
Changed how proto header is converted to string (#228)
* changed how proto header is converted to string

* added test for proto headers

* removed obsolete assert in test
2020-02-19 08:49:14 -08:00
Joni Collinge e67ea01fbe
Added check to handle nil request body in nethttpadaptor (#218) 2020-02-10 12:36:52 -08:00
Joni Collinge 6c65fda88d
Add Rate Limiting Middleware (#193)
* add initial ratelimit middleware

* fixed linting issues

* updated rate limiting logic

* removed redundant const

* remove obsolete go.uber.org/ratelimit reference in go mod

* migrated from juju/ratelimit to tollbooth rate limit

* moved adaptor to a separate package and added tests

* added RemoteAddr

* moved handler wrapped outside hot path

* fix linter
2020-02-07 13:25:36 -08:00
Abhishek Gupta 6de230391d
Aerospike state store implementation (#196)
* aerospike state store impl

* fixed linter issues:

* addressed feedback

* Delete bearer_middleware.go

* Delete cassandra_test.go

* Revert "Delete cassandra_test.go"

This reverts commit 462c066814.

* Revert "Delete bearer_middleware.go"

This reverts commit ae114a1df1.

Co-authored-by: Young Bu Park <youngp@microsoft.com>
2020-01-28 18:55:14 -08:00
Marcin Kosieradzki 381777dc3b Implemented OIDC Bearer middleware (#188)
* Implemented OIDC Bearer middleware

* Fixed indentation
Added support for case-insensitive scheme
Moved scheme to constant

Co-authored-by: Aman Bhardwaj <amanbha@users.noreply.github.com>
2020-01-16 13:26:30 -08:00
Abhishek Gupta 9323c44ecf check etag for etcd update and delete ops (#175) 2020-01-09 12:33:23 -08:00
Haishi2016 98999a6044
fix regression switching to session which missed header injection (#157) 2019-12-19 10:22:52 -08:00
Haishi2016 701f12e529
oAuth2 HTTP middleware (#151)
* oAuth2 HTTP middleware

* fix go mod

* refactor to use sessions

* go mod tidy
2019-12-17 09:43:14 -08:00