Skip to content

Commit 43c5c6f

Browse files
authored
Add license file and check script (#43)
* Add license file and check script * Adding license headers * Fix rc * Ignore generated files
1 parent e702079 commit 43c5c6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+760
-11
lines changed

.github/workflows/license-check.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: license-check
2+
on: pull_request
3+
jobs:
4+
license:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@master
8+
- name: Check License Header
9+
uses: apache/skywalking-eyes/header@501a28d2fb4a9b962661987e50cf0219631b32ff

.licenserc.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
header:
2+
license:
3+
spdx-id: MPL-2.0
4+
5+
content: |
6+
This Source Code Form is subject to the terms of the Mozilla Public
7+
License, v. 2.0. If a copy of the MPL was not distributed with this
8+
file, You can obtain one at https://mozilla.org/MPL/2.0/.
9+
paths:
10+
- '**/*.rs'
11+
paths-ignore:
12+
- '**/generated/*.rs'
13+
14+
comment: on-failure

LICENSE

+373
Large diffs are not rendered by default.

dropshot-authorization-header/src/basic.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use async_trait::async_trait;
26
use base64::{prelude::BASE64_STANDARD, Engine};
37
use dropshot::{

dropshot-authorization-header/src/bearer.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use async_trait::async_trait;
26
use dropshot::{
37
ApiEndpointBodyContentType, ExtensionMode, ExtractorMetadata, HttpError, RequestContext,
+4
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
pub mod basic;
26
pub mod bearer;

parse-rfd/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use serde::Deserialize;
26
use std::{
37
error::Error,

rfd-api/src/authn/jwt.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use std::sync::Arc;
26

37
use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine};

rfd-api/src/authn/key.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use hex::FromHexError;
26
use rand::{rngs::OsRng, RngCore};
37
use secrecy::{ExposeSecret, SecretString, SecretVec};

rfd-api/src/authn/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use async_trait::async_trait;
26
use base64::{prelude::BASE64_STANDARD, Engine};
37
use crc32c::crc32c;

rfd-api/src/config.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use std::path::PathBuf;
26

37
use config::{Config, ConfigError, Environment, File};

rfd-api/src/context.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use chrono::{DateTime, Duration, Utc};
26
use dropshot::{HttpError, RequestContext};
37
use http::StatusCode;

rfd-api/src/email_validator.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
pub trait EmailValidator {
26
fn validate(&self, email: &str) -> bool;
37
}

rfd-api/src/endpoints/api_user.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use std::collections::BTreeSet;
26

37
use chrono::{DateTime, Utc};

rfd-api/src/endpoints/api_user_provider.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use dropshot::{endpoint, HttpError, HttpResponseOk, Path, RequestContext, TypedBody};
26
use schemars::JsonSchema;
37
use serde::{Deserialize, Serialize};

rfd-api/src/endpoints/group.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use dropshot::{endpoint, HttpError, HttpResponseOk, Path, RequestContext, TypedBody};
26
use rfd_model::{AccessGroup, NewAccessGroup};
37
use schemars::JsonSchema;

rfd-api/src/endpoints/login/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use async_trait::async_trait;
26
use dropshot::HttpError;
37
use schemars::JsonSchema;

rfd-api/src/endpoints/login/oauth/client.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use chrono::{DateTime, Utc};
26
use dropshot::{endpoint, HttpError, HttpResponseOk, Path, RequestContext, TypedBody};
37
use http::StatusCode;

rfd-api/src/endpoints/login/oauth/code.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use base64::{prelude::BASE64_URL_SAFE_NO_PAD, Engine};
26
use chrono::{Duration, Utc};
37
use dropshot::{

rfd-api/src/endpoints/login/oauth/device_token.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use chrono::{DateTime, Utc};
26
use dropshot::{endpoint, HttpError, HttpResponseOk, Method, Path, RequestContext, TypedBody};
37
use http::{header, HeaderValue, Request, Response, StatusCode};

rfd-api/src/endpoints/login/oauth/github.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use std::fmt;
26

37
use http::{header::USER_AGENT, HeaderMap, HeaderValue};

rfd-api/src/endpoints/login/oauth/google.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use std::fmt;
26

37
use hyper::body::Bytes;

rfd-api/src/endpoints/login/oauth/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use async_trait::async_trait;
26
use dropshot::Method;
37
use http::header;

rfd-api/src/endpoints/mappers.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use dropshot::{endpoint, HttpError, HttpResponseOk, Path, Query, RequestContext, TypedBody};
26
use rfd_model::{Mapper, NewMapper};
37
use schemars::JsonSchema;

rfd-api/src/endpoints/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
pub mod api_user;
26
pub mod api_user_provider;
37
pub mod group;

rfd-api/src/endpoints/rfd.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use dropshot::{endpoint, HttpError, HttpResponseOk, Path, Query, RequestContext};
26
use http::StatusCode;
37
use rfd_model::storage::RfdFilter;

rfd-api/src/endpoints/webhook.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use async_trait::async_trait;
26
use chrono::{DateTime, Utc};
37
use dropshot::{

rfd-api/src/endpoints/well_known/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use dropshot::{endpoint, HttpError, HttpResponseOk, RequestContext};
26
use jsonwebtoken::jwk::{AlgorithmParameters, JwkSet, PublicKeyUse};
37
use schemars::JsonSchema;

rfd-api/src/error.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use dropshot::HttpError;
26
use rfd_model::storage::StoreError;
37
use thiserror::Error;

rfd-api/src/initial_data.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use config::{Config, ConfigError, Environment, File};
26
use diesel::result::{DatabaseErrorKind, Error as DieselError};
37
use rfd_model::{storage::StoreError, NewAccessGroup, NewMapper};

rfd-api/src/main.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use context::ApiContext;
26
use permissions::ApiPermission;
37
use rfd_model::{

rfd-api/src/mapper/default.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use std::collections::BTreeSet;
26

37
use async_trait::async_trait;

rfd-api/src/mapper/email_address.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use std::collections::BTreeSet;
26

37
use async_trait::async_trait;

rfd-api/src/mapper/email_domain.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use std::collections::BTreeSet;
26

37
use async_trait::async_trait;

rfd-api/src/mapper/github_username.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use std::collections::BTreeSet;
26

37
use async_trait::async_trait;

rfd-api/src/mapper/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use std::collections::BTreeSet;
26

37
use async_trait::async_trait;

rfd-api/src/permissions.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use rfd_model::permissions::Permissions;
26
use schemars::JsonSchema;
37
use serde::{Deserialize, Serialize};

rfd-api/src/secrets.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use schemars::{
26
schema::{InstanceType, SchemaObject},
37
JsonSchema,

rfd-api/src/server.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use dropshot::{
26
ApiDescription, ConfigDropshot, EndpointTagPolicy, HttpServerStarter, TagConfig, TagDetails,
37
};

rfd-api/src/util.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use diesel::result::{DatabaseErrorKind, Error as DieselError};
26
use google_cloudkms1::{
37
hyper_rustls::{self, HttpsConnector},

rfd-cli/src/client.rs

-7
This file was deleted.

rfd-cli/src/cmd/auth/link.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use core::panic;
26

37
use anyhow::Result;

rfd-cli/src/cmd/auth/login.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use anyhow::Result;
26
use clap::{Parser, Subcommand};
37
use oauth2::TokenResponse;

rfd-cli/src/cmd/auth/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use anyhow::Result;
26
use chrono::{DateTime, Duration, Utc};
37
use clap::{Parser, Subcommand};

rfd-cli/src/cmd/auth/oauth.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use std::time::Duration;
26

37
use anyhow::Result;

rfd-cli/src/cmd/config/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use anyhow::Result;
26
use clap::{Parser, Subcommand};
37

rfd-cli/src/cmd/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
pub mod auth;
26
pub mod config;
37
pub mod shortcut;

rfd-cli/src/cmd/shortcut/mapper.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use anyhow::Result;
26
use clap::{Parser, Subcommand};
37
use progenitor_client::Error;

rfd-cli/src/cmd/shortcut/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
15
use anyhow::Result;
26
use clap::{Parser, Subcommand};
37

0 commit comments

Comments
 (0)