diff --git a/trifid-api/src/auth_tokens.rs b/trifid-api/src/auth_tokens.rs
index 4f249a6..f548044 100644
--- a/trifid-api/src/auth_tokens.rs
+++ b/trifid-api/src/auth_tokens.rs
@@ -1,3 +1,19 @@
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
use std::error::Error;
use actix_web::HttpRequest;
diff --git a/trifid-api/src/config.rs b/trifid-api/src/config.rs
index 6e5b4c0..e3560fb 100644
--- a/trifid-api/src/config.rs
+++ b/trifid-api/src/config.rs
@@ -1,3 +1,19 @@
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
use std::fs;
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4};
use log::error;
diff --git a/trifid-api/src/crypto.rs b/trifid-api/src/crypto.rs
index a8b7313..9d8dc63 100644
--- a/trifid-api/src/crypto.rs
+++ b/trifid-api/src/crypto.rs
@@ -1,3 +1,19 @@
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
use std::error::Error;
use aes_gcm::{Aes256Gcm, KeyInit, Nonce};
use aes_gcm::aead::{Aead, Payload};
diff --git a/trifid-api/src/cursor.rs b/trifid-api/src/cursor.rs
index 8fb7335..91f0a07 100644
--- a/trifid-api/src/cursor.rs
+++ b/trifid-api/src/cursor.rs
@@ -1,3 +1,19 @@
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
use std::error::Error;
use base64::Engine;
use serde::{Serialize, Deserialize};
diff --git a/trifid-api/src/error.rs b/trifid-api/src/error.rs
index 4659084..4efa931 100644
--- a/trifid-api/src/error.rs
+++ b/trifid-api/src/error.rs
@@ -1,3 +1,19 @@
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
use actix_web::error::{JsonPayloadError, PayloadError};
use serde::{Serialize, Deserialize};
diff --git a/trifid-api/src/magic_link.rs b/trifid-api/src/magic_link.rs
index a4b57e7..19b6ff8 100644
--- a/trifid-api/src/magic_link.rs
+++ b/trifid-api/src/magic_link.rs
@@ -1,3 +1,19 @@
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
use std::error::Error;
use log::info;
diff --git a/trifid-api/src/main.rs b/trifid-api/src/main.rs
index 32b683f..a53e854 100644
--- a/trifid-api/src/main.rs
+++ b/trifid-api/src/main.rs
@@ -1,3 +1,19 @@
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
use std::error::Error;
use std::time::Duration;
use actix_request_identifier::RequestIdentifier;
diff --git a/trifid-api/src/routes/v1/auth/magic_link.rs b/trifid-api/src/routes/v1/auth/magic_link.rs
index 0dac832..42ea473 100644
--- a/trifid-api/src/routes/v1/auth/magic_link.rs
+++ b/trifid-api/src/routes/v1/auth/magic_link.rs
@@ -1,4 +1,22 @@
-
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+//#POST /v1/auth/magic-link t+parity:full t+type:reverse_engineered t+status:done
+// This endpoint has full parity with the original API. It has been reverse-engineered from the original API as the original API docs do not have this item.
+// This endpoint is considered done. No major features should be added or removed, unless it fixes bugs.
use actix_web::{HttpResponse, post};
use actix_web::web::{Data, Json};
diff --git a/trifid-api/src/routes/v1/auth/totp.rs b/trifid-api/src/routes/v1/auth/totp.rs
index b50aa40..5c1db57 100644
--- a/trifid-api/src/routes/v1/auth/totp.rs
+++ b/trifid-api/src/routes/v1/auth/totp.rs
@@ -1,3 +1,23 @@
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+//#POST /v1/auth/totp t+parity:full t+type:reverse_engineered t+status:done
+// This endpoint has full parity with the original API. It has been reverse-engineered from the original API as the original API docs do not have this item.
+// This endpoint is considered done. No major features should be added or removed, unless it fixes bugs.
+
use actix_web::{HttpRequest, HttpResponse, post};
use actix_web::web::{Data, Json};
use log::{debug, error};
diff --git a/trifid-api/src/routes/v1/auth/verify_magic_link.rs b/trifid-api/src/routes/v1/auth/verify_magic_link.rs
index d5eb770..bf5f418 100644
--- a/trifid-api/src/routes/v1/auth/verify_magic_link.rs
+++ b/trifid-api/src/routes/v1/auth/verify_magic_link.rs
@@ -1,3 +1,23 @@
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+//#POST /v1/auth/verify-magic-link t+parity:full t+type:reverse_engineered t+status:done
+// This endpoint has full parity with the original API. It has been reverse-engineered from the original API as the original API docs do not have this item.
+// This endpoint is considered done. No major features should be added or removed, unless it fixes bugs.
+
use actix_web::{HttpResponse, post};
use actix_web::web::{Data, Json};
use log::error;
diff --git a/trifid-api/src/routes/v1/networks.rs b/trifid-api/src/routes/v1/networks.rs
index 19f868e..c28ccd7 100644
--- a/trifid-api/src/routes/v1/networks.rs
+++ b/trifid-api/src/routes/v1/networks.rs
@@ -1,3 +1,27 @@
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+//#GET /v1/networks t+parity:full t+type:documented t+status:done
+// This endpoint has full parity with the original API. It has been recreated from the original API documentation.
+// This endpoint is considered done. No major features should be added or removed, unless it fixes bugs.
+//
+//#GET /v1/networks/{network_id} t+parity:full t+type:documented t+status:done
+// This endpoint has full parity with the original API. It has been recreated from the original API documentation.
+// This endpoint is considered done. No major features should be added or removed, unless it fixes bugs.
+
use serde::{Serialize, Deserialize};
use actix_web::{get, HttpRequest, HttpResponse};
use actix_web::web::{Data, Path, Query};
@@ -280,7 +304,7 @@ pub async fn get_network_request(net: Path, req_info: HttpRequest, db: D
],
})
}
-
+
let network: Option = match network::Entity::find().filter(network::Column::Id.eq(net.into_inner())).one(&db.conn).await {
Ok(r) => r,
Err(e) => {
@@ -296,7 +320,7 @@ pub async fn get_network_request(net: Path, req_info: HttpRequest, db: D
});
}
};
-
+
if let Some(network) = network {
HttpResponse::Ok().json(GetNetworkResponse {
data: GetNetworksResponseData {
@@ -320,7 +344,7 @@ pub async fn get_network_request(net: Path, req_info: HttpRequest, db: D
}
],
})
-
+
}
}
diff --git a/trifid-api/src/routes/v1/organization.rs b/trifid-api/src/routes/v1/organization.rs
index af72249..ddb8373 100644
--- a/trifid-api/src/routes/v1/organization.rs
+++ b/trifid-api/src/routes/v1/organization.rs
@@ -1,8 +1,22 @@
-// !! !! !! THIS IS NOT A DN-COMPATIBLE API! !! !! !!
-// The organization create API has not yet been reverse engineered. This endpoint has nothing to do with the original API
-// and is a complete fabrication for trifid.
-// Help us out! Reverse engineer the actual org create mechanism and get us back to 100% parity!
-// - trifid maintainers
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+//#POST /v1/organization t+parity:none t+type:fabricated t+status:done t+status:want-reveng
+// This is NOT a DN-compatible API. The organization create API has not yet been reverse engineered. This endpoint is a complete fabrication of trifid-api.
+// While this endpoint is considered done, help is wanted with reverse engineering the original API. Major features should not be added or removed unless it is replacing this endpoint with the correct, DN-compatible endpoint.
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use actix_web::{HttpRequest, HttpResponse};
diff --git a/trifid-api/src/routes/v1/signup.rs b/trifid-api/src/routes/v1/signup.rs
index e619b20..1245805 100644
--- a/trifid-api/src/routes/v1/signup.rs
+++ b/trifid-api/src/routes/v1/signup.rs
@@ -1,3 +1,23 @@
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+//#POST /v1/signup t+parity:full t+type:reverse_engineered t+status:done
+// This endpoint has full parity with the original API. It has been reverse-engineered from the original API as the original API docs do not have this item.
+// This endpoint is considered done. No major features should be added or removed, unless it fixes bugs.
+
use actix_web::{HttpResponse, post};
use actix_web::web::{Data, Json};
use log::error;
diff --git a/trifid-api/src/routes/v1/totp_authenticators.rs b/trifid-api/src/routes/v1/totp_authenticators.rs
index 430c8c2..876a1f4 100644
--- a/trifid-api/src/routes/v1/totp_authenticators.rs
+++ b/trifid-api/src/routes/v1/totp_authenticators.rs
@@ -1,3 +1,23 @@
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+//#POST /v1/totp-authenticators t+parity:full t+type:reverse_engineered t+status:done
+// This endpoint has full parity with the original API. It has been reverse-engineered from the original API as the original API docs do not have this item.
+// This endpoint is considered done. No major features should be added or removed, unless it fixes bugs.
+
use serde::{Serialize, Deserialize};
use actix_web::{HttpRequest, HttpResponse, post};
use actix_web::web::{Data, Json};
diff --git a/trifid-api/src/routes/v1/verify_totp_authenticators.rs b/trifid-api/src/routes/v1/verify_totp_authenticators.rs
index bd979fc..db9bbde 100644
--- a/trifid-api/src/routes/v1/verify_totp_authenticators.rs
+++ b/trifid-api/src/routes/v1/verify_totp_authenticators.rs
@@ -1,3 +1,23 @@
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+//#POST /v1/verify-totp-authenticators t+parity:full t+type:reverse_engineered t+status:done
+// This endpoint has full parity with the original API. It has been reverse-engineered from the original API as the original API docs do not have this item.
+// This endpoint is considered done. No major features should be added or removed, unless it fixes bugs.
+
use actix_web::{HttpRequest, HttpResponse, post};
use actix_web::web::{Data, Json};
use log::{debug, error};
diff --git a/trifid-api/src/timers.rs b/trifid-api/src/timers.rs
index 5a77b83..02b9799 100644
--- a/trifid-api/src/timers.rs
+++ b/trifid-api/src/timers.rs
@@ -1,3 +1,19 @@
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
use std::time::{Duration, SystemTime, UNIX_EPOCH};
pub fn expires_in_seconds(seconds: u64) -> u64 {
diff --git a/trifid-api/src/tokens.rs b/trifid-api/src/tokens.rs
index e441f9a..2ab6afa 100644
--- a/trifid-api/src/tokens.rs
+++ b/trifid-api/src/tokens.rs
@@ -1,3 +1,19 @@
+// trifid-api, an open source reimplementation of the Defined Networking nebula management server.
+// Copyright (C) 2023 c0repwn3r
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
use actix_web::http::header::HeaderValue;
use rand::Rng;