-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul core Tracker: review whitelist functionality (part 2) #1270
Closed
6 tasks done
Tracked by
#1181
Labels
Comments
This was referenced Feb 14, 2025
Closed
josecelano
added a commit
that referenced
this issue
Feb 14, 2025
eca5c59 refactor: [#1268] move scrape logic from udp server to udp_tracker_core package (Jose Celano) c0fc390 refactor: [#1268] move announce logic from udp server to udp_tracker_core package (Jose Celano) 37a142e refactor: [#1268] move scrape logic from axum to http_tracker_core package (Jose Celano) 74815ab refactor: [#1268] move announce logic from axum to http_tracker_core package (Jose Celano) e48aaf5 [#1268] move udp services to udp_tracker_core package (Jose Celano) 73753e3 [#1268] move http services to http_tracker_core package (Jose Celano) dec742e refactor: [#1268] extract servers::udp::services::scrape service (Jose Celano) 3c07b26 refactor: [#1268] extract servers::udp::services::announce service (Jose Celano) 81825c9 refactor: [#1268] separate UDP handlers into diferent modules (Jose Celano) Pull request description: Overhaul core Tracker: review whitelist functionality. ### Sub-tasks - [x] Introduce submodules for handlers in UDP: `servers::udp::handlers::{announce, scrape}`. - [x] Create the missing services (app layer) in the UDP tracker. There is no intermediary level between handlers and the core tracker. It will moved to its own package `udp-tracker-core` later. - [x] Move the service `services::announce::invoke()` in the HTTP tracker to the `http-tracker-core` package. - [x] Move the service `services::announce::invoke()` in the UDP tracker to the `udp-tracker-core` package. - [x] Move logic from the handler (in the framework level - delivery layer) to the application service in the `http-tracker-core` package. - [x] For the `announce` request - [x] For the `scrape` request - [x] Move logic from the handler (controller level - delivery layer) to the application service in the `udp-tracker-core` package. - [x] For the `announce` request - [x] For the `scrape` request - [ ] ~~Add version module also for the UDP tracker. I don't see any reason to use `v1` in the http tracker but not in the UDP tracker.~~ I will leave this until we introduce a new major version. ### Sub-tasks for a new PR I've left these tasks for a new [issue](#1270). This PR is just moving things and the new tasks imply changing function signatures. - [ ] In the tracker-core announce handler return a `Result<AnnounceData, AnnounceError>` when the torrent is not included in the whitelist. - [ ] In the tracker-core scrape handler return a `Result<ScrapeData, ScrapeError>` so we are able to return errors in the future without breaking the public API. ACKs for top commit: josecelano: ACK eca5c59 Tree-SHA512: d3ee37ffa806e8a86813fe564e3840fab7bfc44d2072f85bc2eba84ac3402c95c0f6a5beb2725071cb0498415f55915431b656e98c71b3a6bf469de961c37f03
josecelano
added a commit
to josecelano/torrust-tracker
that referenced
this issue
Feb 17, 2025
when the tracker is running in `listed` mode and the client is trying to announce a torrents whose infohash is not whitelisted.
4 tasks
josecelano
added a commit
to josecelano/torrust-tracker
that referenced
this issue
Feb 17, 2025
- In the announce handler, it returns an error when the tracker is running in `listed` mode and the infohash is not whitelisted. This was done only in the delivery layers but not in the domain. - In the scrape handler, it does not return any errors for now, but It will allow us in the future to return errors whithout making breaking changes.
josecelano
added a commit
to josecelano/torrust-tracker
that referenced
this issue
Feb 17, 2025
josecelano
added a commit
to josecelano/torrust-tracker
that referenced
this issue
Feb 17, 2025
josecelano
added a commit
to josecelano/torrust-tracker
that referenced
this issue
Feb 17, 2025
josecelano
added a commit
to josecelano/torrust-tracker
that referenced
this issue
Feb 17, 2025
josecelano
added a commit
to josecelano/torrust-tracker
that referenced
this issue
Feb 17, 2025
josecelano
added a commit
that referenced
this issue
Feb 17, 2025
…art 2) d0e6936 refactor: simplify loop with map (Jose Celano) d49aebd refactor: [#1270] inline udp tracker scrape invoke fn (Jose Celano) af28429 refactor: [#1270] inline udp tracker announce invoke fn (Jose Celano) 6651343 refactor: [#1270] inline http tracker scrape invoke fn (Jose Celano) 096d503 refactor: [#1270] inline http tracker announce invoke fn (Jose Celano) dbee7ad refactor: [#1270] extract fn to new package udp-protocol (Jose Celano) da1353b refactor: [#1270] return errorin core announce and scrape handler (Jose Celano) Pull request description: Overhaul core Tracker: review whitelist functionality (part 2). - [x] Return an error in the announce handler if the tracker is running in `listed` mode and the infohash is not whitelisted. This is already implemented in the higher delivery layer but it should be also validated in the tracker core (domain layer). - [x] Change scrape handler signature to return an error even if it's not needed now. That will allow us to return an error in the future whiteout breaking changes. - [x] Move `packages::udp_tracker_core::peer_builder::from_request` to new package `udp-protocol` - [x] Inline `invoke` function in handlers (`http-tracker-core` and `udp-tracker-core`) when possible. ACKs for top commit: josecelano: ACK d0e6936 Tree-SHA512: b4e9356291b35b1cc6a20a5b28a6c0b9136baafbb9bc71638bd83932709970f3ee8bee91a81cc09a775244fd3e774131d238cf4f52920bcc141fed4161b86b03
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Parent issue: #1261
Relates to:
This is second part of the implementation of this issue.
I decided to merge the PR for the issue #1268 before continuing working of the refactor.
Sub-tasks
Result<AnnounceData, AnnounceError>
when the torrent is not included in the whitelist.Result<ScrapeData, ScrapeError>
so we are able to return errors in the future without breaking the public API.packages::udp_tracker_core::peer_builder::from_request
to new packageudp-protocol
invoke
function in handlers when possible.Move tests for the handlers (announce and scrape) from HTTP server to. *1http_tracker_core
Move tests for the handlers (announce and scrape) from UDP server to. *1udp_tracker_core
NOTE*1: instead of moving the tests I will create new ones for the
http_tracker_core
after refactoring all packages. The tests contain logic from the delivery layer that it will not be moved to thehttp_tracker_core
so It will be harder to refactor those tests than created new one for the logic that we will finally move to thehttp_tracker_core
.The text was updated successfully, but these errors were encountered: