Skip to content
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

accept classifier interface in analyzer #29

Closed
breml opened this issue Sep 17, 2023 · 1 comment · Fixed by #30
Closed

accept classifier interface in analyzer #29

breml opened this issue Sep 17, 2023 · 1 comment · Fixed by #30

Comments

@breml
Copy link
Contributor

breml commented Sep 17, 2023

Currently the public functions in package github.com/google/capslock/analyzer accept a *interesting.Classifier as an argument. For external usage of this package, it would be beneficial, if these functions would instead accept an interface as follows:

type Classifier interface {
	FunctionCategory(pkg string, name string) cpb.Capability
	IncludeCall(caller string, callee string) bool
}

This would allow users of this package to write their own classifiers or to extend the provided classifiers e.g. by wrapping them (middleware approach).

I am happy to provide a PR for this.

@jcd2
Copy link
Collaborator

jcd2 commented Sep 18, 2023

Good idea, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants