This commit is contained in:
Tristan Weir 2018-12-17 14:45:53 -08:00
Родитель 0bb216ac37
Коммит 8ee954597b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 1C5E6CBF4E06FB04
1 изменённых файлов: 30 добавлений и 32 удалений

Просмотреть файл

@ -13,12 +13,12 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"log"
"net" "net"
"net/http" "net/http"
"os" "os"
"strings" "strings"
"time" "time"
"log"
"github.com/mozilla/gozdef" "github.com/mozilla/gozdef"
"github.com/mozilla/mig" "github.com/mozilla/mig"
@ -102,7 +102,6 @@ func main() {
log.Println(err) log.Println(err)
} }
buf, err := ioutil.ReadAll(os.Stdin) buf, err := ioutil.ReadAll(os.Stdin)
if err != nil { if err != nil {
log.Println(err) log.Println(err)
@ -272,7 +271,6 @@ func GetAuthToken(api ServiceApi) (string, error) {
"audience": "%s" "audience": "%s"
}`, api.ClientID, api.ClientSecret, api.URL)) }`, api.ClientID, api.ClientSecret, api.URL))
req, err := http.NewRequest("POST", api.AuthEndpoint, payload) req, err := http.NewRequest("POST", api.AuthEndpoint, payload)
if err != nil { if err != nil {
return "", err return "", err
@ -306,7 +304,7 @@ func GetAuthToken(api ServiceApi) (string, error) {
// query a ServiceAPI instance for the set of all assets // query a ServiceAPI instance for the set of all assets
// load them into a searchable map, keyed to asset hostname // load them into a searchable map, keyed to asset hostname
// the ServiceAPI object must already be loaded with a Bearer token // the ServiceAPI object must already be loaded with a Bearer token
func GetAssets(m map[string]ServiceApiAsset, api ServiceApi) (error){ func GetAssets(m map[string]ServiceApiAsset, api ServiceApi) error {
// get json array of assets from serviceapi // get json array of assets from serviceapi
requestURL := api.URL + "api/v1/assets/" requestURL := api.URL + "api/v1/assets/"