diff --git a/Readme.md b/Readme.md index 85d7991..a4c2ed4 100644 --- a/Readme.md +++ b/Readme.md @@ -19,7 +19,7 @@ Whether you're embedding scripting capabilities or isolating untrusted code, Qui There are a few steps to achieve the result: - compile QuickJS to [WebAssembly](https://webassembly.org/) -- translate the QuickJS payload to pure Java bytecode using [Chicory Compiler](https://chicory.dev/docs/usage/build-time-compiler) +- translate the QuickJS payload to pure Java bytecode using [Endive Compiler](https://endive.run/docs/usage/build-time-compiler) - run QuickJS directly from Java without using JNI - ship an extremely small and self contained `jar` that can run wherever the JVM can go! @@ -257,4 +257,4 @@ This project stands on the shoulders of giants: * [QuickJS](https://bellard.org/quickjs/) – a small, embeddable JavaScript engine * [Javy](https://github.com/bytecodealliance/javy) – a toolchain for compiling JavaScript to WebAssembly -* [Chicory](https://chicory.dev/) – a native JVM WebAssembly runtime +* [Endive](https://endive.run/) – a native JVM WebAssembly runtime diff --git a/core/pom.xml b/core/pom.xml index 7570701..beec60a 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -14,16 +14,6 @@ QuickJs4J - - com.dylibso.chicory - runtime - ${chicory.version} - - - com.dylibso.chicory - wasi - ${chicory.version} - @@ -31,6 +21,16 @@ jackson-databind ${jackson.version} + + run.endive + runtime + ${endive.version} + + + run.endive + wasi + ${endive.version} + @@ -55,24 +55,6 @@ - - com.dylibso.chicory - chicory-compiler-maven-plugin - ${chicory.version} - - - javy-plugin - - compile - - - io.roastedroot.quickjs4j.core.JavyPluginModule - ../javy_quickjs4j_plugin.wasm - io.roastedroot.quickjs4j.core.Engine - - - - org.apache.maven.plugins @@ -100,6 +82,24 @@ + + run.endive + endive-compiler-maven-plugin + ${endive.version} + + + javy-plugin + + compile + + + io.roastedroot.quickjs4j.core.JavyPluginModule + ../javy_quickjs4j_plugin.wasm + io.roastedroot.quickjs4j.core.Engine + + + + diff --git a/core/src/main/java/io/roastedroot/quickjs4j/core/Engine.java b/core/src/main/java/io/roastedroot/quickjs4j/core/Engine.java index 0095a51..3ba175c 100644 --- a/core/src/main/java/io/roastedroot/quickjs4j/core/Engine.java +++ b/core/src/main/java/io/roastedroot/quickjs4j/core/Engine.java @@ -2,18 +2,6 @@ import static java.nio.charset.StandardCharsets.UTF_8; -import com.dylibso.chicory.log.Logger; -import com.dylibso.chicory.log.SystemLogger; -import com.dylibso.chicory.runtime.ByteArrayMemory; -import com.dylibso.chicory.runtime.HostFunction; -import com.dylibso.chicory.runtime.ImportValues; -import com.dylibso.chicory.runtime.Instance; -import com.dylibso.chicory.runtime.Memory; -import com.dylibso.chicory.runtime.TrapException; -import com.dylibso.chicory.wasi.WasiOptions; -import com.dylibso.chicory.wasi.WasiPreview1; -import com.dylibso.chicory.wasm.types.MemoryLimits; -import com.dylibso.chicory.wasm.types.ValueType; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -24,6 +12,18 @@ import java.util.List; import java.util.Map; import java.util.function.Function; +import run.endive.log.Logger; +import run.endive.log.SystemLogger; +import run.endive.runtime.ByteArrayMemory; +import run.endive.runtime.HostFunction; +import run.endive.runtime.ImportValues; +import run.endive.runtime.Instance; +import run.endive.runtime.Memory; +import run.endive.runtime.TrapException; +import run.endive.wasi.WasiOptions; +import run.endive.wasi.WasiPreview1; +import run.endive.wasm.types.MemoryLimits; +import run.endive.wasm.types.ValueType; public final class Engine implements AutoCloseable { private static final int ALIGNMENT = 1; @@ -314,7 +314,7 @@ private long[] invokeBuiltin(Instance instance, long[] args) { private final HostFunction invokeFn = new HostFunction( - "chicory", + "endive", "invoke", List.of( ValueType.I32, diff --git a/it/pom.xml b/it/pom.xml index 165db9d..b068c9f 100644 --- a/it/pom.xml +++ b/it/pom.xml @@ -32,7 +32,7 @@ ${project.basedir} - ${project.version} + ${project.version} diff --git a/it/src/it/hello-js/src/test/java/io/roastedroot/js/test/HelloJsTest.java b/it/src/it/hello-js/src/test/java/io/roastedroot/js/test/HelloJsTest.java index 88c6d68..b26a6e7 100644 --- a/it/src/it/hello-js/src/test/java/io/roastedroot/js/test/HelloJsTest.java +++ b/it/src/it/hello-js/src/test/java/io/roastedroot/js/test/HelloJsTest.java @@ -1,4 +1,4 @@ -package chicory.test; +package io.roastedroot.js.test; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/it/src/it/script-interface-generics/src/test/java/io/roastedroot/js/test/ScriptInterfaceGenericsTest.java b/it/src/it/script-interface-generics/src/test/java/io/roastedroot/js/test/ScriptInterfaceGenericsTest.java index ea7f33b..1e8f913 100644 --- a/it/src/it/script-interface-generics/src/test/java/io/roastedroot/js/test/ScriptInterfaceGenericsTest.java +++ b/it/src/it/script-interface-generics/src/test/java/io/roastedroot/js/test/ScriptInterfaceGenericsTest.java @@ -1,4 +1,4 @@ -package chicory.test; +package io.roastedroot.js.test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/it/src/it/script-interface-no-context/src/test/java/io/roastedroot/js/test/ScriptInterfaceTest.java b/it/src/it/script-interface-no-context/src/test/java/io/roastedroot/js/test/ScriptInterfaceTest.java index 676f1e1..3fa0730 100644 --- a/it/src/it/script-interface-no-context/src/test/java/io/roastedroot/js/test/ScriptInterfaceTest.java +++ b/it/src/it/script-interface-no-context/src/test/java/io/roastedroot/js/test/ScriptInterfaceTest.java @@ -1,4 +1,4 @@ -package chicory.test; +package io.roastedroot.js.test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/it/src/it/script-interface/src/test/java/io/roastedroot/js/test/ScriptInterfaceTest.java b/it/src/it/script-interface/src/test/java/io/roastedroot/js/test/ScriptInterfaceTest.java index ccf7f20..0123d69 100644 --- a/it/src/it/script-interface/src/test/java/io/roastedroot/js/test/ScriptInterfaceTest.java +++ b/it/src/it/script-interface/src/test/java/io/roastedroot/js/test/ScriptInterfaceTest.java @@ -1,4 +1,4 @@ -package chicory.test; +package io.roastedroot.js.test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/javy-plugin/src/lib.rs b/javy-plugin/src/lib.rs index 4597047..c166866 100644 --- a/javy-plugin/src/lib.rs +++ b/javy-plugin/src/lib.rs @@ -2,10 +2,10 @@ extern crate javy_plugin_api; use javy_plugin_api::{import_namespace, javy::quickjs::prelude::Func, Config}; use std::alloc::{alloc, dealloc, Layout}; -import_namespace!("chicory_plugin"); +import_namespace!("endive_plugin"); -mod chicory_imports { - #[link(wasm_import_module = "chicory")] +mod endive_imports { + #[link(wasm_import_module = "endive")] extern "C" { pub fn invoke( module_str_ptr: *const u8, @@ -31,7 +31,7 @@ fn invoke_exec(module_str: String, name_str: String, args_str: String) -> String let args_bytes: &[u8] = args_str.as_bytes(); let return_str = unsafe { - let wide_ptr = chicory_imports::invoke( + let wide_ptr = endive_imports::invoke( module_bytes.as_ptr(), module_bytes.len(), name_bytes.as_ptr(), diff --git a/javy_quickjs4j_plugin.wasm b/javy_quickjs4j_plugin.wasm index 67b2997..35b2868 100755 Binary files a/javy_quickjs4j_plugin.wasm and b/javy_quickjs4j_plugin.wasm differ diff --git a/pom.xml b/pom.xml index e2a9d5b..1d552d6 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ 5.14.4 - 1.7.5 + 1.0.0 2.21.3 3.28.2 diff --git a/scripting/pom.xml b/scripting/pom.xml index c808b35..0058bdf 100644 --- a/scripting/pom.xml +++ b/scripting/pom.xml @@ -63,9 +63,9 @@ - com.dylibso.chicory + run.endive annotations-processor - ${chicory.version} + ${endive.version} diff --git a/threat-model/QuickJs4J_ThreatModel_20251125_094010.md b/threat-model/QuickJs4J_ThreatModel_20251125_094010.md index a028486..fa8a934 100644 --- a/threat-model/QuickJs4J_ThreatModel_20251125_094010.md +++ b/threat-model/QuickJs4J_ThreatModel_20251125_094010.md @@ -32,7 +32,7 @@ The threat model for QuickJs4J identifies critical vulnerabilities at the bounda | --------- | -------------- | ------------------------------------------------------------------------- | ----------------- | | asset-001 | Confidential | The QuickJS `Engine` instance managing the Wasm runtime. | QuickJs4J Library | | asset-002 | Confidential | The `Runner`, a high-level API for executing JS code with timeouts. | QuickJs4J Library | -| asset-003 | Confidential | The Wasm runtime (Chicory) that executes the QuickJS binary. | QuickJs4J Library | +| asset-003 | Confidential | The Wasm runtime (Endive) that executes the QuickJS binary. | QuickJs4J Library | | asset-004 | Restricted | The compiled QuickJS engine in WebAssembly format. | QuickJs4J Library | | asset-005 | Confidential | Untrusted JavaScript code provided by the end-user/integrator. | Integrator | | asset-006 | Restricted | The host Java application that integrates and uses the QuickJs4J library. | Integrator | diff --git a/threat-model/Readme.md b/threat-model/Readme.md index 8ea57b3..2ef26b5 100644 --- a/threat-model/Readme.md +++ b/threat-model/Readme.md @@ -3,7 +3,7 @@ In this folder you can find the results produced by an automated threat-modelling tool (`rapidinsights`). These outputs have been reviewed and processed by humans, and should be used to derive clear, actionable security improvements. -Please treat these results as guidance for identifying risks, prioritizing mitigations, and strengthening the overall security of the system when integrating Chicory in a project. +Please treat these results as guidance for identifying risks, prioritizing mitigations, and strengthening the overall security of the system when integrating Endive in a project. ## Generation