Skip to content

Commit

Permalink
chore: clean up curio from Operations (#163)
Browse files Browse the repository at this point in the history
* chore: clean up curio from Operations

* fix: update snapshots
  • Loading branch information
cfabianski committed Nov 24, 2022
1 parent 80b550f commit 595b59b
Show file tree
Hide file tree
Showing 13 changed files with 4 additions and 2,231 deletions.
14 changes: 0 additions & 14 deletions pkg/detectors/internal/testhelper/testhelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
reportdetectors "github.com/bearer/curio/pkg/report/detectors"
"github.com/bearer/curio/pkg/report/frameworks"
"github.com/bearer/curio/pkg/report/interfaces"
"github.com/bearer/curio/pkg/report/operations"
"github.com/bearer/curio/pkg/report/schema"
"github.com/bearer/curio/pkg/report/schema/datatype"
"github.com/bearer/curio/pkg/report/secret"
Expand Down Expand Up @@ -142,19 +141,6 @@ func (report *InMemoryReport) AddCreateView(
})
}

func (report *InMemoryReport) AddOperation(
detectorType reportdetectors.Type,
operation operations.Operation,
source source.Source,
) {
report.Detections = append(report.Detections, &detections.Detection{
DetectorType: detectorType,
Value: operation,
Source: source,
Type: detections.TypeOperation,
})
}

func (report *InMemoryReport) AddInterface(
detectorType reportdetectors.Type,
data interfaces.Interface,
Expand Down
71 changes: 1 addition & 70 deletions pkg/detectors/openapi/.snapshots/TestDetectorV2json
Original file line number Diff line number Diff line change
@@ -1,73 +1,4 @@
([]*detections.Detection) (len=12) {
(*detections.Detection)({
Type: (detections.DetectionType) (len=9) "operation",
DetectorType: (detectors.Type) (len=7) "openapi",
CommitSHA: (string) "",
Source: (source.Source) {
Filename: (string) (len=21) "petstore-swagger.json",
Language: (string) (len=4) "JSON",
LanguageType: (string) (len=4) "data",
LineNumber: (*int)(17),
ColumnNumber: (*int)(7),
Text: (*string)((len=5) "\"get\"")
},
Value: (operations.Operation) {
Path: (string) (len=5) "/pets",
Type: (string) (len=3) "GET",
Urls: ([]operations.Url) (len=1) {
(operations.Url) {
Url: (string) (len=29) "http://petstore.swagger.io/v1",
Variables: ([]operations.Variable) <nil>
}
}
}
}),
(*detections.Detection)({
Type: (detections.DetectionType) (len=9) "operation",
DetectorType: (detectors.Type) (len=7) "openapi",
CommitSHA: (string) "",
Source: (source.Source) {
Filename: (string) (len=21) "petstore-swagger.json",
Language: (string) (len=4) "JSON",
LanguageType: (string) (len=4) "data",
LineNumber: (*int)(58),
ColumnNumber: (*int)(7),
Text: (*string)((len=6) "\"post\"")
},
Value: (operations.Operation) {
Path: (string) (len=5) "/pets",
Type: (string) (len=4) "POST",
Urls: ([]operations.Url) (len=1) {
(operations.Url) {
Url: (string) (len=29) "http://petstore.swagger.io/v1",
Variables: ([]operations.Variable) <nil>
}
}
}
}),
(*detections.Detection)({
Type: (detections.DetectionType) (len=9) "operation",
DetectorType: (detectors.Type) (len=7) "openapi",
CommitSHA: (string) "",
Source: (source.Source) {
Filename: (string) (len=21) "petstore-swagger.json",
Language: (string) (len=4) "JSON",
LanguageType: (string) (len=4) "data",
LineNumber: (*int)(76),
ColumnNumber: (*int)(7),
Text: (*string)((len=5) "\"get\"")
},
Value: (operations.Operation) {
Path: (string) (len=7) "/pets/*",
Type: (string) (len=3) "GET",
Urls: ([]operations.Url) (len=1) {
(operations.Url) {
Url: (string) (len=29) "http://petstore.swagger.io/v1",
Variables: ([]operations.Variable) <nil>
}
}
}
}),
([]*detections.Detection) (len=9) {
(*detections.Detection)({
Type: (detections.DetectionType) (len=6) "schema",
DetectorType: (detectors.Type) (len=7) "openapi",
Expand Down
Loading

0 comments on commit 595b59b

Please sign in to comment.