Use infohash instead of torrent ID in API URLs#140
Merged
josecelano merged 9 commits intotorrust:developfrom May 8, 2023
josecelano:issue-115-replace-id-by-info-hash-in-urlpath-vars
Merged
Use infohash instead of torrent ID in API URLs#140josecelano merged 9 commits intotorrust:developfrom josecelano:issue-115-replace-id-by-info-hash-in-urlpath-vars
josecelano merged 9 commits intotorrust:developfrom
josecelano:issue-115-replace-id-by-info-hash-in-urlpath-vars
Conversation
It does need to be public.
We have to start the test env before the condition to skip the test:
```
if !env.provides_a_tracker() {
println!("test skipped. It requires a tracker to be running.");
return;
}
```
Itherwise the test is never executed, even when you are using the
shared env:
```
TORRUST_IDX_BACK_E2E_SHARED=true cargo test
```
They will used in a new struct InfoHash.
…ent/download/{infohash}
BREAKING CHANGE: you can not use the odl endpoint enaymore: `GET /torrent/download/{id}`.
You have to use the torrent infohash.
Member
Author
|
Hi @WarmBeer @da2ce7 , I've finished the first endpoint. It should be easy to change the rest of the endpoints. The hardest part is done. Notice that I've copied the whole InfoHash implementation from the Tracker. At some point, we should publish the bit_torrent mod as an independent package. Form the time being, I've just copied it. The |
Since we are going to change those endpoint, it's convenient to add more
test. Endpoints starting with `torrent/{id}` will be change to use the
infohash instead of the internal torrent id, generated by the database.
BREAKING CHANGE: you cannot use the old endpoints anymore:
- `GET /torrent/{id}`.
- `PUT /torrent/{id}`.
- `DELETE /torrent/{id}`.
New endpoints:
- `GET /torrent/{infohashi`.
- `PUT /torrent/{infohash}`.
- `DELETE /torrent/{infohash}`.
Those files are only realted to `tests\database` tests.
Member
Author
|
ACK de56be0 |
This was referenced May 8, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GET /torrent/download/{id}toGET /torrent/download/{infohash}GET /torrent/{id}toGET /torrent/{infohash}PUT /torrent/{id}toPUT /torrent/{infohash}DELETE /torrent/{id}toDELETE /torrent/{infohash}