Skip to content

ngclient: remove URL normalization #1483

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

Closed
sechkova opened this issue Jul 6, 2021 · 3 comments · Fixed by #1686
Closed

ngclient: remove URL normalization #1483

sechkova opened this issue Jul 6, 2021 · 3 comments · Fixed by #1686
Assignees
Labels
backlog Issues to address with priority for current development goals good first issue Bite-sized items for first time contributors ngclient
Milestone

Comments

@sechkova
Copy link
Contributor

sechkova commented Jul 6, 2021

Description of issue or feature request:

Document that URL is expected to be is a percent encoded URL throughout the client code and remove URL string normalization in lower level methods like the one in:
https://github.com/theupdateframework/tuf/blob/745a8f7680c69ea290d48bc5a2066dd4ad9781d3/tuf/ngclient/_internal/download.py#L88

@sechkova sechkova mentioned this issue Jul 6, 2021
3 tasks
@joshuagl
Copy link
Member

joshuagl commented Jul 6, 2021

See also #1077

@joshuagl joshuagl added backlog Issues to address with priority for current development goals good first issue Bite-sized items for first time contributors labels Jul 6, 2021
@jku
Copy link
Member

jku commented Sep 14, 2021

this is part of the "forming URLs from target paths" issue: My understanding after thinking about this a bit too much is that target paths are meant to be URL-encoded (percent encoded) to begin with -- or at least the client library cannot know what to encode/decode. The library should not encode or unencode but client (caller) can do that if they know what they are doing.

So:

  • client library code should not unquote: it cannot know what is an intended encoding and what is not
  • client library code should not replace any slashes with other slashes: it cannot know which slashes are intended and which are not
  • only exception to this would be a method that explicitly takes a local path and tries to turn that into a target path: My opinion is that we don't need a method like that: client (caller) can implement one if they think they do

@ivanayov
Copy link
Collaborator

Can I take this, please?

ivanayov pushed a commit to ivanayov/python-tuf that referenced this issue Nov 18, 2021
As a target path is a URL path it's not correct to consider it as
interchangeable with a filepath within every operation system. The
unquote is also removed as the ngclient cannot assume correctly
which encoding is intended and which not

Fixes theupdateframework#1483

Signed-off-by: Ivana Atanasova <iyovcheva@iyovcheva-a02.vmware.com>
ivanayov pushed a commit to ivanayov/python-tuf that referenced this issue Nov 22, 2021
As a target path is a URL path it's not correct to consider it as
interchangeable with a filepath within every operation system. The
unquote is also removed as the ngclient cannot assume correctly
which encoding is intended and which not

Fixes theupdateframework#1483

Signed-off-by: Ivana Atanasova <iyovcheva@iyovcheva-a02.vmware.com>
ivanayov pushed a commit to ivanayov/python-tuf that referenced this issue Nov 22, 2021
As a target path is a URL path it's not correct to consider it as
interchangeable with a filepath within every operation system. The
unquote is also removed as the ngclient cannot assume correctly
which encoding is intended and which not

Fixes theupdateframework#1483

Signed-off-by: Ivana Atanasova <iyovcheva@iyovcheva-a02.vmware.com>
ivanayov pushed a commit to ivanayov/python-tuf that referenced this issue Nov 22, 2021
As a target path is a URL path it's not correct to consider it as
interchangeable with a filepath within every operation system. The
unquote is also removed as the ngclient cannot assume correctly
which encoding is intended and which not

Fixes theupdateframework#1483

Signed-off-by: Ivana Atanasova <iyovcheva@iyovcheva-a02.vmware.com>
@sechkova sechkova added this to the Sprint 13 milestone Nov 24, 2021
ivanayov pushed a commit to ivanayov/python-tuf that referenced this issue Nov 25, 2021
As a target path is a URL path it's not correct to consider it as
interchangeable with a filepath within every operation system. The
unquote is also removed as the ngclient cannot assume correctly
which encoding is intended and which not

Fixes theupdateframework#1483

Signed-off-by: Ivana Atanasova <iyovcheva@iyovcheva-a02.vmware.com>
@jku jku closed this as completed in #1686 Nov 30, 2021
MVrachev pushed a commit to MVrachev/tuf that referenced this issue Dec 1, 2021
As a target path is a URL path it's not correct to consider it as
interchangeable with a filepath within every operation system. The
unquote is also removed as the ngclient cannot assume correctly
which encoding is intended and which not

Fixes theupdateframework#1483

Signed-off-by: Ivana Atanasova <iyovcheva@iyovcheva-a02.vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issues to address with priority for current development goals good first issue Bite-sized items for first time contributors ngclient
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants