Commit graph

376 commits

Author SHA1 Message Date
Finn Bear
3d76645908
Bugfix #1946 - allow 4X deeper computation by default, make limit configurable (#1950) 2023-05-09 07:37:07 +01:00
Tobie Morgan Hitchcock
591634e049
Ensure HTTP REST API responses are simplified when serialized (#1924) 2023-05-05 19:54:49 +01:00
Rushmore Mushambi
107e5b5dba
Support switching namespaces and databases separately (#1927) 2023-05-05 19:12:19 +01:00
Tobie Morgan Hitchcock
bcbd5f3e6e
Add PUT & PATCH methods for updating and merging in the HTTP REST API (#1923) 2023-05-04 21:42:02 +01:00
Rushmore Mushambi
c3c6613e7a
Fix simple ID serialisation in the WebSocket protocol (#1900) 2023-05-02 12:17:27 +01:00
Rushmore Mushambi
91e949248d
Unify serialisation (#1881) 2023-04-29 16:58:22 +01:00
Tobie Morgan Hitchcock
66b105dac0
Add support for stricter typings (#1861)
Co-authored-by: Rushmore Mushambi <rushmore@surrealdb.com>
2023-04-25 11:13:04 +01:00
Rushmore Mushambi
1fc802717d
Remove a redundant health check from the isready command (#1849) 2023-04-24 10:50:03 +01:00
Rushmore Mushambi
78625bc7a1
Bypass deserialisation for sql::Values on Response::take (#1834) 2023-04-20 19:20:50 +01:00
Finn Bear
c9a9336fdc
Improve performance and security of simple JSON parser (#1813) 2023-04-17 15:39:37 +01:00
Rushmore Mushambi
1aac97f0da
Print a newline after each query response in the sql shell (#1798) 2023-04-14 19:41:37 +01:00
Tobie Morgan Hitchcock
2a797f6f3b Add WebSocket id to Open Telemetry tracing 2023-04-14 16:51:15 +01:00
Tobie Morgan Hitchcock
45094c76ce Use custom serialization format 2023-03-31 23:49:52 +01:00
Rushmore Mushambi
179878d672
Add compile-time guarantees to make Surreal::delete safer (#1753) 2023-03-31 23:49:29 +01:00
Tobie Morgan Hitchcock
725b03729b Enable full-type serialisation on HTTP import route 2023-03-31 15:31:24 +01:00
Diptesh Choudhuri
494203d358
Allow exporting to stdout (#1701) 2023-03-30 19:13:26 +01:00
Rushmore Mushambi
3e80aa9914
Implement to_value for sql::Value (#1659)
`sql::Value` is an integral part of `surrealdb`. It's the internal type used by our storage layer. Because of this, we do a lot of converting between this type and native Rust types. Currently this conversion is done through `JSON` using the `serde_json` crate because we do not have our own custom data format implementation. This works because `SQL` is a superset of `JSON`.  This, however, means that this conversion is lossy and can cause surprises in some cases. For example expecting record IDs to be deserialized into a `String` instead of its corresponding Rust native type.

This change implements a custom data format around `sql::Value` and introduces a `to_value` function that facilitates that conversion.
2023-03-30 11:41:44 +01:00
Tobie Morgan Hitchcock
e0cad89a8c Improve error logging within CLI tool 2023-03-29 19:19:46 +01:00
Salvador Girones Gil
565717659a
Add functionality for open telemetry tracing (#1727) 2023-03-29 19:16:18 +01:00
Tobie Morgan Hitchcock
0c95126573 Add support for full binary serialization on HTTP endpoints 2023-03-27 13:52:28 +01:00
Tobie Morgan Hitchcock
2769033451 Update 3rd party dependencies 2023-03-25 20:49:00 +00:00
Emmanuel Keller
19c287a011
Implement transaction debug tracing (#1668) 2023-03-16 09:11:30 -04:00
Tobie Morgan Hitchcock
a8df2b6a6f Allow any Value in arguments to RPC use method 2023-03-07 09:55:35 +00:00
Tobie Morgan Hitchcock
7dcb0f83fa Add trace logging to WebSocket implementation 2023-03-07 09:54:58 +00:00
Tobie Morgan Hitchcock
d1558a63ad Use string formatting for SQL output in CLI
Related to #246
2023-03-07 09:54:58 +00:00
Igor Morozov
b10beda30c
Add isready CLI command for checking server health (#1679) 2023-03-07 09:53:56 +00:00
Tobie Morgan Hitchcock
454612487a Allow sending Table type for LIVE query RPC method 2023-02-14 11:01:31 +00:00
Tobie Morgan Hitchcock
5d55f28b98 Fix linting warning 2023-02-13 16:05:02 +00:00
Tobie Morgan Hitchcock
efbc5d3219 Add all WebSockets to a global collection 2023-02-13 12:20:13 +00:00
Tobie Morgan Hitchcock
ac9a574c00 Simplify passing of authentication tokens to client 2023-02-11 15:56:14 +00:00
Tobie Morgan Hitchcock
3f0afd9d72 Fix base64 authentication decoding support
Closes #1625
2023-02-09 10:54:52 +00:00
Tobie Morgan Hitchcock
c90ff5f5d1 Listen to different OS signals on Windows and Unix 2023-02-08 13:19:08 +00:00
Salvador Girones Gil
15f7fb3eee
Ensure SurrealDB listens to SIGTERM/SIGINT signals and quits gracefully (#1639) 2023-02-05 21:03:21 +00:00
Tobie Morgan Hitchcock
84b026679f Update clippy linting tests 2023-02-03 11:47:07 +00:00
Tobie Morgan Hitchcock
cf11eb7f54 Add clippy::mem_forget denial rule 2023-02-03 11:46:39 +00:00
Tobie Morgan Hitchcock
9282feac1f Allow empty params object from text-based WebSocket clients
Closes #1610
2023-01-20 00:54:33 +00:00
Tobie Morgan Hitchcock
0e70e515be Fix base64 authentication token decoding 2023-01-18 00:08:39 +00:00
Tobie Morgan Hitchcock
7682a97a33 Decode urlencoded path parameters automatically
Closes #1396
2023-01-17 14:10:21 +00:00
Tobie Morgan Hitchcock
8f89f8729c Update 3rd party dependencies
Closes #1593
2023-01-17 09:00:30 +00:00
Rushmore Mushambi
af88fcef38
Make cli::sql default to using a WebSocket connection (#1592) 2023-01-11 13:47:21 +00:00
Rushmore Mushambi
953a2008e2
Rename the engines module to engine (#1576) 2023-01-07 08:32:18 +00:00
Rushmore Mushambi
b3d9ce2c68
Ensure CLI exits with non-zero code on errors (#1567) 2022-12-31 08:03:19 +00:00
Rushmore Mushambi
f1b6c44603
Use new client library in CLI import command (#1566) 2022-12-31 08:02:53 +00:00
Rushmore Mushambi
a908d6dd10
Use new client library in CLI export command (#1565) 2022-12-31 08:02:41 +00:00
Rushmore Mushambi
a24bb4f4b8
Allow memory as an address endpoint in CLI sql command (#1563) 2022-12-30 23:53:45 +00:00
Rushmore Mushambi
7c199ff586
Use new client library in CLI sql command (#1561) 2022-12-30 21:27:19 +00:00
Rushmore Mushambi
c2dce39f91
Integrate client library into surrealdb crate (#1514) 2022-12-30 08:23:19 +00:00
Michal Jirman
157f7c8abe
Add CLI option flag to disable banner (#1537) 2022-12-21 11:42:59 +00:00
Tobie Morgan Hitchcock
44c3f32f69 Fix clippy linting warnings 2022-12-20 10:30:40 +00:00
Tobie Morgan Hitchcock
4067efd1e8 Add a user-agent header to CLI HTTP requests 2022-12-20 10:30:06 +00:00
George
a2038f239b
Fix future clippy linting warnings (#1423) 2022-12-18 16:00:36 +00:00
Rinat Shay
ad004999a8
Use temporary HTTP redirect instead of permanent (#1517) 2022-12-09 16:48:54 +00:00
Tobie Morgan Hitchcock
406e277c3b Ensure crate builds with no-default-features 2022-12-07 19:30:29 +00:00
CelebrateVC
f0745386cf
Improve code comments for documentation (#1476) 2022-11-23 09:42:59 +00:00
Igor Morozov
ddaea59d05
Improve error messages for CLI import/export (#1455) 2022-11-23 09:35:29 +00:00
Tobie Morgan Hitchcock
4b14837009 Fix clippy lint warnings 2022-11-23 09:09:24 +00:00
Finn Bear
ff65ef56fc
Don't panic on invalid UTF-8 in web requests (#1422) 2022-10-30 23:28:57 +00:00
Tobie Morgan Hitchcock
c12a1cc1fa Fix typo in code comments 2022-10-30 01:32:27 +00:00
Rushmore Mushambi
12ded8b066
Log version when starting the server (#1358) 2022-10-27 01:58:08 -07:00
Tobie Morgan Hitchcock
f32fb516eb Rearrange code order 2022-10-25 06:40:23 -07:00
Tobie Morgan Hitchcock
a074dc9af5 Add suport for WebSocket RPC binary protocol 2022-10-25 06:40:23 -07:00
Tobie Morgan Hitchcock
ab4c85bf5d Return a single record when requesting a single record with WebSocket 2022-10-25 06:40:23 -07:00
Tobie Morgan Hitchcock
05485406c4 Add support for more input types in WebSocket RPC methods 2022-10-25 06:40:23 -07:00
Tobie Morgan Hitchcock
e03f7e00db Add alias for WebSocket RPC method ‘modify’ to ‘patch’ 2022-10-25 06:40:23 -07:00
Tobie Morgan Hitchcock
1015a948fd Add alias for WebSocket RPC method ‘change’ to ‘merge’ 2022-10-25 06:40:23 -07:00
Tobie Morgan Hitchcock
926356d23b Don’t allow WebSocket RPC authenticate method to be called with no token value 2022-10-25 06:40:23 -07:00
Tobie Morgan Hitchcock
d2e7a8532d Don’t respond with an id if none was specified in the WebSocket RPC query 2022-10-25 06:40:23 -07:00
Tobie Morgan Hitchcock
df8f297221 Add WebSocket RPC unset method for clearing a parameter 2022-10-25 06:40:23 -07:00
Tobie Morgan Hitchcock
70a263f799 Add code comments to WebSocket RPC methods 2022-10-25 06:40:23 -07:00
Tobie Morgan Hitchcock
a0d86248e2 Enable different output serialization formats in WebSocket RPC 2022-10-25 06:40:23 -07:00
Tobie Morgan Hitchcock
d12384f3fb Change method signature for converting strings to table names 2022-10-25 06:40:23 -07:00
Tobie Morgan Hitchcock
3cbb5eed78 Allow datetimes as an id parameter in the WebSocket RPC message 2022-10-25 06:06:02 -07:00
Tobie Morgan Hitchcock
6ff1e250de Add improved handling of different WebSocket message types 2022-10-19 23:57:05 +01:00
Rushmore Mushambi
f0eaf2bd19
Improve RPC method return types (#1384) 2022-10-19 23:54:41 +01:00
Tobie Morgan Hitchcock
c098fe3380 Respond to WebSocket ping messages with a pong message 2022-10-19 21:11:15 +01:00
Tobie Morgan Hitchcock
1becd3ab55 Don’t throw an RPC Error when no params key is specified 2022-10-19 18:57:03 +01:00
Tobie Morgan Hitchcock
65f8194a1f Fix code linting warnings 2022-10-19 15:35:42 +01:00
Tobie Morgan Hitchcock
18d69a620c Add WebSocket ping->pong message ticker 2022-10-19 14:56:43 +01:00
Tobie Morgan Hitchcock
7ed0af4750 Add support for SQL parameters in HTTP REST endpoints 2022-10-17 02:00:15 +01:00
Tobie Morgan Hitchcock
810e174c63 Code tidy up 2022-10-16 23:20:57 +01:00
Tobie Morgan Hitchcock
264f208379 Change the log identifier for web requests 2022-10-16 17:36:07 +01:00
Tobie Morgan Hitchcock
f31b7d7d17 Allow number values for JSON RPC id field 2022-10-16 17:36:07 +01:00
Tobie Morgan Hitchcock
9546b07d71 Add version method to HTTP RPC endpoint 2022-10-16 17:36:07 +01:00
Tobie Morgan Hitchcock
90a5e82e72 ENsure session is completely clearer when invalidated
Closes #1314
2022-10-04 22:26:03 +01:00
Tobie Morgan Hitchcock
d8c7efefd4 Ensure integer Record IDs are treated correctly in HTTP REST endpoints
Closes #1281
2022-10-01 15:50:39 +01:00
Tobie Morgan Hitchcock
711df70bb9 Allow namespaced claim aliases in JWT token
Closes #1269
Closes #1268
2022-09-29 07:54:48 +01:00
Rushmore Mushambi
bcac94f9d6
Add additional build metadata to version identifier (#1254) 2022-09-28 20:13:40 +01:00
Tobie Morgan Hitchcock
a96c6ff8ca Allow authentication token to be verified with or without Bearer or Basic prefix 2022-09-28 01:19:18 +01:00
Tobie Morgan Hitchcock
a82e45f461 Enable more customisable JWT verification
Closes #1244
2022-09-27 22:07:41 +01:00
Rushmore Mushambi
c064890284
Fix the build (#1248) 2022-09-27 16:35:03 +01:00
Tobie Morgan Hitchcock
abd15ec55c Use Accept header on /import and /export HTTP routes
Closes #1245
2022-09-27 15:58:20 +01:00
Tobie Morgan Hitchcock
d8953ab7f8 Ensure HTTP session is not verified multiple times 2022-09-25 23:13:29 +01:00
Tobie Morgan Hitchcock
75d1e86990 Add DEFINE TOKEN … ON SCOPE … functionality
Closes #144
2022-09-25 22:58:38 +01:00
Tobie Morgan Hitchcock
0cb865dc44 Support different Content-Type outputs on /signup and /signin routes
Closes #1223
2022-09-25 13:05:56 +01:00
Tobie Morgan Hitchcock
2fccc87fab Don’t prettify empty responses in SQL REPL 2022-09-25 10:56:57 +01:00
Tobie Morgan Hitchcock
b9603aacab Improve HTTP error messages and status codes 2022-09-25 10:56:57 +01:00
Tobie Morgan Hitchcock
b4209180b6 Ensure server listents to SIGINT/SIGTERM signals
Closes #120
2022-09-22 03:01:11 +01:00
Tobie Morgan Hitchcock
ffeb56fc7e Redirect to temporary website holding page for app interface
Closes #219
2022-09-21 01:03:38 +01:00
Tobie Morgan Hitchcock
1dd08bedaa Handle errors properly when WebSocket client disconnects improperly
Closes #181
Closes #195
Closes #140
2022-09-20 23:04:40 +01:00
Tobie Morgan Hitchcock
d6b544771f Rename function for simplicity 2022-09-19 12:28:41 +01:00
Tobie Morgan Hitchcock
a7444a7c8e Add authentication token claims data to session object
Closes #135
2022-09-17 03:05:23 +01:00
Ryan Russell
b4b2ceb187
Make readability fixes to Rust code comments (#157) 2022-09-17 02:50:10 +01:00
Tobie Morgan Hitchcock
8403238dbb Use Accept header instead of Content-Type header for client content negotiation 2022-09-16 02:19:06 +01:00
Tobie Morgan Hitchcock
b2f4101a9c Improve HTTP request error messages
Closes #153
2022-09-16 00:41:16 +01:00
Tobie Morgan Hitchcock
23d1132526 Ignore blank/empty lines in SurrealDB SQL REPL
Closes #147
2022-09-15 00:39:25 +01:00
Tobie Morgan Hitchcock
74c3b6d708 Don’t automatically unwrap errors when sending on WebSocket
Closes #140
2022-09-13 21:50:04 +01:00
Tobie Morgan Hitchcock
498b0a4530 Fix linting errors 2022-09-10 06:11:56 +01:00
Tobie Morgan Hitchcock
eba00bbca3 Add debug logging for authentication attempts 2022-09-10 05:44:45 +01:00
Tobie Morgan Hitchcock
d20851325b Allow uppercase or lowercase keys in JWT authentication tokens 2022-09-10 05:43:50 +01:00
Tobie Morgan Hitchcock
6f0ff853f8 Ensure session data is stored on the session after signup/signin 2022-09-05 00:53:35 +01:00
Tobie Morgan Hitchcock
5ca3b74e59 Add HTTP /health endpoint for checking database and datastore status
Closes #56
2022-09-01 00:28:43 +01:00
Michael Delaney
960061584d
Add support for specifying database path using env variable DB_PATH (#78) 2022-08-31 14:03:11 +01:00
Tobie Morgan Hitchcock
cdf244f0f5 Simplify command line argument verification code 2022-08-29 13:02:20 +01:00
Tobie Morgan Hitchcock
65d91b122e Add support for simpler datastore paths 2022-08-29 12:30:00 +01:00
Tobie Morgan Hitchcock
69c166fd8e Only send NS and DB header in SQL REPL requests if specified 2022-08-26 23:16:13 +01:00
clawcastle
2bfcb9d694
Make --ns and --db arguments optional in command-line REPL (#63)
Closes #34
2022-08-26 21:51:44 +01:00
Tobie Morgan Hitchcock
e5a78bed06 Allow root authentication over WebSocket connection 2022-08-23 23:44:13 +01:00
Kian-Meng Ang
40157f6170
Fix typos (#42)
Found via `codespell -L crate,inout,ser,fetchs,te,tre,whats`.
2022-08-21 13:13:38 +01:00
Tobie Morgan Hitchcock
b8c793f7a4 Only log successful startup after server binds to desired port 2022-08-17 22:45:31 +01:00
Yusuke Kuoka
1d3880d652
Initial implementation of SurrealDB KVS for FoundationDB (#37)
Referenced in discussion #25 

Closes #38
2022-08-15 19:35:41 +01:00
Tobie Morgan Hitchcock
70a6c5a1ee Enable server configuration to be setup with environment variables 2022-08-12 21:21:32 +01:00
Tobie Morgan Hitchcock
653ced7d58 When enabled, log the root authentication username 2022-08-12 16:33:15 +01:00
Tobie Morgan Hitchcock
9ed50a9514 Add command-line SurrealQL REPL 2022-08-06 13:13:14 +01:00
Tobie Morgan Hitchcock
0043e38bef Add —host command-line option as an alias of —conn 2022-08-06 11:34:17 +01:00
Tobie Morgan Hitchcock
f535501ec2 Improve CLI command descriptions 2022-07-30 22:56:54 +01:00
Tobie Morgan Hitchcock
58698f58fe Update default endpoint for import/export requests 2022-07-29 10:39:49 +01:00
Tobie Morgan Hitchcock
fc68e59644 Simplify import / export response streaming 2022-07-29 10:37:12 +01:00
Tobie Morgan Hitchcock
d67e231431 Ensure NS+DB values are required on export CLI command 2022-07-29 10:36:54 +01:00
Tobie Morgan Hitchcock
c0d851751b Ensure NS+DB values are required on import CLI command 2022-07-29 10:36:49 +01:00
Tobie Morgan Hitchcock
f46acec96f Ensure error is returned when NS/DB header are not present 2022-07-29 10:35:15 +01:00
Tobie Morgan Hitchcock
2646ea119e Temporarily disable HTTP response compression
Disable response compression until `Accept-Encoding` headers are properly evaluated, and the compression can be chosen based on the HTTP request. This relies on https://github.com/seanmonstar/warp/pull/513 being implemented.
2022-07-29 10:33:49 +01:00
Tobie Morgan Hitchcock
d619633340 Enable new database strict mode configuration 2022-07-27 18:20:04 +01:00
Tobie Morgan Hitchcock
7777e3bccd Log a message on startup with root authentication info
Closes #11
2022-07-24 01:15:26 +01:00
Tobie Morgan Hitchcock
960a5a768b Disable root authentication when no password is set
Closes #10
2022-07-24 01:15:26 +01:00
Tobie Morgan Hitchcock
db2208a33a Store all macros in a separate module 2022-07-24 01:15:26 +01:00
Tobie Morgan Hitchcock
428fcf697a Ensure CORS headers are set on failed HTTP responses
Closes #6
2022-07-24 01:15:26 +01:00
Tobie Morgan Hitchcock
05cf6960c2 Set correct description for ‘—log’ command argument 2022-07-19 23:27:06 +01:00
Tobie Morgan Hitchcock
e1c6245151 Use new ‘—log’ command argument to specify server log level 2022-07-19 13:39:35 +01:00
Tobie Morgan Hitchcock
91b8baff3d Set default logging level for import/export/backup commands 2022-07-19 12:58:19 +01:00
Tobie Morgan Hitchcock
7860a205db Use configuration constants in version cli command 2022-07-19 12:54:50 +01:00
Tobie Morgan Hitchcock
a2619a8d72 Don’t show default random password in command-line help 2022-07-19 12:29:43 +01:00
Tobie Morgan Hitchcock
81bad3211d Improve command-line logging 2022-07-19 09:28:24 +01:00
Tobie Morgan Hitchcock
4468e10bd1 Change the default port to 8000 2022-07-18 18:49:43 +01:00
Tobie Morgan Hitchcock
d425f67a8b Allow NULL and missing values in RPC query method 2022-07-08 21:56:04 +01:00
Tobie Morgan Hitchcock
11a3911f70 Add RPC let’ command as a duplicate of ‘set’ command 2022-07-08 21:55:44 +01:00
Tobie Morgan Hitchcock
3c7bd098f3 Enable concurrent requests in WebSocket RPC Server 2022-07-07 11:25:22 +01:00
Tobie Morgan Hitchcock
4438415b55 Fix error in RPC Modify method query 2022-07-07 11:22:41 +01:00
Tobie Morgan Hitchcock
508538e0cc Add initial WebSocket JSON RPC implementation 2022-07-04 02:32:26 +01:00
Tobie Morgan Hitchcock
410295c800 Improve map! macro to allow extending the map with other map 2022-07-04 02:02:03 +01:00
Tobie Morgan Hitchcock
983a7b3f5c Add mrg! macro for merging Maps together 2022-07-04 02:02:03 +01:00