Commit Graph

34 Commits

Author SHA1 Message Date
Ștefan Talpalaru 962bb588d1
CI: test with multiple Nim versions (#22) 2022-01-10 00:51:40 +01:00
Zahary Karadjov 80ebc5b419
Allow the 'api' macro to be used in generic functions 2022-01-06 20:20:20 +02:00
Zahary Karadjov fba35d5a67 Add support for passing extra headers in HTTP requests 2021-12-22 08:00:51 +02:00
Eugene Kabanov de7f923c6b
More debug helpers (#18)
* Add connection_id to logs.
Add more logs.

* Fix chronicles issues.

* Fix SIGSEGV.

* Fix HTTP status logs.

* Bump chronos requirement to 3.0.9.
2021-12-03 18:14:25 +02:00
Eugene Kabanov c41bc8aefc
Add router.rawApi() macro and tests. (#17) 2021-11-29 17:14:10 +02:00
Etan Kissling 5a828c3ef1
fix `it` -> `is` typo (#16)
This fixes a minor typo in the log message `Request it not part of api`
and changes the `api` to uppercase for consistency with the other logs.
2021-11-27 03:22:25 +02:00
Etan Kissling bfcbeceb65
allow reserved Nim keywords as REST params (#15)
This resolves a compilation error when specifying a reserved Nim keyword
as a REST parameter. The error was `node lacks field: strVal`, as the
corresponding identifiers need backticks embedding, e.g., `` `let` ``,
requiring an additional unwrap of `nnkAccQuoted` to get the raw ident.
2021-10-28 19:00:14 +03:00
Eugene Kabanov 89d321bc16
Attempt to fix Windows CI toolchain issue. (#14) 2021-09-07 14:00:25 +03:00
Eugene Kabanov 9a7e711e22
Add Accept handling to REST server and client. (#12)
* Add Accept handling to REST server and client.
Add proper tests to server and client's test suites.
Fix some warnings.
Bump some nimble dependencies.

* Remove debugging echo.
2021-09-07 13:28:56 +03:00
Eugene Kabanov e96c6ded2a
Fix compilation warnings. (#13) 2021-08-13 03:14:46 +03:00
Eugene Kabanov 63fcc3df78
Fix request should be closed only at the end. (#10)
* Fix request should be closed only at the end.

* Final fix.
2021-06-10 20:35:08 +03:00
Eugene Kabanov 0c8c3a584d
Fix AsyncStreamIncompleteError exception leak. (#9)
* Fix AsyncStreamIncompleteError exception leak.

* Fix mistype.
2021-06-04 05:01:28 +03:00
Eugene Kabanov 5163805723
Add flag to pass comma delimited arrays by REST client. (#8)
Simplify server array decoding.
Add tests for comma delimited arrays.
2021-05-18 00:42:35 +03:00
Eugene Kabanov 37b25eaf2c
Move RestError declaration to common. (#7) 2021-05-15 02:39:22 +03:00
Eugene Kabanov db39cdcdc7
Fix chronicles compilation issue. (#6)
Export address variable.
2021-05-14 16:02:03 +03:00
Eugene Kabanov 80e28d15d6
Custom Response types introduced RestStatus, RestResponse[T], RestPlainResponse. (#5)
Added tests.
2021-05-11 18:31:43 +03:00
Eugene Kabanov ccebd5ee12
Optimize CI config. (#4) 2021-05-10 12:42:44 +03:00
Eugene Kabanov d0ed144b9c
Rest client (#3)
* Separate some macro helper procedures to common module.
Initial commit for client.

* Arguments pre-processing and createPath() with tests.

* Further progress on arguments.

* Add method checks.

* REST client release candidate.

* Add redirection support to client requests.
Move all network logic to procedures.
Add first test.
Add PrestoIdent default to REST server and client.

* Add agent.

* Fix url encoding in request's path.

* Fix client url-encoding handling.
RestApiResponse become case-object.
Make `-d:nimDumpRest` the only one dumping procedure.
Add rest client tests.

* Add logging support.

* Bump chronos dependency version.
2021-05-10 11:28:58 +03:00
Eugene Kabanov 8943d3fd6c
Merge pull request #2 from status-im/redirect
Add `redirect` macro to allow path redirection.
2021-04-13 13:16:53 +03:00
cheatfate 991b5836f6
Add `redirect` macro to allow path redirection.
Add tests for `redirect` macro.
Add check for unique patterns in path and tests.
2021-04-13 11:56:21 +03:00
Eugene Kabanov 04c2258721
Merge pull request #1 from status-im/presto-engine
Initial implementation.
2021-03-25 12:08:46 +02:00
cheatfate ebb2c16c0d
Annotate callback with raises and perform fix for it. 2021-03-25 11:26:16 +02:00
cheatfate 2f01c838c6
Finally address comment about processRestRequest().
Fix compiler warning for testbtrees.
2021-03-25 10:35:58 +02:00
cheatfate 670f68acd1
Attempt to address comment with processRestRequest[T]() procedure. 2021-03-25 10:05:59 +02:00
cheatfate 6687601ebb
Address review comments part 1. 2021-03-25 00:29:56 +02:00
cheatfate 32085aa97b
Add SecureRestServer implementation and tests. 2021-03-24 15:52:11 +02:00
cheatfate ae185d2038
Fix presto to follow latest changes in chronos servers split. 2021-03-17 15:53:11 +02:00
cheatfate f2a51369d2
Change REST api error response to custom message with custom content-type. 2021-03-11 14:31:14 +02:00
cheatfate a61baae44c
Fix 32bit issues in tests. 2021-03-02 20:18:44 +02:00
cheatfate 1b94fe21dd
Fix one more path problem. 2021-03-02 16:58:07 +02:00
cheatfate d88d6471a8
Fix path problem. 2021-03-02 16:00:51 +02:00
cheatfate 9c9b061158
Initial implementation for review. 2021-03-02 15:50:16 +02:00
cheatfate d41dfd8ea2
Add infrastructure. 2021-03-02 15:32:20 +02:00
Eugene Kabanov c8f8c32e0f
Initial commit 2021-03-02 15:29:38 +02:00