Skip to content

ngclient: implement glob-like pattern matching #1505

Closed

Description

@sechkova

Description of issue or feature request:

According to the recently updated version of the specification the shell style wildcard matching is glob-like, and therefore a path separator in a path should not be matched by a wildcard in the PATHPATTERN.

Current behavior:
A path separator in a path is matched by a wildcard in the PATHPATTERN (fnmatch.fnmatch)

Expected behavior:
A path separator in a path should not be matched by a wildcard in the PATHPATTERN.

Activity

  1. sechkova commented on Jul 23, 2021

    @sechkova
    ContributorAuthor

    See related issue #1506

  2. added
    backlog
    on Jul 28, 2021
  3. added this to the Sprint 5 milestone on Jul 28, 2021
  4. sechkova commented on Jul 28, 2021

    @sechkova
    ContributorAuthor

    Currently the implementation uses fnmatch from the fnmatch module which doesn't distinguish the filename separator ('/' on Unix) as a special character.
    The recommended "path-aware" module by the python docs is the glob module. However glob.glob does it by accessing the filesystem and working relative to the current dir (or it needs an absolute path). This behaviour does not work in our case where we need to match relative paths:

    Internally glob seems to use fnmatch after having parsed the path segments, maybe implementing similar functionality but treating relative paths as strings, without file system access, could do the job.

  5. modified the milestones: Sprint 5, Sprint 6 on Aug 18, 2021
  6. removed
    backlog
    on Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions