Skip to content

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Feb 28, 2023

scrape request implementation for tracker in private mode.

@josecelano josecelano linked an issue Feb 28, 2023 that may be closed by this pull request
…cannot be parsed

Returns an specific authentication error when the peer uses a key with an invalid
format.
@josecelano josecelano marked this pull request as ready for review February 28, 2023 17:54
#[tokio::test]
async fn should_return_the_zeroed_file_when_the_authentication_key_provided_by_the_client_is_invalid() {
// There is not authentication error
// code-review: should this really be this way?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we return a 401?

Copy link
Member Author

@josecelano josecelano Feb 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. I think all responses have status 200 and errors are just an special bencoded dictionary. But in this case this is not even an error in the current Warp implementation. @WarmBeer do you know it?. Where can we find the specification for private trackers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WarmBeer I think the Axum fork returns an error when the tracker runs in private mode, and the key is missing, invalid or unknown.

I can't find any official documentation:

For me, it makes sense to change this behaviour. I will merge the PR because it's the actual Warp implementation behavior but let me know if we should change it.

@josecelano josecelano merged commit d5e52ec into torrust:develop Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Axum HTTP tracker: scrape request in private mode

2 participants