summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Müller <neikos@neikos.email>2022-07-05 16:19:07 +0200
committerGitHub <noreply@github.com>2022-07-05 16:19:07 +0200
commit863465bf564efe2de6d4673d9e6cedd3de90916f (patch)
tree45df21fcabc639acaee53e3330bab52577c39c73
parent233fee8e7c303ad351cdad9bf6cdf1db9da202cb (diff)
parentf5310908557281f85d994c94ebe7531c05b58ee9 (diff)
Merge pull request #2 from TheNeikos/feature/add_license_check
Add license check step
-rw-r--r--.github/workflows/check.yml8
-rw-r--r--.licenserc.json7
-rw-r--r--mqtt-format/src/lib.rs6
-rw-r--r--mqtt-format/src/v3/connect_return.rs6
-rw-r--r--mqtt-format/src/v3/errors.rs6
-rw-r--r--mqtt-format/src/v3/header.rs6
-rw-r--r--mqtt-format/src/v3/identifier.rs6
-rw-r--r--mqtt-format/src/v3/mod.rs6
-rw-r--r--mqtt-format/src/v3/packet.rs6
-rw-r--r--mqtt-format/src/v3/qos.rs6
-rw-r--r--mqtt-format/src/v3/strings.rs6
-rw-r--r--mqtt-format/src/v3/subscription_acks.rs6
-rw-r--r--mqtt-format/src/v3/subscription_request.rs6
-rw-r--r--mqtt-format/src/v3/unsubscription_request.rs6
-rw-r--r--mqtt-format/src/v3/will.rs6
-rw-r--r--src/bin/cloudmqtt-client.rs6
-rw-r--r--src/client_stream.rs6
-rw-r--r--src/error.rs6
-rw-r--r--src/lib.rs6
-rw-r--r--src/packet_stream.rs6
20 files changed, 123 insertions, 0 deletions
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index 75c0a4f..c1772ab 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -2,6 +2,8 @@ name: "Check CloudMQTT"
on:
pull_request:
push:
+ branches:
+ - main
jobs:
checks:
runs-on: ubuntu-latest
@@ -16,3 +18,9 @@ jobs:
# If you chose API tokens for write access OR if you have a private cache
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix --extra-experimental-features "nix-command flakes" flake check
+ license:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@master
+ - name: Check License Lines
+ uses: kt3k/license_checker@v1.0.6
diff --git a/.licenserc.json b/.licenserc.json
new file mode 100644
index 0000000..70c72b0
--- /dev/null
+++ b/.licenserc.json
@@ -0,0 +1,7 @@
+{
+ "**/*.rs": [
+ "This Source Code Form is subject to the terms of the Mozilla Public",
+ "License, v. 2.0. If a copy of the MPL was not distributed with this",
+ "file, You can obtain one at http://mozilla.org/MPL/2.0/."
+ ]
+}
diff --git a/mqtt-format/src/lib.rs b/mqtt-format/src/lib.rs
index 3c0bc30..1bc674c 100644
--- a/mqtt-format/src/lib.rs
+++ b/mqtt-format/src/lib.rs
@@ -1 +1,7 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
pub mod v3;
diff --git a/mqtt-format/src/v3/connect_return.rs b/mqtt-format/src/v3/connect_return.rs
index f392b0f..732e2e3 100644
--- a/mqtt-format/src/v3/connect_return.rs
+++ b/mqtt-format/src/v3/connect_return.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use nom::error::FromExternalError;
use super::{errors::MPacketHeaderError, MSResult};
diff --git a/mqtt-format/src/v3/errors.rs b/mqtt-format/src/v3/errors.rs
index 99ab323..cb961f7 100644
--- a/mqtt-format/src/v3/errors.rs
+++ b/mqtt-format/src/v3/errors.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
#[derive(Debug, thiserror::Error)]
pub enum MPacketHeaderError {
#[error("An invalid Quality of Service (Qos) was supplied: {}", .0)]
diff --git a/mqtt-format/src/v3/header.rs b/mqtt-format/src/v3/header.rs
index 2d7de56..3a02c18 100644
--- a/mqtt-format/src/v3/header.rs
+++ b/mqtt-format/src/v3/header.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use nom::{
bits,
bytes::complete::take_while_m_n,
diff --git a/mqtt-format/src/v3/identifier.rs b/mqtt-format/src/v3/identifier.rs
index 91e4164..bd006bd 100644
--- a/mqtt-format/src/v3/identifier.rs
+++ b/mqtt-format/src/v3/identifier.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use futures::{AsyncWrite, AsyncWriteExt};
use nom::{number::complete::be_u16, Parser};
diff --git a/mqtt-format/src/v3/mod.rs b/mqtt-format/src/v3/mod.rs
index 5814719..724ac62 100644
--- a/mqtt-format/src/v3/mod.rs
+++ b/mqtt-format/src/v3/mod.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use nom::IResult;
pub mod connect_return;
diff --git a/mqtt-format/src/v3/packet.rs b/mqtt-format/src/v3/packet.rs
index f736314..4bb7099 100644
--- a/mqtt-format/src/v3/packet.rs
+++ b/mqtt-format/src/v3/packet.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use std::pin::Pin;
use futures::AsyncWriteExt;
diff --git a/mqtt-format/src/v3/qos.rs b/mqtt-format/src/v3/qos.rs
index f1855c6..302dfe1 100644
--- a/mqtt-format/src/v3/qos.rs
+++ b/mqtt-format/src/v3/qos.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use futures::{AsyncWrite, AsyncWriteExt};
use super::errors::{MPacketHeaderError, MPacketWriteError};
diff --git a/mqtt-format/src/v3/strings.rs b/mqtt-format/src/v3/strings.rs
index 0fd239e..efab4a5 100644
--- a/mqtt-format/src/v3/strings.rs
+++ b/mqtt-format/src/v3/strings.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use futures::{AsyncWrite, AsyncWriteExt};
use nom::{bytes::complete::take, number::complete::be_u16, IResult, Parser};
use nom_supreme::ParserExt;
diff --git a/mqtt-format/src/v3/subscription_acks.rs b/mqtt-format/src/v3/subscription_acks.rs
index 994d2c6..010a46c 100644
--- a/mqtt-format/src/v3/subscription_acks.rs
+++ b/mqtt-format/src/v3/subscription_acks.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use nom::{error::FromExternalError, multi::many1_count};
use super::{errors::MPacketHeaderError, MSResult};
diff --git a/mqtt-format/src/v3/subscription_request.rs b/mqtt-format/src/v3/subscription_request.rs
index 00d85a8..9770a8b 100644
--- a/mqtt-format/src/v3/subscription_request.rs
+++ b/mqtt-format/src/v3/subscription_request.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use futures::{AsyncWrite, AsyncWriteExt};
use nom::{multi::many1_count, Parser};
use nom_supreme::ParserExt;
diff --git a/mqtt-format/src/v3/unsubscription_request.rs b/mqtt-format/src/v3/unsubscription_request.rs
index 0412bba..87004bf 100644
--- a/mqtt-format/src/v3/unsubscription_request.rs
+++ b/mqtt-format/src/v3/unsubscription_request.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use nom::{multi::many1_count, Parser};
use super::{
diff --git a/mqtt-format/src/v3/will.rs b/mqtt-format/src/v3/will.rs
index 1154c7e..65420d3 100644
--- a/mqtt-format/src/v3/will.rs
+++ b/mqtt-format/src/v3/will.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use super::{qos::MQualityOfService, strings::MString};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
diff --git a/src/bin/cloudmqtt-client.rs b/src/bin/cloudmqtt-client.rs
index f8d9a33..05e4db5 100644
--- a/src/bin/cloudmqtt-client.rs
+++ b/src/bin/cloudmqtt-client.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use clap::Parser;
use cloudmqtt::{packet_stream::Acknowledge, MqttClient, MqttConnectionParams};
use futures::StreamExt;
diff --git a/src/client_stream.rs b/src/client_stream.rs
index 292cbf5..7855d3d 100644
--- a/src/client_stream.rs
+++ b/src/client_stream.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use tokio::io::{AsyncRead, AsyncWrite};
pub enum MqttClientStream {
diff --git a/src/error.rs b/src/error.rs
index 5ccb462..c19e4c5 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use mqtt_format::v3::connect_return::MConnectReturnCode;
#[derive(Debug, thiserror::Error)]
diff --git a/src/lib.rs b/src/lib.rs
index 54662d0..4d6814c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use std::{pin::Pin, sync::Arc, time::Duration};
use bytes::{BufMut, Bytes, BytesMut};
diff --git a/src/packet_stream.rs b/src/packet_stream.rs
index 882f2f3..810cace 100644
--- a/src/packet_stream.rs
+++ b/src/packet_stream.rs
@@ -1,3 +1,9 @@
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
use std::future::Ready;
use crate::{error::MqttError, MqttClient, MqttPacket};