- Nov 11, 2021
-
-
Niklas Adolfsson authored
* ws server: don't kill connection max limit exceeds * Update ws-server/src/server.rs * actually use max size in soketto * rewrite me * improve logs * use soketto fix * rewrite me * fix nit * revert unintentional change * use soketto 0.7.1 * fix logger * Update ws-server/src/server.rs Co-authored-by: David <[email protected]> * Update ws-server/src/server.rs Co-authored-by: David <[email protected]> * Update ws-server/src/server.rs Co-authored-by: David <[email protected]> * Update ws-server/src/server.rs Co-authored-by: David <[email protected]> * Update ws-server/src/server.rs Co-authored-by: David <[email protected]> * fix build * reject too large response * fix some DRY code * feat: bounded serializer for RpcModule * Update utils/src/server/helpers.rs Co-authored-by: Maciej Hirsz <[email protected]> * Update utils/src/server/helpers.rs Co-authored-by: Maciej Hirsz <[email protected]> * address grumbles: safety and other nits * address grumbles: MaxCallSize on closures instead * Update utils/src/server/helpers.rs Co-authored-by: David <[email protected]> * use max response size on errors too * Revert "use max response size on errors too" This reverts commit 3b07e42d257b2eebae311b92b7f72594d94d5f87. * include max limit in error response Co-authored-by: David <[email protected]> Co-authored-by: Maciej Hirsz <[email protected]>
-
- Nov 09, 2021
-
-
Niklas Adolfsson authored
* ws server: don't kill connection max limit exceeds * Update ws-server/src/server.rs * actually use max size in soketto * rewrite me * improve logs * use soketto fix * rewrite me * fix nit * revert unintentional change * use soketto 0.7.1 * fix logger * Update ws-server/src/server.rs Co-authored-by: David <[email protected]> * Update ws-server/src/server.rs Co-authored-by: David <[email protected]> * Update ws-server/src/server.rs Co-authored-by: David <[email protected]> * Update ws-server/src/server.rs Co-authored-by: David <[email protected]> * Update ws-server/src/server.rs Co-authored-by: David <[email protected]> * fix build Co-authored-by: David <[email protected]>
-
- Oct 15, 2021
-
-
Niklas Adolfsson authored
-
- Oct 12, 2021
-
-
Niklas Adolfsson authored
-
Niklas Adolfsson authored
* update CHANGELOG * bump version number * fix nit * Update CHANGELOG.md Co-authored-by: David <[email protected]> * bullet list in CHANGELOG * add last item to CHANGELOG Co-authored-by: David <[email protected]>
-
- Oct 05, 2021
-
-
Niklas Adolfsson authored
* feat(ws client): support redirections * reuse socket * reuse socket * add hacks * fix build * remove hacks * fix bad merge * address grumbles * fix grumbles * fix grumbles * fix nit * add redirection test * Update test-utils/src/types.rs * Resolved todo * Check that redirected client actually works * Rename test-utils "types" to "mocks" * Fix windows test (?) * fmt * What is wrong with you windows? * Ignore redirect test on windows * fix bad transport errors * debug windows tests * update soketto * maybe fix windows test * add config flag for max redirections * revert faulty change. Relative reference must start with either `/` or `//` * revert windows path * use manual join paths * remove url dep * Update ws-client/src/tests.rs * default max redirects 5 * remove needless clone vec * fix bad merge * cmon CI run Co-authored-by: David Palm <[email protected]>
-
dependabot[bot] authored
* Update soketto requirement from 0.6 to 0.7 Updates the requirements on [soketto](https://github.com/paritytech/soketto) to permit the latest version. - [Release notes](https://github.com/paritytech/soketto/releases) - [Changelog](https://github.com/paritytech/soketto/blob/develop/CHANGELOG.md) - [Commits](https://github.com/paritytech/soketto/compare/v0.6.0...v0.7.0 ) --- updated-dependencies: - dependency-name: soketto dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * set_origin -> set_headers * fmg Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Maciej Hirsz <[email protected]>
-
- Sep 14, 2021
-
-
Maciej Hirsz authored
* Reject overflowing connection with status code 429 * fmt * rename Handshake -> HandshakeMode for clarity; verbose test * Gracefully shutdown after rejecting to hopefully fix the errors on windows * HandshakeMode -> HandshakeResponse; tweak pending subscriptions on shutdown test
-
- Sep 11, 2021
-
-
David authored
-
- Aug 25, 2021
-
-
David authored
* Add license headers where missing and update year * Update examples/http.rs Co-authored-by: Niklas Adolfsson <[email protected]> Co-authored-by: Niklas Adolfsson <[email protected]>
-
- Aug 09, 2021
-
-
Niklas Adolfsson authored
To make sure that we are not affected by: - https://github.com/hyperium/hyper/security/advisories/GHSA-f3pg-qwvg-p99c - https://github.com/hyperium/hyper/security/advisories/GHSA-5h46-h7hh-c6x9 However, `hyper 13` is not fixed but I think we should remove that support anyway?!
-
- Jul 12, 2021
-
- Jun 25, 2021
-
-
Niklas Adolfsson authored
* [ci]: test each crate outside workspace We have bitten by these a few times now with that some features are leaked from the workspace which makes it compile in the workspace but not using it's own Cargo.toml. * [ci]: add tests for macos and windows * add missed `WsServer` and `HttpServer` * [ws server]: fix features * debug failure in CI * remove platform dependent assertion * fix nit; proc-macros is proc-macros * restore removed assertion * remove whitespaces
-
- Jun 18, 2021
-
-
Maciej Hirsz authored
* Initial implementation * Comments * Send a 403 on denied origin * Noodling around with `set_allowed_origins` * Error on empty list * Soketto 0.6 * fmt * Add `Builder::allow_all_origins`, clarify doc comments * Rename Cors -> AllowedOrigins, nits, no panic
-
- Jun 04, 2021
-
-
David authored
* Release prep * Mention proc macro limitations * Mention publish script
-
- Jun 03, 2021
-
-
David authored
* Add a builder to the ws server * Use the WsServerBuilder in tests&examples * cleanup * fmt * Fix benches * fix error message * Add connection count limiting and associated config item * Use the strong_count to `methods` to know how many connections we currently have * Fix test
-
Igor Aleksanov authored
* Stick test code to a single runtime * Replace async-std in ws-client with tokio * Replace std::thread::sleep with tokio::time::sleep in test * Add compatibility layer for tokio v0.2 * Add check for both features being enabled + some improvements * Update ws-client/src/tokio.rs Co-authored-by: Niklas Adolfsson <[email protected]>
-
- Jun 02, 2021
-
-
David authored
* Misc async methods tinkerings * Update utils/src/server/rpc_module.rs Co-authored-by: Niklas Adolfsson <[email protected]> * Update types/src/v2/params.rs Co-authored-by: Niklas Adolfsson <[email protected]> * Fix review grumbles * fmt Co-authored-by: Niklas Adolfsson <[email protected]>
-
- May 27, 2021
-
-
Niklas Adolfsson authored
-
Niklas Adolfsson authored
Make it more flexible for users to select which version of `async-std` to use.
-
Niklas Adolfsson authored
The reason is that `Receiver::next` won't panic polling after `Ok(None)` has been received.
-
Niklas Adolfsson authored
-
- May 22, 2021
-
-
Igor Aleksanov authored
* Add extension trait to timeout the futures execution * Use timeout for ws-server tests * Use timeout for ws-client tests * Use timeout for http-server tests * Use timeout for http-client tests * Make TimeoutFutureExt interafaces more explicit
-
- May 12, 2021
-
-
Billy Lindeman authored
* Rename NotifResponse to SubscriptionResponse to make room for new impl * Add support for on_notification Subscription<T> types * Fix handling of NotificationHandler in manager * cleanup * Implement NotificationHandler to replace Subscription<T> and clean up plumbing * More cleanup * impl Drop for NotificationHandler * Address pr feedback #1 * ws client register_notification pr feedback 2 * Fix doc * fix typo * Add tests, get NH working * More cleanup of String/&str * fix doc * Drop notification handler on send_back_sink error * ws client notification auto unsubscribe when channel full test
-
- May 07, 2021
-
-
David authored
* Batch requests over the websocket * Use same call signature for both http and ws server * Use CallError instead of InvalidParams Add a draft batch request test * Sort out formatting of batch responses Cleanup Use CallError * Add test for slow method calls * Update utils/src/server.rs Co-authored-by: Niklas Adolfsson <[email protected]> * Add benchmark for batched websocket requests * rename * Rename batch channels * Sort out the InvalidParams situation * Remove one level of InvalidParams Return app-level error when call fails * Update ws-server/src/server.rs Co-authored-by: Andrew Plaza <[email protected]> * Update ws-server/src/server.rs Co-authored-by: Andrew Plaza <[email protected]> Co-authored-by: Niklas Adolfsson <[email protected]> Co-authored-by: Andrew Plaza <[email protected]>
-
- May 04, 2021
-
-
Niklas Adolfsson authored
* ret err if context/params fails * address grumbles: specific error_code context fail * address grumbles: make env_logger dev-dependency * address grumbles: add tests * chore(deps): remove unused deps * address grumbles: rename types and docs * address grumbles: more renaming. * fix build
-
- Apr 27, 2021
-
-
Niklas Adolfsson authored
-
- Apr 20, 2021
-
-
Niklas Adolfsson authored
-
- Apr 16, 2021
-
-
Niklas Adolfsson authored
* [deps futures]: remove unused features I got annoyed that we bring in `futures-executor` as a dependency however `soketto` does this too, so doesn't help for the `WS` stuff. * cargo fmt
-
- Apr 15, 2021
-
-
Niklas Adolfsson authored
* add wrapper crate * add jsonrpsee crate back * [jsonrpsee]: feature gate modules * [proc macros]: support crate renaming of `types` * Update proc-macros/src/lib.rs Co-authored-by: David <[email protected]> * re-export types * [proc macros]: remove unused features * Update proc-macros/Cargo.toml * fix bad merge Co-authored-by: David <[email protected]>
-
- Mar 02, 2021
-
-
Niklas Adolfsson authored
* draft: client trait sketch... * use async_trait instead of `Box<Future>` * refactor client trait * [types]: shared client types. * integrate with `jsonrpsee_proc_macros::rpc_api` * Update proc-macros/src/lib.rs * integrate with proc macros * fix: hacky support for generic types in proc macro * fix: make the examples work. * trait: error associated type * Update types/src/traits.rs * client trait: make object safe. Make the trait usable as a trait object i.e, `Box<dyn Trait>` * client trait: remove `Self::Sized` * add tests for proc macros. * fix build * fmt * [client trait]: remove unused associated error typ * [proc macros]: separate enum variant each return_t * add tracking issue to `TODO` * doc(client trait): improve documentation. * separate trait for subscribing client * add documentation * proc macros: remove debug impl * fix compile warns * address grumbles: remove fn process_response * Update types/src/client.rs Co-authored-by: David <[email protected]> * Update types/src/client.rs Co-authored-by: David <[email protected]> * Update types/src/client.rs Co-authored-by: David <[email protected]> * Update types/src/client.rs Co-authored-by: David <[email protected]> * Update types/src/client.rs Co-authored-by: David <[email protected]> * remove old proc macro tests * address grumbles: shorter lines Co-authored-by: David <[email protected]>
-
- Jan 18, 2021
-
-
Niklas Adolfsson authored
* update http example * ungeneric crate * update dependencies * [client]: add WebSocket client again. * [deps]: remove needless dev dependencies * nits: forgot to commit new files * [ws client]: `send_text` instead of `send_binary` This is temporary fix to work with the `server` which assumes that `WebSocket` resonses are `text` * chore: add a bunch of more logging * [ws]: port tests but some are failing. * chore: fmt * [server API]: expose `fn local_addr` as public API. * [tests]: make them less ugly by using `127.0.0.1:0` * fix: a bunch of compiler warnings. * [api]: uniform naming, `bind -> new` in transport. * [websocket server]: reply when deserial fails When the server receives an request with invalid JSON `-32700, Parse error shall be returned` * chore: fmt * [tests]: fix remaining tests * [websocket server]: support `binary` and `text` * [ws server]: fix bug in subscription response. `.await` was missing in RegisteredSubscription::send() and no responses were actually sent which this commit fixes. * [client API]: export `WsSubscription` * [examples]: use `localhost` instead of `127.0.0.1` Hostname is required when using `wss` and `127.0.0.1` is not valid hostname. * [examples]: add subscription example. * chore: fmt * [ws server]: fix bug register new subscription. Fixes newly introduced bug that causes `register_subscription` to have side-effects even if the subscription fails. * fmt * more uniform logs * [ws server]: simple subscription test. * [ws server]: subscription tests improved. * [tests]: extract test helpers to a separate crate (#125) * [ws server]: don't close connection when `deserialization` fails (#131) * [ws server]: don't close conn. when `deser` fails * Update src/ws/transport.rs * grumbles: prefer matching of if else. * chore: CI warn `intra_doc_link_resolution_failure` (#139) Since we have not updated the documentation properly it's annoying that the entire job fails. * chore: rustfmt.toml (#138) * chore: add `rustfmt.toml` for formatting * style: `cargo fmt --all` with new config * [server raw params]: fix debug implementation (#137) * [server]: simply raw params impl Use debug implementation of `common::Params` instead of doing something similar that doesn't work properly. * [raw params]: derive `Debug` impl. * [ws server]: parse subscription ID for unsubscription instead of hardcoding `JsonValue::Null` (#136) * [ws server]: fix broken unsubscribe. Try to parse the subscription ID as the first element of an Array or the `subscription` field of an Object/Map. If both of those fails then regard it as a error. * fmt * fix grumbles: remove space indentation * fix(ws server): sub/unsubscribe to same method should generate an error (#140) * fix(ws server): sub/unsubscribe to same method err Subscribe and unsubscribe to the same method should generate an error, which this commit fixed. This bug was introduced by myself in https://github.com/paritytech/jsonrpsee/commit/fc87889de2615dbb3d0cf2d91a306f016d48df2d * Update src/ws/server.rs Co-authored-by: David <[email protected]> Co-authored-by: David <[email protected]> * chore: add naive benches for request/response (#142) Co-authored-by: Niklas <[email protected]> * fix(ws server): remove faulty debug_assert (#145) The code assumed that `subscription id` is still in `active_subscriptions` when the connection was dropped. The list of subscriptions (kept in raw server) are not notified when a client dropped its subscription/unsubscribed thus it's possible that the actual subscriptions are closed before the entire client was dropped. * ci(benches): cargo check on benches. (#146) * fix(http client): implement `clone` uniform API. (#147) * chore(deps): update `futures v0.3.7` (#148) * chore(deps): update remaining crates (#149) * chore(deps): update `futures v0.3.7` * chore(deps): bump the rest of deps * Improve HTTP client background thread (#150) * refactor: resultify API + some crate reorg (#144) * [ws client]: resultify API and fix subscribe. * The commit changes the API to return `Err` when it's possible and to not ignore underlying errors. * Fix that `fn subscribe` doesn't accept the subscription and unsubscription to be same which causes errors in the server. * nits: Err::SubscriptionMetod -> Err::Subscription * refactor(client): common error type * refactor(http client): resultify * refactor(common): rename common -> types.. This commit renames the `common module` to `types` and tries to distinguish the types that is directly related to the `JSON-RPC v2 specification` from others. Somethings are a little big sloppy named as naming is hard. Also, as bonus a removed a bunch of needless stuff in http server related to subscription. * Update src/ws/tests.rs * style: cargo fmt * fix(grumble): matches -> assert(matches) * fix(grumbles): `jsonrpc_v2` -> `jsonrpc` * fix(nit): remove unused code. * fix(benches): make it compile again. * style: cargo fmt * fix nits (#151) * fix(ws client): send binary (1 byte less payload) * docs(ws server): fix bad comment. * chore: add `editorconfig` (#152) * chore: make `debug log` less verbose. (#153) * chore: make `debug log` less verbose. The debug logging was just too verbose and this commit simplies it as follows: ``` DEBUG recv: {"jsonrpc":"2.0","method":"<METHOD>","params":<PARAMS>,"id":<ID>} DEBUG send: {"jsonrpc":"2.0","result":"<RESULT>","id":<ID>} ``` * style: cargo fmt * fix: missed logs * [jsonrpc types]: implement Display for Request/Response (#160) * feat(jsonrpc response/request): impl `Display` * refactor(logging): use display impl * use serde_json for verbosity * [http client]: refactor with "syncronous-like" design (#156) * experimental * ci(benches): sync and concurrent roundtrips Improve benchmarks to take concurrent requests into account. * ci(benches): sync and concurrent roundtrips Improve benchmarks to take concurrent requests into account. * fix(nits) * feat(http client): limit max request body size * test(http transport): request limit test * test(http client): add tests. * fix typo * fix(benches): make it compile again. * fix(ws example): revert unintentional change. * test(http client): subscription response on call. * fix(cleanup) * fix(benches): make it compile again. * Update src/client/http/transport.rs * fix(http client): `&str` -> `AsRef<str>` * docs(client types): better docs for Mismatch type. * style: `Default::default` -> `HttpConfig::default` * fix(http client): read body size from header. Expermential to read number of bytes from `HTTP Content Length` to pre-allocate the number of bytes and bail early if the length is bigger than the `max_request_body size` Need to be benched with bigger requests. * test(raw http): enable tests to works again. * style: cargo fmt * benches: address grumbles * feat(jsonrpc response/request): impl `Display` * refactor(logging): use display impl * fix(http client): nits. * Update benches/benches.rs * fix bad merge. * chore(deps): update dependencies. (#164) * feat(http server): configurable request body limit (#162) * feat(http server): configurable request body limit * refactor(crate reorg): to have shared http helpers. * Merge client and server errors. * Move `http_server_utils` to `utils/http` * Minor cleanup * fix nits * fix(hyper helper): u64 -> u32 * Update src/utils/http/hyper_helpers.rs Co-authored-by: David <[email protected]> * Update src/utils/http/hyper_helpers.rs Co-authored-by: David <[email protected]> * fix: grumbles * Update src/utils/http/hyper_helpers.rs Co-authored-by: David <[email protected]> * Update src/http/server.rs Co-authored-by: David <[email protected]> Co-authored-by: David <[email protected]> * ci: remove nightly (#167) Use stabilized `broken_intra_doc_links` instead of `intra_doc_link_resolution_failure` * fix(websocket client): drop subscriptions that can't keep up with the internal buffer size (#166) * fix(ws client): drop subscriptions when full. This commit changes the behavior in the `WebSocket Client` where each subscription channel is used in a non-blocking matter until it is determined as full or disconnected. When that occurs the channel is simply dropped and when the user `poll` the subscription it will return all sent subscriptions before it was and terminate (return None) once it's polled one last time. Similarly as `Streams` works in Rust. It also adds configuration for the `WebSocket Client` to configure capacity for the different internal channels to avoid filling the buffers when it's not expected. * tests(ws client): simple subscription test. * fix: nits * Update src/client/ws/client.rs * refactor(tests): introduce integration_tests Make the repo structure more understable w.r.t testing. * chore(license): add missing license headers * Update src/client/ws/client.rs * Update src/client/ws/client.rs * style: remove unintended spaces. * tests: add concurrent deadlock test Ensure that if more than the requested channel buffer capacity is exceeded it should not deadlock. Such as spawning alot of concurrent requests, notifications or new subscriptions. * Update src/client/ws/client.rs * fix: review grumbles * fix nits: `remove needless closure` * fix: cargo fmt * Update src/client/ws/client.rs Co-authored-by: David <[email protected]> * fix more nits Co-authored-by: David <[email protected]> * fix(ws client): embed request id in `SubscriptionClosed` (#170) * fix(ws client): embed request id SubscriptClosed Fixes https://github.com/paritytech/jsonrpsee/issues/169 * Update src/client/ws/client.rs * Update src/client/ws/client.rs Co-authored-by: David <[email protected]> * Update src/client/ws/client.rs Co-authored-by: David <[email protected]> Co-authored-by: David <[email protected]> * chore(deps): bump dependencies (#172) * [ws client]: add tests (#134) * [test utils]: add `internal_err` and consts [errors]: unify client/server errors [test utils]: fake WebSocket jsonrpc server [ws client]: export errors [ws client]: add some basic tests * fmt * remove log target * fix nits * [ws client]: add subscription test * revert unintendend changes. * fmt * [ws client]: fix panic in tests * cleanup * tests(ws client): test for invalid request ID. * fix nits * [ws client]: kill raw client (#171) * getting started * WIP WIP * cleanup * cleanup v2 * cleanup v3 * perf: use BufReader BufWriter * fix(request manager): resultify insert API The rationale behind this change is that the `insert_methods` takes ownership of the `send_back_oneshot` and if the operation fails it should be propagated the frontend. So returning the `Err(send_back_oneshot)` if it fails makes it possible. * fix nits * examples(ws): revert changes * Update tests/integration_tests.rs * nits: fix unwraps * Update src/client/ws/manager.rs Co-authored-by: David <[email protected]> * Update src/client/ws/transport.rs Co-authored-by: David <[email protected]> * Update src/client/ws/client.rs Co-authored-by: David <[email protected]> * fix build * refactor: simplify `Error::InvalidRequestId` It was hard to use when the expected id is not known. * fix(ws client): error handling. * fix(grumble error type): better error message. * fix(grumble): docs `JSONRPC WebSocket transport` * fix(ws manager): fix grumbles. * Add better documentation * Rename methods. * Add `proof` to unreachable! * fix(ws manager): fix nit in docs. * fix(grumbles): ws client * fix more nits * fix compile warning: export websocket transports. * Update src/client/ws/manager.rs Co-authored-by: David <[email protected]> * deps: tokio 1.0 and hyper 0.14 (#176) * deps: tokio 1.0 and hyper 0.14 * Update Cargo.toml * refactor: crate re-organization with separate crates (#177) * [ci]: feature `http` and `ws` removed. * refactor: re-org crate with smaller crates. * fmt * [ci]: remove default features Currently there are no features in the crates, so that check is not needed. * [http client]: remove unused dependency tokio * docs(http client): fix nits tokio 0.2 -> tokio 1.0 (#178) * docs(http client): tokio 0.2 -> tokio 1.0 * fix: better link * [ci]: github actions (#179) * docs(http client): tokio 0.2 -> tokio 1.0 * [ci]: remove travis * [ci]: add github actions. * [ci]: fix identation nits * [ci]: use cache for actions * [ci]: filter to clippy * [ci]: remove hacks * separate action for ci and benchmarks * [ci]: tweak to run on master branch. * examples/subscription -> examples/ws_subscription * force CI Co-authored-by: David <[email protected]> Co-authored-by: Maciej Hirsz <[email protected]> Co-authored-by: Atkins <[email protected]>
-