mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
improve error handling in vulnerabilities cron (#7276)
* improve error handling in vulnerabilities cron * fix tests * Use errHandler and go mod tidy * Add dep that got removed by mod tidy * add dsl to tools * Add changes file Co-authored-by: Michal Nicpon <michal@fleetdm.com> Co-authored-by: Tomas Touceda <chiiph@gmail.com>
This commit is contained in:
parent
ba86865231
commit
2103de275a
8 changed files with 200 additions and 212 deletions
1
changes/zwinnerman-michal-fix-cron-vulnerabilities
Normal file
1
changes/zwinnerman-michal-fix-cron-vulnerabilities
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Vulnerabilities cron is able to pickup changes in app config at runtime.
|
||||
|
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
"strconv"
|
||||
|
|
@ -26,7 +27,7 @@ import (
|
|||
)
|
||||
|
||||
func errHandler(ctx context.Context, logger kitlog.Logger, msg string, err error) {
|
||||
level.Error(logger).Log("err", msg, "details", err)
|
||||
level.Error(logger).Log("msg", msg, "err", err)
|
||||
sentry.CaptureException(err)
|
||||
ctxerr.Handle(ctx, err)
|
||||
}
|
||||
|
|
@ -41,53 +42,23 @@ func cronVulnerabilities(
|
|||
logger = kitlog.With(logger, "cron", lockKeyVulnerabilities)
|
||||
|
||||
if config.CurrentInstanceChecks == "no" || config.CurrentInstanceChecks == "0" {
|
||||
level.Info(logger).Log("vulnerability scanning", "host not configured to check for vulnerabilities")
|
||||
level.Info(logger).Log("msg", "host not configured to check for vulnerabilities")
|
||||
return
|
||||
}
|
||||
|
||||
appConfig, err := ds.AppConfig(ctx)
|
||||
if err != nil {
|
||||
level.Error(logger).Log("config", "couldn't read app config", "err", err)
|
||||
return
|
||||
}
|
||||
// release the lock when this function exits
|
||||
defer func() {
|
||||
// use a different context that won't be cancelled when shutting down
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
|
||||
vulnDisabled := false
|
||||
if appConfig.VulnerabilitySettings.DatabasesPath == "" &&
|
||||
config.DatabasesPath == "" {
|
||||
level.Info(logger).Log("vulnerability scanning", "not configured")
|
||||
vulnDisabled = true
|
||||
}
|
||||
if !appConfig.HostSettings.EnableSoftwareInventory {
|
||||
level.Info(logger).Log("software inventory", "not configured")
|
||||
return
|
||||
}
|
||||
|
||||
vulnPath := appConfig.VulnerabilitySettings.DatabasesPath
|
||||
if vulnPath == "" {
|
||||
vulnPath = config.DatabasesPath
|
||||
}
|
||||
if config.DatabasesPath != "" && config.DatabasesPath != vulnPath {
|
||||
vulnPath = config.DatabasesPath
|
||||
level.Info(logger).Log(
|
||||
"databases_path", "fleet config takes precedence over app config when both are configured",
|
||||
"result", vulnPath)
|
||||
}
|
||||
|
||||
if !vulnDisabled {
|
||||
level.Info(logger).Log("databases-path", vulnPath)
|
||||
}
|
||||
level.Info(logger).Log("periodicity", config.Periodicity)
|
||||
|
||||
if !vulnDisabled {
|
||||
if config.CurrentInstanceChecks == "auto" {
|
||||
level.Debug(logger).Log("current instance checks", "auto", "trying to create databases-path", vulnPath)
|
||||
err := os.MkdirAll(vulnPath, 0o755)
|
||||
if err != nil {
|
||||
level.Error(logger).Log("databases-path", "creation failed, returning", "err", err)
|
||||
return
|
||||
}
|
||||
err := ds.Unlock(ctx, lockKeyVulnerabilities, identifier)
|
||||
if err != nil {
|
||||
errHandler(ctx, logger, "error releasing lock", err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
level.Info(logger).Log("periodicity", config.Periodicity)
|
||||
|
||||
ticker := time.NewTicker(10 * time.Second)
|
||||
for {
|
||||
|
|
@ -100,6 +71,7 @@ func cronVulnerabilities(
|
|||
level.Debug(logger).Log("exit", "done with cron.")
|
||||
return
|
||||
}
|
||||
|
||||
if config.CurrentInstanceChecks == "auto" {
|
||||
if locked, err := ds.Lock(ctx, lockKeyVulnerabilities, identifier, 1*time.Hour); err != nil {
|
||||
errHandler(ctx, logger, "error acquiring lock", err)
|
||||
|
|
@ -110,102 +82,145 @@ func cronVulnerabilities(
|
|||
}
|
||||
}
|
||||
|
||||
if !vulnDisabled {
|
||||
// refresh app config to check if webhook or any jira integration is
|
||||
// enabled, as this can be changed dynamically.
|
||||
if freshAppConfig, err := ds.AppConfig(ctx); err != nil {
|
||||
errHandler(ctx, logger, "couldn't refresh app config", err)
|
||||
// continue with stale app config
|
||||
} else {
|
||||
appConfig = freshAppConfig
|
||||
}
|
||||
appConfig, err := ds.AppConfig(ctx)
|
||||
if err != nil {
|
||||
errHandler(ctx, logger, "couldn't read app config", err)
|
||||
continue
|
||||
}
|
||||
|
||||
var vulnAutomationEnabled string
|
||||
if !appConfig.HostSettings.EnableSoftwareInventory {
|
||||
level.Info(logger).Log("msg", "software inventory not configured")
|
||||
continue
|
||||
}
|
||||
|
||||
// only one vuln automation (i.e. webhook or integration) can be enabled at a
|
||||
// time, enforced when updating the appconfig.
|
||||
if appConfig.WebhookSettings.VulnerabilitiesWebhook.Enable {
|
||||
vulnAutomationEnabled = "webhook"
|
||||
}
|
||||
// check for jira integrations
|
||||
for _, j := range appConfig.Integrations.Jira {
|
||||
if j.EnableSoftwareVulnerabilities {
|
||||
if vulnAutomationEnabled != "" {
|
||||
err := ctxerr.New(ctx, "jira check")
|
||||
errHandler(ctx, logger, "more than one automation enabled", err)
|
||||
}
|
||||
vulnAutomationEnabled = "jira"
|
||||
break
|
||||
}
|
||||
}
|
||||
// check for Zendesk integrations
|
||||
for _, z := range appConfig.Integrations.Zendesk {
|
||||
if z.EnableSoftwareVulnerabilities {
|
||||
if vulnAutomationEnabled != "" {
|
||||
err := ctxerr.New(ctx, "zendesk check")
|
||||
errHandler(ctx, logger, "more than one automation enabled", err)
|
||||
}
|
||||
vulnAutomationEnabled = "zendesk"
|
||||
break
|
||||
}
|
||||
}
|
||||
level.Debug(logger).Log("vulnAutomationEnabled", vulnAutomationEnabled)
|
||||
|
||||
collectVulns := vulnAutomationEnabled != ""
|
||||
nvdVulns := checkNVDVulnerabilities(ctx, ds, logger, vulnPath, config, collectVulns)
|
||||
ovalVulns := checkOvalVulnerabilities(ctx, ds, logger, vulnPath, config, collectVulns)
|
||||
recentVulns := filterRecentVulns(ctx, ds, logger, nvdVulns, ovalVulns, config.RecentVulnerabilityMaxAge)
|
||||
|
||||
if len(recentVulns) > 0 {
|
||||
switch vulnAutomationEnabled {
|
||||
case "webhook":
|
||||
// send recent vulnerabilities via webhook
|
||||
if err := webhooks.TriggerVulnerabilitiesWebhook(
|
||||
ctx,
|
||||
ds,
|
||||
kitlog.With(logger, "webhook", "vulnerabilities"),
|
||||
recentVulns,
|
||||
appConfig,
|
||||
time.Now()); err != nil {
|
||||
errHandler(ctx, logger, "triggering vulnerabilities webhook", err)
|
||||
}
|
||||
|
||||
case "jira":
|
||||
// queue job to create jira issues
|
||||
if err := worker.QueueJiraVulnJobs(
|
||||
ctx,
|
||||
ds,
|
||||
kitlog.With(logger, "jira", "vulnerabilities"),
|
||||
recentVulns,
|
||||
); err != nil {
|
||||
errHandler(ctx, logger, "queueing vulnerabilities to jira", err)
|
||||
}
|
||||
|
||||
case "zendesk":
|
||||
// queue job to create zendesk ticket
|
||||
if err := worker.QueueZendeskVulnJobs(
|
||||
ctx,
|
||||
ds,
|
||||
kitlog.With(logger, "zendesk", "vulnerabilities"),
|
||||
recentVulns,
|
||||
); err != nil {
|
||||
errHandler(ctx, logger, "queueing vulnerabilities to Zendesk", err)
|
||||
}
|
||||
|
||||
default:
|
||||
err = ctxerr.New(ctx, "no vuln automations enabled")
|
||||
errHandler(ctx, logger, "attempting to process vuln automations", err)
|
||||
}
|
||||
var vulnPath string
|
||||
switch {
|
||||
case config.DatabasesPath != "" && appConfig.VulnerabilitySettings.DatabasesPath != "":
|
||||
vulnPath = config.DatabasesPath
|
||||
level.Info(logger).Log(
|
||||
"msg", "fleet config takes precedence over app config when both are configured",
|
||||
"databases_path", vulnPath,
|
||||
)
|
||||
case config.DatabasesPath != "":
|
||||
vulnPath = config.DatabasesPath
|
||||
case appConfig.VulnerabilitySettings.DatabasesPath != "":
|
||||
vulnPath = appConfig.VulnerabilitySettings.DatabasesPath
|
||||
default:
|
||||
level.Info(logger).Log("msg", "vulnerability scanning not configured, vulnerabilities databases path is empty")
|
||||
}
|
||||
if vulnPath != "" {
|
||||
level.Info(logger).Log("msg", "scanning vulnerabilities")
|
||||
if err := scanVulnerabilities(ctx, ds, logger, config, appConfig, vulnPath); err != nil {
|
||||
errHandler(ctx, logger, "scanning vulnerabilities", err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := ds.SyncHostsSoftware(ctx, time.Now()); err != nil {
|
||||
errHandler(ctx, logger, "calculating hosts count per software", err)
|
||||
}
|
||||
|
||||
level.Debug(logger).Log("loop", "done")
|
||||
}
|
||||
}
|
||||
|
||||
func scanVulnerabilities(
|
||||
ctx context.Context,
|
||||
ds fleet.Datastore,
|
||||
logger kitlog.Logger,
|
||||
config *config.VulnerabilitiesConfig,
|
||||
appConfig *fleet.AppConfig,
|
||||
vulnPath string,
|
||||
) error {
|
||||
level.Debug(logger).Log("msg", "creating vulnerabilities databases path", "databases_path", vulnPath)
|
||||
err := os.MkdirAll(vulnPath, 0o755)
|
||||
if err != nil {
|
||||
return fmt.Errorf("create vulnerabilities databases directory: %w", err)
|
||||
}
|
||||
|
||||
var vulnAutomationEnabled string
|
||||
|
||||
// only one vuln automation (i.e. webhook or integration) can be enabled at a
|
||||
// time, enforced when updating the appconfig.
|
||||
if appConfig.WebhookSettings.VulnerabilitiesWebhook.Enable {
|
||||
vulnAutomationEnabled = "webhook"
|
||||
}
|
||||
|
||||
// check for jira integrations
|
||||
for _, j := range appConfig.Integrations.Jira {
|
||||
if j.EnableSoftwareVulnerabilities {
|
||||
if vulnAutomationEnabled != "" {
|
||||
err := ctxerr.New(ctx, "jira check")
|
||||
errHandler(ctx, logger, "more than one automation enabled", err)
|
||||
}
|
||||
vulnAutomationEnabled = "jira"
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// check for Zendesk integrations
|
||||
for _, z := range appConfig.Integrations.Zendesk {
|
||||
if z.EnableSoftwareVulnerabilities {
|
||||
if vulnAutomationEnabled != "" {
|
||||
err := ctxerr.New(ctx, "zendesk check")
|
||||
errHandler(ctx, logger, "more than one automation enabled", err)
|
||||
}
|
||||
vulnAutomationEnabled = "zendesk"
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
level.Debug(logger).Log("vulnAutomationEnabled", vulnAutomationEnabled)
|
||||
|
||||
collectVulns := vulnAutomationEnabled != ""
|
||||
nvdVulns := checkNVDVulnerabilities(ctx, ds, logger, vulnPath, config, collectVulns)
|
||||
ovalVulns := checkOvalVulnerabilities(ctx, ds, logger, vulnPath, config, collectVulns)
|
||||
recentVulns := filterRecentVulns(ctx, ds, logger, nvdVulns, ovalVulns, config.RecentVulnerabilityMaxAge)
|
||||
|
||||
if len(recentVulns) > 0 {
|
||||
switch vulnAutomationEnabled {
|
||||
case "webhook":
|
||||
// send recent vulnerabilities via webhook
|
||||
if err := webhooks.TriggerVulnerabilitiesWebhook(
|
||||
ctx,
|
||||
ds,
|
||||
kitlog.With(logger, "webhook", "vulnerabilities"),
|
||||
recentVulns,
|
||||
appConfig,
|
||||
time.Now()); err != nil {
|
||||
errHandler(ctx, logger, "triggering vulnerabilities webhook", err)
|
||||
}
|
||||
|
||||
case "jira":
|
||||
// queue job to create jira issues
|
||||
if err := worker.QueueJiraVulnJobs(
|
||||
ctx,
|
||||
ds,
|
||||
kitlog.With(logger, "jira", "vulnerabilities"),
|
||||
recentVulns,
|
||||
); err != nil {
|
||||
errHandler(ctx, logger, "queueing vulnerabilities to jira", err)
|
||||
}
|
||||
|
||||
case "zendesk":
|
||||
// queue job to create zendesk ticket
|
||||
if err := worker.QueueZendeskVulnJobs(
|
||||
ctx,
|
||||
ds,
|
||||
kitlog.With(logger, "zendesk", "vulnerabilities"),
|
||||
recentVulns,
|
||||
); err != nil {
|
||||
errHandler(ctx, logger, "queueing vulnerabilities to Zendesk", err)
|
||||
}
|
||||
|
||||
default:
|
||||
err = ctxerr.New(ctx, "no vuln automations enabled")
|
||||
errHandler(ctx, logger, "attempting to process vuln automations", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func filterRecentVulns(
|
||||
ctx context.Context,
|
||||
ds fleet.Datastore,
|
||||
|
|
|
|||
|
|
@ -3,11 +3,13 @@ package main
|
|||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
|
|
@ -193,6 +195,7 @@ func TestCronWebhooks(t *testing.T) {
|
|||
func TestCronVulnerabilitiesCreatesDatabasesPath(t *testing.T) {
|
||||
ctx, cancelFunc := context.WithCancel(context.Background())
|
||||
defer cancelFunc()
|
||||
|
||||
ds := new(mock.Store)
|
||||
ds.AppConfigFunc = func(ctx context.Context) (*fleet.AppConfig, error) {
|
||||
return &fleet.AppConfig{
|
||||
|
|
@ -205,6 +208,19 @@ func TestCronVulnerabilitiesCreatesDatabasesPath(t *testing.T) {
|
|||
ds.UnlockFunc = func(ctx context.Context, name string, owner string) error {
|
||||
return nil
|
||||
}
|
||||
ds.InsertCVEMetaFunc = func(ctx context.Context, x []fleet.CVEMeta) error {
|
||||
return nil
|
||||
}
|
||||
ds.AllSoftwareWithoutCPEIteratorFunc = func(ctx context.Context, excludedPlatforms []string) (fleet.SoftwareIterator, error) {
|
||||
// we should not get this far before we see the directory being created
|
||||
return nil, errors.New("shouldn't happen")
|
||||
}
|
||||
ds.OSVersionsFunc = func(ctx context.Context, teamID *uint, platform *string, osID *uint) (*fleet.OSVersions, error) {
|
||||
return &fleet.OSVersions{}, nil
|
||||
}
|
||||
ds.SyncHostsSoftwareFunc = func(ctx context.Context, updatedAt time.Time) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
vulnPath := path.Join(t.TempDir(), "something")
|
||||
require.NoDirExists(t, vulnPath)
|
||||
|
|
@ -215,14 +231,21 @@ func TestCronVulnerabilitiesCreatesDatabasesPath(t *testing.T) {
|
|||
CurrentInstanceChecks: "auto",
|
||||
}
|
||||
|
||||
// We cancel right away so cronsVulnerailities finishes. The logic we are testing happens before the loop starts
|
||||
cancelFunc()
|
||||
cronVulnerabilities(ctx, ds, kitlog.NewNopLogger(), "AAA", &config)
|
||||
go cronVulnerabilities(ctx, ds, kitlog.NewNopLogger(), "AAA", &config)
|
||||
|
||||
require.DirExists(t, vulnPath)
|
||||
require.Eventually(t, func() bool {
|
||||
info, err := os.Lstat(vulnPath)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if !info.IsDir() {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}, 5*time.Minute, 30*time.Second)
|
||||
}
|
||||
|
||||
func TestCronVulnerabilitiesAcceptsExistingDbPath(t *testing.T) {
|
||||
func TestCronVulnerabilitiesMkdirFailsIfVulnPathIsFile(t *testing.T) {
|
||||
buf := new(bytes.Buffer)
|
||||
logger := kitlog.NewJSONLogger(buf)
|
||||
logger = level.NewFilter(logger, level.AllowDebug())
|
||||
|
|
@ -241,40 +264,11 @@ func TestCronVulnerabilitiesAcceptsExistingDbPath(t *testing.T) {
|
|||
ds.UnlockFunc = func(ctx context.Context, name string, owner string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
config := config.VulnerabilitiesConfig{
|
||||
DatabasesPath: t.TempDir(),
|
||||
Periodicity: 10 * time.Second,
|
||||
CurrentInstanceChecks: "auto",
|
||||
}
|
||||
|
||||
// We cancel right away so cronsVulnerailities finishes. The logic we are testing happens before the loop starts
|
||||
cancelFunc()
|
||||
cronVulnerabilities(ctx, ds, logger, "AAA", &config)
|
||||
|
||||
require.Contains(t, buf.String(), `"waiting":"on ticker"`)
|
||||
}
|
||||
|
||||
func TestCronVulnerabilitiesQuitsIfErrorVulnPath(t *testing.T) {
|
||||
buf := new(bytes.Buffer)
|
||||
logger := kitlog.NewJSONLogger(buf)
|
||||
logger = level.NewFilter(logger, level.AllowDebug())
|
||||
|
||||
ctx, cancelFunc := context.WithCancel(context.Background())
|
||||
defer cancelFunc()
|
||||
ds := new(mock.Store)
|
||||
ds.AppConfigFunc = func(ctx context.Context) (*fleet.AppConfig, error) {
|
||||
return &fleet.AppConfig{
|
||||
HostSettings: fleet.HostSettings{EnableSoftwareInventory: true},
|
||||
}, nil
|
||||
}
|
||||
ds.LockFunc = func(ctx context.Context, name string, owner string, expiration time.Duration) (bool, error) {
|
||||
return true, nil
|
||||
}
|
||||
ds.UnlockFunc = func(ctx context.Context, name string, owner string) error {
|
||||
ds.SyncHostsSoftwareFunc = func(ctx context.Context, updatedAt time.Time) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// creating a file with the same path should result in an error when creating the directory
|
||||
fileVulnPath := path.Join(t.TempDir(), "somefile")
|
||||
_, err := os.Create(fileVulnPath)
|
||||
require.NoError(t, err)
|
||||
|
|
@ -286,13 +280,14 @@ func TestCronVulnerabilitiesQuitsIfErrorVulnPath(t *testing.T) {
|
|||
}
|
||||
|
||||
// We cancel right away so cronsVulnerailities finishes. The logic we are testing happens before the loop starts
|
||||
cancelFunc()
|
||||
cronVulnerabilities(ctx, ds, logger, "AAA", &config)
|
||||
go cronVulnerabilities(ctx, ds, logger, "AAA", &config)
|
||||
|
||||
require.Contains(t, buf.String(), `"databases-path":"creation failed, returning"`)
|
||||
require.Eventually(t, func() bool {
|
||||
return strings.Contains(buf.String(), "create vulnerabilities databases directory: mkdir")
|
||||
}, 1*time.Minute, 5*time.Second)
|
||||
}
|
||||
|
||||
func TestCronVulnerabilitiesSkipCreationIfStatic(t *testing.T) {
|
||||
func TestCronVulnerabilitiesSkipMkdirIfDisabled(t *testing.T) {
|
||||
buf := new(bytes.Buffer)
|
||||
logger := kitlog.NewJSONLogger(buf)
|
||||
logger = level.NewFilter(logger, level.AllowDebug())
|
||||
|
|
@ -301,6 +296,7 @@ func TestCronVulnerabilitiesSkipCreationIfStatic(t *testing.T) {
|
|||
defer cancelFunc()
|
||||
ds := new(mock.Store)
|
||||
ds.AppConfigFunc = func(ctx context.Context) (*fleet.AppConfig, error) {
|
||||
// host_settings.enable_software_inventory is false
|
||||
return &fleet.AppConfig{}, nil
|
||||
}
|
||||
ds.LockFunc = func(ctx context.Context, name string, owner string, expiration time.Duration) (bool, error) {
|
||||
|
|
@ -309,6 +305,9 @@ func TestCronVulnerabilitiesSkipCreationIfStatic(t *testing.T) {
|
|||
ds.UnlockFunc = func(ctx context.Context, name string, owner string) error {
|
||||
return nil
|
||||
}
|
||||
ds.SyncHostsSoftwareFunc = func(ctx context.Context, updatedAt time.Time) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
vulnPath := path.Join(t.TempDir(), "something")
|
||||
require.NoDirExists(t, vulnPath)
|
||||
|
|
@ -319,9 +318,11 @@ func TestCronVulnerabilitiesSkipCreationIfStatic(t *testing.T) {
|
|||
CurrentInstanceChecks: "1",
|
||||
}
|
||||
|
||||
// We cancel right away so cronsVulnerailities finishes. The logic we are testing happens before the loop starts
|
||||
cancelFunc()
|
||||
cronVulnerabilities(ctx, ds, logger, "AAA", &config)
|
||||
go cronVulnerabilities(ctx, ds, logger, "AAA", &config)
|
||||
|
||||
require.Eventually(t, func() bool {
|
||||
return strings.Contains(buf.String(), "done")
|
||||
}, 1*time.Minute, 5*time.Second)
|
||||
|
||||
require.NoDirExists(t, vulnPath)
|
||||
}
|
||||
|
|
|
|||
6
go.mod
6
go.mod
|
|
@ -65,6 +65,7 @@ require (
|
|||
github.com/patrickmn/go-cache v2.1.0+incompatible
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/prometheus/client_golang v1.12.2
|
||||
github.com/quasilyte/go-ruleguard/dsl v0.3.21
|
||||
github.com/rs/zerolog v1.20.0
|
||||
github.com/russellhaering/goxmldsig v1.1.0
|
||||
github.com/sethvargo/go-password v0.2.0
|
||||
|
|
@ -88,6 +89,7 @@ require (
|
|||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.7.0
|
||||
go.opentelemetry.io/otel/sdk v1.7.0
|
||||
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
|
||||
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f
|
||||
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad
|
||||
google.golang.org/grpc v1.47.0
|
||||
gopkg.in/guregu/null.v3 v3.4.0
|
||||
|
|
@ -222,7 +224,6 @@ require (
|
|||
github.com/jonboulle/clockwork v0.2.2 // indirect
|
||||
github.com/kevinburke/ssh_config v1.1.0 // indirect
|
||||
github.com/klauspost/compress v1.15.0 // indirect
|
||||
github.com/lib/pq v1.10.2 // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
|
||||
github.com/magiconair/properties v1.8.5 // indirect
|
||||
github.com/mattn/go-colorable v0.1.11 // indirect
|
||||
|
|
@ -247,7 +248,6 @@ require (
|
|||
github.com/prometheus/client_model v0.2.0 // indirect
|
||||
github.com/prometheus/common v0.32.1 // indirect
|
||||
github.com/prometheus/procfs v0.7.3 // indirect
|
||||
github.com/quasilyte/go-ruleguard/dsl v0.3.21 // indirect
|
||||
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
|
||||
github.com/rogpeppe/go-internal v1.8.1 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
|
|
@ -275,7 +275,6 @@ require (
|
|||
github.com/yashtewari/glob-intersection v0.1.0 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.2 // indirect
|
||||
github.com/zclconf/go-cty v1.1.0 // indirect
|
||||
github.com/ziutek/mymysql v1.5.4 // indirect
|
||||
go.elastic.co/apm v1.15.0 // indirect
|
||||
go.elastic.co/fastjson v1.1.0 // indirect
|
||||
go.opencensus.io v0.23.0 // indirect
|
||||
|
|
@ -290,7 +289,6 @@ require (
|
|||
golang.org/x/mod v0.5.1 // indirect
|
||||
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
|
||||
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
|
||||
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
|
||||
|
|
|
|||
28
go.sum
28
go.sum
|
|
@ -197,9 +197,7 @@ github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/
|
|||
github.com/ProtonMail/go-crypto v0.0.0-20210512092938-c05353c2d58c h1:bNpaLLv2Y4kslsdkdCwAYu8Bak1aGVtxwi8Z/wy4Yuo=
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20210512092938-c05353c2d58c/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo=
|
||||
github.com/ProtonMail/go-mime v0.0.0-20190923161245-9b5a4261663a h1:W6RrgN/sTxg1msqzFFb+G80MFmpjMw61IU+slm+wln4=
|
||||
github.com/ProtonMail/go-mime v0.0.0-20190923161245-9b5a4261663a/go.mod h1:NYt+V3/4rEeDuaev/zw1zCq8uqVEuPHzDPo3OZrlGJ4=
|
||||
github.com/ProtonMail/gopenpgp/v2 v2.2.2 h1:u2m7xt+CZWj88qK1UUNBoXeJCFJwJCZ/Ff4ymGoxEXs=
|
||||
github.com/ProtonMail/gopenpgp/v2 v2.2.2/go.mod h1:ajUlBGvxMH1UBZnaYO3d1FSVzjiC6kK9XlZYGiDCvpM=
|
||||
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
|
||||
|
|
@ -224,14 +222,11 @@ github.com/agnivade/levenshtein v1.0.1 h1:3oJU7J3FGFmyhn8KHjmVaZCN5hxTr7GxgRue+s
|
|||
github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
|
||||
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
|
||||
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
|
||||
github.com/alecthomas/jsonschema v0.0.0-20210920000243-787cd8204a0d/go.mod h1:/n6+1/DWPltRLWL/VKyUxg6tzsl5kHUCcraimt4vr60=
|
||||
github.com/alecthomas/jsonschema v0.0.0-20211022214203-8b29eab41725 h1:NjwIgLQlD46o79bheVG4SCdRnnOz4XtgUN1WABX5DLA=
|
||||
github.com/alecthomas/jsonschema v0.0.0-20211022214203-8b29eab41725/go.mod h1:/n6+1/DWPltRLWL/VKyUxg6tzsl5kHUCcraimt4vr60=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0=
|
||||
|
|
@ -338,7 +333,6 @@ github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGr
|
|||
github.com/caarlos0/env/v6 v6.7.0 h1:OftrMgQyETinUI4YU3WxhHeKtCRonDMtnUO14+ZRXdY=
|
||||
github.com/caarlos0/env/v6 v6.7.0/go.mod h1:FE0jGiAnQqtv2TenJ4KTa8+/T2Ss8kdS5s1VEjasoN0=
|
||||
github.com/caarlos0/go-rpmutils v0.2.1-0.20211112020245-2cd62ff89b11 h1:IRrDwVlWQr6kS1U8/EtyA1+EHcc4yl8pndcqXWrEamg=
|
||||
github.com/caarlos0/go-rpmutils v0.2.1-0.20211112020245-2cd62ff89b11/go.mod h1:je2KZ+LxaCNvCoKg32jtOIULcFogJKcL1ZWUaIBjKj0=
|
||||
github.com/caarlos0/go-shellwords v1.0.12 h1:HWrUnu6lGbWfrDcFiHcZiwOLzHWjjrPVehULaTFgPp8=
|
||||
github.com/caarlos0/go-shellwords v1.0.12/go.mod h1:bYeeX1GrTLPl5cAMYEzdm272qdsQAZiaHgeF0KTk1Gw=
|
||||
github.com/caarlos0/testfs v0.4.3 h1:q1zEM5hgsssqWanAfevJYYa0So60DdK6wlJeTc/yfUE=
|
||||
|
|
@ -513,7 +507,6 @@ github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+
|
|||
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||
github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=
|
||||
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
|
|
@ -789,7 +782,6 @@ github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP
|
|||
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
||||
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
|
||||
github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
|
||||
|
|
@ -960,7 +952,6 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2
|
|||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks=
|
||||
|
|
@ -1078,7 +1069,6 @@ github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dv
|
|||
github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
|
||||
github.com/jackc/puddle v1.1.2/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
|
||||
github.com/jarcoal/httpmock v1.0.8 h1:8kI16SoO6LQKgPE7PvQuV+YuD/inwHd7fOOe2zMbo4k=
|
||||
github.com/jarcoal/httpmock v1.0.8/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik=
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
|
||||
github.com/jcchavezs/porto v0.1.0 h1:Xmxxn25zQMmgE7/yHYmh19KcItG81hIwfbEEFnd6w/Q=
|
||||
|
|
@ -1143,7 +1133,6 @@ github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0
|
|||
github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
||||
github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||
github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||
github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||
github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||
github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
|
||||
github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||
|
|
@ -1164,7 +1153,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
|
|||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
||||
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/pty v1.1.2/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
|
||||
|
|
@ -1204,7 +1192,6 @@ github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHef
|
|||
github.com/mat/besticon v3.9.0+incompatible/go.mod h1:mA1auQYHt6CW5e7L9HJLmqVQC8SzNk2gVwouO0AbiEU=
|
||||
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
|
||||
github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE=
|
||||
github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU=
|
||||
github.com/mattermost/xml-roundtrip-validator v0.0.0-20201213122252-bcd7e1b9601e h1:qqXczln0qwkVGcpQ+sQuPOVntt2FytYarXXxYSNJkgw=
|
||||
github.com/mattermost/xml-roundtrip-validator v0.0.0-20201213122252-bcd7e1b9601e/go.mod h1:qccnGMcpgwcNaBnxqpJpWWUiPNr5H3O8eDgGV9gT5To=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
|
|
@ -1491,7 +1478,6 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So
|
|||
github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg=
|
||||
github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
|
||||
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
|
||||
|
|
@ -1502,7 +1488,6 @@ github.com/rs/zerolog v1.20.0/go.mod h1:IzD0RJ65iWH0w97OQQebJEvTZYvsCUm9WVLWBQrJ
|
|||
github.com/russellhaering/goxmldsig v0.0.0-20180430223755-7acd5e4a6ef7/go.mod h1:Oz4y6ImuOQZxynhbSXk7btjEfNBtGlj2dcaOvXl2FSM=
|
||||
github.com/russellhaering/goxmldsig v1.1.0 h1:lK/zeJie2sqG52ZAlPNn1oBBqsIsEKypUUBGpYYF6lk=
|
||||
github.com/russellhaering/goxmldsig v1.1.0/go.mod h1:QK8GhXPB3+AfuCrfo0oRISa9NfzeCpWmxeGnqEpDF9o=
|
||||
github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=
|
||||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
||||
|
|
@ -1579,7 +1564,6 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL
|
|||
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
|
||||
github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI=
|
||||
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
|
||||
github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk=
|
||||
github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g=
|
||||
github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU=
|
||||
github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM=
|
||||
|
|
@ -1658,13 +1642,11 @@ github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVM
|
|||
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
|
||||
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
|
||||
github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
|
||||
github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
|
||||
github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8=
|
||||
github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
|
||||
github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
|
||||
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
|
||||
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo=
|
||||
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=
|
||||
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
|
||||
|
|
@ -1708,7 +1690,6 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:
|
|||
github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
|
||||
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
|
||||
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo=
|
||||
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI=
|
||||
|
|
@ -1731,7 +1712,6 @@ github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go
|
|||
github.com/zclconf/go-cty v1.1.0 h1:uJwc9HiBOCpoKIObTQaLR+tsEXx1HBHnOsOOpcdhZgw=
|
||||
github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
|
||||
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
|
||||
github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs=
|
||||
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
|
||||
github.com/zwass/kit v0.0.0-20210625184505-ec5b5c5cce9c h1:TWQ2UvXPkhPxI2KmApKBOCaV6yD2N4mlvqFQ/DlPtpQ=
|
||||
github.com/zwass/kit v0.0.0-20210625184505-ec5b5c5cce9c/go.mod h1:OYYulo9tUqRadRLwB0+LE914sa1ui2yL7OrcU3Q/1XY=
|
||||
|
|
@ -1767,7 +1747,6 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
|
|||
go.opencensus.io v0.22.6/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
|
||||
go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
|
||||
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
|
||||
go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0=
|
||||
go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc=
|
||||
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.28.0 h1:jGqTKfqtAbO+89WoLP7PuuOp2qCjaf+WkEDblYKL43k=
|
||||
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.28.0/go.mod h1:M4oIwAKStYVkLiVuW0+yPXrwd+pjss8kr547uaJ0cJQ=
|
||||
|
|
@ -1779,7 +1758,6 @@ go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzox
|
|||
go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs=
|
||||
go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM=
|
||||
go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk=
|
||||
go.opentelemetry.io/otel/exporters/otlp v0.20.0 h1:PTNgq9MRmQqqJY0REVbZFvwkYOA85vbdQU/nVfxDyqg=
|
||||
go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM=
|
||||
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4=
|
||||
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0 h1:7Yxsak1q4XrJ5y7XBnNwqWx9amMZvoidCctv62XOQ6Y=
|
||||
|
|
@ -1878,7 +1856,6 @@ golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0
|
|||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4=
|
||||
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
|
||||
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
|
||||
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
|
|
@ -1903,12 +1880,10 @@ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhp
|
|||
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||
golang.org/x/mobile v0.0.0-20200801112145-973feb4309de/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
|
|
@ -1980,7 +1955,6 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx
|
|||
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211007125505-59d4e928ea9d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
|
|
@ -2156,7 +2130,6 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||
golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0=
|
||||
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
|
|
@ -2226,7 +2199,6 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn
|
|||
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
|
|
|
|||
|
|
@ -9,11 +9,10 @@ type JobState string
|
|||
|
||||
// The possible states for a job
|
||||
//
|
||||
// Queued───►Success
|
||||
// │
|
||||
// │
|
||||
// └──────►Failure
|
||||
//
|
||||
// Queued ───► Success
|
||||
// │
|
||||
// │
|
||||
// └──────►Failure
|
||||
const (
|
||||
JobStateQueued JobState = "queued"
|
||||
JobStateSuccess JobState = "success"
|
||||
|
|
|
|||
|
|
@ -61,11 +61,12 @@ func (c *Conn) WriteJSONError(data interface{}) error {
|
|||
// ReadJSONMessage reads an incoming Message from JSON. Note that the
|
||||
// Message.Data field is guaranteed to be *json.RawMessage, and so unchecked
|
||||
// type assertions may be performed as in:
|
||||
// msg, err := c.ReadJSONMessage()
|
||||
// if err == nil && msg.Type == "foo" {
|
||||
// var foo fooData
|
||||
// json.Unmarshal(*(msg.Data.(*json.RawMessage)), &foo)
|
||||
// }
|
||||
//
|
||||
// msg, err := c.ReadJSONMessage()
|
||||
// if err == nil && msg.Type == "foo" {
|
||||
// var foo fooData
|
||||
// json.Unmarshal(*(msg.Data.(*json.RawMessage)), &foo)
|
||||
// }
|
||||
func (c *Conn) ReadJSONMessage() (*JSONMessage, error) {
|
||||
data, err := c.Recv()
|
||||
if err != nil {
|
||||
|
|
|
|||
1
tools.go
1
tools.go
|
|
@ -8,4 +8,5 @@ import (
|
|||
_ "github.com/goreleaser/goreleaser"
|
||||
_ "github.com/kevinburke/go-bindata"
|
||||
_ "github.com/mitchellh/gon/cmd/gon"
|
||||
_ "github.com/quasilyte/go-ruleguard/dsl"
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue