561 Commits

Author SHA1 Message Date
jangko
38950a786d
reduce compiler warnings 2023-02-22 12:00:35 +07:00
Jacek Sieka
c0ecb42613
normalise nimble, update ci, unittest2 (#158) 2022-12-02 13:17:27 +01:00
Tanguy
4e9cc184ca
Fix newRng usage (#157) 2022-11-24 12:10:08 +01:00
Jacek Sieka
3defa1719d
Update README.md 2022-11-24 12:09:06 +01:00
Jacek Sieka
c3fa1a4f0f
update requirements/usage 2022-11-24 12:08:27 +01:00
Jacek Sieka
b4aff8fec5
remove news support (#155)
`news` has several resource leaks and other security issues - replaced
by `nim-websock` which is actively maintained.
2022-11-08 14:39:29 +01:00
Jacek Sieka
e6810af618
expose http server options (#154)
* expose http server options

These are needed to create a server that can handle larger POST requests

* add socket flag options
2022-10-25 18:48:44 +02:00
KonradStaniec
64dbf122d7
Add authhooks to proxy constructor (#153) 2022-09-22 10:58:19 +02:00
Jacek Sieka
5fa7071d5b
use object fromJson after creating ref object instance
otherwise, Option fields don't work as expected
2022-09-21 14:43:41 +02:00
Etan Kissling
446b18819d
do not disable TLS verification by default (#148)
Setting `NoVerifyHost`, `NoVerifyServerName` by default leads to
hard-to-debug bugs, it should always be explicit if wanted.
Note: This is also a workaround for https://github.com/status-im/nim-chronos/issues/313
2022-09-16 21:38:56 +02:00
Jacek Sieka
7c80b75856
fix enum parsing, work around potential nil dereference (#150)
* fix enum parsing, work around potential `nil` dereference

When the bizarre error handling in the http client fails, it may happen
that a nil is returned (maybe due to Nim bugs) - do it manually for now
2022-09-15 22:32:16 +03:00
jangko
184984a4fd
install openssl on macos for Nim devel 2022-09-05 22:56:42 +07:00
Etan Kissling
c8cbe08de7 align nim-websock support with news
To allow switching between `news` and `nim-websock` in `nimbus-eth2`,
add support for the missing CORS and JWT authorization headers to the
`nim-websock` backend. Also transition from `StringTableRef` to
`HttpTable` to properly support multiple instances of same header name.
2022-09-05 22:44:06 +07:00
tersec
32ba2d16b9
update from deprecated to supported Ubuntu and macOS GitHub Actions CI images (#144) 2022-08-18 08:31:16 +00:00
jangko
5ccdaed0ad
add rng param to rpcWebsocketServer constructor 2022-07-27 09:46:36 +07:00
tersec
0ef05ae7f8
update to supported macOS GitHub CI image (#142) 2022-07-22 15:19:39 +00:00
jangko
92bb86edf6
update server transport section in README.md 2022-07-19 09:49:43 +07:00
jangko
0fee4be2cc
implement hook to handle CORS and JWT auth
- fixes #138
- fixes #126
- fixes #38
2022-07-17 23:06:08 +07:00
Ivan Yonchovski
12e921c2ea
Add setup files (#139) 2022-07-12 23:22:17 +03:00
Zahary Karadjov
d618b555e7
Use news by default; websock has known issues 2022-06-28 18:12:51 +03:00
Miran
f65218dd35
move -d:nimRawSetjmp to config.nims (#137)
* move `-d:nimRawSetjmp` to config.nims

Refs https://github.com/status-im/nimbus-build-system/issues/44

* not vcc

* use .cfg not .nims
2022-06-28 19:50:51 +07:00
Zahary Karadjov
335f292a58
Fix connection leaks in the HTTP client 2022-04-10 21:48:46 +03:00
Jacek Sieka
2e3d22b9e2
enable styleCheck:usages (#135) 2022-04-08 10:25:41 +02:00
Jordan Hrycaj
b80313bfed
Facilitate http code response on authentication failure (#134) 2022-04-07 08:34:10 +01:00
Jordan Hrycaj
d4ae2328d4
Add server Hook for authentication (#133)
why:
  JWT authentication needs that
2022-04-05 16:19:52 +01:00
Dustin Brody
9e0a9496c5
rm obsolete/unused/unmaintained CI AppVeyor and Travis scripts 2022-03-31 12:00:38 +00:00
Jacek Sieka
b4bab89abd
fix invalid raises annotations (#132)
* `raises` should not be used with async
* callbacks returning futures should not raise
2022-03-21 15:19:49 +01:00
tersec
3a9b77146a
Merge pull request #131 from status-im/request-header-callback
request header callback
2022-03-14 07:59:42 +00:00
Dustin Brody
2d0a417844
no-op on nil 2022-03-04 21:07:17 +00:00
Dustin Brody
b455958d8a
request header callback 2022-03-04 19:13:29 +00:00
jangko
ad0c3fb6e0
fix missing req id in router exception handler
when an rpc method in server throw `InvalidRequest` using custom error code,
the router need to mention the request id too.

otherwise the client will throw error with confusing message.
2022-02-28 09:39:49 +07:00
tersec
0540afad4c
specify Content-Type: application/json HTTP header (#129) 2022-02-23 08:43:08 +01:00
jangko
733a05b00c
fixes wrong CI badge URL in readme.md 2022-02-14 12:16:31 +07:00
jangko
51fadf850c
Fix #124 2022-02-14 12:16:31 +07:00
Zahary Karadjov
97ba55bbf6
Release the HTTP sessions 2022-02-02 19:51:04 +02:00
Zahary Karadjov
5a28176080 Fix #117 2022-01-08 21:39:29 +02:00
Jacek Sieka
77c85a8876
fix missing logging import 2021-12-17 11:36:49 +01:00
Ștefan Talpalaru
24b56c8d2b
CI: test with multiple Nim versions (#121)
* CI: test with multiple Nim versions

and disable C++ testing (linker doesn't like arg order)
2021-12-16 23:33:42 +01:00
Mark Spanbroek
59a01aa200 Remove version pin on chronicles
Caused dependency conflicts when combining json_rpc with other
packages that depend on chronicles, now that chronicles has
a new version (0.10.2).
2021-12-16 14:48:33 +01:00
Zahary Karadjov
35e6d7e6ff
Restore the support for using the news package 2021-11-29 15:36:17 +02:00
Zahary Karadjov
7ff4559cc0 Allow dynamic RPC method names in the 'rpc' macro 2021-11-24 15:57:46 +02:00
Zahary Karadjov
c455198d4f
Eliminate code duplication in the HTTP/S servers 2021-11-22 20:24:11 +02:00
Zahary Karadjov
e4dba96f5c
Improve cancellation support and code style 2021-11-22 17:24:07 +02:00
Zahary Karadjov
7ab1b31614
Fix code breakage after the rebase 2021-11-22 17:05:26 +02:00
Bernardo A. Rodrigues
3599a73b58
Chronos HTTP(S) Server (#111) 2021-11-22 15:14:30 +02:00
Zahary Karadjov
9db5407e81
Switch to Chronos HTTP client (adds support for HTTPS) 2021-11-22 15:14:27 +02:00
Zahary Karadjov
2307dbec57 Add support for producing custom error codes from request hanlers 2021-10-06 10:50:08 +02:00
jangko
b2417fc071
fix both ws rpc server and client due to websock breaking changes
- change recv() to recvMsg()
2021-08-05 14:54:36 +07:00
KonradStaniec
a1715e33ac
Make client config public (#113) 2021-08-02 13:18:51 +02:00
KonradStaniec
eda5e8554f
add support for websocket in proxy (#112) 2021-07-30 11:24:09 +02:00