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

Feat 5059 #5060

Merged
merged 4 commits into from
Apr 23, 2024
Merged

Feat 5059 #5060

merged 4 commits into from
Apr 23, 2024

Conversation

scottdharvey
Copy link
Contributor

@scottdharvey scottdharvey commented Apr 17, 2024

Proposed changes

Currently, protocols.ExecutorOptions.Catalog uses catalog.Catalog while lib.NucleiEngine.Catalog uses *disk.DiskCatalog. However, disk.DiskCatalog satisfies the catalog.Catalog interface by design.

changes:

  1. change lib.NucleiEngine.Catalog to catalog.Catalog
  2. add a lib.NucleiSDKOptions function UseSuppliedCatalog(cat catalog.Catalog) which assigns the supplied catalog to NucleiEngine.catalog
  3. add a nil check to NucleiEngine.init() to use the default disk.DiskCatalog when NucleiEngine.catalog is nil (not assigned by UseSuppliedCatalog`)

#5059

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@GeorginaReeder
Copy link

Thanks so much for your contribution @scottdharvey , we really appreciate it!

lib/config.go Outdated Show resolved Hide resolved
Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm ! there shouldn't be any breaking changes for sdk users, since we are only using catalog interface instead of disk catalog struct

@ehsandeep ehsandeep merged commit 4b9c3b8 into projectdiscovery:dev Apr 23, 2024
9 of 12 checks passed
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 this pull request may close these issues.

Modify lib.NucleiEngine to allow user-provided catalog in SDK mode
5 participants