diff --git a/Makefile b/Makefile index db2817773a..b5396f3b4e 100644 --- a/Makefile +++ b/Makefile @@ -133,7 +133,7 @@ providers/lr: go build -o lr ./providers-sdk/v1/lr/cli/main.go .PHONY: providers/build -providers/build: providers/build/core providers/build/network providers/build/os providers/build/ipmi providers/build/oci providers/build/slack providers/build/github providers/build/gitlab providers/build/terraform providers/build/vsphere +providers/build: providers/build/core providers/build/network providers/build/os providers/build/ipmi providers/build/oci providers/build/slack providers/build/github providers/build/gitlab providers/build/terraform providers/build/vsphere providers/build/opcua providers/build/core: providers/lr @$(call buildProvider, providers/core) @@ -165,6 +165,9 @@ providers/build/terraform: providers/lr providers/build/vsphere: providers/lr @$(call buildProvider, providers/vsphere) +providers/build/opcua: providers/lr + @$(call buildProvider, providers/opcua) + providers/install: # @$(call installProvider, providers/core) @$(call installProvider, providers/network) @@ -176,6 +179,7 @@ providers/install: @$(call installProvider, providers/gitlab) @$(call installProvider, providers/terraform) @$(call installProvider, providers/vsphere) + @$(call installProvider, providers/opcua) providers/bundle: @$(call bundleProvider, providers/network) @@ -187,6 +191,7 @@ providers/bundle: @$(call bundleProvider, providers/gitlab) @$(call bundleProvider, providers/terraform) @$(call bundleProvider, providers/vsphere) + @$(call bundleProvider, providers/opcua) providers/test: @$(call testProvider, providers/core) @@ -199,6 +204,7 @@ providers/test: @$(call testGpModProvider, providers/gitlab) @$(call testGpModProvider, providers/terraform) @$(call testGpModProvider, providers/vsphere) + @$(call testGpModProvider, providers/opcua) lr/test: go test ./resources/lr/... diff --git a/_motor/discovery/opcua/resolver.go b/_motor/discovery/opcua/resolver.go deleted file mode 100644 index 9363f7be9a..0000000000 --- a/_motor/discovery/opcua/resolver.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Mondoo, Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package opcua - -import ( - "context" - "errors" - - "go.mondoo.com/cnquery/motor/asset" - "go.mondoo.com/cnquery/motor/discovery/common" - "go.mondoo.com/cnquery/motor/providers" - opcua_provider "go.mondoo.com/cnquery/motor/providers/opcua" - "go.mondoo.com/cnquery/motor/providers/resolver" - "go.mondoo.com/cnquery/motor/vault" -) - -type Resolver struct{} - -func (k *Resolver) Name() string { - return "OPC-UA Resolver" -} - -func (r *Resolver) AvailableDiscoveryTargets() []string { - return []string{common.DiscoveryAuto, common.DiscoveryAll} -} - -func (r *Resolver) Resolve(ctx context.Context, root *asset.Asset, cc *providers.Config, credsResolver vault.Resolver, sfn common.QuerySecretFn, userIdDetectors ...providers.PlatformIdDetector) ([]*asset.Asset, error) { - resolved := []*asset.Asset{} - - m, err := resolver.NewMotorConnection(ctx, cc, credsResolver) - if err != nil { - return nil, err - } - defer m.Close() - - provider, ok := m.Provider.(*opcua_provider.Provider) - if !ok { - return nil, errors.New("could not create ms OPC UA provider") - } - - identifier, err := provider.Identifier() - if err != nil { - return nil, err - } - - // detect platform info for the asset - pf, err := m.Platform() - if err != nil { - return nil, err - } - - if cc.IncludesOneOfDiscoveryTarget(common.DiscoveryAuto, common.DiscoveryAll) { - resolved = append(resolved, &asset.Asset{ - PlatformIds: []string{identifier}, - Name: "OPC UA server", - Platform: pf, - Connections: []*providers.Config{cc}, // pass-in the current config - Labels: map[string]string{}, - }) - } - - return resolved, nil -} diff --git a/_motor/providers/opcua/opcua.go b/_motor/providers/opcua/opcua.go deleted file mode 100644 index 4e7e9466b3..0000000000 --- a/_motor/providers/opcua/opcua.go +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Mondoo, Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package opcua - -import ( - "context" - "errors" - "github.com/gopcua/opcua" - "github.com/gopcua/opcua/ua" - "go.mondoo.com/cnquery/motor/providers" -) - -var ( - _ providers.Instance = (*Provider)(nil) - _ providers.PlatformIdentifier = (*Provider)(nil) -) - -func New(pCfg *providers.Config) (*Provider, error) { - if pCfg.Backend != providers.ProviderType_OPCUA { - return nil, providers.ErrProviderTypeDoesNotMatch - } - - if pCfg.Options == nil || pCfg.Options["endpoint"] == "" { - return nil, errors.New("opcua provider requires an endpoint. please set option `endpoint`") - } - - endpoint := pCfg.Options["endpoint"] - - policy := "None" // None, Basic128Rsa15, Basic256, Basic256Sha256. Default: auto" - mode := "None" // None, Sign, SignAndEncrypt. Default: auto - //certFile := "created/server_cert.der" - //keyFile := "created/server_key.der" - - ctx := context.Background() - - endpoints, err := opcua.GetEndpoints(ctx, endpoint) - if err != nil { - return nil, err - } - ep := opcua.SelectEndpoint(endpoints, policy, ua.MessageSecurityModeFromString(mode)) - if ep == nil { - return nil, errors.New("failed to find suitable endpoint") - } - - opts := []opcua.Option{ - opcua.SecurityPolicy(policy), - opcua.SecurityModeString(mode), - //opcua.CertificateFile(certFile), - //opcua.PrivateKeyFile(keyFile), - opcua.AuthAnonymous(), - opcua.SecurityFromEndpoint(ep, ua.UserTokenTypeAnonymous), - } - - c := opcua.NewClient(endpoint, opts...) - if err := c.Connect(ctx); err != nil { - return nil, err - } - - p := &Provider{ - id: "", - client: c, - endpoint: endpoint, - } - - return p, nil -} - -type Provider struct { - id string - client *opcua.Client - endpoint string -} - -func (p *Provider) Close() { - p.client.CloseWithContext(context.Background()) -} - -func (p *Provider) Capabilities() providers.Capabilities { - return providers.Capabilities{} -} - -func (p *Provider) Kind() providers.Kind { - return providers.Kind_KIND_API -} - -func (p *Provider) Runtime() string { - return providers.RUNTIME_OPCUA -} - -func (p *Provider) PlatformIdDetectors() []providers.PlatformIdDetector { - return []providers.PlatformIdDetector{ - providers.TransportPlatformIdentifierDetector, - } -} - -func (p *Provider) Client() *opcua.Client { - return p.client -} diff --git a/_motor/providers/opcua/platform.go b/_motor/providers/opcua/platform.go deleted file mode 100644 index de17f2619e..0000000000 --- a/_motor/providers/opcua/platform.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Mondoo, Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package opcua - -import "go.mondoo.com/cnquery/motor/platform" - -func (p *Provider) Identifier() (string, error) { - return "//platformid.api.mondoo.app/runtime/opcua/" + p.id, nil -} - -func (p *Provider) PlatformInfo() (*platform.Platform, error) { - return &platform.Platform{ - Name: "opcua", - Title: "OPC UA", - Runtime: p.Runtime(), - Kind: p.Kind(), - Family: []string{}, - }, nil -} diff --git a/_resources/packs/opcua/info/info.go b/_resources/packs/opcua/info/info.go deleted file mode 100644 index 9d0f46fb1c..0000000000 --- a/_resources/packs/opcua/info/info.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Mondoo, Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package info - -// Load metadata for this resource pack - -import ( - _ "embed" - "encoding/json" - - "go.mondoo.com/cnquery/resources" - "go.mondoo.com/cnquery/resources/lr/docs" -) - -//go:embed opcua.lr.json -var info []byte - -//go:embed opcua.lr.manifest.json -var manifest []byte - -// Registry contains the resource info necessary for the compiler to work with this pack. -var Registry = resources.NewRegistry() - -// ResourceDocs contains additional resource metadata for the compiler to use. -var ResourceDocs docs.LrDocs - -func init() { - if err := Registry.LoadJson(info); err != nil { - panic(err.Error()) - } - - if err := json.Unmarshal(manifest, &ResourceDocs); err != nil { - panic(err.Error()) - } -} diff --git a/_resources/packs/opcua/info/opcua.lr.json b/_resources/packs/opcua/info/opcua.lr.json deleted file mode 100644 index fd8d5326c9..0000000000 --- a/_resources/packs/opcua/info/opcua.lr.json +++ /dev/null @@ -1 +0,0 @@ -{"resources":{"opcua":{"id":"opcua","name":"opcua","fields":{"namespaces":{"name":"namespaces","type":"\u0019\u001bopcua.namespace","title":"Namespaces"},"nodes":{"name":"nodes","type":"\u0019\u001bopcua.node","title":"List of all nodes"},"root":{"name":"root","type":"\u001bopcua.node","title":"Root node"}},"title":"OPC UA"},"opcua.namespace":{"id":"opcua.namespace","name":"opcua.namespace","fields":{"id":{"name":"id","type":"\u0005","is_mandatory":true,"title":"Namespace ID"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Namespace Name"}},"title":"OPC UA Namespace"},"opcua.node":{"id":"opcua.node","name":"opcua.node","fields":{"accessLevel":{"name":"accessLevel","type":"\u0007","is_mandatory":true,"title":"Access Level"},"class":{"name":"class","type":"\u0007","is_mandatory":true,"title":"Node class"},"components":{"name":"components","type":"\u0019\u001bopcua.node","title":"Components"},"dataType":{"name":"dataType","type":"\u0007","is_mandatory":true,"title":"Data Type"},"description":{"name":"description","type":"\u0007","is_mandatory":true,"title":"Node description"},"id":{"name":"id","type":"\u0007","is_mandatory":true,"title":"Node id"},"max":{"name":"max","type":"\u0007","is_mandatory":true,"title":"Max value"},"min":{"name":"min","type":"\u0007","is_mandatory":true,"title":"Min value"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Node browser name"},"namespace":{"name":"namespace","type":"\u001bopcua.namespace","title":"Namespace"},"organizes":{"name":"organizes","type":"\u0019\u001bopcua.node","title":"Organizes"},"properties":{"name":"properties","type":"\u0019\u001bopcua.node","title":"Properties"},"unit":{"name":"unit","type":"\u0007","is_mandatory":true,"title":"Node unit"},"writeable":{"name":"writeable","type":"\u0004","is_mandatory":true,"title":"Indicates if value is writable"}},"title":"OPC UA Node","defaults":"id name"},"opcua.server":{"id":"opcua.server","name":"opcua.server","fields":{"buildInfo":{"name":"buildInfo","type":"\n","is_mandatory":true,"title":"Server build info"},"currentTime":{"name":"currentTime","type":"\t","is_mandatory":true,"title":"Current time on server"},"node":{"name":"node","type":"\u001bopcua.node","is_mandatory":true,"title":"Reference to node"},"startTime":{"name":"startTime","type":"\t","is_mandatory":true,"title":"Time when the server started"},"state":{"name":"state","type":"\u0007","is_mandatory":true,"title":"Server state"}},"title":"Server Object"}}} \ No newline at end of file diff --git a/_resources/packs/opcua/info/opcua.lr.manifest.json b/_resources/packs/opcua/info/opcua.lr.manifest.json deleted file mode 100644 index f7946f9c6e..0000000000 --- a/_resources/packs/opcua/info/opcua.lr.manifest.json +++ /dev/null @@ -1 +0,0 @@ -{"resources":{"opcua":{"fields":{"namespaces":{},"nodes":{},"root":{}},"min_mondoo_version":"latest"},"opcua.namespace":{"fields":{"id":{},"name":{}},"min_mondoo_version":"latest"},"opcua.node":{"fields":{"accessLevel":{},"class":{},"components":{},"dataType":{},"description":{},"id":{},"max":{},"min":{},"name":{},"namespace":{},"nodeid":{},"organizes":{},"properties":{},"unit":{},"writeable":{}},"min_mondoo_version":"latest"},"opcua.server":{"fields":{"buildInfo":{},"currentTime":{},"node":{},"startTime":{},"state":{}},"min_mondoo_version":"latest"}}} \ No newline at end of file diff --git a/_resources/packs/opcua/namespace.go b/_resources/packs/opcua/namespace.go deleted file mode 100644 index baca47dd1b..0000000000 --- a/_resources/packs/opcua/namespace.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Mondoo, Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package opcua - -import ( - "strconv" - - "go.mondoo.com/cnquery/resources" -) - -func (o *mqlOpcuaNamespace) id() (string, error) { - id, err := o.Id() - if err != nil { - return "", err - } - s := strconv.FormatInt(id, 10) - return "opcua.namespace/" + s, nil -} - -// https://reference.opcfoundation.org/DI/v102/docs/11.2 -func (o *mqlOpcua) GetNamespaces() ([]interface{}, error) { - op, err := opcuaProvider(o.MotorRuntime.Motor.Provider) - if err != nil { - return nil, err - } - client := op.Client() - - namespaces := client.Namespaces() - resList := []interface{}{} - for i := range namespaces { - res, err := newMqlOpcuaNamespaceResource(o.MotorRuntime, int64(i), namespaces[i]) - if err != nil { - return nil, err - } - resList = append(resList, res) - } - return resList, nil -} - -func newMqlOpcuaNamespaceResource(runtime *resources.Runtime, id int64, name string) (interface{}, error) { - return runtime.CreateResource("opcua.namespace", - "id", id, - "name", name, - ) -} diff --git a/_resources/packs/opcua/opcua.lr.go b/_resources/packs/opcua/opcua.lr.go deleted file mode 100644 index 8541563b1d..0000000000 --- a/_resources/packs/opcua/opcua.lr.go +++ /dev/null @@ -1,1248 +0,0 @@ -// Code generated by resources. DO NOT EDIT. -package opcua - -import ( - "errors" - "fmt" - "time" - - "go.mondoo.com/cnquery/resources" - "github.com/rs/zerolog/log" -) - -// Init all resources into the registry -func Init(registry *resources.Registry) { - registry.AddFactory("opcua", newOpcua) - registry.AddFactory("opcua.server", newOpcuaServer) - registry.AddFactory("opcua.namespace", newOpcuaNamespace) - registry.AddFactory("opcua.node", newOpcuaNode) -} - -// Opcua resource interface -type Opcua interface { - MqlResource() (*resources.Resource) - MqlCompute(string) error - Field(string) (interface{}, error) - Register(string) error - Validate() error - Namespaces() ([]interface{}, error) - Root() (OpcuaNode, error) - Nodes() ([]interface{}, error) -} - -// mqlOpcua for the opcua resource -type mqlOpcua struct { - *resources.Resource -} - -// MqlResource to retrieve the underlying resource info -func (s *mqlOpcua) MqlResource() *resources.Resource { - return s.Resource -} - -// create a new instance of the opcua resource -func newOpcua(runtime *resources.Runtime, args *resources.Args) (interface{}, error) { - // User hooks - var err error - res := mqlOpcua{runtime.NewResource("opcua")} - // assign all named fields - var id string - - now := time.Now().Unix() - for name, val := range *args { - if val == nil { - res.Cache.Store(name, &resources.CacheEntry{Data: val, Valid: true, Timestamp: now}) - continue - } - - switch name { - case "namespaces": - if _, ok := val.([]interface{}); !ok { - return nil, errors.New("Failed to initialize \"opcua\", its \"namespaces\" argument has the wrong type (expected type \"[]interface{}\")") - } - case "root": - if _, ok := val.(OpcuaNode); !ok { - return nil, errors.New("Failed to initialize \"opcua\", its \"root\" argument has the wrong type (expected type \"OpcuaNode\")") - } - case "nodes": - if _, ok := val.([]interface{}); !ok { - return nil, errors.New("Failed to initialize \"opcua\", its \"nodes\" argument has the wrong type (expected type \"[]interface{}\")") - } - case "__id": - idVal, ok := val.(string) - if !ok { - return nil, errors.New("Failed to initialize \"opcua\", its \"__id\" argument has the wrong type (expected type \"string\")") - } - id = idVal - default: - return nil, errors.New("Initialized opcua with unknown argument " + name) - } - res.Cache.Store(name, &resources.CacheEntry{Data: val, Valid: true, Timestamp: now}) - } - - // Get the ID - if id == "" { - res.Resource.Id, err = res.id() - if err != nil { - return nil, err - } - } else { - res.Resource.Id = id - } - - return &res, nil -} - -func (s *mqlOpcua) Validate() error { - // required arguments - // no required fields found - - return nil -} - -// Register accessor autogenerated -func (s *mqlOpcua) Register(name string) error { - log.Trace().Str("field", name).Msg("[opcua].Register") - switch name { - case "namespaces": - return nil - case "root": - return nil - case "nodes": - return nil - default: - return errors.New("Cannot find field '" + name + "' in \"opcua\" resource") - } -} - -// Field accessor autogenerated -func (s *mqlOpcua) Field(name string) (interface{}, error) { - log.Trace().Str("field", name).Msg("[opcua].Field") - switch name { - case "namespaces": - return s.Namespaces() - case "root": - return s.Root() - case "nodes": - return s.Nodes() - default: - return nil, fmt.Errorf("Cannot find field '" + name + "' in \"opcua\" resource") - } -} - -// Namespaces accessor autogenerated -func (s *mqlOpcua) Namespaces() ([]interface{}, error) { - res, ok := s.Cache.Load("namespaces") - if !ok || !res.Valid { - if err := s.ComputeNamespaces(); err != nil { - return nil, err - } - res, ok = s.Cache.Load("namespaces") - if !ok { - return nil, errors.New("\"opcua\" calculated \"namespaces\" but didn't find its value in cache.") - } - s.MotorRuntime.Trigger(s, "namespaces") - } - if res.Error != nil { - return nil, res.Error - } - tres, ok := res.Data.([]interface{}) - if !ok { - return nil, fmt.Errorf("\"opcua\" failed to cast field \"namespaces\" to the right type ([]interface{}): %#v", res) - } - return tres, nil -} - -// Root accessor autogenerated -func (s *mqlOpcua) Root() (OpcuaNode, error) { - res, ok := s.Cache.Load("root") - if !ok || !res.Valid { - if err := s.ComputeRoot(); err != nil { - return nil, err - } - res, ok = s.Cache.Load("root") - if !ok { - return nil, errors.New("\"opcua\" calculated \"root\" but didn't find its value in cache.") - } - s.MotorRuntime.Trigger(s, "root") - } - if res.Error != nil { - return nil, res.Error - } - tres, ok := res.Data.(OpcuaNode) - if !ok { - return nil, fmt.Errorf("\"opcua\" failed to cast field \"root\" to the right type (OpcuaNode): %#v", res) - } - return tres, nil -} - -// Nodes accessor autogenerated -func (s *mqlOpcua) Nodes() ([]interface{}, error) { - res, ok := s.Cache.Load("nodes") - if !ok || !res.Valid { - if err := s.ComputeNodes(); err != nil { - return nil, err - } - res, ok = s.Cache.Load("nodes") - if !ok { - return nil, errors.New("\"opcua\" calculated \"nodes\" but didn't find its value in cache.") - } - s.MotorRuntime.Trigger(s, "nodes") - } - if res.Error != nil { - return nil, res.Error - } - tres, ok := res.Data.([]interface{}) - if !ok { - return nil, fmt.Errorf("\"opcua\" failed to cast field \"nodes\" to the right type ([]interface{}): %#v", res) - } - return tres, nil -} - -// Compute accessor autogenerated -func (s *mqlOpcua) MqlCompute(name string) error { - log.Trace().Str("field", name).Msg("[opcua].MqlCompute") - switch name { - case "namespaces": - return s.ComputeNamespaces() - case "root": - return s.ComputeRoot() - case "nodes": - return s.ComputeNodes() - default: - return errors.New("Cannot find field '" + name + "' in \"opcua\" resource") - } -} - -// ComputeNamespaces computer autogenerated -func (s *mqlOpcua) ComputeNamespaces() error { - var err error - if _, ok := s.Cache.Load("namespaces"); ok { - return nil - } - vres, err := s.GetNamespaces() - if _, ok := err.(resources.NotReadyError); ok { - return err - } - s.Cache.Store("namespaces", &resources.CacheEntry{Data: vres, Valid: true, Error: err, Timestamp: time.Now().Unix()}) - return nil -} - -// ComputeRoot computer autogenerated -func (s *mqlOpcua) ComputeRoot() error { - var err error - if _, ok := s.Cache.Load("root"); ok { - return nil - } - vres, err := s.GetRoot() - if _, ok := err.(resources.NotReadyError); ok { - return err - } - s.Cache.Store("root", &resources.CacheEntry{Data: vres, Valid: true, Error: err, Timestamp: time.Now().Unix()}) - return nil -} - -// ComputeNodes computer autogenerated -func (s *mqlOpcua) ComputeNodes() error { - var err error - if _, ok := s.Cache.Load("nodes"); ok { - return nil - } - vres, err := s.GetNodes() - if _, ok := err.(resources.NotReadyError); ok { - return err - } - s.Cache.Store("nodes", &resources.CacheEntry{Data: vres, Valid: true, Error: err, Timestamp: time.Now().Unix()}) - return nil -} - -// OpcuaServer resource interface -type OpcuaServer interface { - MqlResource() (*resources.Resource) - MqlCompute(string) error - Field(string) (interface{}, error) - Register(string) error - Validate() error - Node() (OpcuaNode, error) - BuildInfo() (interface{}, error) - CurrentTime() (*time.Time, error) - StartTime() (*time.Time, error) - State() (string, error) -} - -// mqlOpcuaServer for the opcua.server resource -type mqlOpcuaServer struct { - *resources.Resource -} - -// MqlResource to retrieve the underlying resource info -func (s *mqlOpcuaServer) MqlResource() *resources.Resource { - return s.Resource -} - -// create a new instance of the opcua.server resource -func newOpcuaServer(runtime *resources.Runtime, args *resources.Args) (interface{}, error) { - // User hooks - var err error - res := mqlOpcuaServer{runtime.NewResource("opcua.server")} - var existing OpcuaServer - args, existing, err = res.init(args) - if err != nil { - return nil, err - } - if existing != nil { - return existing, nil - } - - // assign all named fields - var id string - - now := time.Now().Unix() - for name, val := range *args { - if val == nil { - res.Cache.Store(name, &resources.CacheEntry{Data: val, Valid: true, Timestamp: now}) - continue - } - - switch name { - case "node": - if _, ok := val.(OpcuaNode); !ok { - return nil, errors.New("Failed to initialize \"opcua.server\", its \"node\" argument has the wrong type (expected type \"OpcuaNode\")") - } - case "buildInfo": - if _, ok := val.(interface{}); !ok { - return nil, errors.New("Failed to initialize \"opcua.server\", its \"buildInfo\" argument has the wrong type (expected type \"interface{}\")") - } - case "currentTime": - if _, ok := val.(*time.Time); !ok { - return nil, errors.New("Failed to initialize \"opcua.server\", its \"currentTime\" argument has the wrong type (expected type \"*time.Time\")") - } - case "startTime": - if _, ok := val.(*time.Time); !ok { - return nil, errors.New("Failed to initialize \"opcua.server\", its \"startTime\" argument has the wrong type (expected type \"*time.Time\")") - } - case "state": - if _, ok := val.(string); !ok { - return nil, errors.New("Failed to initialize \"opcua.server\", its \"state\" argument has the wrong type (expected type \"string\")") - } - case "__id": - idVal, ok := val.(string) - if !ok { - return nil, errors.New("Failed to initialize \"opcua.server\", its \"__id\" argument has the wrong type (expected type \"string\")") - } - id = idVal - default: - return nil, errors.New("Initialized opcua.server with unknown argument " + name) - } - res.Cache.Store(name, &resources.CacheEntry{Data: val, Valid: true, Timestamp: now}) - } - - // Get the ID - if id == "" { - res.Resource.Id, err = res.id() - if err != nil { - return nil, err - } - } else { - res.Resource.Id = id - } - - return &res, nil -} - -func (s *mqlOpcuaServer) Validate() error { - // required arguments - if _, ok := s.Cache.Load("node"); !ok { - return errors.New("Initialized \"opcua.server\" resource without a \"node\". This field is required.") - } - if _, ok := s.Cache.Load("buildInfo"); !ok { - return errors.New("Initialized \"opcua.server\" resource without a \"buildInfo\". This field is required.") - } - if _, ok := s.Cache.Load("currentTime"); !ok { - return errors.New("Initialized \"opcua.server\" resource without a \"currentTime\". This field is required.") - } - if _, ok := s.Cache.Load("startTime"); !ok { - return errors.New("Initialized \"opcua.server\" resource without a \"startTime\". This field is required.") - } - if _, ok := s.Cache.Load("state"); !ok { - return errors.New("Initialized \"opcua.server\" resource without a \"state\". This field is required.") - } - - return nil -} - -// Register accessor autogenerated -func (s *mqlOpcuaServer) Register(name string) error { - log.Trace().Str("field", name).Msg("[opcua.server].Register") - switch name { - case "node": - return nil - case "buildInfo": - return nil - case "currentTime": - return nil - case "startTime": - return nil - case "state": - return nil - default: - return errors.New("Cannot find field '" + name + "' in \"opcua.server\" resource") - } -} - -// Field accessor autogenerated -func (s *mqlOpcuaServer) Field(name string) (interface{}, error) { - log.Trace().Str("field", name).Msg("[opcua.server].Field") - switch name { - case "node": - return s.Node() - case "buildInfo": - return s.BuildInfo() - case "currentTime": - return s.CurrentTime() - case "startTime": - return s.StartTime() - case "state": - return s.State() - default: - return nil, fmt.Errorf("Cannot find field '" + name + "' in \"opcua.server\" resource") - } -} - -// Node accessor autogenerated -func (s *mqlOpcuaServer) Node() (OpcuaNode, error) { - res, ok := s.Cache.Load("node") - if !ok || !res.Valid { - return nil, errors.New("\"opcua.server\" failed: no value provided for static field \"node\"") - } - if res.Error != nil { - return nil, res.Error - } - tres, ok := res.Data.(OpcuaNode) - if !ok { - return nil, fmt.Errorf("\"opcua.server\" failed to cast field \"node\" to the right type (OpcuaNode): %#v", res) - } - return tres, nil -} - -// BuildInfo accessor autogenerated -func (s *mqlOpcuaServer) BuildInfo() (interface{}, error) { - res, ok := s.Cache.Load("buildInfo") - if !ok || !res.Valid { - return nil, errors.New("\"opcua.server\" failed: no value provided for static field \"buildInfo\"") - } - if res.Error != nil { - return nil, res.Error - } - tres, ok := res.Data.(interface{}) - if !ok { - return nil, fmt.Errorf("\"opcua.server\" failed to cast field \"buildInfo\" to the right type (interface{}): %#v", res) - } - return tres, nil -} - -// CurrentTime accessor autogenerated -func (s *mqlOpcuaServer) CurrentTime() (*time.Time, error) { - res, ok := s.Cache.Load("currentTime") - if !ok || !res.Valid { - return nil, errors.New("\"opcua.server\" failed: no value provided for static field \"currentTime\"") - } - if res.Error != nil { - return nil, res.Error - } - tres, ok := res.Data.(*time.Time) - if !ok { - return nil, fmt.Errorf("\"opcua.server\" failed to cast field \"currentTime\" to the right type (*time.Time): %#v", res) - } - return tres, nil -} - -// StartTime accessor autogenerated -func (s *mqlOpcuaServer) StartTime() (*time.Time, error) { - res, ok := s.Cache.Load("startTime") - if !ok || !res.Valid { - return nil, errors.New("\"opcua.server\" failed: no value provided for static field \"startTime\"") - } - if res.Error != nil { - return nil, res.Error - } - tres, ok := res.Data.(*time.Time) - if !ok { - return nil, fmt.Errorf("\"opcua.server\" failed to cast field \"startTime\" to the right type (*time.Time): %#v", res) - } - return tres, nil -} - -// State accessor autogenerated -func (s *mqlOpcuaServer) State() (string, error) { - res, ok := s.Cache.Load("state") - if !ok || !res.Valid { - return "", errors.New("\"opcua.server\" failed: no value provided for static field \"state\"") - } - if res.Error != nil { - return "", res.Error - } - tres, ok := res.Data.(string) - if !ok { - return "", fmt.Errorf("\"opcua.server\" failed to cast field \"state\" to the right type (string): %#v", res) - } - return tres, nil -} - -// Compute accessor autogenerated -func (s *mqlOpcuaServer) MqlCompute(name string) error { - log.Trace().Str("field", name).Msg("[opcua.server].MqlCompute") - switch name { - case "node": - return nil - case "buildInfo": - return nil - case "currentTime": - return nil - case "startTime": - return nil - case "state": - return nil - default: - return errors.New("Cannot find field '" + name + "' in \"opcua.server\" resource") - } -} - -// OpcuaNamespace resource interface -type OpcuaNamespace interface { - MqlResource() (*resources.Resource) - MqlCompute(string) error - Field(string) (interface{}, error) - Register(string) error - Validate() error - Id() (int64, error) - Name() (string, error) -} - -// mqlOpcuaNamespace for the opcua.namespace resource -type mqlOpcuaNamespace struct { - *resources.Resource -} - -// MqlResource to retrieve the underlying resource info -func (s *mqlOpcuaNamespace) MqlResource() *resources.Resource { - return s.Resource -} - -// create a new instance of the opcua.namespace resource -func newOpcuaNamespace(runtime *resources.Runtime, args *resources.Args) (interface{}, error) { - // User hooks - var err error - res := mqlOpcuaNamespace{runtime.NewResource("opcua.namespace")} - // assign all named fields - var id string - - now := time.Now().Unix() - for name, val := range *args { - if val == nil { - res.Cache.Store(name, &resources.CacheEntry{Data: val, Valid: true, Timestamp: now}) - continue - } - - switch name { - case "id": - if _, ok := val.(int64); !ok { - return nil, errors.New("Failed to initialize \"opcua.namespace\", its \"id\" argument has the wrong type (expected type \"int64\")") - } - case "name": - if _, ok := val.(string); !ok { - return nil, errors.New("Failed to initialize \"opcua.namespace\", its \"name\" argument has the wrong type (expected type \"string\")") - } - case "__id": - idVal, ok := val.(string) - if !ok { - return nil, errors.New("Failed to initialize \"opcua.namespace\", its \"__id\" argument has the wrong type (expected type \"string\")") - } - id = idVal - default: - return nil, errors.New("Initialized opcua.namespace with unknown argument " + name) - } - res.Cache.Store(name, &resources.CacheEntry{Data: val, Valid: true, Timestamp: now}) - } - - // Get the ID - if id == "" { - res.Resource.Id, err = res.id() - if err != nil { - return nil, err - } - } else { - res.Resource.Id = id - } - - return &res, nil -} - -func (s *mqlOpcuaNamespace) Validate() error { - // required arguments - if _, ok := s.Cache.Load("id"); !ok { - return errors.New("Initialized \"opcua.namespace\" resource without a \"id\". This field is required.") - } - if _, ok := s.Cache.Load("name"); !ok { - return errors.New("Initialized \"opcua.namespace\" resource without a \"name\". This field is required.") - } - - return nil -} - -// Register accessor autogenerated -func (s *mqlOpcuaNamespace) Register(name string) error { - log.Trace().Str("field", name).Msg("[opcua.namespace].Register") - switch name { - case "id": - return nil - case "name": - return nil - default: - return errors.New("Cannot find field '" + name + "' in \"opcua.namespace\" resource") - } -} - -// Field accessor autogenerated -func (s *mqlOpcuaNamespace) Field(name string) (interface{}, error) { - log.Trace().Str("field", name).Msg("[opcua.namespace].Field") - switch name { - case "id": - return s.Id() - case "name": - return s.Name() - default: - return nil, fmt.Errorf("Cannot find field '" + name + "' in \"opcua.namespace\" resource") - } -} - -// Id accessor autogenerated -func (s *mqlOpcuaNamespace) Id() (int64, error) { - res, ok := s.Cache.Load("id") - if !ok || !res.Valid { - return 0, errors.New("\"opcua.namespace\" failed: no value provided for static field \"id\"") - } - if res.Error != nil { - return 0, res.Error - } - tres, ok := res.Data.(int64) - if !ok { - return 0, fmt.Errorf("\"opcua.namespace\" failed to cast field \"id\" to the right type (int64): %#v", res) - } - return tres, nil -} - -// Name accessor autogenerated -func (s *mqlOpcuaNamespace) Name() (string, error) { - res, ok := s.Cache.Load("name") - if !ok || !res.Valid { - return "", errors.New("\"opcua.namespace\" failed: no value provided for static field \"name\"") - } - if res.Error != nil { - return "", res.Error - } - tres, ok := res.Data.(string) - if !ok { - return "", fmt.Errorf("\"opcua.namespace\" failed to cast field \"name\" to the right type (string): %#v", res) - } - return tres, nil -} - -// Compute accessor autogenerated -func (s *mqlOpcuaNamespace) MqlCompute(name string) error { - log.Trace().Str("field", name).Msg("[opcua.namespace].MqlCompute") - switch name { - case "id": - return nil - case "name": - return nil - default: - return errors.New("Cannot find field '" + name + "' in \"opcua.namespace\" resource") - } -} - -// OpcuaNode resource interface -type OpcuaNode interface { - MqlResource() (*resources.Resource) - MqlCompute(string) error - Field(string) (interface{}, error) - Register(string) error - Validate() error - Id() (string, error) - Name() (string, error) - Namespace() (OpcuaNamespace, error) - Class() (string, error) - Description() (string, error) - Writeable() (bool, error) - DataType() (string, error) - Min() (string, error) - Max() (string, error) - Unit() (string, error) - AccessLevel() (string, error) - Properties() ([]interface{}, error) - Components() ([]interface{}, error) - Organizes() ([]interface{}, error) -} - -// mqlOpcuaNode for the opcua.node resource -type mqlOpcuaNode struct { - *resources.Resource -} - -// MqlResource to retrieve the underlying resource info -func (s *mqlOpcuaNode) MqlResource() *resources.Resource { - return s.Resource -} - -// create a new instance of the opcua.node resource -func newOpcuaNode(runtime *resources.Runtime, args *resources.Args) (interface{}, error) { - // User hooks - var err error - res := mqlOpcuaNode{runtime.NewResource("opcua.node")} - // assign all named fields - var id string - - now := time.Now().Unix() - for name, val := range *args { - if val == nil { - res.Cache.Store(name, &resources.CacheEntry{Data: val, Valid: true, Timestamp: now}) - continue - } - - switch name { - case "id": - if _, ok := val.(string); !ok { - return nil, errors.New("Failed to initialize \"opcua.node\", its \"id\" argument has the wrong type (expected type \"string\")") - } - case "name": - if _, ok := val.(string); !ok { - return nil, errors.New("Failed to initialize \"opcua.node\", its \"name\" argument has the wrong type (expected type \"string\")") - } - case "namespace": - if _, ok := val.(OpcuaNamespace); !ok { - return nil, errors.New("Failed to initialize \"opcua.node\", its \"namespace\" argument has the wrong type (expected type \"OpcuaNamespace\")") - } - case "class": - if _, ok := val.(string); !ok { - return nil, errors.New("Failed to initialize \"opcua.node\", its \"class\" argument has the wrong type (expected type \"string\")") - } - case "description": - if _, ok := val.(string); !ok { - return nil, errors.New("Failed to initialize \"opcua.node\", its \"description\" argument has the wrong type (expected type \"string\")") - } - case "writeable": - if _, ok := val.(bool); !ok { - return nil, errors.New("Failed to initialize \"opcua.node\", its \"writeable\" argument has the wrong type (expected type \"bool\")") - } - case "dataType": - if _, ok := val.(string); !ok { - return nil, errors.New("Failed to initialize \"opcua.node\", its \"dataType\" argument has the wrong type (expected type \"string\")") - } - case "min": - if _, ok := val.(string); !ok { - return nil, errors.New("Failed to initialize \"opcua.node\", its \"min\" argument has the wrong type (expected type \"string\")") - } - case "max": - if _, ok := val.(string); !ok { - return nil, errors.New("Failed to initialize \"opcua.node\", its \"max\" argument has the wrong type (expected type \"string\")") - } - case "unit": - if _, ok := val.(string); !ok { - return nil, errors.New("Failed to initialize \"opcua.node\", its \"unit\" argument has the wrong type (expected type \"string\")") - } - case "accessLevel": - if _, ok := val.(string); !ok { - return nil, errors.New("Failed to initialize \"opcua.node\", its \"accessLevel\" argument has the wrong type (expected type \"string\")") - } - case "properties": - if _, ok := val.([]interface{}); !ok { - return nil, errors.New("Failed to initialize \"opcua.node\", its \"properties\" argument has the wrong type (expected type \"[]interface{}\")") - } - case "components": - if _, ok := val.([]interface{}); !ok { - return nil, errors.New("Failed to initialize \"opcua.node\", its \"components\" argument has the wrong type (expected type \"[]interface{}\")") - } - case "organizes": - if _, ok := val.([]interface{}); !ok { - return nil, errors.New("Failed to initialize \"opcua.node\", its \"organizes\" argument has the wrong type (expected type \"[]interface{}\")") - } - case "__id": - idVal, ok := val.(string) - if !ok { - return nil, errors.New("Failed to initialize \"opcua.node\", its \"__id\" argument has the wrong type (expected type \"string\")") - } - id = idVal - default: - return nil, errors.New("Initialized opcua.node with unknown argument " + name) - } - res.Cache.Store(name, &resources.CacheEntry{Data: val, Valid: true, Timestamp: now}) - } - - // Get the ID - if id == "" { - res.Resource.Id, err = res.id() - if err != nil { - return nil, err - } - } else { - res.Resource.Id = id - } - - return &res, nil -} - -func (s *mqlOpcuaNode) Validate() error { - // required arguments - if _, ok := s.Cache.Load("id"); !ok { - return errors.New("Initialized \"opcua.node\" resource without a \"id\". This field is required.") - } - if _, ok := s.Cache.Load("name"); !ok { - return errors.New("Initialized \"opcua.node\" resource without a \"name\". This field is required.") - } - if _, ok := s.Cache.Load("class"); !ok { - return errors.New("Initialized \"opcua.node\" resource without a \"class\". This field is required.") - } - if _, ok := s.Cache.Load("description"); !ok { - return errors.New("Initialized \"opcua.node\" resource without a \"description\". This field is required.") - } - if _, ok := s.Cache.Load("writeable"); !ok { - return errors.New("Initialized \"opcua.node\" resource without a \"writeable\". This field is required.") - } - if _, ok := s.Cache.Load("dataType"); !ok { - return errors.New("Initialized \"opcua.node\" resource without a \"dataType\". This field is required.") - } - if _, ok := s.Cache.Load("min"); !ok { - return errors.New("Initialized \"opcua.node\" resource without a \"min\". This field is required.") - } - if _, ok := s.Cache.Load("max"); !ok { - return errors.New("Initialized \"opcua.node\" resource without a \"max\". This field is required.") - } - if _, ok := s.Cache.Load("unit"); !ok { - return errors.New("Initialized \"opcua.node\" resource without a \"unit\". This field is required.") - } - if _, ok := s.Cache.Load("accessLevel"); !ok { - return errors.New("Initialized \"opcua.node\" resource without a \"accessLevel\". This field is required.") - } - - return nil -} - -// Register accessor autogenerated -func (s *mqlOpcuaNode) Register(name string) error { - log.Trace().Str("field", name).Msg("[opcua.node].Register") - switch name { - case "id": - return nil - case "name": - return nil - case "namespace": - return nil - case "class": - return nil - case "description": - return nil - case "writeable": - return nil - case "dataType": - return nil - case "min": - return nil - case "max": - return nil - case "unit": - return nil - case "accessLevel": - return nil - case "properties": - return nil - case "components": - return nil - case "organizes": - return nil - default: - return errors.New("Cannot find field '" + name + "' in \"opcua.node\" resource") - } -} - -// Field accessor autogenerated -func (s *mqlOpcuaNode) Field(name string) (interface{}, error) { - log.Trace().Str("field", name).Msg("[opcua.node].Field") - switch name { - case "id": - return s.Id() - case "name": - return s.Name() - case "namespace": - return s.Namespace() - case "class": - return s.Class() - case "description": - return s.Description() - case "writeable": - return s.Writeable() - case "dataType": - return s.DataType() - case "min": - return s.Min() - case "max": - return s.Max() - case "unit": - return s.Unit() - case "accessLevel": - return s.AccessLevel() - case "properties": - return s.Properties() - case "components": - return s.Components() - case "organizes": - return s.Organizes() - default: - return nil, fmt.Errorf("Cannot find field '" + name + "' in \"opcua.node\" resource") - } -} - -// Id accessor autogenerated -func (s *mqlOpcuaNode) Id() (string, error) { - res, ok := s.Cache.Load("id") - if !ok || !res.Valid { - return "", errors.New("\"opcua.node\" failed: no value provided for static field \"id\"") - } - if res.Error != nil { - return "", res.Error - } - tres, ok := res.Data.(string) - if !ok { - return "", fmt.Errorf("\"opcua.node\" failed to cast field \"id\" to the right type (string): %#v", res) - } - return tres, nil -} - -// Name accessor autogenerated -func (s *mqlOpcuaNode) Name() (string, error) { - res, ok := s.Cache.Load("name") - if !ok || !res.Valid { - return "", errors.New("\"opcua.node\" failed: no value provided for static field \"name\"") - } - if res.Error != nil { - return "", res.Error - } - tres, ok := res.Data.(string) - if !ok { - return "", fmt.Errorf("\"opcua.node\" failed to cast field \"name\" to the right type (string): %#v", res) - } - return tres, nil -} - -// Namespace accessor autogenerated -func (s *mqlOpcuaNode) Namespace() (OpcuaNamespace, error) { - res, ok := s.Cache.Load("namespace") - if !ok || !res.Valid { - if err := s.ComputeNamespace(); err != nil { - return nil, err - } - res, ok = s.Cache.Load("namespace") - if !ok { - return nil, errors.New("\"opcua.node\" calculated \"namespace\" but didn't find its value in cache.") - } - s.MotorRuntime.Trigger(s, "namespace") - } - if res.Error != nil { - return nil, res.Error - } - tres, ok := res.Data.(OpcuaNamespace) - if !ok { - return nil, fmt.Errorf("\"opcua.node\" failed to cast field \"namespace\" to the right type (OpcuaNamespace): %#v", res) - } - return tres, nil -} - -// Class accessor autogenerated -func (s *mqlOpcuaNode) Class() (string, error) { - res, ok := s.Cache.Load("class") - if !ok || !res.Valid { - return "", errors.New("\"opcua.node\" failed: no value provided for static field \"class\"") - } - if res.Error != nil { - return "", res.Error - } - tres, ok := res.Data.(string) - if !ok { - return "", fmt.Errorf("\"opcua.node\" failed to cast field \"class\" to the right type (string): %#v", res) - } - return tres, nil -} - -// Description accessor autogenerated -func (s *mqlOpcuaNode) Description() (string, error) { - res, ok := s.Cache.Load("description") - if !ok || !res.Valid { - return "", errors.New("\"opcua.node\" failed: no value provided for static field \"description\"") - } - if res.Error != nil { - return "", res.Error - } - tres, ok := res.Data.(string) - if !ok { - return "", fmt.Errorf("\"opcua.node\" failed to cast field \"description\" to the right type (string): %#v", res) - } - return tres, nil -} - -// Writeable accessor autogenerated -func (s *mqlOpcuaNode) Writeable() (bool, error) { - res, ok := s.Cache.Load("writeable") - if !ok || !res.Valid { - return false, errors.New("\"opcua.node\" failed: no value provided for static field \"writeable\"") - } - if res.Error != nil { - return false, res.Error - } - tres, ok := res.Data.(bool) - if !ok { - return false, fmt.Errorf("\"opcua.node\" failed to cast field \"writeable\" to the right type (bool): %#v", res) - } - return tres, nil -} - -// DataType accessor autogenerated -func (s *mqlOpcuaNode) DataType() (string, error) { - res, ok := s.Cache.Load("dataType") - if !ok || !res.Valid { - return "", errors.New("\"opcua.node\" failed: no value provided for static field \"dataType\"") - } - if res.Error != nil { - return "", res.Error - } - tres, ok := res.Data.(string) - if !ok { - return "", fmt.Errorf("\"opcua.node\" failed to cast field \"dataType\" to the right type (string): %#v", res) - } - return tres, nil -} - -// Min accessor autogenerated -func (s *mqlOpcuaNode) Min() (string, error) { - res, ok := s.Cache.Load("min") - if !ok || !res.Valid { - return "", errors.New("\"opcua.node\" failed: no value provided for static field \"min\"") - } - if res.Error != nil { - return "", res.Error - } - tres, ok := res.Data.(string) - if !ok { - return "", fmt.Errorf("\"opcua.node\" failed to cast field \"min\" to the right type (string): %#v", res) - } - return tres, nil -} - -// Max accessor autogenerated -func (s *mqlOpcuaNode) Max() (string, error) { - res, ok := s.Cache.Load("max") - if !ok || !res.Valid { - return "", errors.New("\"opcua.node\" failed: no value provided for static field \"max\"") - } - if res.Error != nil { - return "", res.Error - } - tres, ok := res.Data.(string) - if !ok { - return "", fmt.Errorf("\"opcua.node\" failed to cast field \"max\" to the right type (string): %#v", res) - } - return tres, nil -} - -// Unit accessor autogenerated -func (s *mqlOpcuaNode) Unit() (string, error) { - res, ok := s.Cache.Load("unit") - if !ok || !res.Valid { - return "", errors.New("\"opcua.node\" failed: no value provided for static field \"unit\"") - } - if res.Error != nil { - return "", res.Error - } - tres, ok := res.Data.(string) - if !ok { - return "", fmt.Errorf("\"opcua.node\" failed to cast field \"unit\" to the right type (string): %#v", res) - } - return tres, nil -} - -// AccessLevel accessor autogenerated -func (s *mqlOpcuaNode) AccessLevel() (string, error) { - res, ok := s.Cache.Load("accessLevel") - if !ok || !res.Valid { - return "", errors.New("\"opcua.node\" failed: no value provided for static field \"accessLevel\"") - } - if res.Error != nil { - return "", res.Error - } - tres, ok := res.Data.(string) - if !ok { - return "", fmt.Errorf("\"opcua.node\" failed to cast field \"accessLevel\" to the right type (string): %#v", res) - } - return tres, nil -} - -// Properties accessor autogenerated -func (s *mqlOpcuaNode) Properties() ([]interface{}, error) { - res, ok := s.Cache.Load("properties") - if !ok || !res.Valid { - if err := s.ComputeProperties(); err != nil { - return nil, err - } - res, ok = s.Cache.Load("properties") - if !ok { - return nil, errors.New("\"opcua.node\" calculated \"properties\" but didn't find its value in cache.") - } - s.MotorRuntime.Trigger(s, "properties") - } - if res.Error != nil { - return nil, res.Error - } - tres, ok := res.Data.([]interface{}) - if !ok { - return nil, fmt.Errorf("\"opcua.node\" failed to cast field \"properties\" to the right type ([]interface{}): %#v", res) - } - return tres, nil -} - -// Components accessor autogenerated -func (s *mqlOpcuaNode) Components() ([]interface{}, error) { - res, ok := s.Cache.Load("components") - if !ok || !res.Valid { - if err := s.ComputeComponents(); err != nil { - return nil, err - } - res, ok = s.Cache.Load("components") - if !ok { - return nil, errors.New("\"opcua.node\" calculated \"components\" but didn't find its value in cache.") - } - s.MotorRuntime.Trigger(s, "components") - } - if res.Error != nil { - return nil, res.Error - } - tres, ok := res.Data.([]interface{}) - if !ok { - return nil, fmt.Errorf("\"opcua.node\" failed to cast field \"components\" to the right type ([]interface{}): %#v", res) - } - return tres, nil -} - -// Organizes accessor autogenerated -func (s *mqlOpcuaNode) Organizes() ([]interface{}, error) { - res, ok := s.Cache.Load("organizes") - if !ok || !res.Valid { - if err := s.ComputeOrganizes(); err != nil { - return nil, err - } - res, ok = s.Cache.Load("organizes") - if !ok { - return nil, errors.New("\"opcua.node\" calculated \"organizes\" but didn't find its value in cache.") - } - s.MotorRuntime.Trigger(s, "organizes") - } - if res.Error != nil { - return nil, res.Error - } - tres, ok := res.Data.([]interface{}) - if !ok { - return nil, fmt.Errorf("\"opcua.node\" failed to cast field \"organizes\" to the right type ([]interface{}): %#v", res) - } - return tres, nil -} - -// Compute accessor autogenerated -func (s *mqlOpcuaNode) MqlCompute(name string) error { - log.Trace().Str("field", name).Msg("[opcua.node].MqlCompute") - switch name { - case "id": - return nil - case "name": - return nil - case "namespace": - return s.ComputeNamespace() - case "class": - return nil - case "description": - return nil - case "writeable": - return nil - case "dataType": - return nil - case "min": - return nil - case "max": - return nil - case "unit": - return nil - case "accessLevel": - return nil - case "properties": - return s.ComputeProperties() - case "components": - return s.ComputeComponents() - case "organizes": - return s.ComputeOrganizes() - default: - return errors.New("Cannot find field '" + name + "' in \"opcua.node\" resource") - } -} - -// ComputeNamespace computer autogenerated -func (s *mqlOpcuaNode) ComputeNamespace() error { - var err error - if _, ok := s.Cache.Load("namespace"); ok { - return nil - } - vres, err := s.GetNamespace() - if _, ok := err.(resources.NotReadyError); ok { - return err - } - s.Cache.Store("namespace", &resources.CacheEntry{Data: vres, Valid: true, Error: err, Timestamp: time.Now().Unix()}) - return nil -} - -// ComputeProperties computer autogenerated -func (s *mqlOpcuaNode) ComputeProperties() error { - var err error - if _, ok := s.Cache.Load("properties"); ok { - return nil - } - vres, err := s.GetProperties() - if _, ok := err.(resources.NotReadyError); ok { - return err - } - s.Cache.Store("properties", &resources.CacheEntry{Data: vres, Valid: true, Error: err, Timestamp: time.Now().Unix()}) - return nil -} - -// ComputeComponents computer autogenerated -func (s *mqlOpcuaNode) ComputeComponents() error { - var err error - if _, ok := s.Cache.Load("components"); ok { - return nil - } - vres, err := s.GetComponents() - if _, ok := err.(resources.NotReadyError); ok { - return err - } - s.Cache.Store("components", &resources.CacheEntry{Data: vres, Valid: true, Error: err, Timestamp: time.Now().Unix()}) - return nil -} - -// ComputeOrganizes computer autogenerated -func (s *mqlOpcuaNode) ComputeOrganizes() error { - var err error - if _, ok := s.Cache.Load("organizes"); ok { - return nil - } - vres, err := s.GetOrganizes() - if _, ok := err.(resources.NotReadyError); ok { - return err - } - s.Cache.Store("organizes", &resources.CacheEntry{Data: vres, Valid: true, Error: err, Timestamp: time.Now().Unix()}) - return nil -} - diff --git a/_resources/packs/opcua/opcua.lr.manifest.yaml b/_resources/packs/opcua/opcua.lr.manifest.yaml deleted file mode 100755 index 86684a2631..0000000000 --- a/_resources/packs/opcua/opcua.lr.manifest.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Mondoo, Inc. -# SPDX-License-Identifier: BUSL-1.1 - -resources: - opcua: - fields: - namespaces: {} - nodes: {} - root: {} - min_mondoo_version: latest - opcua.namespace: - fields: - id: {} - name: {} - min_mondoo_version: latest - opcua.node: - fields: - accessLevel: {} - class: {} - components: {} - dataType: {} - description: {} - id: {} - max: {} - min: {} - name: {} - namespace: {} - nodeid: {} - organizes: {} - properties: {} - unit: {} - writeable: {} - min_mondoo_version: latest - opcua.server: - fields: - buildInfo: {} - currentTime: {} - node: {} - startTime: {} - state: {} - min_mondoo_version: latest diff --git a/_resources/packs/opcua/server.go b/_resources/packs/opcua/server.go deleted file mode 100644 index 675c75d1d5..0000000000 --- a/_resources/packs/opcua/server.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Mondoo, Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package opcua - -import ( - "context" - - "github.com/gopcua/opcua/id" - "github.com/gopcua/opcua/ua" - "go.mondoo.com/cnquery/resources" - "go.mondoo.com/cnquery/resources/packs/core" -) - -func (o *mqlOpcuaServer) init(args *resources.Args) (*resources.Args, OpcuaServer, error) { - op, err := opcuaProvider(o.MotorRuntime.Motor.Provider) - if err != nil { - return nil, nil, err - } - client := op.Client() - - ctx := context.Background() - - n := client.Node(ua.NewNumericNodeID(0, id.Server)) - ndef, err := fetchNodeInfo(ctx, n) - if err != nil { - return nil, nil, err - } - - // create server resource - serverNode, err := newMqlOpcuaNodeResource(o.MotorRuntime, ndef) - if err != nil { - return nil, nil, err - } - (*args)["node"] = serverNode - - // server status variable of server - v, err := client.Node(ua.NewNumericNodeID(0, id.Server_ServerStatus)).Value() - switch { - case err != nil: - return nil, nil, err - case v == nil: - (*args)["buildInfo"] = nil - (*args)["currentTime"] = nil - (*args)["startTime"] = nil - (*args)["state"] = "" - default: - res := v.Value() - extensionObject := res.(*ua.ExtensionObject) - serverStatus := extensionObject.Value.(*ua.ServerStatusDataType) - - buildInfo, _ := core.JsonToDict(serverStatus.BuildInfo) - (*args)["buildInfo"] = buildInfo - (*args)["currentTime"] = &serverStatus.CurrentTime - (*args)["startTime"] = &serverStatus.StartTime - (*args)["state"] = serverStatus.State.String() - } - - return args, nil, nil -} - -func (o *mqlOpcuaServer) id() (string, error) { - node, err := o.Node() - if err != nil { - return "", err - } - - id, err := node.Id() - if err != nil { - return "", err - } - - return "opcua.server/" + id, nil -} diff --git a/_motor/providers/errors.go b/providers-sdk/v1/plugin/errors.go similarity index 94% rename from _motor/providers/errors.go rename to providers-sdk/v1/plugin/errors.go index a24435f58f..4a88213e44 100644 --- a/_motor/providers/errors.go +++ b/providers-sdk/v1/plugin/errors.go @@ -1,7 +1,7 @@ // Copyright (c) Mondoo, Inc. // SPDX-License-Identifier: BUSL-1.1 -package providers +package plugin import "errors" diff --git a/providers/opcua/config/config.go b/providers/opcua/config/config.go new file mode 100644 index 0000000000..97a93578c4 --- /dev/null +++ b/providers/opcua/config/config.go @@ -0,0 +1,28 @@ +// Copyright (c) Mondoo, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package config + +import "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + +var Config = plugin.Provider{ + Name: "opcua", + ID: "go.mondoo.com/cnquery/providers/opcua", + Version: "9.0.0", + Connectors: []plugin.Connector{ + { + Name: "opcua", + Use: "opcua", + Short: "OPC UA", + Discovery: []string{}, + Flags: []plugin.Flag{ + { + Long: "endpoint", + Type: plugin.FlagType_String, + Default: "", + Desc: "OPC UA service endpoint", + }, + }, + }, + }, +} diff --git a/providers/opcua/connection/connection.go b/providers/opcua/connection/connection.go new file mode 100644 index 0000000000..13692a98da --- /dev/null +++ b/providers/opcua/connection/connection.go @@ -0,0 +1,96 @@ +// Copyright (c) Mondoo, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package connection + +import ( + "context" + "errors" + + "github.com/gopcua/opcua" + "github.com/gopcua/opcua/ua" + "go.mondoo.com/cnquery/providers-sdk/v1/inventory" + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" +) + +type OpcuaConnection struct { + id uint32 + Conf *inventory.Config + asset *inventory.Asset + client *opcua.Client + endpoint string +} + +func NewOpcuaConnection(id uint32, asset *inventory.Asset, conf *inventory.Config) (*OpcuaConnection, error) { + conn := &OpcuaConnection{ + Conf: conf, + id: id, + asset: asset, + } + + // initialize connection + if conf.Type != "opcua" { + return nil, plugin.ErrProviderTypeDoesNotMatch + } + + if conf.Options == nil || conf.Options["endpoint"] == "" { + return nil, errors.New("opcua provider requires an endpoint. please set option `endpoint`") + } + + endpoint := conf.Options["endpoint"] + + policy := "None" // None, Basic128Rsa15, Basic256, Basic256Sha256. Default: auto" + mode := "None" // None, Sign, SignAndEncrypt. Default: auto + // certFile := "created/server_cert.der" + // keyFile := "created/server_key.der" + + ctx := context.Background() + + endpoints, err := opcua.GetEndpoints(ctx, endpoint) + if err != nil { + return nil, err + } + ep := opcua.SelectEndpoint(endpoints, policy, ua.MessageSecurityModeFromString(mode)) + if ep == nil { + return nil, errors.New("failed to find suitable endpoint") + } + + opts := []opcua.Option{ + opcua.SecurityPolicy(policy), + opcua.SecurityModeString(mode), + // opcua.CertificateFile(certFile), + // opcua.PrivateKeyFile(keyFile), + opcua.AuthAnonymous(), + opcua.SecurityFromEndpoint(ep, ua.UserTokenTypeAnonymous), + } + + c := opcua.NewClient(endpoint, opts...) + if err := c.Connect(ctx); err != nil { + return nil, err + } + + conn.client = c + conn.endpoint = endpoint + + return conn, nil +} + +func (c *OpcuaConnection) Name() string { + return "opcua" +} + +func (c *OpcuaConnection) ID() uint32 { + return c.id +} + +func (c *OpcuaConnection) Asset() *inventory.Asset { + return c.asset +} + +func (c *OpcuaConnection) Client() *opcua.Client { + return c.client +} + +func (c *OpcuaConnection) Endpoint() string { + return c.endpoint +} diff --git a/providers/opcua/gen/main.go b/providers/opcua/gen/main.go new file mode 100644 index 0000000000..99bdeeeac2 --- /dev/null +++ b/providers/opcua/gen/main.go @@ -0,0 +1,13 @@ +// Copyright (c) Mondoo, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package main + +import ( + "go.mondoo.com/cnquery/providers-sdk/v1/plugin/gen" + "go.mondoo.com/cnquery/providers/opcua/config" +) + +func main() { + gen.CLI(&config.Config) +} diff --git a/providers/opcua/go.mod b/providers/opcua/go.mod new file mode 100644 index 0000000000..ad49537247 --- /dev/null +++ b/providers/opcua/go.mod @@ -0,0 +1,60 @@ +module go.mondoo.com/cnquery/providers/opcua + +replace go.mondoo.com/cnquery => ../.. + +go 1.20 + +require ( + github.com/gopcua/opcua v0.5.0 + github.com/mozillazg/go-slugify v0.2.0 + go.mondoo.com/cnquery v0.0.0-00010101000000-000000000000 +) + +require ( + github.com/Masterminds/semver v1.5.0 // indirect + github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect + github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f // indirect + github.com/cockroachdb/redact v1.1.3 // indirect + github.com/fatih/color v1.15.0 // indirect + github.com/getsentry/sentry-go v0.13.0 // indirect + github.com/gofrs/uuid v4.3.1+incompatible // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt v3.2.2+incompatible // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-plugin v1.4.8 // indirect + github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect + github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/lucasb-eyer/go-colorful v1.2.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-runewidth v0.0.14 // indirect + github.com/mitchellh/go-testing-interface v1.0.0 // indirect + github.com/mozillazg/go-unidecode v0.2.0 // indirect + github.com/muesli/termenv v0.15.2 // indirect + github.com/oklog/run v1.0.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/rivo/uniseg v0.4.4 // indirect + github.com/rogpeppe/go-internal v1.10.0 // indirect + github.com/rs/zerolog v1.30.0 // indirect + github.com/segmentio/fasthash v1.0.3 // indirect + github.com/segmentio/ksuid v1.0.4 // indirect + github.com/spf13/afero v1.9.5 // indirect + go.mondoo.com/ranger-rpc v0.0.0-20230328135530-12135c17095f // indirect + golang.org/x/crypto v0.12.0 // indirect + golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect + golang.org/x/net v0.14.0 // indirect + golang.org/x/sys v0.11.0 // indirect + golang.org/x/text v0.12.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect + google.golang.org/grpc v1.55.0 // indirect + google.golang.org/protobuf v1.30.0 // indirect + gopkg.in/square/go-jose.v2 v2.6.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + moul.io/http2curl v1.0.0 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect +) diff --git a/providers/opcua/go.sum b/providers/opcua/go.sum new file mode 100644 index 0000000000..8db7ce45dd --- /dev/null +++ b/providers/opcua/go.sum @@ -0,0 +1,753 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= +github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= +github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= +github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= +github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= +github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= +github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f h1:6jduT9Hfc0njg5jJ1DdKCFPdMBrp/mdZfCpa5h+WM74= +github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= +github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= +github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= +github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= +github.com/getsentry/sentry-go v0.13.0 h1:20dgTiUSfxRB/EhMPtxcL9ZEbM1ZdR+W/7f7NWD+xWo= +github.com/getsentry/sentry-go v0.13.0/go.mod h1:EOsfu5ZdvKPfeHYV6pTVQnsjfp30+XA7//UooKNumH0= +github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= +github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-errors/errors v1.1.1 h1:ljK/pL5ltg3qoN+OtN6yCv9HWSfMwxSx90GJCZQxYNg= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/uuid v4.3.1+incompatible h1:0/KbAdpx3UXAx1kEOWHJeOkpbgRFGHVgv+CFIY7dBJI= +github.com/gofrs/uuid v4.3.1+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= +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/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gopcua/opcua v0.5.0 h1:U7RAyioxHd3tm1FwhxkFuXd1q5wt4ED1DiC3kUgyi3E= +github.com/gopcua/opcua v0.5.0/go.mod h1:nrVl4/Rs3SDQRhNQ50EbAiI5JSpDrTG6Frx3s4HLnw4= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f h1:7LYC+Yfkj3CTRcShK0KOL/w6iTiKyqqBA9a41Wnggw8= +github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= +github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= +github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= +github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= +github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= +github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= +github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= +github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= +github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= +github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= +github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= +github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= +github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= +github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= +github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= +github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= +github.com/mozillazg/go-slugify v0.2.0 h1:SIhqDlnJWZH8OdiTmQgeXR28AOnypmAXPeOTcG7b9lk= +github.com/mozillazg/go-slugify v0.2.0/go.mod h1:z7dPH74PZf2ZPFkyxx+zjPD8CNzRJNa1CGacv0gg8Ns= +github.com/mozillazg/go-unidecode v0.2.0 h1:vFGEzAH9KSwyWmXCOblazEWDh7fOkpmy/Z4ArmamSUc= +github.com/mozillazg/go-unidecode v0.2.0/go.mod h1:zB48+/Z5toiRolOZy9ksLryJ976VIwmDmpQ2quyt1aA= +github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= +github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/pascaldekloe/goe v0.1.1 h1:Ah6WQ56rZONR3RW3qWa2NCZ6JAVvSpUcoLBaOmYFt9Q= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +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/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c= +github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/segmentio/fasthash v1.0.3 h1:EI9+KE1EwvMLBWwjpRDc+fEM+prwxDYbslddQGtrmhM= +github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= +github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c= +github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= +github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +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/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= +github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= +github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +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= +github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= +github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= +github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.mondoo.com/ranger-rpc v0.0.0-20230328135530-12135c17095f h1:l8N+cU5Ul8+NzC3DtyjrUqpzSDpPQDnGqvxpwMz7CMw= +go.mondoo.com/ranger-rpc v0.0.0-20230328135530-12135c17095f/go.mod h1:3YKcqFrlPgaB4FZ4EoLgdmRtwMQdO7RoAkZYFn+F1eY= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= +go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +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-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= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= +golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +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/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.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= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +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-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= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= +google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= +gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +moul.io/http2curl v1.0.0 h1:6XwpyZOYsgZJrU8exnG87ncVkU1FVCcTRpwzOkTDUi8= +moul.io/http2curl v1.0.0/go.mod h1:f6cULg+e4Md/oW1cYmwW4IWQOVl2lGbmCNGOHvzX2kE= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/providers/opcua/main.go b/providers/opcua/main.go new file mode 100644 index 0000000000..b9a75a5831 --- /dev/null +++ b/providers/opcua/main.go @@ -0,0 +1,15 @@ +// Copyright (c) Mondoo, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package main + +import ( + "os" + + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/opcua/provider" +) + +func main() { + plugin.Start(os.Args, provider.Init()) +} diff --git a/providers/opcua/provider/provider.go b/providers/opcua/provider/provider.go new file mode 100644 index 0000000000..9c1ce72d39 --- /dev/null +++ b/providers/opcua/provider/provider.go @@ -0,0 +1,192 @@ +// Copyright (c) Mondoo, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package provider + +import ( + "errors" + "strconv" + + "github.com/mozillazg/go-slugify" + + "go.mondoo.com/cnquery/llx" + "go.mondoo.com/cnquery/providers-sdk/v1/inventory" + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers-sdk/v1/upstream" + "go.mondoo.com/cnquery/providers/opcua/connection" + "go.mondoo.com/cnquery/providers/opcua/resources" +) + +type Service struct { + runtimes map[uint32]*plugin.Runtime + lastConnectionID uint32 +} + +func Init() *Service { + return &Service{ + runtimes: map[uint32]*plugin.Runtime{}, + lastConnectionID: 0, + } +} + +func (s *Service) ParseCLI(req *plugin.ParseCLIReq) (*plugin.ParseCLIRes, error) { + flags := req.Flags + if flags == nil { + flags = map[string]*llx.Primitive{} + } + + conn := &inventory.Config{ + Type: req.Connector, + Options: make(map[string]string), + } + + // Do custom flag parsing + endpoint := "" + if x, ok := flags["endpoint"]; ok && len(x.Value) != 0 { + endpoint = string(x.Value) + } + + if endpoint != "" { + conn.Options["endpoint"] = endpoint + } + + asset := inventory.Asset{ + Connections: []*inventory.Config{conn}, + } + + return &plugin.ParseCLIRes{Asset: &asset}, nil +} + +func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*plugin.ConnectRes, error) { + if req == nil || req.Asset == nil { + return nil, errors.New("no connection data provided") + } + + conn, err := s.connect(req, callback) + if err != nil { + return nil, err + } + + // We only need to run the detection step when we don't have any asset information yet. + if req.Asset.Platform == nil { + if err := s.detect(req.Asset, conn); err != nil { + return nil, err + } + } + + return &plugin.ConnectRes{ + Id: conn.ID(), + Name: conn.Name(), + Asset: req.Asset, + Inventory: nil, + }, nil +} + +func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.OpcuaConnection, error) { + if len(req.Asset.Connections) == 0 { + return nil, errors.New("no connection options for asset") + } + + asset := req.Asset + conf := asset.Connections[0] + var conn *connection.OpcuaConnection + var err error + + switch conf.Type { + default: + s.lastConnectionID++ + conn, err = connection.NewOpcuaConnection(s.lastConnectionID, asset, conf) + } + + if err != nil { + return nil, err + } + + var upstream *upstream.UpstreamClient + if req.Upstream != nil { + upstream, err = req.Upstream.InitClient() + if err != nil { + return nil, err + } + } + + asset.Connections[0].Id = conn.ID() + s.runtimes[conn.ID()] = &plugin.Runtime{ + Connection: conn, + Resources: map[string]plugin.Resource{}, + Callback: callback, + HasRecording: req.HasRecording, + CreateResource: resources.CreateResource, + Upstream: upstream, + } + + return conn, err +} + +func (s *Service) detect(asset *inventory.Asset, conn *connection.OpcuaConnection) error { + asset.Id = conn.Conf.Type + asset.Name = conn.Conf.Host + + asset.Platform = &inventory.Platform{ + Name: "opcua", + Family: []string{"opcua"}, + Kind: "api", + Title: "OPC UA", + } + + // Add platform ID + endpoint := conn.Endpoint() + asset.PlatformIds = []string{"//platformid.api.mondoo.app/runtime/opcua/" + slugify.Slugify(endpoint)} + return nil +} + +func (s *Service) GetData(req *plugin.DataReq) (*plugin.DataRes, error) { + runtime, ok := s.runtimes[req.Connection] + if !ok { + return nil, errors.New("connection " + strconv.FormatUint(uint64(req.Connection), 10) + " not found") + } + + args := plugin.PrimitiveArgsToRawDataArgs(req.Args, runtime) + + if req.ResourceId == "" && req.Field == "" { + res, err := resources.NewResource(runtime, req.Resource, args) + if err != nil { + return nil, err + } + + rd := llx.ResourceData(res, res.MqlName()).Result() + return &plugin.DataRes{ + Data: rd.Data, + }, nil + } + + resource, ok := runtime.Resources[req.Resource+"\x00"+req.ResourceId] + if !ok { + // Note: Since resources are internally always created, there are only very + // few cases where we arrive here: + // 1. The caller is wrong. Possibly a mixup with IDs + // 2. The resource was loaded from a recording, but the field is not + // in the recording. Thus the resource was never created inside the + // plugin. We will attempt to create the resource and see if the field + // can be computed. + if !runtime.HasRecording { + return nil, errors.New("resource '" + req.Resource + "' (id: " + req.ResourceId + ") doesn't exist") + } + + args, err := runtime.ResourceFromRecording(req.Resource, req.ResourceId) + if err != nil { + return nil, errors.New("attempted to load resource '" + req.Resource + "' (id: " + req.ResourceId + ") from recording failed: " + err.Error()) + } + + resource, err = resources.CreateResource(runtime, req.Resource, args) + if err != nil { + return nil, errors.New("attempted to create resource '" + req.Resource + "' (id: " + req.ResourceId + ") from recording failed: " + err.Error()) + } + } + + return resources.GetData(resource, req.Field, args), nil +} + +func (s *Service) StoreData(req *plugin.StoreReq) (*plugin.StoreRes, error) { + return nil, errors.New("not yet implemented") +} diff --git a/_resources/packs/opcua/README.md b/providers/opcua/resources/README.md similarity index 100% rename from _resources/packs/opcua/README.md rename to providers/opcua/resources/README.md diff --git a/providers/opcua/resources/namespace.go b/providers/opcua/resources/namespace.go new file mode 100644 index 0000000000..5429b6e892 --- /dev/null +++ b/providers/opcua/resources/namespace.go @@ -0,0 +1,44 @@ +// Copyright (c) Mondoo, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package resources + +import ( + "strconv" + + "go.mondoo.com/cnquery/llx" + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers/opcua/connection" +) + +func (o *mqlOpcuaNamespace) id() (string, error) { + if o.Id.Error != nil { + return "", o.Id.Error + } + s := strconv.FormatInt(o.Id.Data, 10) + return "opcua.namespace/" + s, nil +} + +// https://reference.opcfoundation.org/DI/v102/docs/11.2 +func (o *mqlOpcua) namespaces() ([]interface{}, error) { + conn := o.MqlRuntime.Connection.(*connection.OpcuaConnection) + client := conn.Client() + + namespaces := client.Namespaces() + resList := []interface{}{} + for i := range namespaces { + res, err := newMqlOpcuaNamespaceResource(o.MqlRuntime, int64(i), namespaces[i]) + if err != nil { + return nil, err + } + resList = append(resList, res) + } + return resList, nil +} + +func newMqlOpcuaNamespaceResource(runtime *plugin.Runtime, id int64, name string) (interface{}, error) { + return CreateResource(runtime, "opcua.namespace", map[string]*llx.RawData{ + "id": llx.IntData(id), + "name": llx.StringData(name), + }) +} diff --git a/_resources/packs/opcua/node.go b/providers/opcua/resources/node.go similarity index 62% rename from _resources/packs/opcua/node.go rename to providers/opcua/resources/node.go index 0893d39b25..d29eef5e51 100644 --- a/_resources/packs/opcua/node.go +++ b/providers/opcua/resources/node.go @@ -1,17 +1,17 @@ // Copyright (c) Mondoo, Inc. // SPDX-License-Identifier: BUSL-1.1 -package opcua +package resources import ( "context" - "fmt" "github.com/gopcua/opcua" "github.com/gopcua/opcua/errors" "github.com/gopcua/opcua/id" "github.com/gopcua/opcua/ua" - "go.mondoo.com/cnquery/resources" + "go.mondoo.com/cnquery/llx" + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" ) type nodeMeta struct { @@ -33,7 +33,7 @@ type nodeMeta struct { } func fetchNodeInfo(ctx context.Context, n *opcua.Node) (*nodeMeta, error) { - attrs, err := n.AttributesWithContext(ctx, ua.AttributeIDNodeClass, ua.AttributeIDBrowseName, ua.AttributeIDDescription, ua.AttributeIDAccessLevel, ua.AttributeIDDataType) + attrs, err := n.Attributes(ctx, ua.AttributeIDNodeClass, ua.AttributeIDBrowseName, ua.AttributeIDDescription, ua.AttributeIDAccessLevel, ua.AttributeIDDataType) if err != nil { return nil, err } @@ -119,9 +119,8 @@ func fetchNodeInfo(ctx context.Context, n *opcua.Node) (*nodeMeta, error) { } // TODO: set path - fetchReference := func(refType uint32) ([]*opcua.Node, error) { - return n.ReferencedNodesWithContext(ctx, refType, ua.BrowseDirectionForward, ua.NodeClassAll, true) + return n.ReferencedNodes(ctx, refType, ua.BrowseDirectionForward, ua.NodeClassAll, true) } if componentRefs, err := fetchReference(id.HasComponent); err != nil { @@ -145,77 +144,62 @@ func fetchNodeInfo(ctx context.Context, n *opcua.Node) (*nodeMeta, error) { return &def, nil } -func newMqlOpcuaNodeResource(runtime *resources.Runtime, ndef *nodeMeta) (interface{}, error) { - res, err := runtime.CreateResource("opcua.node", - "id", ndef.NodeID.String(), - "name", ndef.BrowseName, - "class", ndef.NodeClass.String(), - "description", ndef.Description, - "writeable", ndef.Writable, - "dataType", ndef.DataType, - "min", ndef.Min, - "max", ndef.Max, - "unit", ndef.Unit, - "accessLevel", ndef.AccessLevel.String(), - ) +func newMqlOpcuaNodeResource(runtime *plugin.Runtime, ndef *nodeMeta) (*mqlOpcuaNode, error) { + res, err := CreateResource(runtime, "opcua.node", map[string]*llx.RawData{ + "id": llx.StringData(ndef.NodeID.String()), + "name": llx.StringData(ndef.BrowseName), + "class": llx.StringData(ndef.NodeClass.String()), + "description": llx.StringData(ndef.Description), + "writeable": llx.BoolData(ndef.Writable), + "dataType": llx.StringData(ndef.DataType), + "min": llx.StringData(ndef.Min), + "max": llx.StringData(ndef.Max), + "unit": llx.StringData(ndef.Unit), + "accessLevel": llx.StringData(ndef.AccessLevel.String()), + }) if err != nil { return nil, err } - res.MqlResource().Cache.Store("_object", &resources.CacheEntry{ - Data: ndef, - }) - return res, nil + + r := res.(*mqlOpcuaNode) + r.object = ndef + return r, nil +} + +type mqlOpcuaNodeInternal struct { + object *nodeMeta } func (o *mqlOpcuaNode) id() (string, error) { - id, err := o.Id() - if err != nil { - return "", err - } - return "opcua.node/" + id, nil + return "opcua.node/" + o.Id.Data, o.Id.Error } -func (o *mqlOpcuaNode) GetNamespace() (interface{}, error) { - res, ok := o.Cache.Load("_object") - if !ok { +func (o *mqlOpcuaNode) namespace() (*mqlOpcuaNamespace, error) { + nodeDef := o.object + if nodeDef == nil { return nil, errors.New("could not fetch properties") } - if res.Error != nil { - return nil, res.Error - } - nodeDef, ok := res.Data.(*nodeMeta) - if !ok { - return nil, fmt.Errorf("\"opcua\" failed to cast field \"node\" to the right type: %#v", res) - } - - obj, err := o.MotorRuntime.CreateResource("opcua") + obj, err := CreateResource(o.MqlRuntime, "opcua", nil) if err != nil { return nil, err } - mqlOpcua := obj.(Opcua) + mqlOpcua := obj.(*mqlOpcua) - namespaces, err := mqlOpcua.Namespaces() - if err != nil { - return nil, err + namespaces := mqlOpcua.GetNamespaces() + if namespaces.Error != nil { + return nil, namespaces.Error } - entry := namespaces[nodeDef.NodeID.Namespace()] - return entry, nil + entry := namespaces.Data[nodeDef.NodeID.Namespace()] + return entry.(*mqlOpcuaNamespace), nil } -func (o *mqlOpcuaNode) GetProperties() ([]interface{}, error) { - res, ok := o.Cache.Load("_object") - if !ok { +func (o *mqlOpcuaNode) properties() ([]interface{}, error) { + nodeDef := o.object + if nodeDef == nil { return nil, errors.New("could not fetch properties") } - if res.Error != nil { - return nil, res.Error - } - nodeDef, ok := res.Data.(*nodeMeta) - if !ok { - return nil, fmt.Errorf("\"opcua\" failed to cast field \"node\" to the right type: %#v", res) - } ctx := context.Background() results := []interface{}{} @@ -225,7 +209,7 @@ func (o *mqlOpcuaNode) GetProperties() ([]interface{}, error) { if err != nil { return nil, err } - r, err := newMqlOpcuaNodeResource(o.MotorRuntime, n) + r, err := newMqlOpcuaNodeResource(o.MqlRuntime, n) if err != nil { return nil, err } @@ -235,18 +219,11 @@ func (o *mqlOpcuaNode) GetProperties() ([]interface{}, error) { return results, nil } -func (o *mqlOpcuaNode) GetComponents() ([]interface{}, error) { - res, ok := o.Cache.Load("_object") - if !ok { +func (o *mqlOpcuaNode) components() ([]interface{}, error) { + nodeDef := o.object + if nodeDef == nil { return nil, errors.New("could not fetch properties") } - if res.Error != nil { - return nil, res.Error - } - nodeDef, ok := res.Data.(*nodeMeta) - if !ok { - return nil, fmt.Errorf("\"opcua\" failed to cast field \"node\" to the right type: %#v", res) - } ctx := context.Background() results := []interface{}{} @@ -256,7 +233,7 @@ func (o *mqlOpcuaNode) GetComponents() ([]interface{}, error) { if err != nil { return nil, err } - r, err := newMqlOpcuaNodeResource(o.MotorRuntime, n) + r, err := newMqlOpcuaNodeResource(o.MqlRuntime, n) if err != nil { return nil, err } @@ -266,18 +243,11 @@ func (o *mqlOpcuaNode) GetComponents() ([]interface{}, error) { return results, nil } -func (o *mqlOpcuaNode) GetOrganizes() ([]interface{}, error) { - res, ok := o.Cache.Load("_object") - if !ok { +func (o *mqlOpcuaNode) organizes() ([]interface{}, error) { + nodeDef := o.object + if nodeDef == nil { return nil, errors.New("could not fetch properties") } - if res.Error != nil { - return nil, res.Error - } - nodeDef, ok := res.Data.(*nodeMeta) - if !ok { - return nil, fmt.Errorf("\"opcua\" failed to cast field \"node\" to the right type: %#v", res) - } ctx := context.Background() results := []interface{}{} @@ -287,7 +257,7 @@ func (o *mqlOpcuaNode) GetOrganizes() ([]interface{}, error) { if err != nil { return nil, err } - r, err := newMqlOpcuaNodeResource(o.MotorRuntime, n) + r, err := newMqlOpcuaNodeResource(o.MqlRuntime, n) if err != nil { return nil, err } diff --git a/_resources/packs/opcua/opcua.go b/providers/opcua/resources/opcua.go similarity index 68% rename from _resources/packs/opcua/opcua.go rename to providers/opcua/resources/opcua.go index c8c06d8b06..237e506d2c 100644 --- a/_resources/packs/opcua/opcua.go +++ b/providers/opcua/resources/opcua.go @@ -1,43 +1,23 @@ // Copyright (c) Mondoo, Inc. // SPDX-License-Identifier: BUSL-1.1 -package opcua +package resources import ( "context" - "errors" "github.com/gopcua/opcua/id" "github.com/gopcua/opcua/ua" - "go.mondoo.com/cnquery/motor/providers" - opcua_provider "go.mondoo.com/cnquery/motor/providers/opcua" - "go.mondoo.com/cnquery/resources/packs/opcua/info" + "go.mondoo.com/cnquery/providers/opcua/connection" ) -var Registry = info.Registry - -func init() { - Init(Registry) -} - -func opcuaProvider(p providers.Instance) (*opcua_provider.Provider, error) { - at, ok := p.(*opcua_provider.Provider) - if !ok { - return nil, errors.New("OPC UA resource is not supported on this provider") - } - return at, nil -} - func (o *mqlOpcua) id() (string, error) { return "opcua", nil } -func (o *mqlOpcua) GetRoot() (interface{}, error) { - op, err := opcuaProvider(o.MotorRuntime.Motor.Provider) - if err != nil { - return nil, err - } - client := op.Client() +func (o *mqlOpcua) root() (*mqlOpcuaNode, error) { + conn := o.MqlRuntime.Connection.(*connection.OpcuaConnection) + client := conn.Client() ctx := context.Background() n := client.Node(ua.NewNumericNodeID(0, id.RootFolder)) @@ -45,7 +25,7 @@ func (o *mqlOpcua) GetRoot() (interface{}, error) { if err != nil { return nil, err } - return newMqlOpcuaNodeResource(o.MotorRuntime, ndef) + return newMqlOpcuaNodeResource(o.MqlRuntime, ndef) } func resolve(ctx context.Context, meta *nodeMeta) ([]*nodeMeta, error) { @@ -96,12 +76,9 @@ func resolve(ctx context.Context, meta *nodeMeta) ([]*nodeMeta, error) { return nodeList, nil } -func (o *mqlOpcua) GetNodes() ([]interface{}, error) { - op, err := opcuaProvider(o.MotorRuntime.Motor.Provider) - if err != nil { - return nil, err - } - client := op.Client() +func (o *mqlOpcua) nodes() ([]interface{}, error) { + conn := o.MqlRuntime.Connection.(*connection.OpcuaConnection) + client := conn.Client() ctx := context.Background() n := client.Node(ua.NewNumericNodeID(0, id.RootFolder)) @@ -121,7 +98,7 @@ func (o *mqlOpcua) GetNodes() ([]interface{}, error) { // convert list to interface res := []interface{}{} for i := range nodeList { - entry, err := newMqlOpcuaNodeResource(o.MotorRuntime, nodeList[i]) + entry, err := newMqlOpcuaNodeResource(o.MqlRuntime, nodeList[i]) if err != nil { return nil, err } diff --git a/_resources/packs/opcua/opcua.lr b/providers/opcua/resources/opcua.lr similarity index 84% rename from _resources/packs/opcua/opcua.lr rename to providers/opcua/resources/opcua.lr index 1b802b8635..148feba28c 100644 --- a/_resources/packs/opcua/opcua.lr +++ b/providers/opcua/resources/opcua.lr @@ -1,7 +1,8 @@ // Copyright (c) Mondoo, Inc. // SPDX-License-Identifier: BUSL-1.1 -option go_package = "go.mondoo.com/cnquery/resources/packs/opcua" +option provider = "go.mondoo.com/cnquery/providers/opcua" +option go_package = "go.mondoo.com/cnquery/providers/opcua/resources" // OPC UA opcua { @@ -28,7 +29,7 @@ opcua.server { } // OPC UA Namespace -opcua.namespace { +private opcua.namespace { // Namespace ID id int // Namespace Name @@ -36,7 +37,7 @@ opcua.namespace { } // OPC UA Node -opcua.node @defaults("id name") { +private opcua.node @defaults("id name") { // Node id id string // Node browser name diff --git a/providers/opcua/resources/opcua.lr.go b/providers/opcua/resources/opcua.lr.go new file mode 100644 index 0000000000..e49b36fc31 --- /dev/null +++ b/providers/opcua/resources/opcua.lr.go @@ -0,0 +1,699 @@ +// Code generated by resources. DO NOT EDIT. +package resources + +import ( + "errors" + "time" + + "go.mondoo.com/cnquery/llx" + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/types" +) + +var resourceFactories map[string]plugin.ResourceFactory + +func init() { + resourceFactories = map[string]plugin.ResourceFactory { + "opcua": { + // to override args, implement: initOpcua(runtime *plugin.Runtime, args map[string]*llx.RawData) (map[string]*llx.RawData, plugin.Resource, error) + Create: createOpcua, + }, + "opcua.server": { + Init: initOpcuaServer, + Create: createOpcuaServer, + }, + "opcua.namespace": { + // to override args, implement: initOpcuaNamespace(runtime *plugin.Runtime, args map[string]*llx.RawData) (map[string]*llx.RawData, plugin.Resource, error) + Create: createOpcuaNamespace, + }, + "opcua.node": { + // to override args, implement: initOpcuaNode(runtime *plugin.Runtime, args map[string]*llx.RawData) (map[string]*llx.RawData, plugin.Resource, error) + Create: createOpcuaNode, + }, + } +} + +// NewResource is used by the runtime of this plugin to create new resources. +// Its arguments may be provided by users. This function is generally not +// used by initializing resources from recordings or from lists. +func NewResource(runtime *plugin.Runtime, name string, args map[string]*llx.RawData) (plugin.Resource, error) { + f, ok := resourceFactories[name] + if !ok { + return nil, errors.New("cannot find resource " + name + " in this provider") + } + + if f.Init != nil { + cargs, res, err := f.Init(runtime, args) + if err != nil { + return res, err + } + + if res != nil { + id := name+"\x00"+res.MqlID() + if x, ok := runtime.Resources[id]; ok { + return x, nil + } + runtime.Resources[id] = res + return res, nil + } + + args = cargs + } + + res, err := f.Create(runtime, args) + if err != nil { + return nil, err + } + + id := name+"\x00"+res.MqlID() + if x, ok := runtime.Resources[id]; ok { + return x, nil + } + + runtime.Resources[id] = res + return res, nil +} + +// CreateResource is used by the runtime of this plugin to create resources. +// Its arguments must be complete and pre-processed. This method is used +// for initializing resources from recordings or from lists. +func CreateResource(runtime *plugin.Runtime, name string, args map[string]*llx.RawData) (plugin.Resource, error) { + f, ok := resourceFactories[name] + if !ok { + return nil, errors.New("cannot find resource " + name + " in this provider") + } + + res, err := f.Create(runtime, args) + if err != nil { + return nil, err + } + + id := name+"\x00"+res.MqlID() + if x, ok := runtime.Resources[id]; ok { + return x, nil + } + + runtime.Resources[id] = res + return res, nil +} + +var getDataFields = map[string]func(r plugin.Resource) *plugin.DataRes{ + "opcua.namespaces": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcua).GetNamespaces()).ToDataRes(types.Array(types.Resource("opcua.namespace"))) + }, + "opcua.root": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcua).GetRoot()).ToDataRes(types.Resource("opcua.node")) + }, + "opcua.nodes": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcua).GetNodes()).ToDataRes(types.Array(types.Resource("opcua.node"))) + }, + "opcua.server.node": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaServer).GetNode()).ToDataRes(types.Resource("opcua.node")) + }, + "opcua.server.buildInfo": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaServer).GetBuildInfo()).ToDataRes(types.Dict) + }, + "opcua.server.currentTime": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaServer).GetCurrentTime()).ToDataRes(types.Time) + }, + "opcua.server.startTime": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaServer).GetStartTime()).ToDataRes(types.Time) + }, + "opcua.server.state": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaServer).GetState()).ToDataRes(types.String) + }, + "opcua.namespace.id": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNamespace).GetId()).ToDataRes(types.Int) + }, + "opcua.namespace.name": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNamespace).GetName()).ToDataRes(types.String) + }, + "opcua.node.id": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNode).GetId()).ToDataRes(types.String) + }, + "opcua.node.name": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNode).GetName()).ToDataRes(types.String) + }, + "opcua.node.namespace": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNode).GetNamespace()).ToDataRes(types.Resource("opcua.namespace")) + }, + "opcua.node.class": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNode).GetClass()).ToDataRes(types.String) + }, + "opcua.node.description": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNode).GetDescription()).ToDataRes(types.String) + }, + "opcua.node.writeable": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNode).GetWriteable()).ToDataRes(types.Bool) + }, + "opcua.node.dataType": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNode).GetDataType()).ToDataRes(types.String) + }, + "opcua.node.min": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNode).GetMin()).ToDataRes(types.String) + }, + "opcua.node.max": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNode).GetMax()).ToDataRes(types.String) + }, + "opcua.node.unit": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNode).GetUnit()).ToDataRes(types.String) + }, + "opcua.node.accessLevel": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNode).GetAccessLevel()).ToDataRes(types.String) + }, + "opcua.node.properties": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNode).GetProperties()).ToDataRes(types.Array(types.Resource("opcua.node"))) + }, + "opcua.node.components": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNode).GetComponents()).ToDataRes(types.Array(types.Resource("opcua.node"))) + }, + "opcua.node.organizes": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlOpcuaNode).GetOrganizes()).ToDataRes(types.Array(types.Resource("opcua.node"))) + }, +} + +func GetData(resource plugin.Resource, field string, args map[string]*llx.RawData) *plugin.DataRes { + f, ok := getDataFields[resource.MqlName()+"."+field] + if !ok { + return &plugin.DataRes{Error: "cannot find '" + field + "' in resource '" + resource.MqlName() + "'"} + } + + return f(resource) +} + +var setDataFields = map[string]func(r plugin.Resource, v *llx.RawData) bool { + "opcua.__id": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcua).__id, ok = v.Value.(string) + return + }, + "opcua.namespaces": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcua).Namespaces, ok = plugin.RawToTValue[[]interface{}](v.Value, v.Error) + return + }, + "opcua.root": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcua).Root, ok = plugin.RawToTValue[*mqlOpcuaNode](v.Value, v.Error) + return + }, + "opcua.nodes": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcua).Nodes, ok = plugin.RawToTValue[[]interface{}](v.Value, v.Error) + return + }, + "opcua.server.__id": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaServer).__id, ok = v.Value.(string) + return + }, + "opcua.server.node": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaServer).Node, ok = plugin.RawToTValue[*mqlOpcuaNode](v.Value, v.Error) + return + }, + "opcua.server.buildInfo": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaServer).BuildInfo, ok = plugin.RawToTValue[interface{}](v.Value, v.Error) + return + }, + "opcua.server.currentTime": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaServer).CurrentTime, ok = plugin.RawToTValue[*time.Time](v.Value, v.Error) + return + }, + "opcua.server.startTime": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaServer).StartTime, ok = plugin.RawToTValue[*time.Time](v.Value, v.Error) + return + }, + "opcua.server.state": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaServer).State, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, + "opcua.namespace.__id": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNamespace).__id, ok = v.Value.(string) + return + }, + "opcua.namespace.id": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNamespace).Id, ok = plugin.RawToTValue[int64](v.Value, v.Error) + return + }, + "opcua.namespace.name": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNamespace).Name, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, + "opcua.node.__id": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNode).__id, ok = v.Value.(string) + return + }, + "opcua.node.id": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNode).Id, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, + "opcua.node.name": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNode).Name, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, + "opcua.node.namespace": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNode).Namespace, ok = plugin.RawToTValue[*mqlOpcuaNamespace](v.Value, v.Error) + return + }, + "opcua.node.class": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNode).Class, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, + "opcua.node.description": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNode).Description, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, + "opcua.node.writeable": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNode).Writeable, ok = plugin.RawToTValue[bool](v.Value, v.Error) + return + }, + "opcua.node.dataType": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNode).DataType, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, + "opcua.node.min": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNode).Min, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, + "opcua.node.max": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNode).Max, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, + "opcua.node.unit": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNode).Unit, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, + "opcua.node.accessLevel": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNode).AccessLevel, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, + "opcua.node.properties": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNode).Properties, ok = plugin.RawToTValue[[]interface{}](v.Value, v.Error) + return + }, + "opcua.node.components": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNode).Components, ok = plugin.RawToTValue[[]interface{}](v.Value, v.Error) + return + }, + "opcua.node.organizes": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlOpcuaNode).Organizes, ok = plugin.RawToTValue[[]interface{}](v.Value, v.Error) + return + }, +} + +func SetData(resource plugin.Resource, field string, val *llx.RawData) error { + f, ok := setDataFields[resource.MqlName() + "." + field] + if !ok { + return errors.New("[opcua] cannot set '"+field+"' in resource '"+resource.MqlName()+"', field not found") + } + + if ok := f(resource, val); !ok { + return errors.New("[opcua] cannot set '"+field+"' in resource '"+resource.MqlName()+"', type does not match") + } + return nil +} + +func SetAllData(resource plugin.Resource, args map[string]*llx.RawData) error { + var err error + for k, v := range args { + if err = SetData(resource, k, v); err != nil { + return err + } + } + return nil +} + +// mqlOpcua for the opcua resource +type mqlOpcua struct { + MqlRuntime *plugin.Runtime + __id string + // optional: if you define mqlOpcuaInternal it will be used here + Namespaces plugin.TValue[[]interface{}] + Root plugin.TValue[*mqlOpcuaNode] + Nodes plugin.TValue[[]interface{}] +} + +// createOpcua creates a new instance of this resource +func createOpcua(runtime *plugin.Runtime, args map[string]*llx.RawData) (plugin.Resource, error) { + res := &mqlOpcua{ + MqlRuntime: runtime, + } + + err := SetAllData(res, args) + if err != nil { + return res, err + } + + if res.__id == "" { + res.__id, err = res.id() + if err != nil { + return nil, err + } + } + + if runtime.HasRecording { + args, err = runtime.ResourceFromRecording("opcua", res.__id) + if err != nil || args == nil { + return res, err + } + return res, SetAllData(res, args) + } + + return res, nil +} + +func (c *mqlOpcua) MqlName() string { + return "opcua" +} + +func (c *mqlOpcua) MqlID() string { + return c.__id +} + +func (c *mqlOpcua) GetNamespaces() *plugin.TValue[[]interface{}] { + return plugin.GetOrCompute[[]interface{}](&c.Namespaces, func() ([]interface{}, error) { + if c.MqlRuntime.HasRecording { + d, err := c.MqlRuntime.FieldResourceFromRecording("opcua", c.__id, "namespaces") + if err != nil { + return nil, err + } + if d != nil { + return d.Value.([]interface{}), nil + } + } + + return c.namespaces() + }) +} + +func (c *mqlOpcua) GetRoot() *plugin.TValue[*mqlOpcuaNode] { + return plugin.GetOrCompute[*mqlOpcuaNode](&c.Root, func() (*mqlOpcuaNode, error) { + if c.MqlRuntime.HasRecording { + d, err := c.MqlRuntime.FieldResourceFromRecording("opcua", c.__id, "root") + if err != nil { + return nil, err + } + if d != nil { + return d.Value.(*mqlOpcuaNode), nil + } + } + + return c.root() + }) +} + +func (c *mqlOpcua) GetNodes() *plugin.TValue[[]interface{}] { + return plugin.GetOrCompute[[]interface{}](&c.Nodes, func() ([]interface{}, error) { + if c.MqlRuntime.HasRecording { + d, err := c.MqlRuntime.FieldResourceFromRecording("opcua", c.__id, "nodes") + if err != nil { + return nil, err + } + if d != nil { + return d.Value.([]interface{}), nil + } + } + + return c.nodes() + }) +} + +// mqlOpcuaServer for the opcua.server resource +type mqlOpcuaServer struct { + MqlRuntime *plugin.Runtime + __id string + // optional: if you define mqlOpcuaServerInternal it will be used here + Node plugin.TValue[*mqlOpcuaNode] + BuildInfo plugin.TValue[interface{}] + CurrentTime plugin.TValue[*time.Time] + StartTime plugin.TValue[*time.Time] + State plugin.TValue[string] +} + +// createOpcuaServer creates a new instance of this resource +func createOpcuaServer(runtime *plugin.Runtime, args map[string]*llx.RawData) (plugin.Resource, error) { + res := &mqlOpcuaServer{ + MqlRuntime: runtime, + } + + err := SetAllData(res, args) + if err != nil { + return res, err + } + + if res.__id == "" { + res.__id, err = res.id() + if err != nil { + return nil, err + } + } + + if runtime.HasRecording { + args, err = runtime.ResourceFromRecording("opcua.server", res.__id) + if err != nil || args == nil { + return res, err + } + return res, SetAllData(res, args) + } + + return res, nil +} + +func (c *mqlOpcuaServer) MqlName() string { + return "opcua.server" +} + +func (c *mqlOpcuaServer) MqlID() string { + return c.__id +} + +func (c *mqlOpcuaServer) GetNode() *plugin.TValue[*mqlOpcuaNode] { + return &c.Node +} + +func (c *mqlOpcuaServer) GetBuildInfo() *plugin.TValue[interface{}] { + return &c.BuildInfo +} + +func (c *mqlOpcuaServer) GetCurrentTime() *plugin.TValue[*time.Time] { + return &c.CurrentTime +} + +func (c *mqlOpcuaServer) GetStartTime() *plugin.TValue[*time.Time] { + return &c.StartTime +} + +func (c *mqlOpcuaServer) GetState() *plugin.TValue[string] { + return &c.State +} + +// mqlOpcuaNamespace for the opcua.namespace resource +type mqlOpcuaNamespace struct { + MqlRuntime *plugin.Runtime + __id string + // optional: if you define mqlOpcuaNamespaceInternal it will be used here + Id plugin.TValue[int64] + Name plugin.TValue[string] +} + +// createOpcuaNamespace creates a new instance of this resource +func createOpcuaNamespace(runtime *plugin.Runtime, args map[string]*llx.RawData) (plugin.Resource, error) { + res := &mqlOpcuaNamespace{ + MqlRuntime: runtime, + } + + err := SetAllData(res, args) + if err != nil { + return res, err + } + + if res.__id == "" { + res.__id, err = res.id() + if err != nil { + return nil, err + } + } + + if runtime.HasRecording { + args, err = runtime.ResourceFromRecording("opcua.namespace", res.__id) + if err != nil || args == nil { + return res, err + } + return res, SetAllData(res, args) + } + + return res, nil +} + +func (c *mqlOpcuaNamespace) MqlName() string { + return "opcua.namespace" +} + +func (c *mqlOpcuaNamespace) MqlID() string { + return c.__id +} + +func (c *mqlOpcuaNamespace) GetId() *plugin.TValue[int64] { + return &c.Id +} + +func (c *mqlOpcuaNamespace) GetName() *plugin.TValue[string] { + return &c.Name +} + +// mqlOpcuaNode for the opcua.node resource +type mqlOpcuaNode struct { + MqlRuntime *plugin.Runtime + __id string + mqlOpcuaNodeInternal + Id plugin.TValue[string] + Name plugin.TValue[string] + Namespace plugin.TValue[*mqlOpcuaNamespace] + Class plugin.TValue[string] + Description plugin.TValue[string] + Writeable plugin.TValue[bool] + DataType plugin.TValue[string] + Min plugin.TValue[string] + Max plugin.TValue[string] + Unit plugin.TValue[string] + AccessLevel plugin.TValue[string] + Properties plugin.TValue[[]interface{}] + Components plugin.TValue[[]interface{}] + Organizes plugin.TValue[[]interface{}] +} + +// createOpcuaNode creates a new instance of this resource +func createOpcuaNode(runtime *plugin.Runtime, args map[string]*llx.RawData) (plugin.Resource, error) { + res := &mqlOpcuaNode{ + MqlRuntime: runtime, + } + + err := SetAllData(res, args) + if err != nil { + return res, err + } + + if res.__id == "" { + res.__id, err = res.id() + if err != nil { + return nil, err + } + } + + if runtime.HasRecording { + args, err = runtime.ResourceFromRecording("opcua.node", res.__id) + if err != nil || args == nil { + return res, err + } + return res, SetAllData(res, args) + } + + return res, nil +} + +func (c *mqlOpcuaNode) MqlName() string { + return "opcua.node" +} + +func (c *mqlOpcuaNode) MqlID() string { + return c.__id +} + +func (c *mqlOpcuaNode) GetId() *plugin.TValue[string] { + return &c.Id +} + +func (c *mqlOpcuaNode) GetName() *plugin.TValue[string] { + return &c.Name +} + +func (c *mqlOpcuaNode) GetNamespace() *plugin.TValue[*mqlOpcuaNamespace] { + return plugin.GetOrCompute[*mqlOpcuaNamespace](&c.Namespace, func() (*mqlOpcuaNamespace, error) { + if c.MqlRuntime.HasRecording { + d, err := c.MqlRuntime.FieldResourceFromRecording("opcua.node", c.__id, "namespace") + if err != nil { + return nil, err + } + if d != nil { + return d.Value.(*mqlOpcuaNamespace), nil + } + } + + return c.namespace() + }) +} + +func (c *mqlOpcuaNode) GetClass() *plugin.TValue[string] { + return &c.Class +} + +func (c *mqlOpcuaNode) GetDescription() *plugin.TValue[string] { + return &c.Description +} + +func (c *mqlOpcuaNode) GetWriteable() *plugin.TValue[bool] { + return &c.Writeable +} + +func (c *mqlOpcuaNode) GetDataType() *plugin.TValue[string] { + return &c.DataType +} + +func (c *mqlOpcuaNode) GetMin() *plugin.TValue[string] { + return &c.Min +} + +func (c *mqlOpcuaNode) GetMax() *plugin.TValue[string] { + return &c.Max +} + +func (c *mqlOpcuaNode) GetUnit() *plugin.TValue[string] { + return &c.Unit +} + +func (c *mqlOpcuaNode) GetAccessLevel() *plugin.TValue[string] { + return &c.AccessLevel +} + +func (c *mqlOpcuaNode) GetProperties() *plugin.TValue[[]interface{}] { + return plugin.GetOrCompute[[]interface{}](&c.Properties, func() ([]interface{}, error) { + if c.MqlRuntime.HasRecording { + d, err := c.MqlRuntime.FieldResourceFromRecording("opcua.node", c.__id, "properties") + if err != nil { + return nil, err + } + if d != nil { + return d.Value.([]interface{}), nil + } + } + + return c.properties() + }) +} + +func (c *mqlOpcuaNode) GetComponents() *plugin.TValue[[]interface{}] { + return plugin.GetOrCompute[[]interface{}](&c.Components, func() ([]interface{}, error) { + if c.MqlRuntime.HasRecording { + d, err := c.MqlRuntime.FieldResourceFromRecording("opcua.node", c.__id, "components") + if err != nil { + return nil, err + } + if d != nil { + return d.Value.([]interface{}), nil + } + } + + return c.components() + }) +} + +func (c *mqlOpcuaNode) GetOrganizes() *plugin.TValue[[]interface{}] { + return plugin.GetOrCompute[[]interface{}](&c.Organizes, func() ([]interface{}, error) { + if c.MqlRuntime.HasRecording { + d, err := c.MqlRuntime.FieldResourceFromRecording("opcua.node", c.__id, "organizes") + if err != nil { + return nil, err + } + if d != nil { + return d.Value.([]interface{}), nil + } + } + + return c.organizes() + }) +} diff --git a/providers/opcua/resources/server.go b/providers/opcua/resources/server.go new file mode 100644 index 0000000000..246c9ec73a --- /dev/null +++ b/providers/opcua/resources/server.go @@ -0,0 +1,67 @@ +// Copyright (c) Mondoo, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package resources + +import ( + "context" + + "github.com/gopcua/opcua/id" + "github.com/gopcua/opcua/ua" + "go.mondoo.com/cnquery/llx" + "go.mondoo.com/cnquery/providers-sdk/v1/plugin" + "go.mondoo.com/cnquery/providers-sdk/v1/util/convert" + "go.mondoo.com/cnquery/providers/opcua/connection" +) + +func initOpcuaServer(runtime *plugin.Runtime, args map[string]*llx.RawData) (map[string]*llx.RawData, plugin.Resource, error) { + conn := runtime.Connection.(*connection.OpcuaConnection) + client := conn.Client() + + ctx := context.Background() + n := client.Node(ua.NewNumericNodeID(0, id.Server)) + ndef, err := fetchNodeInfo(ctx, n) + if err != nil { + return nil, nil, err + } + + // create server resource + serverNode, err := newMqlOpcuaNodeResource(runtime, ndef) + if err != nil { + return nil, nil, err + } + args["node"] = llx.ResourceData(serverNode, "opcua.node") + + // server status variable of server + nodeID := ua.NewNumericNodeID(0, id.Server_ServerStatus) + v, err := client.Node(nodeID).Value(ctx) + switch { + case err != nil: + return nil, nil, err + case v == nil: + args["buildInfo"] = llx.NilData + args["currentTime"] = llx.NilData + args["startTime"] = llx.NilData + args["state"] = llx.StringData("") + default: + res := v.Value() + extensionObject := res.(*ua.ExtensionObject) + serverStatus := extensionObject.Value.(*ua.ServerStatusDataType) + + buildInfo, _ := convert.JsonToDict(serverStatus.BuildInfo) + args["buildInfo"] = llx.DictData(buildInfo) + args["currentTime"] = llx.TimeData(serverStatus.CurrentTime) + args["startTime"] = llx.TimeData(serverStatus.StartTime) + args["state"] = llx.StringData(serverStatus.State.String()) + } + + return args, nil, nil +} + +func (o *mqlOpcuaServer) id() (string, error) { + if o.Node.Error != nil { + return "", o.Node.Error + } + node := o.Node.Data + return "opcua.server/" + node.Id.Data, nil +}