-
Notifications
You must be signed in to change notification settings - Fork 8
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
Rewrite simple glob match + FuzzMatch #20
Conversation
By fuzzing, I've found (large) inputs that takes forever to
How should we treat those? Shouldn't the spec enforce a limit both on policy statements and node size? |
capability/policy/policy.go
Outdated
return nil, err | ||
} | ||
return wildcard{selector: selector, pattern: pattern, glob: g}, nil | ||
return wildcard{selector: selector, pattern: pattern}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imho, you should validate the pattern here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly, you could have a Parse
function or something like that, that return a type (type Pattern string
for example). Then you can attach the "match" function on that type.
Really nitpicking though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MichaelMure is that what you mean? 16ba4b3
Good results from fuzzing, after converting
|
Replace
github.com/gobwas/glob
with spec-based implementation, and perform fuzz tests onMatch
.