Skip to content

Inconsistent path match behaviour compared to python implementation #209

@cosmin79

Description

@cosmin79

General information:
Hey. So in the general spec https://github.com/in-toto/docs/blob/master/in-toto-spec.md#433-artifact-rules , we have this statement about the path patterns accepted in expected materials / products paths:
"The 'pattern' value is a path-pattern that will be matched against paths reported in the link metadata, including bash-style wildcards (e.g., '*')."

This is implemented differently between Golang and Python.

Could you comment on the differences?

  • Version (tag or commit):
  • Operating system (Linux/Mac/Windows):
  • Go version:
  • Go build flags (if any):

Description of the bug:
I've noticed the python implementation for in-toto uses fnmatch:
https://github.com/in-toto/in-toto/blob/develop/in_toto/verifylib.py#L676

In the Golang implementation, this is achieved via https://github.com/in-toto/in-toto-golang/blob/master/in_toto/match.go . The following test for example wouldn't be true if using fnmatch https://github.com/in-toto/in-toto-golang/blob/master/in_toto/match_test.go#L49 .

Anything special you want to tell us?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions