diff --git a/.slsa-goreleaser.yml b/.slsa-goreleaser.yml index 68e4bb1..050f887 100644 --- a/.slsa-goreleaser.yml +++ b/.slsa-goreleaser.yml @@ -30,7 +30,7 @@ binary: blip-{{ .Os }}-{{ .Arch }} # (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow. ldflags: - - "-X main.Version={{ .Env.VERSION }}" + # - "-X main.Version={{ .Env.VERSION }}" - "-X main.Commit={{ .Env.COMMIT }}" - "-X main.CommitDate={{ .Env.COMMIT_DATE }}" - "-X main.TreeState={{ .Env.TREE_STATE }}" \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 55dd86f..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Launch", - "type": "go", - "request": "launch", - "mode": "auto", - "program": "main.go", - "env": {}, - "args": [ - "fetch", - "--path", - "https://gitlab.com/hoppr/droppr/-/releases/v0.4.0-dev.5/downloads/droppr_0.4.0-dev.5_windows_amd64.zip" - ] - }, - { - "name": "Launch SBOM", - "type": "go", - "request": "launch", - "mode": "auto", - "program": "main.go", - "args": [ - "validate", - "--sbom", - // "test/blip.cdx.json" - "test/bom.json" - ] - } - ] -} diff --git a/pkg/fetch/fetcher.go b/pkg/fetch/fetcher.go index 8e1df07..39850fa 100644 --- a/pkg/fetch/fetcher.go +++ b/pkg/fetch/fetcher.go @@ -60,8 +60,11 @@ func fetchRequest(path string, file string, username string, password string) er } if username != "" && password != "" { - var bearer = "Bearer " + password request.SetBasicAuth(username, password) + } + + if username == "" && password != "" { + var bearer = "Bearer " + password request.Header.Add("Authorization", bearer) }