Skip to content
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) #1274

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Feb 17, 2025

Overhaul core Tracker: review whitelist functionality (part 2).

  • 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).
  • 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.
  • Move packages::udp_tracker_core::peer_builder::from_request to new package udp-protocol
  • Inline invoke function in handlers (http-tracker-core and udp-tracker-core) when possible.

@josecelano josecelano self-assigned this Feb 17, 2025
@josecelano josecelano added the Code Cleanup / Refactoring Tidying and Making Neat label Feb 17, 2025
@josecelano josecelano requested a review from da2ce7 February 17, 2025 09:58
@josecelano josecelano linked an issue Feb 17, 2025 that may be closed by this pull request
6 tasks
- 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 josecelano force-pushed the 1270-overhaul-core-tracker-review-whitelist-functionality-part-2 branch from e40777f to da1353b Compare February 17, 2025 10:37
Copy link

codecov bot commented Feb 17, 2025

Codecov Report

Attention: Patch coverage is 92.47911% with 27 lines in your changes missing coverage. Please review.

Project coverage is 81.11%. Comparing base (1a5ad31) to head (d0e6936).
Report is 8 commits behind head on develop.

Files with missing lines Patch % Lines
packages/http-protocol/src/v1/responses/error.rs 9.09% 10 Missing ⚠️
src/packages/udp_tracker_core/services/announce.rs 68.42% 5 Missing and 1 partial ⚠️
src/servers/udp/handlers/scrape.rs 0.00% 4 Missing ⚠️
packages/http-protocol/src/v1/requests/announce.rs 57.14% 3 Missing ⚠️
packages/tracker-core/src/announce_handler.rs 98.80% 0 Missing and 1 partial ⚠️
...rc/packages/http_tracker_core/services/announce.rs 98.94% 0 Missing and 1 partial ⚠️
src/packages/http_tracker_core/services/scrape.rs 98.88% 0 Missing and 1 partial ⚠️
src/packages/udp_tracker_core/services/scrape.rs 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1274      +/-   ##
===========================================
- Coverage    81.19%   81.11%   -0.09%     
===========================================
  Files          212      212              
  Lines        14891    15015     +124     
  Branches     14891    15015     +124     
===========================================
+ Hits         12091    12179      +88     
- Misses        2603     2636      +33     
- Partials       197      200       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@josecelano josecelano marked this pull request as ready for review February 17, 2025 16:33
@josecelano josecelano requested a review from a team as a code owner February 17, 2025 16:33
@josecelano josecelano force-pushed the 1270-overhaul-core-tracker-review-whitelist-functionality-part-2 branch from 4d69abc to d0e6936 Compare February 17, 2025 16:34
@josecelano
Copy link
Member Author

ACK d0e6936

@josecelano josecelano merged commit 467d50a into torrust:develop Feb 17, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Cleanup / Refactoring Tidying and Making Neat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overhaul core Tracker: review whitelist functionality (part 2)
1 participant