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

Make OSV api public #167

Merged
merged 7 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/output/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"path/filepath"
"strings"

"github.com/google/osv-scanner/internal/osv"
"github.com/google/osv-scanner/pkg/models"
"github.com/google/osv-scanner/pkg/osv/v1"
another-rex marked this conversation as resolved.
Show resolved Hide resolved

"github.com/jedib0t/go-pretty/v6/table"
"github.com/jedib0t/go-pretty/v6/text"
Expand Down
1 change: 1 addition & 0 deletions internal/osv/osv.go → pkg/osv/v1/osv.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ func checkResponseError(resp *http.Response) error {
return fmt.Errorf("server response error: %s", string(respBuf))
another-rex marked this conversation as resolved.
Show resolved Hide resolved
}

// MakeRequest sends a batched query to osv.dev
func MakeRequest(request BatchedQuery) (*BatchedResponse, error) {
// API has a limit of 1000 bulk query per request
queryChunks := chunkBy(request.Queries, MaxQueriesPerRequest)
Expand Down
2 changes: 1 addition & 1 deletion pkg/osvscanner/osvscanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
"path/filepath"
"strings"

"github.com/google/osv-scanner/internal/osv"
"github.com/google/osv-scanner/internal/output"
"github.com/google/osv-scanner/internal/sbom"
"github.com/google/osv-scanner/pkg/config"
"github.com/google/osv-scanner/pkg/lockfile"
"github.com/google/osv-scanner/pkg/models"
"github.com/google/osv-scanner/pkg/osv/v1"
)

type ScannerActions struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/osvscanner/vulnerability_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package osvscanner
import (
"fmt"

"github.com/google/osv-scanner/internal/osv"
"github.com/google/osv-scanner/internal/output"
"github.com/google/osv-scanner/pkg/grouper"
"github.com/google/osv-scanner/pkg/models"
"github.com/google/osv-scanner/pkg/osv/v1"
)

// groupResponseBySource converts raw OSV API response into structured vulnerability information
Expand Down
2 changes: 1 addition & 1 deletion pkg/osvscanner/vulnerability_result_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"reflect"
"testing"

"github.com/google/osv-scanner/internal/osv"
"github.com/google/osv-scanner/internal/output"
"github.com/google/osv-scanner/pkg/models"
"github.com/google/osv-scanner/pkg/osv/v1"
)

func Test_groupResponseBySource(t *testing.T) {
Expand Down