Skip to content

Axum HTTP tracker: Compact announce response in public mode in Axum#1

Closed
josecelano wants to merge 6 commits intoissue-184-axum-hhtp-tracker-announce-req-public-modefrom
issue-187-axum-http-tracker-compact-announce-req-public-mode
Closed

Axum HTTP tracker: Compact announce response in public mode in Axum#1
josecelano wants to merge 6 commits intoissue-184-axum-hhtp-tracker-announce-req-public-modefrom
issue-187-axum-http-tracker-compact-announce-req-public-mode

Conversation

@josecelano
Copy link
Copy Markdown
Owner

@josecelano josecelano commented Feb 17, 2023

Implementation for the compact announce response in the Axum HTTP tracker.

da638d6 docs(http): fix extractor docs (Jose Celano)
30918da refactor(http): [torrust#184] move extractor to extractor mod (Jose Celano)
99dbbe4 refactor(http): [torrust#184] extract announce service in Axum tracker (Jose Celano)
02e2516 feat(http): [torrust#184] Axum extractor for peer IP (Jose Celano)
74ed592 feat(http): [torrust#184] added optional params to announce req in Axum implementation (Jose Celano)
b1612f6 test(http): improve tests (Jose Celano)
3eb7475 feat(http): [torrust#184] normal (non-compact) announce response in axum tracker (Jose Celano)
42bd313 feat: [torrust#184] calculate remote client ip depending on whether the tracker is running on reverse proxy or not (Jose Celano)
8318057 feat: [torrust#184] add dependency: axum-client-ip (Jose Celano)
f327dcf fix(http): [torrust#184] bencoded error responses for announce request (Jose Celano)
d0c8eb0 refactor(http): reorganize mods (Jose Celano)
03024e2 refactor(http): extract function to get client IP on reverse proxy (Jose Celano)

Pull request description:

  It implements the `announce` request handler in the Axum HTTP tracker for `public` mode.

  - [x] Normal (non-compact) response with only mandatory params
  - [x] Optional params for `announce` request
  - [x] Return bencoded error when remote client IP cannot be obtained from the `X-Forwarded-For` header on reverse proxy mode. See commented tests.
  - [x] Refactor: extract service for handler body.

  Out of this PR scope:

  - [ ] Capture unexpected handler errors and convert them into bencoded generic HTTP tracker response errors. Moved to [parent issue](torrust#160).
  - [ ] Compact response.

  **UPDATE**: 16/02/2023

Top commit has no ACKs.

Tree-SHA512: 76f77ed87f64ff6a488090e9013d92cbc516135a770206408a38bcba1c57ceb01154cd87b7169ed01ee12791c12d5e991ab59c4e53ba7c164a146292d6a94677
@josecelano josecelano force-pushed the issue-187-axum-http-tracker-compact-announce-req-public-mode branch from 1445d0b to db21e6d Compare February 20, 2023 07:48
@josecelano josecelano force-pushed the issue-187-axum-http-tracker-compact-announce-req-public-mode branch 2 times, most recently from d595151 to eed4348 Compare February 20, 2023 17:52
It will be used to build the bencoded compact annouce response in the
HTTP tracker. We are currently writting directly bytes into a byte
buffer, but Bencode specification imposes some restrictions like:

The keys in a dictionary must me alphabetically orderded. We are not
doing that in the current implementation.
- Remove extra byte "e" between "peer" and "peer6" dictionary keys.
- Alphabetically order dictionary keys.
Those test should have been enabled when the implementation was done.
…ut a different port

Other refactores were made to improve funtions names.

BREAKING CHANGE: before this a peer with the same IP as the client that
is making the announce request was removed from the announce response
regardless whether they have the same IP or not.
@josecelano josecelano force-pushed the issue-187-axum-http-tracker-compact-announce-req-public-mode branch from eed4348 to 5020722 Compare February 20, 2023 18:36
@josecelano
Copy link
Copy Markdown
Owner Author

torrust#190

@josecelano josecelano closed this Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant