Commit Graph

94 Commits

Author SHA1 Message Date
Steve Manuel
b8d2f2d6b3 chore: bump versions for v0.0.1-rc.4 (#24) v0.0.1-rc.4 2022-09-29 15:52:10 -07:00
zach
fe5f9eeb8b feat: add allowed_hosts configuration option (#23)
- Adds `allowed_hosts` to the manifest
- If there are any `allowed_hosts` then `extism_http_request` checks to
make sure a URL's host is listed before performing the reques
2022-09-28 16:40:09 -07:00
zach
64d9358ea9 Don't panic on invalid plugin id (#22) 2022-09-26 09:23:56 -07:00
zach
355d4cdc4f cleanup: rename get! macro to args! 2022-09-25 19:44:05 -07:00
zach
1897276ee8 cleanup(runtime): get rid of more unwraps/panics 2022-09-24 11:17:14 -07:00
zach
a23e4a8b88 cleanup(runtime): improve pdk memory access 2022-09-24 10:46:05 -07:00
zach
631eb14cca fix: more helpful error message for manifests 2022-09-24 10:43:50 -07:00
zach
460b477b87 fix: don't panic on invalid plugin id 2022-09-24 10:43:50 -07:00
zach
15cd047569 fix: invalid length in config_get, vars_get 2022-09-23 16:15:05 -07:00
zach
52200c90ad fix(python): missing argument 2022-09-23 15:36:57 -07:00
zach
6bad1c43eb fix(python): missing argument 2022-09-22 16:11:34 -07:00
zach
958e56ba6d fix: compilation error when building without http_request support 2022-09-22 15:44:06 -07:00
zach
a4921e2d73 cleanup(runtime): better handling of reclaimed IDs 2022-09-21 10:57:18 -07:00
Steve Manuel
cdc614b04b fix: broken link in readme to extism overview 2022-09-21 09:50:41 -06:00
Steve Manuel
d3248119f7 chore: add links to pdks in readme 2022-09-21 01:10:27 -06:00
Steve Manuel
02f15985e2 docs: update readme to current sdk support graphic 2022-09-21 01:08:42 -06:00
zach
77964c7724 Update to wasmtime 1.0 (#21) 2022-09-20 14:47:54 -07:00
zach
15b7d0fa1f chore: update wasmtime to 1.0 2022-09-20 14:05:02 -07:00
zach
87be73570d Add ExtismContext to SDK + better errors for failed register/update (#19)
- Adds `ExtismContext` instead of global `PLUGINS` registry
- Adds `extism_context_new`, `extism_context_free` and
`extism_context_reset`
- Requires updating nearly every SDK function to add context parameter
- Renames some SDK functions to follow better naming conventions
   - `extism_plugin_register` -> `extism_plugin_new`
   - `extism_output_get` -> `extism_plugin_output_data`
   - `extism_output_length` -> `extism_plugin_output_length`
   - `extism_call` -> `extism_plugin_call`
- Updates `extism_error` to return the context error when -1 issued for
the plug-in ID
- Adds `extism_plugin_free` to remove an existing plugin
- Updates SDKs to include these functions
- Updates SDK examples and comments

Co-authored-by: Steve Manuel <steve@dylib.so>
2022-09-20 14:53:15 -06:00
Steve Manuel
e12efbeadb docs: add discord badge to readme 2022-09-17 01:01:11 -06:00
zach
5f096161da fix: use correct search path 2022-09-16 06:04:37 -07:00
zach
f0490058f1 cleanup: remove duplicate file 2022-09-16 06:04:06 -07:00
Jhaines1988
b7d52a1320 feat: update node sdk to use async call (#17) 2022-09-15 22:00:39 -06:00
Steve Manuel
c298208e04 ci: finish pypi release step 2022-09-14 11:37:01 -06:00
Steve Manuel
4c8a6b0ecb Merge branch 'main' of github.com:extism/extism 2022-09-14 11:26:05 -06:00
zach
f473be9044 meta: add scripts directory with SDK coverage script (#16)
Adds a script to check which runtime API functions are not used in each host SDK. Provides a coverage report with percent of functions called in each SDK. 

Co-authored-by: Steve Manuel <steve@dylib.so>
2022-09-14 11:12:05 -06:00
Steve Manuel
6883a5b6ba ci: add delay in release workflow to wait for crates.io 2022-09-14 09:21:06 -06:00
Steve Manuel
f9e9ff28d9 chore: bump versions for release, minimize c sdk imports (#15)
Co-authored-by: zach <zachshipko@gmail.com>
v0.0.1-rc.3
2022-09-13 13:27:58 -06:00
Steve Manuel
c9ded15dd2 Merge branch 'main' of github.com:extism/extism 2022-09-13 11:18:16 -06:00
Steve Manuel
e39901be68 ci: add no-verify to runtime release, bump rust sdk version 2022-09-13 11:17:59 -06:00
zach
4a49408045 fix: handle large allocations (missing commits) (#14) 2022-09-13 00:17:05 -06:00
zach
ddde19b6f4 fix: handle large allocations (#13)
This PR fixes an issue where large allocations are currently causing
some arithmetic to wrap which caused a panic.

This was discovered by calling `http_get` on `youtube.com` from the http
example in the Rust PDK
2022-09-12 20:26:31 -06:00
Steve Manuel
8191d85bc1 ci: remove cross integration, make node sdk public v0.0.1-rc.2 2022-09-12 15:49:43 -06:00
Steve Manuel
01dc54b6e6 ci: use node_auth_token env var for setup and publish 2022-09-12 15:23:46 -06:00
Steve Manuel
85cadeaf0e ci: update windows dll lib name 2022-09-12 13:55:25 -06:00
Steve Manuel
66937dc2cf ci: fix npm auth env var 2022-09-12 13:52:39 -06:00
Steve Manuel
e7b3688c11 ci: add host sdk releases (#12)
Adds automated releases for crates.io, pypi, and npm for Rust, Python,
and Node host SDKs respectively.
2022-09-12 13:32:06 -06:00
zach
8bc608d1e9 feat: access input/output buffers directly (#11)
This PR updates `extism_output_get` to return an actual pointer to the
output value (`const uint8_t* extism_output_get(PluginIndex plugin)`
instead of `void extism_output_get(PluginIndex plugin, uint8_t *buffer,
uint64_t length)`), this pointer will only be valid until the next call,
but it makes it possible to access the output data without copying.

The input buffer is also not copied and the same issue applies: 
the input buffer must not change during `call`.

Co-authored-by: Steve Manuel <steve@dylib.so>
2022-09-12 09:34:50 -06:00
zach
7626a1b1d4 feat: add HttpRequest builder functions (#10)
This makes using `HttpRequest` from the PDK a little nicer
2022-09-09 16:17:18 -07:00
zach
bd790fa5b3 feat: add HttpRequest builder functions 2022-09-09 16:00:35 -07:00
zach
4d3d966498 Handle missing config keys without raising an error (#9)
- Makes it so `extism_length(0)` returns 0, as far as I can tell this
seems safe
- Returns 0 when a key can't be found
2022-09-09 16:56:18 -06:00
Steve Manuel
a174dedc6e fix: provide plugin id to lib config call (#8) 2022-09-09 15:48:15 -06:00
zach
981728057f refactor: remove unused code 2022-09-09 08:18:05 -07:00
zach
88058ca31e fix: let linker tell us which functions are missing 2022-09-09 07:58:13 -07:00
zach
7b27d4f883 feat: add extism_plugin_update (#6)
This gives host the ability to re-use plugin descriptors instead of
loading a new plugin each time. The plugin memory and everything is
reset, so no state is shared with the newly loaded plugin.

Co-authored-by: Steve Manuel <steve@dylib.so>
2022-09-09 00:39:57 -06:00
zach
4fa8030a64 fix(python): print error as string instead of bytes 2022-09-07 12:46:02 -07:00
zach
05e9084277 fix: var_set 2022-09-06 20:35:47 -07:00
Benjamin Eckel
ffa01403a3 feat(ruby-sdk): create Extism module / namespace (#5)
I noticed when calling set_log_file that it's on the top-level namespace.
And so is the rest of the gem. It's not a good idea to do this as it
pollutes the user's application. Best practice is to wrap all code in a
module which by convention is the gem name.

I was also getting `Uninitialized constant FFI:NIL` and in the
set_log_file method and I could not tell why it was needed. I changed it
to a regular ruby nil. If it's needed for some reason I'll change it
back or move to another PR.
2022-09-04 17:05:10 -06:00
Steve Manuel
cede8e179e Avoid indexing zero-length slice in go (#4) v0.0.1-gamma 2022-09-04 15:48:58 -06:00
zach
98b463914c fix: avoid indexing zero-length slice in go 2022-09-04 14:39:06 -07:00