This commit is contained in:
mzack 2024-03-13 21:46:30 +01:00
parent e9f6febe01
commit a751993808
14 changed files with 29 additions and 29 deletions

View File

@ -20,8 +20,8 @@ import (
"github.com/projectdiscovery/nuclei/v3/pkg/catalog/loader"
"github.com/projectdiscovery/nuclei/v3/pkg/core"
"github.com/projectdiscovery/nuclei/v3/pkg/core/inputs"
parsers "github.com/projectdiscovery/nuclei/v3/pkg/loader/workflow"
"github.com/projectdiscovery/nuclei/v3/pkg/output"
"github.com/projectdiscovery/nuclei/v3/pkg/parsers"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/contextargs"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/hosterrorscache"
@ -101,7 +101,7 @@ func executeNucleiAsLibrary(templatePath, templateURL string) ([]string, error)
ratelimiter := ratelimit.New(context.Background(), 150, time.Second)
defer ratelimiter.Stop()
parser, _ := templates.New()
parser, _ := templates.NewParser()
executerOpts := protocols.ExecutorOptions{
Output: outputWriter,

View File

@ -15,7 +15,7 @@ import (
"github.com/projectdiscovery/nuclei/v3/internal/pdcp"
"github.com/projectdiscovery/nuclei/v3/pkg/installer"
"github.com/projectdiscovery/nuclei/v3/pkg/pparser"
"github.com/projectdiscovery/nuclei/v3/pkg/loader/parser"
uncoverlib "github.com/projectdiscovery/uncover"
pdcpauth "github.com/projectdiscovery/utils/auth/pdcp"
"github.com/projectdiscovery/utils/env"
@ -37,8 +37,8 @@ import (
"github.com/projectdiscovery/nuclei/v3/pkg/core/inputs/hybrid"
"github.com/projectdiscovery/nuclei/v3/pkg/external/customtemplates"
"github.com/projectdiscovery/nuclei/v3/pkg/input"
parsers "github.com/projectdiscovery/nuclei/v3/pkg/loader/workflow"
"github.com/projectdiscovery/nuclei/v3/pkg/output"
"github.com/projectdiscovery/nuclei/v3/pkg/parsers"
"github.com/projectdiscovery/nuclei/v3/pkg/progress"
"github.com/projectdiscovery/nuclei/v3/pkg/projectfile"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols"
@ -88,7 +88,7 @@ type Runner struct {
pdcpUploadErrMsg string
//general purpose temporary directory
tmpDir string
parser pparser.Parser
parser parser.Parser
}
const pprofServerAddress = "127.0.0.1:8086"
@ -150,7 +150,7 @@ func New(options *types.Options) (*Runner, error) {
}
}
parser, err := templates.New()
parser, err := templates.NewParser()
if err != nil {
return nil, err
}

View File

@ -8,8 +8,8 @@ import (
"github.com/projectdiscovery/nuclei/v3/pkg/catalog/loader"
"github.com/projectdiscovery/nuclei/v3/pkg/core"
"github.com/projectdiscovery/nuclei/v3/pkg/core/inputs"
"github.com/projectdiscovery/nuclei/v3/pkg/loader/workflow"
"github.com/projectdiscovery/nuclei/v3/pkg/output"
"github.com/projectdiscovery/nuclei/v3/pkg/parsers"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/contextargs"
"github.com/projectdiscovery/nuclei/v3/pkg/types"
@ -110,7 +110,7 @@ func (e *ThreadSafeNucleiEngine) ExecuteNucleiWithOpts(targets []string, opts ..
}
// load templates
workflowLoader, err := parsers.NewLoader(&unsafeOpts.executerOpts)
workflowLoader, err := workflow.NewLoader(&unsafeOpts.executerOpts)
if err != nil {
return errorutil.New("Could not create workflow loader: %s\n", err)
}

View File

@ -10,8 +10,8 @@ import (
"github.com/projectdiscovery/nuclei/v3/pkg/catalog/loader"
"github.com/projectdiscovery/nuclei/v3/pkg/core"
"github.com/projectdiscovery/nuclei/v3/pkg/core/inputs"
"github.com/projectdiscovery/nuclei/v3/pkg/loader/workflow"
"github.com/projectdiscovery/nuclei/v3/pkg/output"
"github.com/projectdiscovery/nuclei/v3/pkg/parsers"
"github.com/projectdiscovery/nuclei/v3/pkg/progress"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/hosterrorscache"
@ -85,7 +85,7 @@ type NucleiEngine struct {
// LoadAllTemplates loads all nuclei template based on given options
func (e *NucleiEngine) LoadAllTemplates() error {
workflowLoader, err := parsers.NewLoader(&e.executerOpts)
workflowLoader, err := workflow.NewLoader(&e.executerOpts)
if err != nil {
return errorutil.New("Could not create workflow loader: %s\n", err)
}

View File

@ -114,7 +114,7 @@ func (e *NucleiEngine) init() error {
e.httpClient = httpclient
}
if parser, err := templates.New(); err != nil {
if parser, err := templates.NewParser(); err != nil {
return err
} else {
e.parser = parser

View File

@ -1,4 +1,4 @@
package pparser
package parser
import (
"github.com/projectdiscovery/nuclei/v3/pkg/catalog"

View File

@ -1,4 +1,4 @@
package parsers
package workflow
import (
"github.com/projectdiscovery/gologger"

View File

@ -8,7 +8,7 @@ import (
"github.com/projectdiscovery/nuclei/v3/pkg/catalog/config"
"github.com/projectdiscovery/nuclei/v3/pkg/catalog/disk"
"github.com/projectdiscovery/nuclei/v3/pkg/parsers"
"github.com/projectdiscovery/nuclei/v3/pkg/loader/workflow"
"github.com/projectdiscovery/nuclei/v3/pkg/progress"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols"
"github.com/projectdiscovery/nuclei/v3/pkg/templates"
@ -31,7 +31,7 @@ func setup() {
options := testutils.DefaultOptions
testutils.Init(options)
progressImpl, _ := progress.NewStatsTicker(0, false, false, false, 0)
parser, _ = templates.New()
parser, _ = templates.NewParser()
executerOpts = protocols.ExecutorOptions{
Output: testutils.NewMockOutputWriter(options.OmitTemplate),
@ -44,7 +44,7 @@ func setup() {
RateLimiter: ratelimit.New(context.Background(), uint(options.RateLimit), time.Second),
Parser: parser,
}
workflowLoader, err := parsers.NewLoader(&executerOpts)
workflowLoader, err := workflow.NewLoader(&executerOpts)
if err != nil {
log.Fatalf("Could not create workflow loader: %s\n", err)
}

View File

@ -13,12 +13,12 @@ import (
"github.com/projectdiscovery/nuclei/v3/pkg/catalog"
"github.com/projectdiscovery/nuclei/v3/pkg/input"
"github.com/projectdiscovery/nuclei/v3/pkg/js/compiler"
"github.com/projectdiscovery/nuclei/v3/pkg/loader/parser"
"github.com/projectdiscovery/nuclei/v3/pkg/model"
"github.com/projectdiscovery/nuclei/v3/pkg/operators"
"github.com/projectdiscovery/nuclei/v3/pkg/operators/extractors"
"github.com/projectdiscovery/nuclei/v3/pkg/operators/matchers"
"github.com/projectdiscovery/nuclei/v3/pkg/output"
"github.com/projectdiscovery/nuclei/v3/pkg/pparser"
"github.com/projectdiscovery/nuclei/v3/pkg/progress"
"github.com/projectdiscovery/nuclei/v3/pkg/projectfile"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/contextargs"
@ -119,7 +119,7 @@ type ExecutorOptions struct {
OverrideThreadsCount PayloadThreadSetterCallback
//TemporaryDirectory is the directory to store temporary files
TemporaryDirectory string
Parser pparser.Parser
Parser parser.Parser
}
// GetThreadsForPayloadRequests returns the number of threads to use as default for

View File

@ -13,12 +13,12 @@ import (
"github.com/julienschmidt/httprouter"
"github.com/projectdiscovery/nuclei/v3/pkg/catalog/config"
"github.com/projectdiscovery/nuclei/v3/pkg/catalog/disk"
"github.com/projectdiscovery/nuclei/v3/pkg/loader/workflow"
"github.com/projectdiscovery/nuclei/v3/pkg/model"
"github.com/projectdiscovery/nuclei/v3/pkg/model/types/severity"
"github.com/projectdiscovery/nuclei/v3/pkg/model/types/stringslice"
"github.com/projectdiscovery/nuclei/v3/pkg/operators"
"github.com/projectdiscovery/nuclei/v3/pkg/operators/matchers"
"github.com/projectdiscovery/nuclei/v3/pkg/parsers"
"github.com/projectdiscovery/nuclei/v3/pkg/progress"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/generators"
@ -37,7 +37,7 @@ func setup() {
options := testutils.DefaultOptions
testutils.Init(options)
progressImpl, _ := progress.NewStatsTicker(0, false, false, false, 0)
parser, _ := templates.New()
parser, _ := templates.NewParser()
executerOpts = protocols.ExecutorOptions{
Output: testutils.NewMockOutputWriter(options.OmitTemplate),
@ -50,7 +50,7 @@ func setup() {
RateLimiter: ratelimit.New(context.Background(), uint(options.RateLimit), time.Second),
Parser: parser,
}
workflowLoader, err := parsers.NewLoader(&executerOpts)
workflowLoader, err := workflow.NewLoader(&executerOpts)
if err != nil {
log.Fatalf("Could not create workflow loader: %s\n", err)
}

View File

@ -24,7 +24,7 @@ type Parser struct {
compiledTemplatesCache *Cache
}
func New() (*Parser, error) {
func NewParser() (*Parser, error) {
p := &Parser{
parsedTemplatesCache: NewCache(),
compiledTemplatesCache: NewCache(),

View File

@ -14,7 +14,7 @@ import (
func TestLoadTemplate(t *testing.T) {
catalog := disk.NewCatalog("")
p, err := New()
p, err := NewParser()
require.Nil(t, err)
tt := []struct {

View File

@ -8,7 +8,7 @@ import (
"github.com/projectdiscovery/nuclei/v3/pkg/catalog/config"
"github.com/projectdiscovery/nuclei/v3/pkg/catalog/disk"
"github.com/projectdiscovery/nuclei/v3/pkg/parsers"
"github.com/projectdiscovery/nuclei/v3/pkg/loader/workflow"
"github.com/projectdiscovery/nuclei/v3/pkg/progress"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/contextargs"
@ -25,7 +25,7 @@ func setup() {
options := testutils.DefaultOptions
testutils.Init(options)
progressImpl, _ := progress.NewStatsTicker(0, false, false, false, 0)
parser, _ := templates.New()
parser, _ := templates.NewParser()
executerOpts = protocols.ExecutorOptions{
Output: testutils.NewMockOutputWriter(options.OmitTemplate),
@ -38,7 +38,7 @@ func setup() {
RateLimiter: ratelimit.New(context.Background(), uint(options.RateLimit), time.Second),
Parser: parser,
}
workflowLoader, err := parsers.NewLoader(&executerOpts)
workflowLoader, err := workflow.NewLoader(&executerOpts)
if err != nil {
log.Fatalf("Could not create workflow loader: %s\n", err)
}

View File

@ -8,7 +8,7 @@ import (
"github.com/projectdiscovery/nuclei/v3/pkg/catalog/config"
"github.com/projectdiscovery/nuclei/v3/pkg/catalog/disk"
"github.com/projectdiscovery/nuclei/v3/pkg/parsers"
"github.com/projectdiscovery/nuclei/v3/pkg/loader/workflow"
"github.com/projectdiscovery/nuclei/v3/pkg/progress"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/contextargs"
@ -25,7 +25,7 @@ func setup() {
options := testutils.DefaultOptions
testutils.Init(options)
progressImpl, _ := progress.NewStatsTicker(0, false, false, false, 0)
parser, _ := templates.New()
parser, _ := templates.NewParser()
executerOpts = protocols.ExecutorOptions{
Output: testutils.NewMockOutputWriter(options.OmitTemplate),
@ -38,7 +38,7 @@ func setup() {
RateLimiter: ratelimit.New(context.Background(), uint(options.RateLimit), time.Second),
Parser: parser,
}
workflowLoader, err := parsers.NewLoader(&executerOpts)
workflowLoader, err := workflow.NewLoader(&executerOpts)
if err != nil {
log.Fatalf("Could not create workflow loader: %s\n", err)
}