Comments (2)
/api/multipart/run/:wasm_id/:function_name
When using multipart as part of a wasm executable's function execution the following logic needs to be implemented
URL
- when the caller passes a url as the value of form's text key, check to see what the fetch returns
- if the URL (as seen above) returns a text/plain or application/json body, then pass this into SSVM as string
- if the URL returns anything else, pass this into SSVM as as Buffer
File
- when the caller passes a file as shown below fetch the file as Buffer (default fetch type of nodejs fs readFile is Buffer)
--form 'first_file=@/Users/tpmccallum/data.txt'
- ask about whether or not it would be preferred if the default Buffer is converted to String before being passed into SSVM NAPI
Order of arguments being passed into SSVM NAPI
The caller can pass any number of arguments into the Joey request, these will be passed into SSVM NAPI by Joey. The order and the data type of these arguments will be known by the Rust Wasm application (there is always an implicit agreement/understanding between the caller and the Rust Wasm code that they are calling)
- Need to test that the order in which multipart data is given in the HTTP request is maintained right through to Nodejs's Formidable middleware
For example, if a caller provides two URLs, one which is string and the other which is Buffer, does Nodejs's Formidable middleware process these in the order given?
It is possible that the middleware will provide them in the order that they are fetched (smaller data gets in first) or in no particular order at all. If this is the case Joey will not be able to pass multiple parameters into SSVM NAPI in the right order. It may be necessary to use pre-defined explicit naming convention for keys used in multipart data requests.
For example
--form 'joey_remote_data_url_1=https://raw.githubusercontent.com/tpmccallum/test_endpoint2/master/raw_file_example.txt'
--form 'joey_remote_data_url_2=https://raw.githubusercontent.com/tpmccallum/test_endpoint2/master/raw_file_example.txt'
from wasm-joey.
This is now implemented and working.
There are no race conditions due to some new custom code
The data types and order are always maintained and ssvm is able to execute any combination of multipart requests
https://web.postman.co/collections/4967217-84b93d68-2073-4f51-bde3-68f19de57c62?version=latest&workspace=6683d8e5-f543-4751-8871-aeceebf90811#b0be4952-8322-4eff-bb09-959d6fff9de9
from wasm-joey.
Related Issues (20)
- Specify a “callback url” in the header HOT 4
- Move the wasm_description to the header HOT 5
- Implement header prefix of SSVM HOT 1
- Specify an "argument_url" in the header HOT 4
- Provide logging via `logging_callback_url` HOT 3
- Add logic for cases where wasm_id does not exist HOT 1
- Support stateful context HOT 2
- Support text/plain in /api/state HOT 1
- Limit the number of callbacks to rpc.ssvm.secondstate.io HOT 1
- Allow caller to submit request and then terminate request/response process HOT 1
- Levels of logging (verbose vs minimal) HOT 1
- Add unique parameter i.e. `joey_remote_url` or `joey_arg_url` for remote m2m data exchange HOT 1
- Documentation
- Provide easy access to store small amounts of data frequently HOT 2
- Enquire about return_value of RunUint8Array HOT 1
- Test new issue template
- Write tests for multipart using every combination of GET, POST and Callback HOT 1
- Error executing this function, please check function name, input parameters, return parameter for correctness HOT 9
- ⚠️ Prevent SQL injection HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasm-joey.