Skip to content

Commit 605eb3f

Browse files
committed
Merge #1332: Rename API packages
d190fee refactor: [#1317] rename api packages (Jose Celano) Pull request description: Rename API packages to avoid future conflicts with other API implementations like GraphQL API. ACKs for top commit: josecelano: ACK d190fee Tree-SHA512: 5f13c2c1edf198666a1991036d2f700ca8f30e602a5c9751fd98cf2f66511e2018f824e27dcbb890e07ae63aedb23b30139b3667c26617b034a1ef56cbc86143
2 parents 47f903a + d190fee commit 605eb3f

Some content is hidden

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

81 files changed

+122
-121
lines changed

.github/workflows/deployment.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ jobs:
6363
cargo publish -p bittorrent-udp-tracker-protocol
6464
cargo publish -p torrust-axum-health-check-api-server
6565
cargo publish -p torrust-axum-http-tracker-server
66+
cargo publish -p torrust-axum-rest-tracker-api-server
6667
cargo publish -p torrust-axum-server
67-
cargo publish -p torrust-axum-tracker-api-server
68+
cargo publish -p torrust-rest-tracker-api-client
69+
cargo publish -p torrust-rest-tracker-api-core
6870
cargo publish -p torrust-torrust-server-lib
6971
cargo publish -p torrust-tracker
70-
cargo publish -p torrust-tracker-api-client
71-
cargo publish -p torrust-tracker-api-core
7272
cargo publish -p torrust-tracker-client
7373
cargo publish -p torrust-tracker-clock
7474
cargo publish -p torrust-tracker-configuration

Cargo.lock

+56-55
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ serde_json = { version = "1", features = ["preserve_order"] }
4949
tokio = { version = "1", features = ["macros", "net", "rt-multi-thread", "signal", "sync"] }
5050
torrust-axum-health-check-api-server = { version = "3.0.0-develop", path = "packages/axum-health-check-api-server" }
5151
torrust-axum-http-tracker-server = { version = "3.0.0-develop", path = "packages/axum-http-tracker-server" }
52+
torrust-axum-rest-tracker-api-server = { version = "3.0.0-develop", path = "packages/axum-rest-tracker-api-server" }
5253
torrust-axum-server = { version = "3.0.0-develop", path = "packages/axum-server" }
53-
torrust-axum-tracker-api-server = { version = "3.0.0-develop", path = "packages/axum-tracker-api-server" }
54+
torrust-rest-tracker-api-core = { version = "3.0.0-develop", path = "packages/rest-tracker-api-core" }
5455
torrust-server-lib = { version = "3.0.0-develop", path = "packages/server-lib" }
55-
torrust-tracker-api-core = { version = "3.0.0-develop", path = "packages/tracker-api-core" }
5656
torrust-tracker-clock = { version = "3.0.0-develop", path = "packages/clock" }
5757
torrust-tracker-configuration = { version = "3.0.0-develop", path = "packages/configuration" }
5858
torrust-udp-tracker-server = { version = "3.0.0-develop", path = "packages/udp-tracker-server" }
@@ -62,7 +62,7 @@ tracing-subscriber = { version = "0", features = ["json"] }
6262
[dev-dependencies]
6363
local-ip-address = "0"
6464
mockall = "0"
65-
torrust-tracker-api-client = { version = "3.0.0-develop", path = "packages/tracker-api-client" }
65+
torrust-rest-tracker-api-client = { version = "3.0.0-develop", path = "packages/rest-tracker-api-client" }
6666
torrust-tracker-test-helpers = { version = "3.0.0-develop", path = "packages/test-helpers" }
6767

6868
[workspace]

packages/axum-health-check-api-server/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ tracing = "0"
3131
reqwest = { version = "0", features = ["json"] }
3232
torrust-axum-health-check-api-server = { version = "3.0.0-develop", path = "../axum-health-check-api-server" }
3333
torrust-axum-http-tracker-server = { version = "3.0.0-develop", path = "../axum-http-tracker-server" }
34-
torrust-axum-tracker-api-server = { version = "3.0.0-develop", path = "../axum-tracker-api-server" }
34+
torrust-axum-rest-tracker-api-server = { version = "3.0.0-develop", path = "../axum-rest-tracker-api-server" }
3535
torrust-tracker-clock = { version = "3.0.0-develop", path = "../clock" }
3636
torrust-tracker-test-helpers = { version = "3.0.0-develop", path = "../test-helpers" }
3737
torrust-udp-tracker-server = { version = "3.0.0-develop", path = "../udp-tracker-server" }

packages/axum-health-check-api-server/tests/server/contract.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ mod api {
4343

4444
let configuration = Arc::new(configuration::ephemeral());
4545

46-
let service = torrust_axum_tracker_api_server::environment::Started::new(&configuration).await;
46+
let service = torrust_axum_rest_tracker_api_server::environment::Started::new(&configuration).await;
4747

4848
let registar = service.registar.clone();
4949

@@ -90,7 +90,7 @@ mod api {
9090

9191
let configuration = Arc::new(configuration::ephemeral());
9292

93-
let service = torrust_axum_tracker_api_server::environment::Started::new(&configuration).await;
93+
let service = torrust_axum_rest_tracker_api_server::environment::Started::new(&configuration).await;
9494

9595
let binding = service.bind_address();
9696

packages/axum-tracker-api-server/Cargo.toml packages/axum-rest-tracker-api-server/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition.workspace = true
66
homepage.workspace = true
77
keywords = ["axum", "bittorrent", "http", "server", "torrust", "tracker"]
88
license.workspace = true
9-
name = "torrust-axum-tracker-api-server"
9+
name = "torrust-axum-rest-tracker-api-server"
1010
publish.workspace = true
1111
readme = "README.md"
1212
repository.workspace = true
@@ -32,9 +32,9 @@ serde_with = { version = "3", features = ["json"] }
3232
thiserror = "2"
3333
tokio = { version = "1", features = ["macros", "net", "rt-multi-thread", "signal", "sync"] }
3434
torrust-axum-server = { version = "3.0.0-develop", path = "../axum-server" }
35+
torrust-rest-tracker-api-client = { version = "3.0.0-develop", path = "../rest-tracker-api-client" }
36+
torrust-rest-tracker-api-core = { version = "3.0.0-develop", path = "../rest-tracker-api-core" }
3537
torrust-server-lib = { version = "3.0.0-develop", path = "../server-lib" }
36-
torrust-tracker-api-client = { version = "3.0.0-develop", path = "../tracker-api-client" }
37-
torrust-tracker-api-core = { version = "3.0.0-develop", path = "../tracker-api-core" }
3838
torrust-tracker-clock = { version = "3.0.0-develop", path = "../clock" }
3939
torrust-tracker-configuration = { version = "3.0.0-develop", path = "../configuration" }
4040
torrust-tracker-primitives = { version = "3.0.0-develop", path = "../primitives" }
@@ -46,7 +46,7 @@ tracing = "0"
4646
[dev-dependencies]
4747
local-ip-address = "0"
4848
mockall = "0"
49-
torrust-tracker-api-client = { version = "3.0.0-develop", path = "../tracker-api-client" }
49+
torrust-rest-tracker-api-client = { version = "3.0.0-develop", path = "../rest-tracker-api-client" }
5050
torrust-tracker-test-helpers = { version = "3.0.0-develop", path = "../test-helpers" }
5151
url = { version = "2", features = ["serde"] }
5252
uuid = { version = "1", features = ["v4"] }

packages/axum-tracker-api-server/src/environment.rs packages/axum-rest-tracker-api-server/src/environment.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ use bittorrent_tracker_core::container::TrackerCoreContainer;
77
use bittorrent_udp_tracker_core::container::UdpTrackerCoreContainer;
88
use futures::executor::block_on;
99
use torrust_axum_server::tsl::make_rust_tls;
10+
use torrust_rest_tracker_api_client::connection_info::{ConnectionInfo, Origin};
11+
use torrust_rest_tracker_api_core::container::TrackerHttpApiCoreContainer;
1012
use torrust_server_lib::registar::Registar;
11-
use torrust_tracker_api_client::connection_info::{ConnectionInfo, Origin};
12-
use torrust_tracker_api_core::container::TrackerHttpApiCoreContainer;
1313
use torrust_tracker_configuration::{logging, Configuration};
1414
use torrust_tracker_primitives::peer;
1515
use torrust_udp_tracker_server::container::UdpTrackerServerContainer;

packages/axum-tracker-api-server/src/routes.rs packages/axum-rest-tracker-api-server/src/routes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ use axum::response::Response;
1515
use axum::routing::get;
1616
use axum::{middleware, BoxError, Router};
1717
use hyper::{Request, StatusCode};
18+
use torrust_rest_tracker_api_core::container::TrackerHttpApiCoreContainer;
1819
use torrust_server_lib::logging::Latency;
19-
use torrust_tracker_api_core::container::TrackerHttpApiCoreContainer;
2020
use torrust_tracker_configuration::{AccessTokens, DEFAULT_TIMEOUT};
2121
use tower::timeout::TimeoutLayer;
2222
use tower::ServiceBuilder;

packages/axum-tracker-api-server/src/server.rs packages/axum-rest-tracker-api-server/src/server.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ use thiserror::Error;
3535
use tokio::sync::oneshot::{Receiver, Sender};
3636
use torrust_axum_server::custom_axum_server::{self, TimeoutAcceptor};
3737
use torrust_axum_server::signals::graceful_shutdown;
38+
use torrust_rest_tracker_api_core::container::TrackerHttpApiCoreContainer;
3839
use torrust_server_lib::logging::STARTED_ON;
3940
use torrust_server_lib::registar::{ServiceHealthCheckJob, ServiceRegistration, ServiceRegistrationForm};
4041
use torrust_server_lib::signals::{Halted, Started};
41-
use torrust_tracker_api_core::container::TrackerHttpApiCoreContainer;
4242
use torrust_tracker_configuration::AccessTokens;
4343
use tracing::{instrument, Level};
4444

@@ -295,8 +295,8 @@ mod tests {
295295
use std::sync::Arc;
296296

297297
use torrust_axum_server::tsl::make_rust_tls;
298+
use torrust_rest_tracker_api_core::container::TrackerHttpApiCoreContainer;
298299
use torrust_server_lib::registar::Registar;
299-
use torrust_tracker_api_core::container::TrackerHttpApiCoreContainer;
300300
use torrust_tracker_configuration::{logging, Configuration};
301301
use torrust_tracker_test_helpers::configuration::ephemeral_public;
302302

packages/axum-tracker-api-server/src/v1/context/stats/handlers.rs packages/axum-rest-tracker-api-server/src/v1/context/stats/handlers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use bittorrent_tracker_core::torrent::repository::in_memory::InMemoryTorrentRepo
99
use bittorrent_udp_tracker_core::services::banning::BanService;
1010
use serde::Deserialize;
1111
use tokio::sync::RwLock;
12-
use torrust_tracker_api_core::statistics::services::get_metrics;
12+
use torrust_rest_tracker_api_core::statistics::services::get_metrics;
1313

1414
use super::responses::{metrics_response, stats_response};
1515

packages/axum-tracker-api-server/src/v1/context/stats/resources.rs packages/axum-rest-tracker-api-server/src/v1/context/stats/resources.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! API resources for the [`stats`](crate::v1::context::stats)
22
//! API context.
33
use serde::{Deserialize, Serialize};
4-
use torrust_tracker_api_core::statistics::services::TrackerMetrics;
4+
use torrust_rest_tracker_api_core::statistics::services::TrackerMetrics;
55

66
/// It contains all the statistics generated by the tracker.
77
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
@@ -117,8 +117,8 @@ impl From<TrackerMetrics> for Stats {
117117

118118
#[cfg(test)]
119119
mod tests {
120-
use torrust_tracker_api_core::statistics::metrics::Metrics;
121-
use torrust_tracker_api_core::statistics::services::TrackerMetrics;
120+
use torrust_rest_tracker_api_core::statistics::metrics::Metrics;
121+
use torrust_rest_tracker_api_core::statistics::services::TrackerMetrics;
122122
use torrust_tracker_primitives::torrent_metrics::TorrentsMetrics;
123123

124124
use super::Stats;

packages/axum-tracker-api-server/src/v1/context/stats/responses.rs packages/axum-rest-tracker-api-server/src/v1/context/stats/responses.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! API responses for the [`stats`](crate::v1::context::stats)
22
//! API context.
33
use axum::response::{IntoResponse, Json, Response};
4-
use torrust_tracker_api_core::statistics::services::TrackerMetrics;
4+
use torrust_rest_tracker_api_core::statistics::services::TrackerMetrics;
55

66
use super::resources::Stats;
77

packages/axum-tracker-api-server/src/v1/context/stats/routes.rs packages/axum-rest-tracker-api-server/src/v1/context/stats/routes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::sync::Arc;
77

88
use axum::routing::get;
99
use axum::Router;
10-
use torrust_tracker_api_core::container::TrackerHttpApiCoreContainer;
10+
use torrust_rest_tracker_api_core::container::TrackerHttpApiCoreContainer;
1111

1212
use super::handlers::get_stats_handler;
1313

packages/axum-tracker-api-server/src/v1/routes.rs packages/axum-rest-tracker-api-server/src/v1/routes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use std::sync::Arc;
33

44
use axum::Router;
5-
use torrust_tracker_api_core::container::TrackerHttpApiCoreContainer;
5+
use torrust_rest_tracker_api_core::container::TrackerHttpApiCoreContainer;
66

77
use super::context::{auth_key, stats, torrent, whitelist};
88

packages/axum-tracker-api-server/tests/server/connection_info.rs packages/axum-rest-tracker-api-server/tests/server/connection_info.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use torrust_tracker_api_client::connection_info::{ConnectionInfo, Origin};
1+
use torrust_rest_tracker_api_client::connection_info::{ConnectionInfo, Origin};
22

33
pub fn connection_with_invalid_token(origin: Origin) -> ConnectionInfo {
44
ConnectionInfo::authenticated(origin, "invalid token")

packages/axum-tracker-api-server/tests/server/v1/asserts.rs packages/axum-rest-tracker-api-server/tests/server/v1/asserts.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// code-review: should we use macros to return the exact line where the assert fails?
22

33
use reqwest::Response;
4-
use torrust_axum_tracker_api_server::v1::context::auth_key::resources::AuthKey;
5-
use torrust_axum_tracker_api_server::v1::context::stats::resources::Stats;
6-
use torrust_axum_tracker_api_server::v1::context::torrent::resources::torrent::{ListItem, Torrent};
4+
use torrust_axum_rest_tracker_api_server::v1::context::auth_key::resources::AuthKey;
5+
use torrust_axum_rest_tracker_api_server::v1::context::stats::resources::Stats;
6+
use torrust_axum_rest_tracker_api_server::v1::context::torrent::resources::torrent::{ListItem, Torrent};
77

88
// Resource responses
99

packages/axum-tracker-api-server/tests/server/v1/contract/authentication.rs packages/axum-rest-tracker-api-server/tests/server/v1/contract/authentication.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use torrust_axum_tracker_api_server::environment::Started;
2-
use torrust_tracker_api_client::common::http::{Query, QueryParam};
3-
use torrust_tracker_api_client::v1::client::{headers_with_request_id, Client};
1+
use torrust_axum_rest_tracker_api_server::environment::Started;
2+
use torrust_rest_tracker_api_client::common::http::{Query, QueryParam};
3+
use torrust_rest_tracker_api_client::v1::client::{headers_with_request_id, Client};
44
use torrust_tracker_test_helpers::logging::logs_contains_a_line_with;
55
use torrust_tracker_test_helpers::{configuration, logging};
66
use uuid::Uuid;

0 commit comments

Comments
 (0)