diff --git a/.github/workflows/ValidatePullRequests.yml b/.github/workflows/ValidatePullRequests.yml index ad661fa..87c8471 100644 --- a/.github/workflows/ValidatePullRequests.yml +++ b/.github/workflows/ValidatePullRequests.yml @@ -17,34 +17,43 @@ permissions: contents: read jobs: - spelling: - name: Spell check with typos - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - name: Spell Check Repo - uses: crate-ci/typos@v1.43.5 - - build: - uses: ./.github/workflows/dep_build.yml - secrets: inherit - benchmarks: uses: ./.github/workflows/dep_benchmarks.yml secrets: inherit with: download-benchmarks: true upload-benchmarks: false - + + build: + uses: ./.github/workflows/dep_build.yml + secrets: inherit + + license-headers: + name: check license headers + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Check License Headers + run: ./dev/check-license-headers.sh + # Gate PR merges on this specific "join-job" which requires all other # jobs to run first. report-ci-status: needs: - - build - benchmarks + - build + - license-headers - spelling if: always() runs-on: ubuntu-latest steps: - name: calculate the correct exit status - run: jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}' \ No newline at end of file + run: jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}' + + spelling: + name: Spell check with typos + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Spell Check Repo + uses: crate-ci/typos@v1.43.5 diff --git a/Justfile b/Justfile index 95cdbe2..3529358 100644 --- a/Justfile +++ b/Justfile @@ -35,6 +35,9 @@ check-npm: check: cargo check +check-license-headers: + ./dev/check-license-headers.sh + clippy target=default-target features="": (ensure-tools) cd src/hyperlight-js-runtime && \ cargo hyperlight clippy \ diff --git a/dev/check-license-headers.sh b/dev/check-license-headers.sh new file mode 100755 index 0000000..26aecfa --- /dev/null +++ b/dev/check-license-headers.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +# This script checks for the presence of the required license header in Rust source files. + +# Get the repository root +REPO_ROOT="$(git rev-parse --show-toplevel)" +cd "$REPO_ROOT" || exit 1 + +# Define the license header pattern to look for +LICENSE_PATTERN="Copyright .* The Hyperlight Authors..*Licensed under the Apache License, Version 2.0" + +# Define the full license header for files that need it +LICENSE_HEADER='/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +' + +# Initialize a variable to track missing headers +MISSING_HEADERS=0 +MISSING_FILES="" + +# Find all Rust files +while IFS= read -r -d $'\0' file; do + # Check if the file has the license header (allowing for multi-line matching) + if ! grep -q -z "$LICENSE_PATTERN" "$file"; then + echo "Missing or invalid license header in $file" + MISSING_FILES="$MISSING_FILES\n $file" + MISSING_HEADERS=$((MISSING_HEADERS + 1)) + fi +done < <(find src -name "*.rs" -type f -print0) + +if [ $MISSING_HEADERS -gt 0 ]; then + echo "Found $MISSING_HEADERS files with missing or invalid license headers:" + echo -e "$MISSING_FILES" + echo "" + echo "Please add the following license header to these files:" + echo "$LICENSE_HEADER" + echo "You can also run: just check-license-headers to verify your changes." + exit 1 +else + echo "All Rust files have the required license header" + exit 0 +fi diff --git a/src/hyperlight-js-runtime/build.rs b/src/hyperlight-js-runtime/build.rs index 6855f0b..34ef786 100644 --- a/src/hyperlight-js-runtime/build.rs +++ b/src/hyperlight-js-runtime/build.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ fn main() { if std::env::var_os("CARGO_CFG_HYPERLIGHT").is_none() { return; diff --git a/src/hyperlight-js-runtime/src/globals/console.rs b/src/hyperlight-js-runtime/src/globals/console.rs index 0c0691f..37f6db0 100644 --- a/src/hyperlight-js-runtime/src/globals/console.rs +++ b/src/hyperlight-js-runtime/src/globals/console.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use rquickjs::object::Property; use rquickjs::{Ctx, Module, Object}; diff --git a/src/hyperlight-js-runtime/src/globals/mod.rs b/src/hyperlight-js-runtime/src/globals/mod.rs index a02d4ad..82f6d26 100644 --- a/src/hyperlight-js-runtime/src/globals/mod.rs +++ b/src/hyperlight-js-runtime/src/globals/mod.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use rquickjs::Ctx; mod console; diff --git a/src/hyperlight-js-runtime/src/globals/print.rs b/src/hyperlight-js-runtime/src/globals/print.rs index 35f947d..91afe66 100644 --- a/src/hyperlight-js-runtime/src/globals/print.rs +++ b/src/hyperlight-js-runtime/src/globals/print.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use rquickjs::object::Property; use rquickjs::{Ctx, Function, Module, Object}; diff --git a/src/hyperlight-js-runtime/src/globals/require.rs b/src/hyperlight-js-runtime/src/globals/require.rs index 9f2a3a7..8fdd62b 100644 --- a/src/hyperlight-js-runtime/src/globals/require.rs +++ b/src/hyperlight-js-runtime/src/globals/require.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use rquickjs::object::Property; use rquickjs::{Ctx, Function, Module, Object}; diff --git a/src/hyperlight-js-runtime/src/globals/string.rs b/src/hyperlight-js-runtime/src/globals/string.rs index 6a0fa67..d585b51 100644 --- a/src/hyperlight-js-runtime/src/globals/string.rs +++ b/src/hyperlight-js-runtime/src/globals/string.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use alloc::string::{String, ToString as _}; use base64::engine::general_purpose::STANDARD_NO_PAD; diff --git a/src/hyperlight-js-runtime/src/host.rs b/src/hyperlight-js-runtime/src/host.rs index 413ebe3..f51bbc2 100644 --- a/src/hyperlight-js-runtime/src/host.rs +++ b/src/hyperlight-js-runtime/src/host.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use alloc::string::String; use anyhow::Result; diff --git a/src/hyperlight-js-runtime/src/host_fn.rs b/src/hyperlight-js-runtime/src/host_fn.rs index 48d8353..531b97d 100644 --- a/src/hyperlight-js-runtime/src/host_fn.rs +++ b/src/hyperlight-js-runtime/src/host_fn.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use alloc::format; use alloc::rc::Rc; use alloc::string::{String, ToString as _}; diff --git a/src/hyperlight-js-runtime/src/lib.rs b/src/hyperlight-js-runtime/src/lib.rs index 258f097..e7e8065 100644 --- a/src/hyperlight-js-runtime/src/lib.rs +++ b/src/hyperlight-js-runtime/src/lib.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ #![no_std] #![no_main] extern crate alloc; diff --git a/src/hyperlight-js-runtime/src/main.rs b/src/hyperlight-js-runtime/src/main.rs index 9f2d149..5774b8c 100644 --- a/src/hyperlight-js-runtime/src/main.rs +++ b/src/hyperlight-js-runtime/src/main.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ #![cfg_attr(hyperlight, no_std)] #![cfg_attr(hyperlight, no_main)] diff --git a/src/hyperlight-js-runtime/src/main/hyperlight.rs b/src/hyperlight-js-runtime/src/main/hyperlight.rs index 1c47ada..f5f60f1 100644 --- a/src/hyperlight-js-runtime/src/main/hyperlight.rs +++ b/src/hyperlight-js-runtime/src/main/hyperlight.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ extern crate alloc; use core::ffi::*; diff --git a/src/hyperlight-js-runtime/src/main/native.rs b/src/hyperlight-js-runtime/src/main/native.rs index 229dadb..b6b0ca2 100644 --- a/src/hyperlight-js-runtime/src/main/native.rs +++ b/src/hyperlight-js-runtime/src/main/native.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use std::path::{Path, PathBuf}; use std::{env, fs}; diff --git a/src/hyperlight-js-runtime/src/modules/console.rs b/src/hyperlight-js-runtime/src/modules/console.rs index 8403c36..77c29b5 100644 --- a/src/hyperlight-js-runtime/src/modules/console.rs +++ b/src/hyperlight-js-runtime/src/modules/console.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use alloc::string::String; use rquickjs::prelude::Rest; diff --git a/src/hyperlight-js-runtime/src/modules/crypto.rs b/src/hyperlight-js-runtime/src/modules/crypto.rs index cbb6cce..a9f5455 100644 --- a/src/hyperlight-js-runtime/src/modules/crypto.rs +++ b/src/hyperlight-js-runtime/src/modules/crypto.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use alloc::format; use alloc::rc::Rc; use alloc::string::String; diff --git a/src/hyperlight-js-runtime/src/modules/io.rs b/src/hyperlight-js-runtime/src/modules/io.rs index de9704a..d0d3187 100644 --- a/src/hyperlight-js-runtime/src/modules/io.rs +++ b/src/hyperlight-js-runtime/src/modules/io.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use alloc::string::String; #[rquickjs::module(rename_vars = "camelCase", rename_types = "camelCase")] diff --git a/src/hyperlight-js-runtime/src/modules/mod.rs b/src/hyperlight-js-runtime/src/modules/mod.rs index b3b8b63..c0ca64f 100644 --- a/src/hyperlight-js-runtime/src/modules/mod.rs +++ b/src/hyperlight-js-runtime/src/modules/mod.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use alloc::string::{String, ToString as _}; use hashbrown::HashMap; diff --git a/src/hyperlight-js-runtime/src/modules/require.rs b/src/hyperlight-js-runtime/src/modules/require.rs index 98a8dc4..1756a6d 100644 --- a/src/hyperlight-js-runtime/src/modules/require.rs +++ b/src/hyperlight-js-runtime/src/modules/require.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use alloc::string::String; use rquickjs::{Ctx, Module, Object, Result}; diff --git a/src/hyperlight-js-runtime/src/utils.rs b/src/hyperlight-js-runtime/src/utils.rs index 951f9d8..2be8b2c 100644 --- a/src/hyperlight-js-runtime/src/utils.rs +++ b/src/hyperlight-js-runtime/src/utils.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use alloc::vec::Vec; use rquickjs::{Exception, Result, Value}; diff --git a/src/hyperlight-js-runtime/stubs/clock.c b/src/hyperlight-js-runtime/stubs/clock.c index 0cf2831..a81d625 100644 --- a/src/hyperlight-js-runtime/stubs/clock.c +++ b/src/hyperlight-js-runtime/stubs/clock.c @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ #define _POSIX_MONOTONIC_CLOCK 1 #include diff --git a/src/hyperlight-js-runtime/tests/native_cli.rs b/src/hyperlight-js-runtime/tests/native_cli.rs index 17bf212..61f2024 100644 --- a/src/hyperlight-js-runtime/tests/native_cli.rs +++ b/src/hyperlight-js-runtime/tests/native_cli.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ #![cfg(not(hyperlight))] use std::fs::write; diff --git a/src/hyperlight-js/benches/benchmarks.rs b/src/hyperlight-js/benches/benchmarks.rs index 2e6d8b5..f277ea9 100644 --- a/src/hyperlight-js/benches/benchmarks.rs +++ b/src/hyperlight-js/benches/benchmarks.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use std::time::{Duration, Instant}; use criterion::{criterion_group, criterion_main, Bencher, Criterion}; diff --git a/src/hyperlight-js/build.rs b/src/hyperlight-js/build.rs index de6e119..e8d5961 100644 --- a/src/hyperlight-js/build.rs +++ b/src/hyperlight-js/build.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ #![allow(clippy::disallowed_macros)] // allow assert!(..) // build.rs diff --git a/src/hyperlight-js/examples/interrupt/main.rs b/src/hyperlight-js/examples/interrupt/main.rs index df52cc5..2bd8c9c 100644 --- a/src/hyperlight-js/examples/interrupt/main.rs +++ b/src/hyperlight-js/examples/interrupt/main.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! Interrupt Example: Demonstrates timeout-based handler termination and poisoned state recovery //! //! This example shows how to: diff --git a/src/hyperlight-js/examples/metrics/main.rs b/src/hyperlight-js/examples/metrics/main.rs index cb81b6c..53bfcf2 100644 --- a/src/hyperlight-js/examples/metrics/main.rs +++ b/src/hyperlight-js/examples/metrics/main.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ #![allow(clippy::disallowed_macros)] use std::thread::{spawn, JoinHandle}; diff --git a/src/hyperlight-js/examples/run_handler/main.rs b/src/hyperlight-js/examples/run_handler/main.rs index d99dfbc..041a13d 100644 --- a/src/hyperlight-js/examples/run_handler/main.rs +++ b/src/hyperlight-js/examples/run_handler/main.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ #![allow(clippy::disallowed_macros)] use std::collections::HashMap; use std::path::PathBuf; diff --git a/src/hyperlight-js/examples/runtime_debugging/main.rs b/src/hyperlight-js/examples/runtime_debugging/main.rs index f4e791e..7e564c5 100644 --- a/src/hyperlight-js/examples/runtime_debugging/main.rs +++ b/src/hyperlight-js/examples/runtime_debugging/main.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use hyperlight_js::{Result, SandboxBuilder, Script}; fn builder() -> SandboxBuilder { diff --git a/src/hyperlight-js/examples/tracing-otlp/main.rs b/src/hyperlight-js/examples/tracing-otlp/main.rs index 6f3cde7..33c9048 100644 --- a/src/hyperlight-js/examples/tracing-otlp/main.rs +++ b/src/hyperlight-js/examples/tracing-otlp/main.rs @@ -1,5 +1,5 @@ /* -Copyright 2025 The Hyperlight Authors. +Copyright 2026 The Hyperlight Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/hyperlight-js/examples/tracing/main.rs b/src/hyperlight-js/examples/tracing/main.rs index 33b3a5b..096d6ed 100644 --- a/src/hyperlight-js/examples/tracing/main.rs +++ b/src/hyperlight-js/examples/tracing/main.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ #![allow(clippy::disallowed_macros)] extern crate hyperlight_js; use std::collections::HashMap; diff --git a/src/hyperlight-js/src/lib.rs b/src/hyperlight-js/src/lib.rs index bd6b379..916faba 100644 --- a/src/hyperlight-js/src/lib.rs +++ b/src/hyperlight-js/src/lib.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! This crate provides a Hyperlight implementation for JavaScript guest code. #![deny(dead_code, missing_docs, unused_mut)] #![cfg_attr(not(any(test, debug_assertions)), warn(clippy::panic))] diff --git a/src/hyperlight-js/src/resolver.rs b/src/hyperlight-js/src/resolver.rs index 4f78428..094ad98 100644 --- a/src/hyperlight-js/src/resolver.rs +++ b/src/hyperlight-js/src/resolver.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! Module resolution and loading implementations. //! //! This module provides the core abstractions and implementations for loading diff --git a/src/hyperlight-js/src/sandbox/host_fn.rs b/src/hyperlight-js/src/sandbox/host_fn.rs index 7ba8773..8f0322b 100644 --- a/src/hyperlight-js/src/sandbox/host_fn.rs +++ b/src/hyperlight-js/src/sandbox/host_fn.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use std::collections::HashMap; use serde::de::DeserializeOwned; diff --git a/src/hyperlight-js/src/sandbox/js_sandbox.rs b/src/hyperlight-js/src/sandbox/js_sandbox.rs index 2e3ef14..5fae60d 100644 --- a/src/hyperlight-js/src/sandbox/js_sandbox.rs +++ b/src/hyperlight-js/src/sandbox/js_sandbox.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use std::collections::HashMap; use std::fmt::Debug; diff --git a/src/hyperlight-js/src/sandbox/loaded_js_sandbox.rs b/src/hyperlight-js/src/sandbox/loaded_js_sandbox.rs index baed5d8..975bc49 100644 --- a/src/hyperlight-js/src/sandbox/loaded_js_sandbox.rs +++ b/src/hyperlight-js/src/sandbox/loaded_js_sandbox.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use std::fmt::Debug; use std::sync::Arc; diff --git a/src/hyperlight-js/src/sandbox/metrics.rs b/src/hyperlight-js/src/sandbox/metrics.rs index 035f5ea..9bb09b2 100644 --- a/src/hyperlight-js/src/sandbox/metrics.rs +++ b/src/hyperlight-js/src/sandbox/metrics.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ /*! This module contains the definitions and implementations of the metrics used by the sandbox module */ diff --git a/src/hyperlight-js/src/sandbox/mod.rs b/src/hyperlight-js/src/sandbox/mod.rs index 7fbc546..cb1e90c 100644 --- a/src/hyperlight-js/src/sandbox/mod.rs +++ b/src/hyperlight-js/src/sandbox/mod.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! The `sandbox` module contains the sandbox types for the Hyperlight JavaScript runtime. use std::env; /// Definition of a host function that can be called from guest JavaScript code. diff --git a/src/hyperlight-js/src/sandbox/monitor/cpu_time.rs b/src/hyperlight-js/src/sandbox/monitor/cpu_time.rs index 78715f4..d1a133f 100644 --- a/src/hyperlight-js/src/sandbox/monitor/cpu_time.rs +++ b/src/hyperlight-js/src/sandbox/monitor/cpu_time.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! CPU time based execution monitor. //! //! This module provides monitoring based on actual CPU execution time rather than diff --git a/src/hyperlight-js/src/sandbox/monitor/mod.rs b/src/hyperlight-js/src/sandbox/monitor/mod.rs index e17dea4..e76328c 100644 --- a/src/hyperlight-js/src/sandbox/monitor/mod.rs +++ b/src/hyperlight-js/src/sandbox/monitor/mod.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! Execution monitoring for JavaScript sandbox handlers. //! //! This module provides the [`ExecutionMonitor`] trait and built-in implementations diff --git a/src/hyperlight-js/src/sandbox/monitor/runtime.rs b/src/hyperlight-js/src/sandbox/monitor/runtime.rs index cc0f50e..afb757a 100644 --- a/src/hyperlight-js/src/sandbox/monitor/runtime.rs +++ b/src/hyperlight-js/src/sandbox/monitor/runtime.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! Shared Tokio runtime for execution monitor orchestration. //! //! This module provides a lazily-initialized, shared Tokio runtime used by diff --git a/src/hyperlight-js/src/sandbox/monitor/wall_clock.rs b/src/hyperlight-js/src/sandbox/monitor/wall_clock.rs index 436ed0a..d430659 100644 --- a/src/hyperlight-js/src/sandbox/monitor/wall_clock.rs +++ b/src/hyperlight-js/src/sandbox/monitor/wall_clock.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! Wall-clock time based execution monitor. use std::future::Future; diff --git a/src/hyperlight-js/src/sandbox/proto_js_sandbox.rs b/src/hyperlight-js/src/sandbox/proto_js_sandbox.rs index ab36245..587eccb 100644 --- a/src/hyperlight-js/src/sandbox/proto_js_sandbox.rs +++ b/src/hyperlight-js/src/sandbox/proto_js_sandbox.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use std::collections::HashMap; use std::fmt::Debug; use std::time::SystemTime; diff --git a/src/hyperlight-js/src/sandbox/sandbox_builder.rs b/src/hyperlight-js/src/sandbox/sandbox_builder.rs index 8cea862..53c6beb 100644 --- a/src/hyperlight-js/src/sandbox/sandbox_builder.rs +++ b/src/hyperlight-js/src/sandbox/sandbox_builder.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ #[cfg(target_os = "linux")] use std::time::Duration; diff --git a/src/hyperlight-js/src/script.rs b/src/hyperlight-js/src/script.rs index c8b1550..adce6ba 100644 --- a/src/hyperlight-js/src/script.rs +++ b/src/hyperlight-js/src/script.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use std::path::{Path, PathBuf}; use std::sync::Arc; diff --git a/src/hyperlight-js/tests/builtin_crypto.rs b/src/hyperlight-js/tests/builtin_crypto.rs index 99b836c..d603789 100644 --- a/src/hyperlight-js/tests/builtin_crypto.rs +++ b/src/hyperlight-js/tests/builtin_crypto.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! Test the built-in crypto module #![allow(clippy::disallowed_macros)] diff --git a/src/hyperlight-js/tests/builtin_globals.rs b/src/hyperlight-js/tests/builtin_globals.rs index e5cd79a..6202614 100644 --- a/src/hyperlight-js/tests/builtin_globals.rs +++ b/src/hyperlight-js/tests/builtin_globals.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ #![allow(clippy::disallowed_macros)] use hyperlight_js::{SandboxBuilder, Script}; diff --git a/src/hyperlight-js/tests/builtin_modules.rs b/src/hyperlight-js/tests/builtin_modules.rs index 3bc3f15..f35d431 100644 --- a/src/hyperlight-js/tests/builtin_modules.rs +++ b/src/hyperlight-js/tests/builtin_modules.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! Tests for the built-in (native) modules #![allow(clippy::disallowed_macros)] diff --git a/src/hyperlight-js/tests/handlers.rs b/src/hyperlight-js/tests/handlers.rs index 2464d20..b3f7b5f 100644 --- a/src/hyperlight-js/tests/handlers.rs +++ b/src/hyperlight-js/tests/handlers.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! Test the behaviour of JavaScript handlers #![allow(clippy::disallowed_macros)] diff --git a/src/hyperlight-js/tests/host_functions.rs b/src/hyperlight-js/tests/host_functions.rs index 975b803..2266f61 100644 --- a/src/hyperlight-js/tests/host_functions.rs +++ b/src/hyperlight-js/tests/host_functions.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! Test for host modules / functions. #![allow(clippy::disallowed_macros)] diff --git a/src/hyperlight-js/tests/module_loader.rs b/src/hyperlight-js/tests/module_loader.rs index f06c962..655000a 100644 --- a/src/hyperlight-js/tests/module_loader.rs +++ b/src/hyperlight-js/tests/module_loader.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! Tests for the module loader that import files from the embedded filesystem. #![allow(clippy::disallowed_macros)] diff --git a/src/hyperlight-js/tests/monitors.rs b/src/hyperlight-js/tests/monitors.rs index 9aec292..283ab0a 100644 --- a/src/hyperlight-js/tests/monitors.rs +++ b/src/hyperlight-js/tests/monitors.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! Execution Monitor Integration Tests #![cfg(any(feature = "monitor-wall-clock", feature = "monitor-cpu-time"))] diff --git a/src/hyperlight-js/tests/printing.rs b/src/hyperlight-js/tests/printing.rs index 5c14a47..763cce2 100644 --- a/src/hyperlight-js/tests/printing.rs +++ b/src/hyperlight-js/tests/printing.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! Tests for output printing from the sandbox #![allow(clippy::disallowed_macros)] diff --git a/src/hyperlight-js/tests/runtime.rs b/src/hyperlight-js/tests/runtime.rs index da6b32f..1ec8b05 100644 --- a/src/hyperlight-js/tests/runtime.rs +++ b/src/hyperlight-js/tests/runtime.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! Test some key aspects of the JavaScript runtime #![allow(clippy::disallowed_macros)] diff --git a/src/hyperlight-js/tests/termination.rs b/src/hyperlight-js/tests/termination.rs index f545147..3212c16 100644 --- a/src/hyperlight-js/tests/termination.rs +++ b/src/hyperlight-js/tests/termination.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ //! Test manual termination of the sandbox (i.e., without using a monitor) #![allow(clippy::disallowed_macros)] diff --git a/src/js-host-api/build.rs b/src/js-host-api/build.rs index 0f1b010..2dc7cfb 100644 --- a/src/js-host-api/build.rs +++ b/src/js-host-api/build.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ fn main() { napi_build::setup(); } diff --git a/src/js-host-api/lib.js b/src/js-host-api/lib.js index 84d2336..0fdf593 100644 --- a/src/js-host-api/lib.js +++ b/src/js-host-api/lib.js @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // ── Hyperlight JS Host API — Error enrichment wrapper ──────────────── // // This module re-exports the native napi-rs binding from index.js and diff --git a/src/js-host-api/src/lib.rs b/src/js-host-api/src/lib.rs index 977e567..53378a9 100644 --- a/src/js-host-api/src/lib.rs +++ b/src/js-host-api/src/lib.rs @@ -1,3 +1,18 @@ +/* +Copyright 2026 The Hyperlight Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex}; use std::time::Duration;