diff --git a/.github/workflows/license-check.yml b/.github/workflows/license-check.yml new file mode 100644 index 00000000..6b43a39b --- /dev/null +++ b/.github/workflows/license-check.yml @@ -0,0 +1,9 @@ +name: license-check +on: pull_request +jobs: + license: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Check License Header + uses: apache/skywalking-eyes/header@501a28d2fb4a9b962661987e50cf0219631b32ff \ No newline at end of file diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 00000000..eb74f733 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,14 @@ +header: + license: + spdx-id: MPL-2.0 + + content: | + 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 https://mozilla.org/MPL/2.0/. + paths: + - '**/*.rs' + paths-ignore: + - '**/generated/*.rs' + + comment: on-failure \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..f4bbcd20 --- /dev/null +++ b/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + 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/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dropshot-authorization-header/src/basic.rs b/dropshot-authorization-header/src/basic.rs index 3813b5b1..4c6bfab0 100644 --- a/dropshot-authorization-header/src/basic.rs +++ b/dropshot-authorization-header/src/basic.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use base64::{prelude::BASE64_STANDARD, Engine}; use dropshot::{ diff --git a/dropshot-authorization-header/src/bearer.rs b/dropshot-authorization-header/src/bearer.rs index 0e345dc8..ce900f4e 100644 --- a/dropshot-authorization-header/src/bearer.rs +++ b/dropshot-authorization-header/src/bearer.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use dropshot::{ ApiEndpointBodyContentType, ExtensionMode, ExtractorMetadata, HttpError, RequestContext, diff --git a/dropshot-authorization-header/src/lib.rs b/dropshot-authorization-header/src/lib.rs index 1666c70b..be5cbed7 100644 --- a/dropshot-authorization-header/src/lib.rs +++ b/dropshot-authorization-header/src/lib.rs @@ -1,2 +1,6 @@ +// 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 https://mozilla.org/MPL/2.0/. + pub mod basic; pub mod bearer; diff --git a/parse-rfd/src/lib.rs b/parse-rfd/src/lib.rs index 7195e562..c8c05ec9 100644 --- a/parse-rfd/src/lib.rs +++ b/parse-rfd/src/lib.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use serde::Deserialize; use std::{ error::Error, diff --git a/rfd-api/src/authn/jwt.rs b/rfd-api/src/authn/jwt.rs index 0e8e6976..17f66635 100644 --- a/rfd-api/src/authn/jwt.rs +++ b/rfd-api/src/authn/jwt.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::sync::Arc; use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; diff --git a/rfd-api/src/authn/key.rs b/rfd-api/src/authn/key.rs index a5aba001..61fe6c2d 100644 --- a/rfd-api/src/authn/key.rs +++ b/rfd-api/src/authn/key.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use hex::FromHexError; use rand::{rngs::OsRng, RngCore}; use secrecy::{ExposeSecret, SecretString, SecretVec}; diff --git a/rfd-api/src/authn/mod.rs b/rfd-api/src/authn/mod.rs index 143924b3..e53fe49d 100644 --- a/rfd-api/src/authn/mod.rs +++ b/rfd-api/src/authn/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use base64::{prelude::BASE64_STANDARD, Engine}; use crc32c::crc32c; diff --git a/rfd-api/src/config.rs b/rfd-api/src/config.rs index 8f7940df..2484e265 100644 --- a/rfd-api/src/config.rs +++ b/rfd-api/src/config.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::path::PathBuf; use config::{Config, ConfigError, Environment, File}; diff --git a/rfd-api/src/context.rs b/rfd-api/src/context.rs index 6ba92d0b..9d407803 100644 --- a/rfd-api/src/context.rs +++ b/rfd-api/src/context.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use chrono::{DateTime, Duration, Utc}; use dropshot::{HttpError, RequestContext}; use http::StatusCode; diff --git a/rfd-api/src/email_validator.rs b/rfd-api/src/email_validator.rs index a5b67ced..e4f6b5de 100644 --- a/rfd-api/src/email_validator.rs +++ b/rfd-api/src/email_validator.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + pub trait EmailValidator { fn validate(&self, email: &str) -> bool; } diff --git a/rfd-api/src/endpoints/api_user.rs b/rfd-api/src/endpoints/api_user.rs index 452a1823..52f58adb 100644 --- a/rfd-api/src/endpoints/api_user.rs +++ b/rfd-api/src/endpoints/api_user.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::collections::BTreeSet; use chrono::{DateTime, Utc}; diff --git a/rfd-api/src/endpoints/api_user_provider.rs b/rfd-api/src/endpoints/api_user_provider.rs index 664711e7..dcbefa2c 100644 --- a/rfd-api/src/endpoints/api_user_provider.rs +++ b/rfd-api/src/endpoints/api_user_provider.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use dropshot::{endpoint, HttpError, HttpResponseOk, Path, RequestContext, TypedBody}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/rfd-api/src/endpoints/group.rs b/rfd-api/src/endpoints/group.rs index 0eb7e7fc..4f77353d 100644 --- a/rfd-api/src/endpoints/group.rs +++ b/rfd-api/src/endpoints/group.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use dropshot::{endpoint, HttpError, HttpResponseOk, Path, RequestContext, TypedBody}; use rfd_model::{AccessGroup, NewAccessGroup}; use schemars::JsonSchema; diff --git a/rfd-api/src/endpoints/login/mod.rs b/rfd-api/src/endpoints/login/mod.rs index 049de1d8..bc16522e 100644 --- a/rfd-api/src/endpoints/login/mod.rs +++ b/rfd-api/src/endpoints/login/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use dropshot::HttpError; use schemars::JsonSchema; diff --git a/rfd-api/src/endpoints/login/oauth/client.rs b/rfd-api/src/endpoints/login/oauth/client.rs index c53b586e..164e5abb 100644 --- a/rfd-api/src/endpoints/login/oauth/client.rs +++ b/rfd-api/src/endpoints/login/oauth/client.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use chrono::{DateTime, Utc}; use dropshot::{endpoint, HttpError, HttpResponseOk, Path, RequestContext, TypedBody}; use http::StatusCode; diff --git a/rfd-api/src/endpoints/login/oauth/code.rs b/rfd-api/src/endpoints/login/oauth/code.rs index cddfc9cc..8f1b104e 100644 --- a/rfd-api/src/endpoints/login/oauth/code.rs +++ b/rfd-api/src/endpoints/login/oauth/code.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use base64::{prelude::BASE64_URL_SAFE_NO_PAD, Engine}; use chrono::{Duration, Utc}; use dropshot::{ diff --git a/rfd-api/src/endpoints/login/oauth/device_token.rs b/rfd-api/src/endpoints/login/oauth/device_token.rs index 18265ac1..0f3111e6 100644 --- a/rfd-api/src/endpoints/login/oauth/device_token.rs +++ b/rfd-api/src/endpoints/login/oauth/device_token.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use chrono::{DateTime, Utc}; use dropshot::{endpoint, HttpError, HttpResponseOk, Method, Path, RequestContext, TypedBody}; use http::{header, HeaderValue, Request, Response, StatusCode}; diff --git a/rfd-api/src/endpoints/login/oauth/github.rs b/rfd-api/src/endpoints/login/oauth/github.rs index adc59cc5..9210ccaa 100644 --- a/rfd-api/src/endpoints/login/oauth/github.rs +++ b/rfd-api/src/endpoints/login/oauth/github.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::fmt; use http::{header::USER_AGENT, HeaderMap, HeaderValue}; diff --git a/rfd-api/src/endpoints/login/oauth/google.rs b/rfd-api/src/endpoints/login/oauth/google.rs index 23f7bc34..fb15d0d5 100644 --- a/rfd-api/src/endpoints/login/oauth/google.rs +++ b/rfd-api/src/endpoints/login/oauth/google.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::fmt; use hyper::body::Bytes; diff --git a/rfd-api/src/endpoints/login/oauth/mod.rs b/rfd-api/src/endpoints/login/oauth/mod.rs index ae97c6ea..62f574b4 100644 --- a/rfd-api/src/endpoints/login/oauth/mod.rs +++ b/rfd-api/src/endpoints/login/oauth/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use dropshot::Method; use http::header; diff --git a/rfd-api/src/endpoints/mappers.rs b/rfd-api/src/endpoints/mappers.rs index 365721d3..b04112cf 100644 --- a/rfd-api/src/endpoints/mappers.rs +++ b/rfd-api/src/endpoints/mappers.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use dropshot::{endpoint, HttpError, HttpResponseOk, Path, Query, RequestContext, TypedBody}; use rfd_model::{Mapper, NewMapper}; use schemars::JsonSchema; diff --git a/rfd-api/src/endpoints/mod.rs b/rfd-api/src/endpoints/mod.rs index c984464b..8d80a93d 100644 --- a/rfd-api/src/endpoints/mod.rs +++ b/rfd-api/src/endpoints/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + pub mod api_user; pub mod api_user_provider; pub mod group; diff --git a/rfd-api/src/endpoints/rfd.rs b/rfd-api/src/endpoints/rfd.rs index 992aab0a..7a6a697a 100644 --- a/rfd-api/src/endpoints/rfd.rs +++ b/rfd-api/src/endpoints/rfd.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use dropshot::{endpoint, HttpError, HttpResponseOk, Path, Query, RequestContext}; use http::StatusCode; use rfd_model::storage::RfdFilter; diff --git a/rfd-api/src/endpoints/webhook.rs b/rfd-api/src/endpoints/webhook.rs index e2feed8f..77c1d8b4 100644 --- a/rfd-api/src/endpoints/webhook.rs +++ b/rfd-api/src/endpoints/webhook.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use chrono::{DateTime, Utc}; use dropshot::{ diff --git a/rfd-api/src/endpoints/well_known/mod.rs b/rfd-api/src/endpoints/well_known/mod.rs index de734b22..56cd8293 100644 --- a/rfd-api/src/endpoints/well_known/mod.rs +++ b/rfd-api/src/endpoints/well_known/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use dropshot::{endpoint, HttpError, HttpResponseOk, RequestContext}; use jsonwebtoken::jwk::{AlgorithmParameters, JwkSet, PublicKeyUse}; use schemars::JsonSchema; diff --git a/rfd-api/src/error.rs b/rfd-api/src/error.rs index 68d252de..2a1bfc9c 100644 --- a/rfd-api/src/error.rs +++ b/rfd-api/src/error.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use dropshot::HttpError; use rfd_model::storage::StoreError; use thiserror::Error; diff --git a/rfd-api/src/initial_data.rs b/rfd-api/src/initial_data.rs index be099d10..c340901a 100644 --- a/rfd-api/src/initial_data.rs +++ b/rfd-api/src/initial_data.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use config::{Config, ConfigError, Environment, File}; use diesel::result::{DatabaseErrorKind, Error as DieselError}; use rfd_model::{storage::StoreError, NewAccessGroup, NewMapper}; diff --git a/rfd-api/src/main.rs b/rfd-api/src/main.rs index 3c30e498..134ae57d 100644 --- a/rfd-api/src/main.rs +++ b/rfd-api/src/main.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use context::ApiContext; use permissions::ApiPermission; use rfd_model::{ diff --git a/rfd-api/src/mapper/default.rs b/rfd-api/src/mapper/default.rs index babd5da7..49e38da3 100644 --- a/rfd-api/src/mapper/default.rs +++ b/rfd-api/src/mapper/default.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::collections::BTreeSet; use async_trait::async_trait; diff --git a/rfd-api/src/mapper/email_address.rs b/rfd-api/src/mapper/email_address.rs index 9d4ac84f..d05e2004 100644 --- a/rfd-api/src/mapper/email_address.rs +++ b/rfd-api/src/mapper/email_address.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::collections::BTreeSet; use async_trait::async_trait; diff --git a/rfd-api/src/mapper/email_domain.rs b/rfd-api/src/mapper/email_domain.rs index 90045f1f..350cb757 100644 --- a/rfd-api/src/mapper/email_domain.rs +++ b/rfd-api/src/mapper/email_domain.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::collections::BTreeSet; use async_trait::async_trait; diff --git a/rfd-api/src/mapper/github_username.rs b/rfd-api/src/mapper/github_username.rs index 84d6ea36..b482beec 100644 --- a/rfd-api/src/mapper/github_username.rs +++ b/rfd-api/src/mapper/github_username.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::collections::BTreeSet; use async_trait::async_trait; diff --git a/rfd-api/src/mapper/mod.rs b/rfd-api/src/mapper/mod.rs index 67f3769b..bcab4d29 100644 --- a/rfd-api/src/mapper/mod.rs +++ b/rfd-api/src/mapper/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::collections::BTreeSet; use async_trait::async_trait; diff --git a/rfd-api/src/permissions.rs b/rfd-api/src/permissions.rs index 00c8bc9b..eaf294c5 100644 --- a/rfd-api/src/permissions.rs +++ b/rfd-api/src/permissions.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use rfd_model::permissions::Permissions; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/rfd-api/src/secrets.rs b/rfd-api/src/secrets.rs index da64e43c..a4f95604 100644 --- a/rfd-api/src/secrets.rs +++ b/rfd-api/src/secrets.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use schemars::{ schema::{InstanceType, SchemaObject}, JsonSchema, diff --git a/rfd-api/src/server.rs b/rfd-api/src/server.rs index 113af488..b6dcc53e 100644 --- a/rfd-api/src/server.rs +++ b/rfd-api/src/server.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use dropshot::{ ApiDescription, ConfigDropshot, EndpointTagPolicy, HttpServerStarter, TagConfig, TagDetails, }; diff --git a/rfd-api/src/util.rs b/rfd-api/src/util.rs index cc305591..e014cced 100644 --- a/rfd-api/src/util.rs +++ b/rfd-api/src/util.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use diesel::result::{DatabaseErrorKind, Error as DieselError}; use google_cloudkms1::{ hyper_rustls::{self, HttpsConnector}, diff --git a/rfd-cli/src/client.rs b/rfd-cli/src/client.rs deleted file mode 100644 index 04098a6a..00000000 --- a/rfd-cli/src/client.rs +++ /dev/null @@ -1,7 +0,0 @@ -use progenitor::generate_api; - -generate_api!( - spec = "../rfd-api-spec.json", - interface = Builder, - inner_type = (), -); diff --git a/rfd-cli/src/cmd/auth/link.rs b/rfd-cli/src/cmd/auth/link.rs index 2229bab3..c11ee9b3 100644 --- a/rfd-cli/src/cmd/auth/link.rs +++ b/rfd-cli/src/cmd/auth/link.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use core::panic; use anyhow::Result; diff --git a/rfd-cli/src/cmd/auth/login.rs b/rfd-cli/src/cmd/auth/login.rs index cb1eec9b..52a12133 100644 --- a/rfd-cli/src/cmd/auth/login.rs +++ b/rfd-cli/src/cmd/auth/login.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use anyhow::Result; use clap::{Parser, Subcommand}; use oauth2::TokenResponse; diff --git a/rfd-cli/src/cmd/auth/mod.rs b/rfd-cli/src/cmd/auth/mod.rs index 8725b211..b2927c81 100644 --- a/rfd-cli/src/cmd/auth/mod.rs +++ b/rfd-cli/src/cmd/auth/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use anyhow::Result; use chrono::{DateTime, Duration, Utc}; use clap::{Parser, Subcommand}; diff --git a/rfd-cli/src/cmd/auth/oauth.rs b/rfd-cli/src/cmd/auth/oauth.rs index de3a0513..47b9b8dd 100644 --- a/rfd-cli/src/cmd/auth/oauth.rs +++ b/rfd-cli/src/cmd/auth/oauth.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::time::Duration; use anyhow::Result; diff --git a/rfd-cli/src/cmd/config/mod.rs b/rfd-cli/src/cmd/config/mod.rs index 17690e17..56b44d34 100644 --- a/rfd-cli/src/cmd/config/mod.rs +++ b/rfd-cli/src/cmd/config/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use anyhow::Result; use clap::{Parser, Subcommand}; diff --git a/rfd-cli/src/cmd/mod.rs b/rfd-cli/src/cmd/mod.rs index 8428aa7d..99147163 100644 --- a/rfd-cli/src/cmd/mod.rs +++ b/rfd-cli/src/cmd/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + pub mod auth; pub mod config; pub mod shortcut; diff --git a/rfd-cli/src/cmd/shortcut/mapper.rs b/rfd-cli/src/cmd/shortcut/mapper.rs index 09f51c21..850f8586 100644 --- a/rfd-cli/src/cmd/shortcut/mapper.rs +++ b/rfd-cli/src/cmd/shortcut/mapper.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use anyhow::Result; use clap::{Parser, Subcommand}; use progenitor_client::Error; diff --git a/rfd-cli/src/cmd/shortcut/mod.rs b/rfd-cli/src/cmd/shortcut/mod.rs index ea81473a..d8b3b90d 100644 --- a/rfd-cli/src/cmd/shortcut/mod.rs +++ b/rfd-cli/src/cmd/shortcut/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use anyhow::Result; use clap::{Parser, Subcommand}; diff --git a/rfd-cli/src/err.rs b/rfd-cli/src/err.rs index b5284b84..41de283a 100644 --- a/rfd-cli/src/err.rs +++ b/rfd-cli/src/err.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use anyhow::{anyhow, Error}; use rfd_sdk::{types::Error as ApiError, ProgenitorClientError}; diff --git a/rfd-cli/src/main.rs b/rfd-cli/src/main.rs index b1c8686a..4226b340 100644 --- a/rfd-cli/src/main.rs +++ b/rfd-cli/src/main.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + #![allow(unused)] use anyhow::{anyhow, Result}; diff --git a/rfd-cli/src/printer/json.rs b/rfd-cli/src/printer/json.rs index a1a9b90d..44ecf27a 100644 --- a/rfd-cli/src/printer/json.rs +++ b/rfd-cli/src/printer/json.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use rfd_sdk::types; use serde::Serialize; diff --git a/rfd-cli/src/printer/mod.rs b/rfd-cli/src/printer/mod.rs index 8ca279bc..733bc8ac 100644 --- a/rfd-cli/src/printer/mod.rs +++ b/rfd-cli/src/printer/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + mod json; mod tab; diff --git a/rfd-cli/src/printer/tab.rs b/rfd-cli/src/printer/tab.rs index 5d179b42..7c537c45 100644 --- a/rfd-cli/src/printer/tab.rs +++ b/rfd-cli/src/printer/tab.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use itertools::{EitherOrBoth, Itertools}; use owo_colors::{OwoColorize, Style}; use rfd_sdk::types::{ diff --git a/rfd-cli/src/store/mod.rs b/rfd-cli/src/store/mod.rs index 32b39244..8e9da1f9 100644 --- a/rfd-cli/src/store/mod.rs +++ b/rfd-cli/src/store/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::{ fs::{create_dir_all, File as StdFile, OpenOptions}, io::Write, diff --git a/rfd-data/src/lib.rs b/rfd-data/src/lib.rs index 854d76ea..f4177071 100644 --- a/rfd-data/src/lib.rs +++ b/rfd-data/src/lib.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::fmt::Display; #[derive(Debug, Copy, Clone)] diff --git a/rfd-model/src/db.rs b/rfd-model/src/db.rs index ab493084..e9094b95 100644 --- a/rfd-model/src/db.rs +++ b/rfd-model/src/db.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use chrono::{DateTime, Utc}; use diesel::{Insertable, Queryable}; use serde::{Deserialize, Serialize}; diff --git a/rfd-model/src/lib.rs b/rfd-model/src/lib.rs index 74d7e8a9..db4f9eb5 100644 --- a/rfd-model/src/lib.rs +++ b/rfd-model/src/lib.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::{ collections::{BTreeMap, BTreeSet}, fmt::Display, @@ -22,7 +26,6 @@ pub mod permissions; pub mod schema; pub mod schema_ext; pub mod storage; -mod utils; #[partial(NewRfd)] #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] diff --git a/rfd-model/src/permissions.rs b/rfd-model/src/permissions.rs index b48764a1..4f29b68d 100644 --- a/rfd-model/src/permissions.rs +++ b/rfd-model/src/permissions.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::{collections::BTreeSet, fmt::Debug, hash::Hash}; use diesel::{sql_types::Jsonb, AsExpression, FromSqlRow}; diff --git a/rfd-model/src/schema.rs b/rfd-model/src/schema.rs index 0c6c46c5..571bbf39 100644 --- a/rfd-model/src/schema.rs +++ b/rfd-model/src/schema.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + // @generated automatically by Diesel CLI. pub mod sql_types { diff --git a/rfd-model/src/schema_ext.rs b/rfd-model/src/schema_ext.rs index 0cc2c61b..1c279b0f 100644 --- a/rfd-model/src/schema_ext.rs +++ b/rfd-model/src/schema_ext.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use diesel::{ backend::Backend, deserialize::{self, FromSql}, diff --git a/rfd-model/src/storage/mod.rs b/rfd-model/src/storage/mod.rs index 43b24df0..c2dad8a5 100644 --- a/rfd-model/src/storage/mod.rs +++ b/rfd-model/src/storage/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::fmt::Debug; pub use async_bb8_diesel::{ConnectionError, PoolError}; diff --git a/rfd-model/src/storage/postgres.rs b/rfd-model/src/storage/postgres.rs index edfa1901..4bc23c13 100644 --- a/rfd-model/src/storage/postgres.rs +++ b/rfd-model/src/storage/postgres.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_bb8_diesel::{AsyncRunQueryDsl, ConnectionError, ConnectionManager}; use async_trait::async_trait; use bb8::Pool; diff --git a/rfd-model/src/utils.rs b/rfd-model/src/utils.rs deleted file mode 100644 index 8b137891..00000000 --- a/rfd-model/src/utils.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/rfd-model/tests/postgres.rs b/rfd-model/tests/postgres.rs index 473d4441..fe7886d3 100644 --- a/rfd-model/tests/postgres.rs +++ b/rfd-model/tests/postgres.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::collections::BTreeSet; use chrono::{Duration, Utc}; diff --git a/rfd-processor/src/content/asciidoc.rs b/rfd-processor/src/content/asciidoc.rs index 9c9152f1..82887687 100644 --- a/rfd-processor/src/content/asciidoc.rs +++ b/rfd-processor/src/content/asciidoc.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use octorust::Client; use regex::Regex; diff --git a/rfd-processor/src/content/markdown.rs b/rfd-processor/src/content/markdown.rs index 0a87aab2..74d1113e 100644 --- a/rfd-processor/src/content/markdown.rs +++ b/rfd-processor/src/content/markdown.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::borrow::Cow; use regex::Regex; diff --git a/rfd-processor/src/content/mod.rs b/rfd-processor/src/content/mod.rs index 38b6a4fa..926630fd 100644 --- a/rfd-processor/src/content/mod.rs +++ b/rfd-processor/src/content/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::{borrow::Cow, io, path::PathBuf, str::Utf8Error, string::FromUtf8Error}; use async_trait::async_trait; diff --git a/rfd-processor/src/context.rs b/rfd-processor/src/context.rs index 04b60048..aec43632 100644 --- a/rfd-processor/src/context.rs +++ b/rfd-processor/src/context.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::{io::Cursor, time::Duration}; use async_trait::async_trait; diff --git a/rfd-processor/src/github/ext.rs b/rfd-processor/src/github/ext.rs index cd15468d..82cadcc2 100644 --- a/rfd-processor/src/github/ext.rs +++ b/rfd-processor/src/github/ext.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use base64::{prelude::BASE64_STANDARD, DecodeError, Engine}; use octorust::{repos::Repos, types::ContentFile, ClientError}; diff --git a/rfd-processor/src/github/mod.rs b/rfd-processor/src/github/mod.rs index b2c6bd93..65a44e17 100644 --- a/rfd-processor/src/github/mod.rs +++ b/rfd-processor/src/github/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::{ borrow::Cow, collections::HashMap, diff --git a/rfd-processor/src/main.rs b/rfd-processor/src/main.rs index e80d99fc..ae8e41e2 100644 --- a/rfd-processor/src/main.rs +++ b/rfd-processor/src/main.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use config::{Config, ConfigError, Environment, File}; use processor::{processor, JobError}; use serde::{Deserialize, Serialize}; diff --git a/rfd-processor/src/pdf.rs b/rfd-processor/src/pdf.rs index 8db33304..9fa3b456 100644 --- a/rfd-processor/src/pdf.rs +++ b/rfd-processor/src/pdf.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use google_drive3::Error as ClientError; use rfd_data::RfdNumber; diff --git a/rfd-processor/src/processor.rs b/rfd-processor/src/processor.rs index e3476a3f..934203c3 100644 --- a/rfd-processor/src/processor.rs +++ b/rfd-processor/src/processor.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use futures::TryFutureExt; use rfd_model::storage::{JobFilter, JobStore, ListPagination, StoreError}; use std::sync::Arc; diff --git a/rfd-processor/src/rfd.rs b/rfd-processor/src/rfd.rs index 53563529..c12d58d9 100644 --- a/rfd-processor/src/rfd.rs +++ b/rfd-processor/src/rfd.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::sync::Mutex; use chrono::{DateTime, Utc}; diff --git a/rfd-processor/src/scanner.rs b/rfd-processor/src/scanner.rs index 39054c00..ae0717d2 100644 --- a/rfd-processor/src/scanner.rs +++ b/rfd-processor/src/scanner.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use diesel::result::{DatabaseErrorKind, Error as DieselError}; use rfd_model::{ storage::{JobStore, StoreError}, diff --git a/rfd-processor/src/search/mod.rs b/rfd-processor/src/search/mod.rs index b92b6dfd..8057dcc3 100644 --- a/rfd-processor/src/search/mod.rs +++ b/rfd-processor/src/search/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use hmac::{Hmac, Mac}; use md5::Md5; use meilisearch_sdk::{ diff --git a/rfd-processor/src/updater/copy_images_to_storage.rs b/rfd-processor/src/updater/copy_images_to_storage.rs index 56cb91d5..58070045 100644 --- a/rfd-processor/src/updater/copy_images_to_storage.rs +++ b/rfd-processor/src/updater/copy_images_to_storage.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use google_storage1::api::Object; use tracing::instrument; diff --git a/rfd-processor/src/updater/create_pull_request.rs b/rfd-processor/src/updater/create_pull_request.rs index 8ea7e738..187a34ee 100644 --- a/rfd-processor/src/updater/create_pull_request.rs +++ b/rfd-processor/src/updater/create_pull_request.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use tracing::instrument; diff --git a/rfd-processor/src/updater/ensure_default_state.rs b/rfd-processor/src/updater/ensure_default_state.rs index 58421a82..85a0f1f4 100644 --- a/rfd-processor/src/updater/ensure_default_state.rs +++ b/rfd-processor/src/updater/ensure_default_state.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use tracing::instrument; diff --git a/rfd-processor/src/updater/ensure_pr_state.rs b/rfd-processor/src/updater/ensure_pr_state.rs index f623a68c..151ebba9 100644 --- a/rfd-processor/src/updater/ensure_pr_state.rs +++ b/rfd-processor/src/updater/ensure_pr_state.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use std::cmp::Ordering; use tracing::instrument; diff --git a/rfd-processor/src/updater/mod.rs b/rfd-processor/src/updater/mod.rs index 0b1af4ea..ee059ce6 100644 --- a/rfd-processor/src/updater/mod.rs +++ b/rfd-processor/src/updater/mod.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::fmt::Debug; use async_trait::async_trait; diff --git a/rfd-processor/src/updater/update_discussion_url.rs b/rfd-processor/src/updater/update_discussion_url.rs index 627a3848..bc3358e5 100644 --- a/rfd-processor/src/updater/update_discussion_url.rs +++ b/rfd-processor/src/updater/update_discussion_url.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use std::cmp::Ordering; use tracing::instrument; diff --git a/rfd-processor/src/updater/update_pdfs.rs b/rfd-processor/src/updater/update_pdfs.rs index e4260142..d8abdcef 100644 --- a/rfd-processor/src/updater/update_pdfs.rs +++ b/rfd-processor/src/updater/update_pdfs.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use rfd_model::{ schema_ext::PdfSource, diff --git a/rfd-processor/src/updater/update_pull_request.rs b/rfd-processor/src/updater/update_pull_request.rs index 0ddc5c2b..ed9dca4f 100644 --- a/rfd-processor/src/updater/update_pull_request.rs +++ b/rfd-processor/src/updater/update_pull_request.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use std::cmp::Ordering; use tap::TapFallible; diff --git a/rfd-processor/src/updater/update_search_index.rs b/rfd-processor/src/updater/update_search_index.rs index ef66f6e1..e8e1ac4a 100644 --- a/rfd-processor/src/updater/update_search_index.rs +++ b/rfd-processor/src/updater/update_search_index.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use async_trait::async_trait; use tracing::instrument; diff --git a/rfd-processor/src/util.rs b/rfd-processor/src/util.rs index 02b65027..96068a4b 100644 --- a/rfd-processor/src/util.rs +++ b/rfd-processor/src/util.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use base64::{prelude::BASE64_STANDARD, DecodeError, Engine}; use google_drive3::{hyper, hyper_rustls, DriveHub}; use std::path::Path; diff --git a/rfd-redirect/src/config.rs b/rfd-redirect/src/config.rs index b13daa05..06abee7d 100644 --- a/rfd-redirect/src/config.rs +++ b/rfd-redirect/src/config.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use config::{Config, ConfigError, Environment, File}; use serde::{ de::{self, Visitor}, diff --git a/rfd-redirect/src/context.rs b/rfd-redirect/src/context.rs index 2f8d8f82..4209aa98 100644 --- a/rfd-redirect/src/context.rs +++ b/rfd-redirect/src/context.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use regex::Regex; pub struct Context { diff --git a/rfd-redirect/src/endpoints.rs b/rfd-redirect/src/endpoints.rs index 028e7adf..bbe2390b 100644 --- a/rfd-redirect/src/endpoints.rs +++ b/rfd-redirect/src/endpoints.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use dropshot::{ endpoint, http_response_temporary_redirect, HttpError, HttpResponseTemporaryRedirect, Path, RequestContext, diff --git a/rfd-redirect/src/main.rs b/rfd-redirect/src/main.rs index 5f4cb94a..b28be4c7 100644 --- a/rfd-redirect/src/main.rs +++ b/rfd-redirect/src/main.rs @@ -1,5 +1,7 @@ -/// Handle redirecting urls of the form https://{rfd_number}.rfd.oxide.computer to GitHub to -/// maintain backwards compatibility +// 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 https://mozilla.org/MPL/2.0/. + use std::{ error::Error, net::{SocketAddr, SocketAddrV4}, diff --git a/rfd-redirect/src/server.rs b/rfd-redirect/src/server.rs index 61ddc0aa..809d8a1e 100644 --- a/rfd-redirect/src/server.rs +++ b/rfd-redirect/src/server.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use dropshot::{ApiDescription, ConfigDropshot, EndpointTagPolicy, HttpServerStarter, TagConfig}; use slog::Drain; use std::{error::Error, net::SocketAddr}; diff --git a/rfd-sdk/src/lib.rs b/rfd-sdk/src/lib.rs index 9c54fb28..006dc9ae 100644 --- a/rfd-sdk/src/lib.rs +++ b/rfd-sdk/src/lib.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + mod generated; use std::fmt::Display; diff --git a/trace-request/src/lib.rs b/trace-request/src/lib.rs index 2d538806..36130214 100644 --- a/trace-request/src/lib.rs +++ b/trace-request/src/lib.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + #![allow(dead_code, unused_imports)] extern crate proc_macro; diff --git a/trace-request/tests/test.rs b/trace-request/tests/test.rs index 46342656..d5a3d746 100644 --- a/trace-request/tests/test.rs +++ b/trace-request/tests/test.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use dropshot::{endpoint, HttpError, HttpResponseOk, RequestContext}; use trace_request::trace_request; diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 6d012d72..c138d22c 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -1,3 +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 https://mozilla.org/MPL/2.0/. + use std::{ fs::{self, File}, io::Write,