summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorYiyu Lin <linyiyu1992@gmail.com>2023-01-13 15:51:32 +0800
committerGitHub <noreply@github.com>2023-01-13 16:51:32 +0900
commita00e432297d2ae119c8e1097aec74badc886f912 (patch)
tree7380b37245e889e97a8c7b1535a1e31fddb74738 /ext
parent5707a958ac2b44d573d50260b1d0d40887662011 (diff)
chore: add `copyright_checker` tool and add the missing copyright (#17285)
Diffstat (limited to 'ext')
-rw-r--r--ext/broadcast_channel/in_memory_broadcast_channel.rs6
-rw-r--r--ext/crypto/decrypt.rs5
-rw-r--r--ext/crypto/ed25519.rs2
-rw-r--r--ext/crypto/encrypt.rs4
-rw-r--r--ext/crypto/export_key.rs5
-rw-r--r--ext/crypto/generate_key.rs5
-rw-r--r--ext/crypto/import_key.rs7
-rw-r--r--ext/crypto/shared.rs2
-rw-r--r--ext/crypto/x25519.rs2
-rw-r--r--ext/flash/chunked.rs3
-rw-r--r--ext/flash/sendfile.rs2
-rw-r--r--ext/flash/socket.rs15
-rw-r--r--ext/node/module_es_shim.js2
-rw-r--r--ext/node/path.rs2
-rw-r--r--ext/url/benches/url_ops.rs2
-rw-r--r--ext/url/urlpattern.rs2
-rw-r--r--ext/web/benches/encoding.rs3
-rw-r--r--ext/web/benches/timers_ops.rs3
-rw-r--r--ext/web/blob.rs15
-rw-r--r--ext/web/message_port.rs2
20 files changed, 63 insertions, 26 deletions
diff --git a/ext/broadcast_channel/in_memory_broadcast_channel.rs b/ext/broadcast_channel/in_memory_broadcast_channel.rs
index 595a7cc13..7c9c68ae0 100644
--- a/ext/broadcast_channel/in_memory_broadcast_channel.rs
+++ b/ext/broadcast_channel/in_memory_broadcast_channel.rs
@@ -1,14 +1,16 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-use crate::BroadcastChannel;
+use std::sync::Arc;
+
use async_trait::async_trait;
use deno_core::error::AnyError;
use deno_core::parking_lot::Mutex;
-use std::sync::Arc;
use tokio::sync::broadcast;
use tokio::sync::mpsc;
use uuid::Uuid;
+use crate::BroadcastChannel;
+
#[derive(Clone)]
pub struct InMemoryBroadcastChannel(Arc<Mutex<broadcast::Sender<Message>>>);
diff --git a/ext/crypto/decrypt.rs b/ext/crypto/decrypt.rs
index c83ff55bd..6c4d5b6ba 100644
--- a/ext/crypto/decrypt.rs
+++ b/ext/crypto/decrypt.rs
@@ -1,4 +1,5 @@
-use crate::shared::*;
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
use aes::cipher::block_padding::Pkcs7;
use aes::cipher::BlockDecryptMut;
use aes::cipher::KeyIvInit;
@@ -29,6 +30,8 @@ use sha2::Sha256;
use sha2::Sha384;
use sha2::Sha512;
+use crate::shared::*;
+
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DecryptOptions {
diff --git a/ext/crypto/ed25519.rs b/ext/crypto/ed25519.rs
index b7ff99d8b..898366bbc 100644
--- a/ext/crypto/ed25519.rs
+++ b/ext/crypto/ed25519.rs
@@ -1,3 +1,5 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
use deno_core::error::AnyError;
use deno_core::op;
use deno_core::ZeroCopyBuf;
diff --git a/ext/crypto/encrypt.rs b/ext/crypto/encrypt.rs
index 9420acdbd..f34e0cbc6 100644
--- a/ext/crypto/encrypt.rs
+++ b/ext/crypto/encrypt.rs
@@ -1,4 +1,4 @@
-use crate::shared::*;
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
use aes::cipher::block_padding::Pkcs7;
use aes::cipher::BlockEncryptMut;
@@ -31,6 +31,8 @@ use sha2::Sha256;
use sha2::Sha384;
use sha2::Sha512;
+use crate::shared::*;
+
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct EncryptOptions {
diff --git a/ext/crypto/export_key.rs b/ext/crypto/export_key.rs
index 0cbb2f676..ec76bac92 100644
--- a/ext/crypto/export_key.rs
+++ b/ext/crypto/export_key.rs
@@ -1,4 +1,5 @@
-use crate::shared::*;
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
use const_oid::AssociatedOid;
use const_oid::ObjectIdentifier;
use deno_core::error::custom_error;
@@ -15,6 +16,8 @@ use spki::der::Decode;
use spki::der::Encode;
use spki::AlgorithmIdentifier;
+use crate::shared::*;
+
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ExportKeyOptions {
diff --git a/ext/crypto/generate_key.rs b/ext/crypto/generate_key.rs
index 9ecbb8d11..2a9452c43 100644
--- a/ext/crypto/generate_key.rs
+++ b/ext/crypto/generate_key.rs
@@ -1,4 +1,5 @@
-use crate::shared::*;
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
use deno_core::error::AnyError;
use deno_core::op;
use deno_core::ZeroCopyBuf;
@@ -12,6 +13,8 @@ use rsa::BigUint;
use rsa::RsaPrivateKey;
use serde::Deserialize;
+use crate::shared::*;
+
// Allowlist for RSA public exponents.
static PUB_EXPONENT_1: Lazy<BigUint> =
Lazy::new(|| BigUint::from_u64(3).unwrap());
diff --git a/ext/crypto/import_key.rs b/ext/crypto/import_key.rs
index 07c7f3f6f..42eab0e6c 100644
--- a/ext/crypto/import_key.rs
+++ b/ext/crypto/import_key.rs
@@ -1,5 +1,5 @@
-use crate::key::CryptoNamedCurve;
-use crate::shared::*;
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
use deno_core::error::AnyError;
use deno_core::op;
use deno_core::ZeroCopyBuf;
@@ -12,6 +12,9 @@ use serde::Serialize;
use spki::der::Decode;
use spki::der::Encode;
+use crate::key::CryptoNamedCurve;
+use crate::shared::*;
+
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum KeyData {
diff --git a/ext/crypto/shared.rs b/ext/crypto/shared.rs
index d2f7d53e8..4ecb35dc2 100644
--- a/ext/crypto/shared.rs
+++ b/ext/crypto/shared.rs
@@ -1,3 +1,5 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
use std::borrow::Cow;
use deno_core::error::custom_error;
diff --git a/ext/crypto/x25519.rs b/ext/crypto/x25519.rs
index 1e64e9909..0ecdf4ddc 100644
--- a/ext/crypto/x25519.rs
+++ b/ext/crypto/x25519.rs
@@ -1,3 +1,5 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
use curve25519_dalek::montgomery::MontgomeryPoint;
use deno_core::error::AnyError;
use deno_core::op;
diff --git a/ext/flash/chunked.rs b/ext/flash/chunked.rs
index d414f211e..711dd717d 100644
--- a/ext/flash/chunked.rs
+++ b/ext/flash/chunked.rs
@@ -1,7 +1,8 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+//
// Based on https://github.com/frewsxcv/rust-chunked-transfer/blob/5c08614458580f9e7a85124021006d83ce1ed6e9/src/decoder.rs
// Copyright 2015 The tiny-http Contributors
// Copyright 2015 The rust-chunked-transfer Contributors
-// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
use std::error::Error;
use std::fmt;
diff --git a/ext/flash/sendfile.rs b/ext/flash/sendfile.rs
index 43b5323a4..92e8f2bb7 100644
--- a/ext/flash/sendfile.rs
+++ b/ext/flash/sendfile.rs
@@ -1,5 +1,5 @@
-// Forked from https://github.com/Thomasdezeeuw/sendfile/blob/024f82cd4dede9048392a5bd6d8afcd4d5aa83d5/src/lib.rs
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+// Forked from https://github.com/Thomasdezeeuw/sendfile/blob/024f82cd4dede9048392a5bd6d8afcd4d5aa83d5/src/lib.rs
use std::future::Future;
use std::io;
diff --git a/ext/flash/socket.rs b/ext/flash/socket.rs
index 8256be8a0..77881d536 100644
--- a/ext/flash/socket.rs
+++ b/ext/flash/socket.rs
@@ -1,12 +1,13 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
+use std::cell::UnsafeCell;
+use std::future::Future;
+use std::io::{Read, Write};
+use std::pin::Pin;
+use std::sync::{Arc, Mutex};
+
use deno_core::error::AnyError;
use mio::net::TcpStream;
-use std::{
- cell::UnsafeCell,
- future::Future,
- io::{Read, Write},
- pin::Pin,
- sync::{Arc, Mutex},
-};
use tokio::sync::mpsc;
use crate::ParseStatus;
diff --git a/ext/node/module_es_shim.js b/ext/node/module_es_shim.js
index 164e18db5..f32006b4a 100644
--- a/ext/node/module_es_shim.js
+++ b/ext/node/module_es_shim.js
@@ -1,3 +1,5 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
const m = Deno[Deno.internal].require.Module;
export const _cache = m._cache;
export const _extensions = m._extensions;
diff --git a/ext/node/path.rs b/ext/node/path.rs
index 8477fe713..f0ce52002 100644
--- a/ext/node/path.rs
+++ b/ext/node/path.rs
@@ -1,3 +1,5 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
use std::path::Component;
use std::path::PathBuf;
diff --git a/ext/url/benches/url_ops.rs b/ext/url/benches/url_ops.rs
index 63810733d..2bf113f54 100644
--- a/ext/url/benches/url_ops.rs
+++ b/ext/url/benches/url_ops.rs
@@ -1,3 +1,5 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
use deno_bench_util::bench_js_sync;
use deno_bench_util::bench_or_profile;
use deno_bench_util::bencher::{benchmark_group, Bencher};
diff --git a/ext/url/urlpattern.rs b/ext/url/urlpattern.rs
index 99fd21664..dcb3eaac8 100644
--- a/ext/url/urlpattern.rs
+++ b/ext/url/urlpattern.rs
@@ -1,3 +1,5 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
use deno_core::error::type_error;
use deno_core::error::AnyError;
use deno_core::op;
diff --git a/ext/web/benches/encoding.rs b/ext/web/benches/encoding.rs
index 8c9eaeb6c..01fba9e66 100644
--- a/ext/web/benches/encoding.rs
+++ b/ext/web/benches/encoding.rs
@@ -1,8 +1,9 @@
-use deno_core::Extension;
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
use deno_bench_util::bench_js_sync;
use deno_bench_util::bench_or_profile;
use deno_bench_util::bencher::{benchmark_group, Bencher};
+use deno_core::Extension;
use deno_web::BlobStore;
struct Permissions;
diff --git a/ext/web/benches/timers_ops.rs b/ext/web/benches/timers_ops.rs
index 2ba93c5e1..024d52360 100644
--- a/ext/web/benches/timers_ops.rs
+++ b/ext/web/benches/timers_ops.rs
@@ -1,8 +1,9 @@
-use deno_core::Extension;
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
use deno_bench_util::bench_js_async;
use deno_bench_util::bench_or_profile;
use deno_bench_util::bencher::{benchmark_group, Bencher};
+use deno_core::Extension;
use deno_web::BlobStore;
struct Permissions;
diff --git a/ext/web/blob.rs b/ext/web/blob.rs
index 24cd13454..e4ba93a2f 100644
--- a/ext/web/blob.rs
+++ b/ext/web/blob.rs
@@ -1,18 +1,19 @@
-use async_trait::async_trait;
-use deno_core::error::type_error;
-use deno_core::op;
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-use deno_core::parking_lot::Mutex;
-use deno_core::url::Url;
-use deno_core::ZeroCopyBuf;
-use serde::{Deserialize, Serialize};
use std::cell::RefCell;
use std::collections::HashMap;
use std::fmt::Debug;
use std::rc::Rc;
use std::sync::Arc;
+use async_trait::async_trait;
+use deno_core::error::type_error;
use deno_core::error::AnyError;
+use deno_core::op;
+use deno_core::parking_lot::Mutex;
+use deno_core::url::Url;
+use deno_core::ZeroCopyBuf;
+use serde::{Deserialize, Serialize};
use uuid::Uuid;
use crate::Location;
diff --git a/ext/web/message_port.rs b/ext/web/message_port.rs
index 48c899216..f287fc82d 100644
--- a/ext/web/message_port.rs
+++ b/ext/web/message_port.rs
@@ -1,3 +1,5 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
use std::borrow::Cow;
use std::cell::RefCell;
use std::rc::Rc;