Skip to content

Commit

Permalink
Add license header (iotaledger#113)
Browse files Browse the repository at this point in the history
* Add license header

* Add to wasm bindings
  • Loading branch information
l1h3r authored Jan 22, 2021
1 parent 0de3989 commit f681b02
Show file tree
Hide file tree
Showing 103 changed files with 304 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .license_template
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Copyright {20\d{2}(-20\d{2})?} IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0
1 change: 1 addition & 0 deletions bindings/wasm/.license_template
1 change: 1 addition & 0 deletions bindings/wasm/rustfmt.toml
3 changes: 3 additions & 0 deletions bindings/wasm/src/did.rs
Original file line number Diff line number Diff line change
@@ -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::*;
Expand Down
3 changes: 3 additions & 0 deletions bindings/wasm/src/doc.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down
3 changes: 3 additions & 0 deletions bindings/wasm/src/iota.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand Down
3 changes: 3 additions & 0 deletions bindings/wasm/src/key.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
3 changes: 3 additions & 0 deletions bindings/wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use wasm_bindgen::prelude::*;

pub mod did;
Expand Down
3 changes: 3 additions & 0 deletions bindings/wasm/src/pubkey.rs
Original file line number Diff line number Diff line change
@@ -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::*;
Expand Down
3 changes: 3 additions & 0 deletions bindings/wasm/src/vc.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand Down
3 changes: 3 additions & 0 deletions bindings/wasm/src/vp.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand Down
3 changes: 3 additions & 0 deletions examples/credential/src/main.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 3 additions & 0 deletions examples/diff-chain/src/main.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down
3 changes: 3 additions & 0 deletions examples/resolution/src/main.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/common/context.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

//! Definitions of common types.
mod context;
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/common/one_or_many.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/common/timestamp.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use chrono::{DateTime, SecondsFormat, Utc};
use core::{
convert::TryFrom,
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/common/url.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/convert/json.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use crate::error::{Error, Result};
use serde::{Deserialize, Serialize};

Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/convert/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

//! Traits for conversions between types.
mod json;
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/convert/serde_into.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use crate::{
convert::{AsJson, ToJson},
error::Result,
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/credential/credential.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/credential/credential_builder.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use crate::{
common::{Context, Object, Timestamp, Url, Value},
credential::{
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/credential/mod.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/credential/presentation.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/credential/presentation_builder.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/credential/types/credential_schema.rs
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/credential/types/credential_status.rs
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/credential/types/credential_subject.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/credential/types/evidence.rs
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/credential/types/issuer.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/credential/types/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

mod credential_schema;
mod credential_status;
mod credential_subject;
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/credential/types/refresh_service.rs
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/credential/types/terms_of_use.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/credential/verifiable_credential.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/credential/verifiable_presentation.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/crypto/key_impl.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

macro_rules! impl_bytes {
($ident:ident) => {
/// A cryptographic key.
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/crypto/key_pair.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use zeroize::Zeroize;

use crate::crypto::{PublicKey, SecretKey};
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/crypto/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

//! Cryptographic Utilities
mod key_impl;
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/error.rs
Original file line number Diff line number Diff line change
@@ -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`].
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

//! Identity Core
#![warn(
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/proof/jcsed25519signature2020.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/proof/mod.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/resolver/dereference.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/resolver/document_metadata.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use crate::common::{Object, Timestamp};
use serde::{Deserialize, Serialize};

Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/resolver/error_kind.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/resolver/impls.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/resolver/input_metadata.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use serde::{Deserialize, Serialize};

use crate::common::Object;
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/resolver/mod.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/resolver/resolution.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use did_doc::Document;
use serde::{Deserialize, Serialize};

Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/resolver/resolution_metadata.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/resolver/resource.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/resolver/traits.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/utils/base58.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/utils/jcs_sha256.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
3 changes: 3 additions & 0 deletions identity-core/src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

//! Misc. utility functions.

mod base58;
Expand Down
3 changes: 3 additions & 0 deletions identity-diff/derive/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

mod enums;
mod structs;

Expand Down
Loading

0 comments on commit f681b02

Please sign in to comment.