diff --git a/.license_template b/.license_template new file mode 100644 index 0000000000..30334ddc0c --- /dev/null +++ b/.license_template @@ -0,0 +1,2 @@ +// Copyright {20\d{2}(-20\d{2})?} IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 diff --git a/bindings/wasm/.license_template b/bindings/wasm/.license_template new file mode 120000 index 0000000000..6641e11a13 --- /dev/null +++ b/bindings/wasm/.license_template @@ -0,0 +1 @@ +../../.license_template \ No newline at end of file diff --git a/bindings/wasm/rustfmt.toml b/bindings/wasm/rustfmt.toml new file mode 120000 index 0000000000..760eb840be --- /dev/null +++ b/bindings/wasm/rustfmt.toml @@ -0,0 +1 @@ +../../rustfmt.toml \ No newline at end of file diff --git a/bindings/wasm/src/did.rs b/bindings/wasm/src/did.rs index 4fc1cf3ea4..77666459f4 100644 --- a/bindings/wasm/src/did.rs +++ b/bindings/wasm/src/did.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use identity_core::utils::decode_b58; use identity_iota::did::IotaDID; use wasm_bindgen::prelude::*; diff --git a/bindings/wasm/src/doc.rs b/bindings/wasm/src/doc.rs index d7a48b4310..b41944da0b 100644 --- a/bindings/wasm/src/doc.rs +++ b/bindings/wasm/src/doc.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use identity_core::{ convert::{FromJson as _, SerdeInto as _}, did_doc::{ diff --git a/bindings/wasm/src/iota.rs b/bindings/wasm/src/iota.rs index 4734d5013e..fb38d4c54a 100644 --- a/bindings/wasm/src/iota.rs +++ b/bindings/wasm/src/iota.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use identity_core::common::Object; use identity_iota::{ client::{Client, ClientBuilder, Network, TxnPrinter}, diff --git a/bindings/wasm/src/key.rs b/bindings/wasm/src/key.rs index db821c678a..a2fc5a27f0 100644 --- a/bindings/wasm/src/key.rs +++ b/bindings/wasm/src/key.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use identity_core::{ crypto::{KeyPair, PublicKey, SecretKey}, did_doc::MethodType, diff --git a/bindings/wasm/src/lib.rs b/bindings/wasm/src/lib.rs index b0da45bed8..ddf324285c 100644 --- a/bindings/wasm/src/lib.rs +++ b/bindings/wasm/src/lib.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use wasm_bindgen::prelude::*; pub mod did; diff --git a/bindings/wasm/src/pubkey.rs b/bindings/wasm/src/pubkey.rs index 2a0056e777..9a1de26996 100644 --- a/bindings/wasm/src/pubkey.rs +++ b/bindings/wasm/src/pubkey.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use identity_core::did_doc::{Method, MethodBuilder, MethodData}; use identity_iota::did::IotaDID; use wasm_bindgen::prelude::*; diff --git a/bindings/wasm/src/vc.rs b/bindings/wasm/src/vc.rs index 2c6b9277bf..a458800fda 100644 --- a/bindings/wasm/src/vc.rs +++ b/bindings/wasm/src/vc.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use identity_core::{ common::{OneOrMany, Url}, credential::{Credential, CredentialBuilder, CredentialSubject, VerifiableCredential as VC}, diff --git a/bindings/wasm/src/vp.rs b/bindings/wasm/src/vp.rs index ed23714e42..1fe5fcde26 100644 --- a/bindings/wasm/src/vp.rs +++ b/bindings/wasm/src/vp.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use identity_core::{ common::{OneOrMany, Url}, credential::{Presentation, PresentationBuilder, VerifiableCredential, VerifiablePresentation as VP}, diff --git a/examples/credential/src/main.rs b/examples/credential/src/main.rs index 3e888b447d..b2a810dd00 100644 --- a/examples/credential/src/main.rs +++ b/examples/credential/src/main.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + //! A basic example that generates and publishes subject and issuer DID //! Documents, creates a VerifiableCredential specifying claims about the //! subject, and retrieves information through the CredentialValidator API. diff --git a/examples/diff-chain/src/main.rs b/examples/diff-chain/src/main.rs index 7b5655f3e2..ce6cf554e3 100644 --- a/examples/diff-chain/src/main.rs +++ b/examples/diff-chain/src/main.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + //! An example that utilizes a diff and auth chain to publish updates to a //! DID Document. use identity_core::{ diff --git a/examples/resolution/src/main.rs b/examples/resolution/src/main.rs index 1953b4e592..2f94791b79 100644 --- a/examples/resolution/src/main.rs +++ b/examples/resolution/src/main.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + //! A basic example that generates a DID Document, publishes it to the Tangle, //! and retrieves information through DID Document resolution/dereferencing. use identity_core::resolver::{dereference, resolve, Dereference, Resolution}; diff --git a/identity-core/src/common/context.rs b/identity-core/src/common/context.rs index f19fa5b73a..4326bae95c 100644 --- a/identity-core/src/common/context.rs +++ b/identity-core/src/common/context.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::fmt::{Debug, Formatter, Result}; use serde::{Deserialize, Serialize}; diff --git a/identity-core/src/common/mod.rs b/identity-core/src/common/mod.rs index 98de9328e5..e4902dd719 100644 --- a/identity-core/src/common/mod.rs +++ b/identity-core/src/common/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + //! Definitions of common types. mod context; diff --git a/identity-core/src/common/one_or_many.rs b/identity-core/src/common/one_or_many.rs index b917799371..aaeab6dec7 100644 --- a/identity-core/src/common/one_or_many.rs +++ b/identity-core/src/common/one_or_many.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::{ fmt::{Debug, Display, Formatter, Result as FmtResult}, hash::Hash, diff --git a/identity-core/src/common/timestamp.rs b/identity-core/src/common/timestamp.rs index b819ff5e37..39da062280 100644 --- a/identity-core/src/common/timestamp.rs +++ b/identity-core/src/common/timestamp.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use chrono::{DateTime, SecondsFormat, Utc}; use core::{ convert::TryFrom, diff --git a/identity-core/src/common/url.rs b/identity-core/src/common/url.rs index 40383aeaed..41612b3848 100644 --- a/identity-core/src/common/url.rs +++ b/identity-core/src/common/url.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::{ fmt::{Debug, Display, Formatter, Result as FmtResult}, ops::{Deref, DerefMut}, diff --git a/identity-core/src/convert/json.rs b/identity-core/src/convert/json.rs index 330b597ad5..b53b0603ad 100644 --- a/identity-core/src/convert/json.rs +++ b/identity-core/src/convert/json.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::error::{Error, Result}; use serde::{Deserialize, Serialize}; diff --git a/identity-core/src/convert/mod.rs b/identity-core/src/convert/mod.rs index 4c573a4f9f..f5a8a98690 100644 --- a/identity-core/src/convert/mod.rs +++ b/identity-core/src/convert/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + //! Traits for conversions between types. mod json; diff --git a/identity-core/src/convert/serde_into.rs b/identity-core/src/convert/serde_into.rs index 4a679f3b63..6cf5ba5d80 100644 --- a/identity-core/src/convert/serde_into.rs +++ b/identity-core/src/convert/serde_into.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::{ convert::{AsJson, ToJson}, error::Result, diff --git a/identity-core/src/credential/credential.rs b/identity-core/src/credential/credential.rs index 03ff08ccfe..ed1c5e9171 100644 --- a/identity-core/src/credential/credential.rs +++ b/identity-core/src/credential/credential.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::fmt::{Display, Error as FmtError, Formatter, Result as FmtResult}; use did_doc::{Document, LdSuite, MethodQuery, MethodType, MethodWrap, SignatureOptions}; use serde::Serialize; diff --git a/identity-core/src/credential/credential_builder.rs b/identity-core/src/credential/credential_builder.rs index 21943d480f..c89647211f 100644 --- a/identity-core/src/credential/credential_builder.rs +++ b/identity-core/src/credential/credential_builder.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::{ common::{Context, Object, Timestamp, Url, Value}, credential::{ diff --git a/identity-core/src/credential/mod.rs b/identity-core/src/credential/mod.rs index a8969e9044..4cd3ad8d1e 100644 --- a/identity-core/src/credential/mod.rs +++ b/identity-core/src/credential/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + //! Types and traits for working with Verifiable Credentials. #![allow(clippy::module_inception)] diff --git a/identity-core/src/credential/presentation.rs b/identity-core/src/credential/presentation.rs index 6bb45287b9..5d418fda03 100644 --- a/identity-core/src/credential/presentation.rs +++ b/identity-core/src/credential/presentation.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::fmt::{Display, Error as FmtError, Formatter, Result as FmtResult}; use serde::Serialize; diff --git a/identity-core/src/credential/presentation_builder.rs b/identity-core/src/credential/presentation_builder.rs index 6ac409e255..e5fa8e8abb 100644 --- a/identity-core/src/credential/presentation_builder.rs +++ b/identity-core/src/credential/presentation_builder.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::{ common::{Context, Object, Url, Value}, credential::{Presentation, RefreshService, TermsOfUse, VerifiableCredential}, diff --git a/identity-core/src/credential/types/credential_schema.rs b/identity-core/src/credential/types/credential_schema.rs index 2d96240b3e..f5613676d9 100644 --- a/identity-core/src/credential/types/credential_schema.rs +++ b/identity-core/src/credential/types/credential_schema.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::common::{Object, OneOrMany, Url}; /// Information used to validate the structure of a `Credential`. diff --git a/identity-core/src/credential/types/credential_status.rs b/identity-core/src/credential/types/credential_status.rs index 19a07aaaf5..a40a8e5604 100644 --- a/identity-core/src/credential/types/credential_status.rs +++ b/identity-core/src/credential/types/credential_status.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::common::{Object, OneOrMany, Url}; /// Information used to determine the current status of a `Credential`. diff --git a/identity-core/src/credential/types/credential_subject.rs b/identity-core/src/credential/types/credential_subject.rs index 4a5b6f201e..892fb8a804 100644 --- a/identity-core/src/credential/types/credential_subject.rs +++ b/identity-core/src/credential/types/credential_subject.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::common::{Object, Url}; /// An entity who is the target of a set of claims. diff --git a/identity-core/src/credential/types/evidence.rs b/identity-core/src/credential/types/evidence.rs index 61ebc344b7..43aecc8009 100644 --- a/identity-core/src/credential/types/evidence.rs +++ b/identity-core/src/credential/types/evidence.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::common::{Object, OneOrMany}; /// Information used to increase confidence in the claims of a `Credential` diff --git a/identity-core/src/credential/types/issuer.rs b/identity-core/src/credential/types/issuer.rs index 506deddd0b..9754116c01 100644 --- a/identity-core/src/credential/types/issuer.rs +++ b/identity-core/src/credential/types/issuer.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::common::{Object, Url}; /// A `Credential` issuer in object form. diff --git a/identity-core/src/credential/types/mod.rs b/identity-core/src/credential/types/mod.rs index 335cba8967..e8990cf851 100644 --- a/identity-core/src/credential/types/mod.rs +++ b/identity-core/src/credential/types/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + mod credential_schema; mod credential_status; mod credential_subject; diff --git a/identity-core/src/credential/types/refresh_service.rs b/identity-core/src/credential/types/refresh_service.rs index ddc41f0c26..df88470981 100644 --- a/identity-core/src/credential/types/refresh_service.rs +++ b/identity-core/src/credential/types/refresh_service.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::common::{Object, OneOrMany, Url}; /// Information used to refresh or assert the status of a `Credential`. diff --git a/identity-core/src/credential/types/terms_of_use.rs b/identity-core/src/credential/types/terms_of_use.rs index b3c4310e3b..278eae35af 100644 --- a/identity-core/src/credential/types/terms_of_use.rs +++ b/identity-core/src/credential/types/terms_of_use.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::common::{Object, OneOrMany, Url}; /// Information used to express obligations, prohibitions, and permissions about diff --git a/identity-core/src/credential/verifiable_credential.rs b/identity-core/src/credential/verifiable_credential.rs index be2ac2a3a3..dbdb9889a3 100644 --- a/identity-core/src/credential/verifiable_credential.rs +++ b/identity-core/src/credential/verifiable_credential.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::{ fmt::{Display, Error as FmtError, Formatter, Result as FmtResult}, ops::{Deref, DerefMut}, diff --git a/identity-core/src/credential/verifiable_presentation.rs b/identity-core/src/credential/verifiable_presentation.rs index d83c84f268..774591bf0c 100644 --- a/identity-core/src/credential/verifiable_presentation.rs +++ b/identity-core/src/credential/verifiable_presentation.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::{ fmt::{Display, Error as FmtError, Formatter, Result as FmtResult}, ops::{Deref, DerefMut}, diff --git a/identity-core/src/crypto/key_impl.rs b/identity-core/src/crypto/key_impl.rs index 5c69ca61a4..69c426cfe3 100644 --- a/identity-core/src/crypto/key_impl.rs +++ b/identity-core/src/crypto/key_impl.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + macro_rules! impl_bytes { ($ident:ident) => { /// A cryptographic key. diff --git a/identity-core/src/crypto/key_pair.rs b/identity-core/src/crypto/key_pair.rs index 0fdf18abeb..b5ad3a8df7 100644 --- a/identity-core/src/crypto/key_pair.rs +++ b/identity-core/src/crypto/key_pair.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use zeroize::Zeroize; use crate::crypto::{PublicKey, SecretKey}; diff --git a/identity-core/src/crypto/mod.rs b/identity-core/src/crypto/mod.rs index 8f0cac8916..d4dac6edea 100644 --- a/identity-core/src/crypto/mod.rs +++ b/identity-core/src/crypto/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + //! Cryptographic Utilities mod key_impl; diff --git a/identity-core/src/error.rs b/identity-core/src/error.rs index 5749615cb5..9a7e551d87 100644 --- a/identity-core/src/error.rs +++ b/identity-core/src/error.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + //! Errors that may occur when Self-sovereign Identity goes wrong. /// Alias for a `Result` with the error type [`Error`]. diff --git a/identity-core/src/lib.rs b/identity-core/src/lib.rs index b283bde351..ba9c7c0328 100644 --- a/identity-core/src/lib.rs +++ b/identity-core/src/lib.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + //! Identity Core #![warn( diff --git a/identity-core/src/proof/jcsed25519signature2020.rs b/identity-core/src/proof/jcsed25519signature2020.rs index b4e036ec4e..b8c6298f41 100644 --- a/identity-core/src/proof/jcsed25519signature2020.rs +++ b/identity-core/src/proof/jcsed25519signature2020.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::convert::TryInto as _; use did_doc::{Error, Method, Result, Sign, SignatureData, SuiteName, Verify}; use ed25519_zebra::{Signature, SigningKey, VerificationKey, VerificationKeyBytes}; diff --git a/identity-core/src/proof/mod.rs b/identity-core/src/proof/mod.rs index 2df7f6edce..e4c8f0e8a0 100644 --- a/identity-core/src/proof/mod.rs +++ b/identity-core/src/proof/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + //! Types and traits for helping ensure the authenticity and integrity of //! DID Documents and Verifiable Credentials. diff --git a/identity-core/src/resolver/dereference.rs b/identity-core/src/resolver/dereference.rs index 89b4a56e91..a15f755886 100644 --- a/identity-core/src/resolver/dereference.rs +++ b/identity-core/src/resolver/dereference.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use serde::{Deserialize, Serialize}; use crate::resolver::{DocumentMetadata, ResolutionMetadata, Resource}; diff --git a/identity-core/src/resolver/document_metadata.rs b/identity-core/src/resolver/document_metadata.rs index cd2ec88f47..da01cbc047 100644 --- a/identity-core/src/resolver/document_metadata.rs +++ b/identity-core/src/resolver/document_metadata.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::common::{Object, Timestamp}; use serde::{Deserialize, Serialize}; diff --git a/identity-core/src/resolver/error_kind.rs b/identity-core/src/resolver/error_kind.rs index 1f74ccaee0..428a44de9a 100644 --- a/identity-core/src/resolver/error_kind.rs +++ b/identity-core/src/resolver/error_kind.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use serde::{Deserialize, Serialize}; /// Types of errors that be returned from a [DID resolution][SPEC] process. diff --git a/identity-core/src/resolver/impls.rs b/identity-core/src/resolver/impls.rs index 47aab89fa1..d3e280dab3 100644 --- a/identity-core/src/resolver/impls.rs +++ b/identity-core/src/resolver/impls.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use anyhow::anyhow; use did_doc::{url::Url, Document}; use did_url::DID; diff --git a/identity-core/src/resolver/input_metadata.rs b/identity-core/src/resolver/input_metadata.rs index 8f01b619ac..582a94b9be 100644 --- a/identity-core/src/resolver/input_metadata.rs +++ b/identity-core/src/resolver/input_metadata.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use serde::{Deserialize, Serialize}; use crate::common::Object; diff --git a/identity-core/src/resolver/mod.rs b/identity-core/src/resolver/mod.rs index 023a4afc7a..6074bd267c 100644 --- a/identity-core/src/resolver/mod.rs +++ b/identity-core/src/resolver/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + //! Types and traits for supporting DID Document resolution. mod dereference; diff --git a/identity-core/src/resolver/resolution.rs b/identity-core/src/resolver/resolution.rs index 40dc35e546..4d805a980c 100644 --- a/identity-core/src/resolver/resolution.rs +++ b/identity-core/src/resolver/resolution.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use did_doc::Document; use serde::{Deserialize, Serialize}; diff --git a/identity-core/src/resolver/resolution_metadata.rs b/identity-core/src/resolver/resolution_metadata.rs index 7d3b5a9065..9a3662cdca 100644 --- a/identity-core/src/resolver/resolution_metadata.rs +++ b/identity-core/src/resolver/resolution_metadata.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::time::Duration; use did_url::DID; use serde::{Deserialize, Serialize}; diff --git a/identity-core/src/resolver/resource.rs b/identity-core/src/resolver/resource.rs index d36720af38..eb0d877f41 100644 --- a/identity-core/src/resolver/resource.rs +++ b/identity-core/src/resolver/resource.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use did_doc::{url::Url, DIDKey, Document, Method, MethodRef, Service}; use did_url::DID; use serde::{Deserialize, Serialize}; diff --git a/identity-core/src/resolver/traits.rs b/identity-core/src/resolver/traits.rs index 554c4e596b..73fea7520c 100644 --- a/identity-core/src/resolver/traits.rs +++ b/identity-core/src/resolver/traits.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use async_trait::async_trait; use did_doc::Document; use did_url::DID; diff --git a/identity-core/src/utils/base58.rs b/identity-core/src/utils/base58.rs index 6701505bf8..c28a73ac82 100644 --- a/identity-core/src/utils/base58.rs +++ b/identity-core/src/utils/base58.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::error::{Error, Result}; /// Decodes the given `data` as base58-btc. diff --git a/identity-core/src/utils/jcs_sha256.rs b/identity-core/src/utils/jcs_sha256.rs index 24f8d01092..de464e6035 100644 --- a/identity-core/src/utils/jcs_sha256.rs +++ b/identity-core/src/utils/jcs_sha256.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use sha2::{digest::Output, Digest, Sha256}; use crate::{convert::ToJson, error::Result}; diff --git a/identity-core/src/utils/mod.rs b/identity-core/src/utils/mod.rs index 6c3470eced..7e57237c94 100644 --- a/identity-core/src/utils/mod.rs +++ b/identity-core/src/utils/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + //! Misc. utility functions. mod base58; diff --git a/identity-diff/derive/src/impls.rs b/identity-diff/derive/src/impls.rs index d563234f21..87fd42c886 100644 --- a/identity-diff/derive/src/impls.rs +++ b/identity-diff/derive/src/impls.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + mod enums; mod structs; diff --git a/identity-diff/derive/src/impls/enums.rs b/identity-diff/derive/src/impls/enums.rs index 00671f3ff6..d049531a47 100644 --- a/identity-diff/derive/src/impls/enums.rs +++ b/identity-diff/derive/src/impls/enums.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + #![allow(non_snake_case)] use crate::model::{DataFields, EVariant, InputModel, SVariant}; diff --git a/identity-diff/derive/src/impls/structs.rs b/identity-diff/derive/src/impls/structs.rs index c4b9bc4362..a57db906f9 100644 --- a/identity-diff/derive/src/impls/structs.rs +++ b/identity-diff/derive/src/impls/structs.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + #![allow(non_snake_case)] use crate::model::{InputModel, SVariant}; diff --git a/identity-diff/derive/src/lib.rs b/identity-diff/derive/src/lib.rs index cb0c9d92e7..75f5335716 100644 --- a/identity-diff/derive/src/lib.rs +++ b/identity-diff/derive/src/lib.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use proc_macro::TokenStream; use quote::quote; use syn::{parse_macro_input, DeriveInput}; diff --git a/identity-diff/derive/src/model.rs b/identity-diff/derive/src/model.rs index 0134ff248c..84f129d2c3 100644 --- a/identity-diff/derive/src/model.rs +++ b/identity-diff/derive/src/model.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use proc_macro2::{Ident, Literal, Span, TokenStream}; use quote::{format_ident, quote}; use syn::{ diff --git a/identity-diff/derive/src/utils.rs b/identity-diff/derive/src/utils.rs index 81ce671abc..ceaf5305f6 100644 --- a/identity-diff/derive/src/utils.rs +++ b/identity-diff/derive/src/utils.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use proc_macro2::{Delimiter, TokenTree}; use syn::{DeriveInput, Field, Meta, MetaList, NestedMeta, Path, PathSegment}; diff --git a/identity-diff/src/did_doc.rs b/identity-diff/src/did_doc.rs index df56e52d02..462ac8b7e3 100644 --- a/identity-diff/src/did_doc.rs +++ b/identity-diff/src/did_doc.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::convert::TryFrom as _; use did_doc::{ url::Url, DIDKey, Document, DocumentBuilder, Method, MethodBuilder, MethodData, MethodRef, MethodType, Object, diff --git a/identity-diff/src/error.rs b/identity-diff/src/error.rs index ee3579e527..77c07b24f3 100644 --- a/identity-diff/src/error.rs +++ b/identity-diff/src/error.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use anyhow::Result as AnyhowResult; use core::fmt::Display; use thiserror::Error as DeriveError; diff --git a/identity-diff/src/hashmap.rs b/identity-diff/src/hashmap.rs index bac0b33b16..628ce99390 100644 --- a/identity-diff/src/hashmap.rs +++ b/identity-diff/src/hashmap.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::Diff; use serde::{Deserialize, Serialize}; use std::{ diff --git a/identity-diff/src/hashset.rs b/identity-diff/src/hashset.rs index 9d3da90274..990621ea27 100644 --- a/identity-diff/src/hashset.rs +++ b/identity-diff/src/hashset.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::Diff; use serde::{Deserialize, Serialize}; use std::{ diff --git a/identity-diff/src/lib.rs b/identity-diff/src/lib.rs index f166d46dc4..8b7490bd2b 100644 --- a/identity-diff/src/lib.rs +++ b/identity-diff/src/lib.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + /// This module implements a `Diff` trait type. The Diff trait gives data structures an ability to compare /// themselves to another data structure of the same type over time. The library pairs off with `identity_derive` which /// implements a derive macro for the `Diff` Trait. Types supported include `HashMap`, `Option`, `String`, diff --git a/identity-diff/src/macros.rs b/identity-diff/src/macros.rs index d78516d1c6..dc2b043381 100644 --- a/identity-diff/src/macros.rs +++ b/identity-diff/src/macros.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::traits::Diff; use std::fmt::{Debug, Formatter, Result as FmtResult}; diff --git a/identity-diff/src/option.rs b/identity-diff/src/option.rs index 705f0d6b2c..4a03ff579e 100644 --- a/identity-diff/src/option.rs +++ b/identity-diff/src/option.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use serde::{Deserialize, Serialize}; use std::fmt::{Debug, Formatter, Result as FmtResult}; diff --git a/identity-diff/src/string.rs b/identity-diff/src/string.rs index 5703f82efe..e74f367912 100644 --- a/identity-diff/src/string.rs +++ b/identity-diff/src/string.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use serde::{Deserialize, Serialize}; use crate::Diff; diff --git a/identity-diff/src/traits.rs b/identity-diff/src/traits.rs index 8698f4ea56..aa7ae37cbc 100644 --- a/identity-diff/src/traits.rs +++ b/identity-diff/src/traits.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use serde::{Deserialize, Serialize}; use std::fmt::Debug; diff --git a/identity-diff/src/value.rs b/identity-diff/src/value.rs index b50cad561a..98db0cf613 100644 --- a/identity-diff/src/value.rs +++ b/identity-diff/src/value.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use serde::{Deserialize, Serialize}; use serde_json::Value; diff --git a/identity-diff/src/vec.rs b/identity-diff/src/vec.rs index 1f36089c76..0101959bd1 100644 --- a/identity-diff/src/vec.rs +++ b/identity-diff/src/vec.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::Diff; use serde::{Deserialize, Serialize}; use std::fmt::{Debug, Formatter, Result as FmtResult}; diff --git a/identity-diff/tests/derive_enum_test.rs b/identity-diff/tests/derive_enum_test.rs index 9fca7c8cdc..3661b2cde6 100644 --- a/identity-diff/tests/derive_enum_test.rs +++ b/identity-diff/tests/derive_enum_test.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + #![allow(unused_variables)] use identity_diff::Diff; diff --git a/identity-diff/tests/derive_struct_test.rs b/identity-diff/tests/derive_struct_test.rs index 00d4ecc3e7..c6c7fedc4c 100644 --- a/identity-diff/tests/derive_struct_test.rs +++ b/identity-diff/tests/derive_struct_test.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + // use identity_diff::Diff; // use serde::{Deserialize, Serialize}; diff --git a/identity-iota/src/chain/auth.rs b/identity-iota/src/chain/auth.rs index 65d975ebb8..a284aefdcc 100644 --- a/identity-iota/src/chain/auth.rs +++ b/identity-iota/src/chain/auth.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::mem; use crate::{ diff --git a/identity-iota/src/chain/diff.rs b/identity-iota/src/chain/diff.rs index 5ed45f8669..23dcd04523 100644 --- a/identity-iota/src/chain/diff.rs +++ b/identity-iota/src/chain/diff.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::slice::Iter; use crate::{ diff --git a/identity-iota/src/chain/document.rs b/identity-iota/src/chain/document.rs index cb5f1cbac1..be42695121 100644 --- a/identity-iota/src/chain/document.rs +++ b/identity-iota/src/chain/document.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::{ chain::{AuthChain, DiffChain}, did::{DocumentDiff, IotaDID, IotaDocument}, diff --git a/identity-iota/src/chain/mod.rs b/identity-iota/src/chain/mod.rs index 52281b6a78..fac642769b 100644 --- a/identity-iota/src/chain/mod.rs +++ b/identity-iota/src/chain/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + mod auth; mod diff; mod document; diff --git a/identity-iota/src/client/client.rs b/identity-iota/src/client/client.rs index 32cee0c50a..993f67a9ce 100644 --- a/identity-iota/src/client/client.rs +++ b/identity-iota/src/client/client.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::slice::from_ref; use identity_core::{common::Url, convert::ToJson}; use iota::{ diff --git a/identity-iota/src/client/client_builder.rs b/identity-iota/src/client/client_builder.rs index 786bc78fc5..6ce09e68ca 100644 --- a/identity-iota/src/client/client_builder.rs +++ b/identity-iota/src/client/client_builder.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::{ client::{Client, Network}, error::Result, diff --git a/identity-iota/src/client/mod.rs b/identity-iota/src/client/mod.rs index 6e81da3038..fbc81c39c5 100644 --- a/identity-iota/src/client/mod.rs +++ b/identity-iota/src/client/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + #[allow(clippy::module_inception)] mod client; mod client_builder; diff --git a/identity-iota/src/client/network.rs b/identity-iota/src/client/network.rs index 8f64f55b51..0695153c60 100644 --- a/identity-iota/src/client/network.rs +++ b/identity-iota/src/client/network.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use identity_core::common::Url; use iota::client::builder; diff --git a/identity-iota/src/client/resolver.rs b/identity-iota/src/client/resolver.rs index b10d340124..f62cb9934a 100644 --- a/identity-iota/src/client/resolver.rs +++ b/identity-iota/src/client/resolver.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use async_trait::async_trait; use identity_core::{ convert::SerdeInto as _, diff --git a/identity-iota/src/client/txn_printer.rs b/identity-iota/src/client/txn_printer.rs index 86d6263c63..323467322c 100644 --- a/identity-iota/src/client/txn_printer.rs +++ b/identity-iota/src/client/txn_printer.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::{ fmt::{Debug, Display, Formatter, Result}, marker::PhantomData, diff --git a/identity-iota/src/credential/mod.rs b/identity-iota/src/credential/mod.rs index 4768ccdaa4..835cd4c304 100644 --- a/identity-iota/src/credential/mod.rs +++ b/identity-iota/src/credential/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + mod validator; pub use validator::*; diff --git a/identity-iota/src/credential/validator.rs b/identity-iota/src/credential/validator.rs index 6478f6a075..9b1b48518f 100644 --- a/identity-iota/src/credential/validator.rs +++ b/identity-iota/src/credential/validator.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use identity_core::{ common::Object, convert::FromJson as _, diff --git a/identity-iota/src/did/did.rs b/identity-iota/src/did/did.rs index ebcb08080f..040fedef23 100644 --- a/identity-iota/src/did/did.rs +++ b/identity-iota/src/did/did.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::{ convert::TryFrom, fmt::{Debug, Display, Formatter, Result as FmtResult}, diff --git a/identity-iota/src/did/did_segments.rs b/identity-iota/src/did/did_segments.rs index 1419f7cb52..9f39c88bbb 100644 --- a/identity-iota/src/did/did_segments.rs +++ b/identity-iota/src/did/did_segments.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::did::IotaDID; macro_rules! get { diff --git a/identity-iota/src/did/document.rs b/identity-iota/src/did/document.rs index d71b755eda..a4950c17a3 100644 --- a/identity-iota/src/did/document.rs +++ b/identity-iota/src/did/document.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::{ convert::TryFrom, fmt::{Debug, Display, Formatter, Result as FmtResult}, diff --git a/identity-iota/src/did/document_builder.rs b/identity-iota/src/did/document_builder.rs index 50bda0eab3..18184ccdbc 100644 --- a/identity-iota/src/did/document_builder.rs +++ b/identity-iota/src/did/document_builder.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use identity_core::{ crypto::KeyPair, did_doc::{DocumentBuilder, Method, MethodBuilder, MethodData, MethodType, VerifiableDocument}, diff --git a/identity-iota/src/did/document_diff.rs b/identity-iota/src/did/document_diff.rs index 4f45745423..fdeab166ca 100644 --- a/identity-iota/src/did/document_diff.rs +++ b/identity-iota/src/did/document_diff.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use identity_core::{ convert::{AsJson as _, SerdeInto as _}, did_doc::{Document, SetSignature, Signature, TrySignature, TrySignatureMut}, diff --git a/identity-iota/src/did/document_properties.rs b/identity-iota/src/did/document_properties.rs index 7944ba7d31..a99fc5b7af 100644 --- a/identity-iota/src/did/document_properties.rs +++ b/identity-iota/src/did/document_properties.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use identity_core::common::{Object, Timestamp}; use crate::tangle::MessageId; diff --git a/identity-iota/src/did/mod.rs b/identity-iota/src/did/mod.rs index b62879f8af..99b07c8731 100644 --- a/identity-iota/src/did/mod.rs +++ b/identity-iota/src/did/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + #[allow(clippy::module_inception)] mod did; mod did_segments; diff --git a/identity-iota/src/error.rs b/identity-iota/src/error.rs index ead12e9f4a..92475830cc 100644 --- a/identity-iota/src/error.rs +++ b/identity-iota/src/error.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + pub type Result = core::result::Result; #[derive(Debug, thiserror::Error)] diff --git a/identity-iota/src/lib.rs b/identity-iota/src/lib.rs index 59f6af8e78..671517de97 100644 --- a/identity-iota/src/lib.rs +++ b/identity-iota/src/lib.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + // #![warn( // missing_docs, // missing_crate_level_docs, diff --git a/identity-iota/src/tangle/message.rs b/identity-iota/src/tangle/message.rs index f350f91677..ef9c1fc34d 100644 --- a/identity-iota/src/tangle/message.rs +++ b/identity-iota/src/tangle/message.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::fmt::{Debug, Formatter, Result as FmtResult}; use identity_core::convert::FromJson as _; use iota::{ diff --git a/identity-iota/src/tangle/message_id.rs b/identity-iota/src/tangle/message_id.rs index 0e934f1364..b31cfe110e 100644 --- a/identity-iota/src/tangle/message_id.rs +++ b/identity-iota/src/tangle/message_id.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::fmt::{Debug, Formatter, Result}; #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)] diff --git a/identity-iota/src/tangle/message_index.rs b/identity-iota/src/tangle/message_index.rs index f71321a8f4..decd057b8c 100644 --- a/identity-iota/src/tangle/message_index.rs +++ b/identity-iota/src/tangle/message_index.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::{ borrow::Borrow, iter::FromIterator, diff --git a/identity-iota/src/tangle/mod.rs b/identity-iota/src/tangle/mod.rs index 44f0843294..f1b4753299 100644 --- a/identity-iota/src/tangle/mod.rs +++ b/identity-iota/src/tangle/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + mod message; mod message_id; mod message_index; diff --git a/identity-iota/src/tangle/traits.rs b/identity-iota/src/tangle/traits.rs index f747d5f878..97453956fe 100644 --- a/identity-iota/src/tangle/traits.rs +++ b/identity-iota/src/tangle/traits.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use crate::tangle::MessageId; pub trait TangleRef { diff --git a/identity-iota/src/utils.rs b/identity-iota/src/utils.rs index bc1ef76d6d..0ad362a830 100644 --- a/identity-iota/src/utils.rs +++ b/identity-iota/src/utils.rs @@ -1,3 +1,6 @@ +// Copyright 2020-2021 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + use core::{cmp::Ordering, iter::once}; use iota::{ crypto::ternary::{