Support more complicated path_regexp
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.1k
- Forks
- 1.1k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 9
Description
Is it possible to support more complicated regexp in path_regex? Like mentioned in the documentation here https://golang.org/pkg/regexp/#MatchString
"More complicated queries need to use Compile and the full Regexp interface"
so the match has to be implemented more like this
validRegExp = regexp.MustCompile(path_regexp)
match = validRegExp.MatchString(filePath))
I think this is the reason for issues like this one https://github.com/mozilla/sops/issues/480
We also had problems to specify a path which is including the filename and not just a filename. Especially if there are '/' in the path it's not working at all and we get the message 'no matching creation rules found'
Example not working (no matter if '/' are escaped or not!):
path_regexp: stages/dev/secrets.env$
Examples working:
path_regexp: .*dev.*
path_regexp: secrets\.env$
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace how the path_regexp creation rule is evaluated against file paths, using the reported stages/dev/secrets.env$ and secrets.env$ examples as reproductions. Check the existing matching behavior against Go's regexp documentation; done means valid expressions match paths containing directories and no matching creation-rules error occurs for the reported case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100