1. Sep 15, 2021
    • David's avatar
      Rename and reorg types (#462) · 635142e3
      David authored
      * Renames
      
      * More renames
      
      * fmt
      
      * s/RpcParams/Params/
      
      * Add a type alias `SubscriptionResponse` to `Notification` which is parametrized to `SubscriptionPayload`
      Move `SubscriptionResponse` to the `response` module
      
      * Fix doc links
      
      * Cleanup and some docs
      
      * Review feedback
      
      * cleanup
      635142e3
    • Niklas Adolfsson's avatar
      [http server]: export acl types + remove cors_max_age (#466) · be96c56d
      Niklas Adolfsson authored
      * [http server]: export acl + kill cors_max_age
      
      * fix cors_max_age nit
      
      * fmt
      
      * remove max_cors_age
      be96c56d
  2. Sep 14, 2021
    • David's avatar
      Fix build warnings (#465) · c13f97ba
      David authored
      * Silence warning on cors_max_age
      
      * Revert change to `AccessControl`
      c13f97ba
    • David's avatar
      Propagate cause of `InvalidParams` (#463) · b16568b4
      David authored
      * Add a test illustrating how to use the `call` convenience method
      
      * Extend test + review feedback
      
      * log
      
      * log
      
      * log
      
      * log
      
      * log
      
      * log
      
      * log
      
      * log
      
      * log
      
      * log
      
      * log
      
      * log
      
      * log
      
      * log
      
      * log
      
      * Add Methods::test_subscription
      Log more when params parsing fails
      
      * Add call_with test helper (ty @niklas!) + cleanup
      
      * Remove todo (part of https://github.com/paritytech/jsonrpsee/issues/457
      
      )
      
      * fmt
      
      * Let `test_subscription` be called from other crates
      
      * Manually fix indentation
      
      * fmt
      
      * SSself-review grumbles
      
      * CallError::InvalidParams carries an anyhow::Error
      
      * fmt
      
      * Tweak docs
      
      * Update utils/src/server/rpc_module.rs
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      
      * review grumble
      
      * Fix todos
      
      * fmt
      
      * Fixup error messages
      
      * Include source in the error message for `CallError`
      
      * fmt
      
      * Update proc-macros/src/render_server.rs
      
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      
      * Mention needing jsonrpsee crate in scope
      
      * Resolve todo
      
      * Impl ToRpcParams for 0-sized array
      
      * optimized logging
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      b16568b4
    • Maciej Hirsz's avatar
      Reject overflowing connection with status code 429 (#456) · bf2fff04
      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
      bf2fff04
  3. Sep 13, 2021
  4. Sep 11, 2021
  5. Sep 09, 2021
  6. Sep 08, 2021
  7. Sep 01, 2021
    • Maciej Hirsz's avatar
      Tidy `StopHandle` (#425) · ffa504e2
      Maciej Hirsz authored
      
      
      * Experimental generic driver for methods
      
      * Move FutureDriver to its own module
      
      * "Infallible" sync methods + fmt
      
      * Drive all methods to completion before background_task closes
      
      * Testing a different stop handle
      
      * Added the waker for the monitors
      
      * Fix the test
      
      * Fix a possible deadlock
      
      * fmt
      
      * Explain strong_count check in StopHandle Drop impl
      
      * Clippy tweak
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      
      * Added comment on atomicbool ordering
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      ffa504e2
    • Niklas Adolfsson's avatar
      feat: alias attribute for proc macros (#442) · 3ad1cc21
      Niklas Adolfsson authored
      
      
      * feat: alias attribute for proc macros
      
      * implement David's suggested no more unsub field
      
      * keep aliases outside namespace
      
      * revert example
      
      * fix build
      
      * Update proc-macros/src/attributes.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * grumbles: alias -> aliases
      
      * grumbles v2: alias -> aliases
      
      Co-authored-by: default avatarDavid <[email protected]>
      3ad1cc21
    • Niklas Adolfsson's avatar
      Make it possible to treat empty JSON response as no params (#446) · bf211cb2
      Niklas Adolfsson authored
      
      
      * treat empty json as no params when optional
      
      * add test with nested array brackets
      
      * address grumbles: better tests
      
      * Update types/src/v2/params.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * introduce RpcParams::sequence_ignore_empty
      
      * address grumbles: ignore empty json in RpcParams
      
      * Update proc-macros/src/render_server.rs
      
      * address grumbles: remove trim in next_inner()
      
      * address grumbles: trim_start after params.next()
      
      * address more grumbles
      
      * [proc macros]: add test for empty array
      
      * make proc macro kind of work
      
      * add hack to make it work in proc macros
      
      * add hack to make it work in proc macros
      
      * [] ->
      
      * revert cerebral palsy
      
      * Update proc-macros/tests/ui/correct/basic.rs
      
      * Update proc-macros/tests/ui/correct/basic.rs
      
      * address grumbles
      
      * improve is_option
      
      * add test for core::option::Option
      
      Co-authored-by: default avatarDavid <[email protected]>
      bf211cb2
  8. Aug 31, 2021
  9. Aug 27, 2021
    • Niklas Adolfsson's avatar
      [proc macros]: support generic type params (#436) · 1045c785
      Niklas Adolfsson authored
      
      
      * PoC support generic type params
      
      * more annoying example
      
      * add trait bounds for generic params in proc macros
      
      * add compile-time test for complicated trait
      
      * smarter trait bounds in proc macros
      
      * add non-working example for now
      
      * revert nits
      
      * Update examples/proc_macro.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Update proc-macros/src/helpers.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * add messy code but works
      
      * cleanup
      
      * add some simple compile check in tests
      
      * fix doc link
      
      * fix doc link last time
      
      * address grumbles
      
      * docs
      
      * Update proc-macros/src/helpers.rs
      
      * Update proc-macros/src/helpers.rs
      
      * Update proc-macros/src/helpers.rs
      
      * Update proc-macros/src/helpers.rs
      
      * Update proc-macros/src/visitor.rs
      
      * fix nit: | -> ||
      
      * Update proc-macros/src/helpers.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Update proc-macros/src/helpers.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Update proc-macros/src/helpers.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * add issues to introduced TODOs
      
      * generics support where clause on trait
      
      * Update proc-macros/src/helpers.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Update proc-macros/src/helpers.rs
      
      * address grumbles
      
      * add more docs
      
      Co-authored-by: default avatarDavid <[email protected]>
      1045c785
  10. Aug 25, 2021
  11. Aug 18, 2021
    • Niklas Adolfsson's avatar
      [proc macros] force proc macro api to return `Result` (#435) · 09abbaaa
      Niklas Adolfsson authored
      * rewrite me
      
      * require proc macro API to return result
      
      * send unknown message when error is not CallError
      
      * show example that auto cast StdError doesn't work
      
      * register_*_method Into<Error>
      
      * clippy
      
      * replace generic errors with anyhow::Error
      
      * fix nits
      
      * example that anyhow::Error in register_method works
      
      * CallError: add missing From impl
      
      * [types]: add helper methods for Error types
      
      The rationale is to make it possible for users to either use anyhow::Error or use the helper methods.
      
      * fmt
      
      * Revert "register_*_method Into<Error>"
      
      This reverts commit 33b4fa28730b72647ba150659d3c0ab1937e524a.
      
      * add better comment
      
      * fix nit
      09abbaaa
    • Maciej Hirsz's avatar
  12. Aug 17, 2021
    • Maciej Hirsz's avatar
      Concurrent polling on async methods (#424) · c69e0dd8
      Maciej Hirsz authored
      * Experimental generic driver for methods
      
      * Move FutureDriver to its own module
      
      * "Infallible" sync methods + fmt
      
      * Drive all methods to completion before background_task closes
      c69e0dd8
  13. Aug 16, 2021
    • David's avatar
      Don't allocate until we know it's worth it (#420) · 326d0c91
      David authored
      * Sniff the first byte to glean if the incoming request is a single or batch request
      
      This works around the serde limitations around `untagged` enums and `RawValue`.
      
      * fmt
      
      * For http server, check first byte before allocating space for the body
      
      Also, rework the way we return errors: prefer JSON-RPC errors according to spec (application/json) wherever sensible.
      
      * Review feedback
      
      * Don't assume there is a first byte to read
      
      * ty clipyp
      
      * Review concerns
      
      * Cleanup
      326d0c91
  14. Aug 13, 2021
  15. Aug 09, 2021
  16. Aug 05, 2021
    • Niklas Adolfsson's avatar
      fix(ws client): use query part of URL. (#429) · 430dcfaf
      Niklas Adolfsson authored
      * fix(ws client): use query part of URL.
      
      Fixes #428, we didn't take that query part of the URL into account and it wasn't sent in GET request.
      
      * add log when connecting to a target
      
      * fix(grumbles): path -> path_and_query
      430dcfaf
  17. Jul 27, 2021
    • Maciej Hirsz's avatar
      Proc macro params optimizations and tests. (#421) · 3d52c6ac
      Maciej Hirsz authored
      * WIP
      
      * Feature-complete-ish
      
      * WIP
      
      * Cleaner replace marker
      
      * Inject lifetimes in elided `Cow`s
      
      * Use a single static &str for all injected lifetimes
      
      * Working lifetimes
      
      * Add the `call` method to `Methods`
      
      * Testing proc macro with optional params
      
      * Remove internal loop
      
      * fmt
      
      * Fix grumbles
      3d52c6ac
  18. Jul 15, 2021
  19. Jul 12, 2021
    • David's avatar
      Prepare v0.3.0 (#415) · 0f66093e
      David authored
      * Bump versions to 0.3.0
      
      * Add draft release checklist
      
      * Changelog for v0.3.0
      
      * Mention possibility of passing params to `publish.sh`
      
      * Added PR 412
      v0.3.0
      0f66093e
    • Maciej Hirsz's avatar
      Module API refactor (#412) · 8db65b42
      Maciej Hirsz authored
      
      
      * Do not register methods on servers
      
      * fmt
      
      * Infallible `to_rpc` proc macro
      
      * Remove dead code
      
      * Check for duplicate names at compile time
      
      * Add a UI test for name conflicts
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      Co-authored-by: default avatarDavid Palm <[email protected]>
      8db65b42
    • David's avatar
      Sort out type paths in proc macros (#414) · b8af4cc0
      David authored
      * Only return the crate name when the crate is `jsonrpsee` as well
      
      * Sort out the type paths in the macros, this time for real (?)
      
      * fmt
      b8af4cc0
    • David's avatar
      Fix type paths for client macros (#413) · b83be742
      David authored
      * type paths in client macros
      
      * Tweak more paths
      
      * Helpers as well
      b83be742
    • David's avatar
      Rexport types for servers (#409) · 0592442e
      David authored
      * Include "macros" in the "server" feature
      
      * Re-export SubscriptionSink
      
      * Include the "types" feature in both the "client" and "server" features
      Export types::* from façade when the "types" is active
      Export types::* from servers
      
      * fmt
      
      * Export jsonrpsee_types under types
      
      * fmt
      
      * broken doc link
      
      * fix benches
      
      * fmt
      
      * Fix test imports
      0592442e
  20. Jul 10, 2021
    • David's avatar
      Pass OwnedRpcParams to async methods (#410) · d5d67e98
      David authored
      
      
      * Pass OwnedRpcParams to async methods
      
      * Cow-ified RpcParams
      
      * fmt
      
      * Separate `RpcParamsSequence` parser from `RpcParams`
      
      * Remove OwnedId, use Id<'static> instead
      
      * Ensure that parsed `Id` is borrowing from input slice
      
      * Tweak/add some docs
      Test that parse() works after calling sequence()
      
      * Fix rustdoc link
      
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      d5d67e98
  21. Jul 08, 2021
  22. Jul 01, 2021
    • Igor Aleksanov's avatar
      New proc macro (#387) · ddb50806
      Igor Aleksanov authored
      
      
      * Start working on the new proc macro system
      
      * Add skeleton for rendering
      
      * Improve error reporting
      
      * Main part of 'render_client'
      
      * Implement RPC client generation
      
      * Client successfully rendered
      
      * Add doc-comment generation for the API client
      
      * Check that all the methods have receiver
      
      * Start working on the server impl
      
      * Add helper method to find server crate
      
      * Fix usage of client rpc path
      
      * Decent progress on the server macro implementation
      
      * Server macro compiled successfully
      
      * Remove unneeded re-export
      
      * Insert SubscriptionSink argument to the subscription server signatures
      
      * Add basic doc-comment for the macro
      
      * no_run -> ignore
      
      * Trait with subscription compiles
      
      * Extend the example
      
      * Add integration test for client/server impl
      
      * Add trybuild setup
      
      * Set correct span for attribute parsing related errors
      
      * Add basic set of trybuild tests
      
      * Add tests for client and server generated separately
      
      * Improve proc-macro documentation
      
      * Update proc-macros/src/lib.rs
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      
      * Fix a couple of bugs in docs
      
      * Fix rendering subscription with params
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      ddb50806
    • Maciej Hirsz's avatar
      Streaming RpcParams parsing (#401) · 095db9b2
      Maciej Hirsz authored
      * Streaming RpcParams parsing
      
      * DRY RpcParams::one again
      
      * Fix doc comments
      095db9b2
    • Maciej Hirsz's avatar
      Set allowed Host header values (#399) · f705e325
      Maciej Hirsz authored
      
      
      * Set allowed Host header values
      
      * Error if allowed hosts list is empty
      
      * Grammar
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      Co-authored-by: default avatarDavid <[email protected]>
      f705e325