diff --git a/Cargo.toml b/Cargo.toml index b2f0bf288d..1d75718f2c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,8 @@ name = "llrt" version = "0.1.5-beta" edition = "2021" +license-file = "LICENSE" +license = "Apache-2.0" [features] default = ["macro"] diff --git a/LICENSE b/LICENSE index 6aa0c458f3..7a4a3ea242 100644 --- a/LICENSE +++ b/LICENSE @@ -1,14 +1,202 @@ -Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 newline at end of file diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000000..7104457dee --- /dev/null +++ b/NOTICE @@ -0,0 +1,2 @@ +LLRT +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. \ No newline at end of file diff --git a/build.rs b/build.rs index a3598923a9..e543fc5f73 100644 --- a/build.rs +++ b/build.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::{ collections::HashSet, env, diff --git a/pack b/pack index d72ec06626..326dcae665 100755 --- a/pack +++ b/pack @@ -1,4 +1,7 @@ #!/usr/bin/env bash +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + set -e if [ "$#" -ne 2 ]; then diff --git a/package.json b/package.json index 902219173c..f94e44e441 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "workspaces": [ "./example/*" ], + "license": "Apache-2.0", "version": "1.0.0", "type": "module", "private": true, diff --git a/src/buffer.rs b/src/buffer.rs index d89b68fcce..c77b051520 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use rquickjs::{ atom::PredefinedAtom, cstr, diff --git a/src/bytearray_buffer.rs b/src/bytearray_buffer.rs index c718dda4f3..486a33687a 100644 --- a/src/bytearray_buffer.rs +++ b/src/bytearray_buffer.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::{ cmp::min, collections::VecDeque, diff --git a/src/child_process.rs b/src/child_process.rs index e01f3535ff..a773841510 100644 --- a/src/child_process.rs +++ b/src/child_process.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::{ collections::HashMap, io::Result as IoResult, diff --git a/src/compiler.rs b/src/compiler.rs index 540a28c0ca..03aa8a5313 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::{fs, io, path::Path}; use rquickjs::{Context, Module, Runtime}; diff --git a/src/compiler_common.rs b/src/compiler_common.rs index 1556b4926f..a2e15629af 100644 --- a/src/compiler_common.rs +++ b/src/compiler_common.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 // Shared with build.rs and compiler.rs use rquickjs::{ diff --git a/src/console.rs b/src/console.rs index 1ebcb78477..a034cab74c 100644 --- a/src/console.rs +++ b/src/console.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::fmt::Write as FormatWrite; use std::{ io::{stderr, stdout, IsTerminal, Write}, diff --git a/src/crypto/crc32.rs b/src/crypto/crc32.rs index a02e6c4276..62ef31e96e 100644 --- a/src/crypto/crc32.rs +++ b/src/crypto/crc32.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::hash::Hasher; use crc32c::Crc32cHasher; diff --git a/src/crypto/md5_hash.rs b/src/crypto/md5_hash.rs index 0f537e1d76..65ebc9f063 100644 --- a/src/crypto/md5_hash.rs +++ b/src/crypto/md5_hash.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use md5::{Digest as Md5Digest, Md5 as MdHasher}; use rquickjs::{function::Opt, prelude::This, Class, Ctx, Result, Value}; diff --git a/src/crypto/mod.rs b/src/crypto/mod.rs index 977cc001e3..a0c6964781 100644 --- a/src/crypto/mod.rs +++ b/src/crypto/mod.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 mod crc32; mod md5_hash; mod sha_hash; diff --git a/src/crypto/sha_hash.rs b/src/crypto/sha_hash.rs index edf6b55fe8..96161d0fb0 100644 --- a/src/crypto/sha_hash.rs +++ b/src/crypto/sha_hash.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use ring::{ digest::{self, Context as DigestContext}, hmac::{self, Context as HmacContext}, diff --git a/src/encoding/encoder.rs b/src/encoding/encoder.rs index fc16746d2e..bc0165c371 100644 --- a/src/encoding/encoder.rs +++ b/src/encoding/encoder.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use hex_simd::AsciiCase; use std::result::Result; diff --git a/src/encoding/mod.rs b/src/encoding/mod.rs index 60b833c074..344ac3d813 100644 --- a/src/encoding/mod.rs +++ b/src/encoding/mod.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 pub mod encoder; use rquickjs::{ diff --git a/src/events.rs b/src/events.rs index 9de61d27df..610d0d35cf 100644 --- a/src/events.rs +++ b/src/events.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 #![allow(clippy::mutable_key_type, clippy::for_kv_map)] use std::sync::{Arc, RwLock}; diff --git a/src/fs/access.rs b/src/fs/access.rs index 4d2ba2d97b..0e251a433c 100644 --- a/src/fs/access.rs +++ b/src/fs/access.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use rquickjs::{prelude::Opt, Ctx, Exception, Result}; use tokio::fs; diff --git a/src/fs/mkdir.rs b/src/fs/mkdir.rs index bcf49ad841..8ec98e2990 100644 --- a/src/fs/mkdir.rs +++ b/src/fs/mkdir.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::os::unix::prelude::PermissionsExt; use ring::rand::{SecureRandom, SystemRandom}; diff --git a/src/fs/mod.rs b/src/fs/mod.rs index c1aa6d23a4..264dcb191c 100644 --- a/src/fs/mod.rs +++ b/src/fs/mod.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 mod access; mod mkdir; mod read_dir; diff --git a/src/fs/read_dir.rs b/src/fs/read_dir.rs index e5f218da9c..2f1a11d981 100644 --- a/src/fs/read_dir.rs +++ b/src/fs/read_dir.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::fs::Metadata; use rquickjs::{ diff --git a/src/fs/read_file.rs b/src/fs/read_file.rs index ee5a507a44..fdc6f443a5 100644 --- a/src/fs/read_file.rs +++ b/src/fs/read_file.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use rquickjs::{function::Opt, Ctx, Object, Result}; use tokio::fs; diff --git a/src/fs/rm.rs b/src/fs/rm.rs index 065e298b94..24d04718d7 100644 --- a/src/fs/rm.rs +++ b/src/fs/rm.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use rquickjs::{function::Opt, Ctx, Object, Result}; use tokio::fs; diff --git a/src/fs/stats.rs b/src/fs/stats.rs index 86325b9aae..59bc45703c 100644 --- a/src/fs/stats.rs +++ b/src/fs/stats.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use crate::utils::result::ResultExt; use rquickjs::{Ctx, Result}; diff --git a/src/fs/write_file.rs b/src/fs/write_file.rs index 1568d69439..86504a2755 100644 --- a/src/fs/write_file.rs +++ b/src/fs/write_file.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use rquickjs::{Ctx, Result, Value}; use tokio::fs; use tokio::io::AsyncWriteExt; diff --git a/src/http/fetch.rs b/src/http/fetch.rs index eb57c9a1e1..ebd72ed456 100644 --- a/src/http/fetch.rs +++ b/src/http/fetch.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use bytes::Bytes; use http_body_util::Full; use hyper::{Request, Uri}; diff --git a/src/http/headers.rs b/src/http/headers.rs index 5ce4162a12..474abf76ce 100644 --- a/src/http/headers.rs +++ b/src/http/headers.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::collections::BTreeMap; use hyper::HeaderMap; diff --git a/src/http/mod.rs b/src/http/mod.rs index 156f5ee3b0..4ea9015528 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 mod fetch; mod headers; mod request; diff --git a/src/http/request.rs b/src/http/request.rs index 99789f9138..c985a25d4e 100644 --- a/src/http/request.rs +++ b/src/http/request.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use rquickjs::{class::Trace, function::Opt, methods, Class, Ctx, Object, Result, Value}; use crate::utils::object::ObjectExt; diff --git a/src/http/response.rs b/src/http/response.rs index d55e165342..2eea3ad652 100644 --- a/src/http/response.rs +++ b/src/http/response.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::time::Instant; use http_body_util::BodyExt; diff --git a/src/http/url.rs b/src/http/url.rs index cd6b92218a..5242ab38d1 100644 --- a/src/http/url.rs +++ b/src/http/url.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use rquickjs::{ atom::PredefinedAtom, class::{Trace, Tracer}, diff --git a/src/http/url_search_params.rs b/src/http/url_search_params.rs index 7b75af9389..521798b9dc 100644 --- a/src/http/url_search_params.rs +++ b/src/http/url_search_params.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::collections::BTreeMap; use rquickjs::{ diff --git a/src/js/@llrt/init.ts b/src/js/@llrt/init.ts index 9f48adb968..3d8eb69482 100644 --- a/src/js/@llrt/init.ts +++ b/src/js/@llrt/init.ts @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 global.ReadableStream = class ReadableStream { constructor() { throw new Error( diff --git a/src/js/@llrt/runtime.ts b/src/js/@llrt/runtime.ts index 9856e0ed4e..947978f03a 100644 --- a/src/js/@llrt/runtime.ts +++ b/src/js/@llrt/runtime.ts @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 // @ts-ignore const global = globalThis as any; diff --git a/src/js/@llrt/std.ts b/src/js/@llrt/std.ts index 6d45d11c00..8e8a5c4ac4 100644 --- a/src/js/@llrt/std.ts +++ b/src/js/@llrt/std.ts @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import "./init"; Object.defineProperty(globalThis, "module", { diff --git a/src/js/@llrt/test.ts b/src/js/@llrt/test.ts index 2d4557fce3..3128ff2bb2 100644 --- a/src/js/@llrt/test.ts +++ b/src/js/@llrt/test.ts @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import assert from "assert"; const GLOBAL = globalThis as any; diff --git a/src/js/llrt.d.ts b/src/js/llrt.d.ts index 23b129cf2b..948cf497c6 100644 --- a/src/js/llrt.d.ts +++ b/src/js/llrt.d.ts @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 declare var __bootstrap: any; declare namespace NodeJS { diff --git a/src/js/stream.ts b/src/js/stream.ts index a383eacdbf..ad7b62598d 100644 --- a/src/js/stream.ts +++ b/src/js/stream.ts @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { EventEmitter as EE } from "events"; // @ts-ignore import { Readable } from "readable-stream/lib/_stream_readable.js"; diff --git a/src/json/escape.rs b/src/json/escape.rs index 41e355df3b..5e1a2c399f 100644 --- a/src/json/escape.rs +++ b/src/json/escape.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 #[cfg(feature = "nightly")] //FIXME remove when std::simd is stable use std::simd::{u8x16, Mask, Simd, SimdPartialEq, SimdPartialOrd, ToBitMask}; diff --git a/src/json/mod.rs b/src/json/mod.rs index ad293076f0..13c99e9d9b 100644 --- a/src/json/mod.rs +++ b/src/json/mod.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 pub mod escape; pub mod parse; pub mod stringify; diff --git a/src/json/parse.rs b/src/json/parse.rs index 7b1192eced..c66d5eb0f4 100644 --- a/src/json/parse.rs +++ b/src/json/parse.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use rquickjs::{Array, Ctx, IntoJs, Null, Object, Result, Undefined, Value}; use simd_json::{Node, StaticNode}; diff --git a/src/json/stringify.rs b/src/json/stringify.rs index 0fa4036fe6..086f93d2cf 100644 --- a/src/json/stringify.rs +++ b/src/json/stringify.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::collections::HashSet; use rquickjs::{ diff --git a/src/macros.rs b/src/macros.rs index 705f9cf3c6..16c9be0555 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 macro_rules! iterable_enum { ($visibility:vis, $name:ident, $($member:tt),*) => { #[derive(Copy, Clone)] diff --git a/src/main.c b/src/main.c index 81cb1b2628..8bfbc75025 100644 --- a/src/main.c +++ b/src/main.c @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 #define _GNU_SOURCE #include diff --git a/src/main.rs b/src/main.rs index 7b00b13780..605fa5059c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 #![allow(clippy::new_without_default)] #![allow(clippy::inherent_to_string)] #![cfg_attr(feature = "nightly", feature(portable_simd))] diff --git a/src/minimal_tracer.rs b/src/minimal_tracer.rs index 3760a1d493..66bcf9ed7c 100644 --- a/src/minimal_tracer.rs +++ b/src/minimal_tracer.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::{ env, fmt::{self, Write}, diff --git a/src/module.rs b/src/module.rs index f1c64171fc..1686562a6b 100644 --- a/src/module.rs +++ b/src/module.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use rquickjs::{ module::{Declarations, Exports, ModuleDef}, prelude::Func, diff --git a/src/net/mod.rs b/src/net/mod.rs index b35f5ab439..e7c6734ab3 100644 --- a/src/net/mod.rs +++ b/src/net/mod.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 mod socket; use once_cell::sync::Lazy; diff --git a/src/net/socket.rs b/src/net/socket.rs index f7559eedb5..26b3243d1d 100644 --- a/src/net/socket.rs +++ b/src/net/socket.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::{ net::SocketAddr, result::Result as StdResult, diff --git a/src/number.rs b/src/number.rs index 0eb079f150..33eaf57137 100644 --- a/src/number.rs +++ b/src/number.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use rquickjs::{ function::{Opt, This}, Ctx, Exception, Result, Value, diff --git a/src/os.rs b/src/os.rs index 29c04ea280..af78f7361c 100644 --- a/src/os.rs +++ b/src/os.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::env; use once_cell::sync::Lazy; diff --git a/src/path.rs b/src/path.rs index 092ba6cc44..bcdd53ad73 100644 --- a/src/path.rs +++ b/src/path.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::{ path::{Component, Path, PathBuf, MAIN_SEPARATOR, MAIN_SEPARATOR_STR}, slice::Iter, diff --git a/src/process.rs b/src/process.rs index 41db11efbb..6b553bec05 100644 --- a/src/process.rs +++ b/src/process.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::{ collections::HashMap, env, diff --git a/src/security.rs b/src/security.rs index 9800906618..e7cc31e0c6 100644 --- a/src/security.rs +++ b/src/security.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use hyper::{http::uri::InvalidUri, Uri}; use once_cell::sync::Lazy; use rquickjs::{Ctx, Error, Exception, Result}; diff --git a/src/stream/mod.rs b/src/stream/mod.rs index 2d41cf4472..ed1ba0a2eb 100644 --- a/src/stream/mod.rs +++ b/src/stream/mod.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use rquickjs::{prelude::This, Class, Ctx, IntoJs, Result, Value}; use std::result::Result as StdResult; use tokio::sync::broadcast::error::RecvError; diff --git a/src/stream/readable.rs b/src/stream/readable.rs index e8b662333a..8864b28735 100644 --- a/src/stream/readable.rs +++ b/src/stream/readable.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::sync::{atomic::AtomicUsize, Arc, RwLock}; use rquickjs::{ diff --git a/src/stream/writable.rs b/src/stream/writable.rs index e45c8a0423..cfc05a0006 100644 --- a/src/stream/writable.rs +++ b/src/stream/writable.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::sync::{Arc, RwLock}; use rquickjs::{ diff --git a/src/test_utils.rs b/src/test_utils.rs index c3061a98c9..7c55fb6965 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 #[cfg(test)] pub mod utils { use rquickjs::{markers::ParallelSend, CatchResultExt, Ctx, Result}; diff --git a/src/timers.rs b/src/timers.rs index e13d75ba72..20717726fe 100644 --- a/src/timers.rs +++ b/src/timers.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::{ sync::{ atomic::{AtomicBool, AtomicUsize, Ordering}, diff --git a/src/utils/class.rs b/src/utils/class.rs index 450abc1d37..0a552b02c7 100644 --- a/src/utils/class.rs +++ b/src/utils/class.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use rquickjs::{ atom::PredefinedAtom, class::JsClass, prelude::This, Array, Ctx, Function, Object, Result, Value, diff --git a/src/utils/clone.rs b/src/utils/clone.rs index 65b3470623..061d20494d 100644 --- a/src/utils/clone.rs +++ b/src/utils/clone.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use fxhash::{FxBuildHasher, FxHashSet}; use rquickjs::function::This; diff --git a/src/utils/io.rs b/src/utils/io.rs index fcd3deb681..59417db1bd 100644 --- a/src/utils/io.rs +++ b/src/utils/io.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::{ path::{Path, PathBuf}, result::Result as StdResult, diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 26a91280f8..62b24da991 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use rquickjs::{ cstr, module::{Declarations, Exports, ModuleDef}, diff --git a/src/utils/object.rs b/src/utils/object.rs index e7731aa60f..cf00a214c6 100644 --- a/src/utils/object.rs +++ b/src/utils/object.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::collections::{BTreeMap, HashMap}; use rquickjs::{ diff --git a/src/utils/result.rs b/src/utils/result.rs index 52387516d5..af5f8701de 100644 --- a/src/utils/result.rs +++ b/src/utils/result.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::result::Result as StdResult; use rquickjs::{Ctx, Exception, Result}; diff --git a/src/utils/string.rs b/src/utils/string.rs index da5db7a35c..dfab361bfc 100644 --- a/src/utils/string.rs +++ b/src/utils/string.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 pub trait JoinToString { fn join_to_string(&mut self, separator: &str, f: F) -> String where diff --git a/src/uuid.rs b/src/uuid.rs index df70f9971c..bc22e4bfb5 100644 --- a/src/uuid.rs +++ b/src/uuid.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use once_cell::sync::Lazy; use ring::rand::SecureRandom; use rquickjs::{ diff --git a/src/vm.rs b/src/vm.rs index d3aa560f94..042f707a21 100644 --- a/src/vm.rs +++ b/src/vm.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::{ cmp::min, collections::{HashMap, HashSet}, diff --git a/src/xml.rs b/src/xml.rs index b07ea563cd..bc260f5a49 100644 --- a/src/xml.rs +++ b/src/xml.rs @@ -1,3 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 use std::collections::HashMap; use quick_xml::{