From 4de1d79d0eae28f02552fe3fc7b410b4e25fe0f5 Mon Sep 17 00:00:00 2001 From: artaasadi Date: Thu, 7 Nov 2024 17:28:15 +0100 Subject: [PATCH] fix: get configs from opengovernance --- go.mod | 4 +++- go.sum | 6 ++++++ .../runable/steampipe_es_client_generator/main.go | 2 +- provider/configs/credentials.go | 10 +++------- provider/configs/general.go | 8 +++++--- provider/configs/nats.go | 12 +++++++----- 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 145f0761..cbf578ac 100755 --- a/go.mod +++ b/go.mod @@ -113,7 +113,7 @@ require ( github.com/microsoftgraph/msgraph-sdk-go-core v1.2.1 github.com/nats-io/nats.go v1.36.0 github.com/opengovern/og-util v1.0.6-0.20241105222646-0d15ca2bc5c5 - github.com/spf13/cobra v1.7.0 + github.com/spf13/cobra v1.8.1 github.com/tombuildsstuff/giovanni v0.18.0 github.com/turbot/steampipe-plugin-sdk/v5 v5.10.1 go.uber.org/zap v1.26.0 @@ -165,6 +165,7 @@ require ( cloud.google.com/go/storage v1.38.0 // indirect github.com/Azure/azure-pipeline-go v0.2.3 // indirect github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization v1.0.0 // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect github.com/Azure/go-autorest/autorest/adal v0.9.23 // indirect github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect @@ -270,6 +271,7 @@ require ( github.com/nats-io/nuid v1.0.1 // indirect github.com/oklog/run v1.1.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/opengovern/opengovernance v0.434.30-feat-integrations-service.1 // indirect github.com/opensearch-project/opensearch-go/v2 v2.3.0 // indirect github.com/pganalyze/pg_query_go/v4 v4.2.3 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect diff --git a/go.sum b/go.sum index 7f307527..de2f93d8 100644 --- a/go.sum +++ b/go.sum @@ -213,6 +213,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapp github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights v1.2.0/go.mod h1:S7Ss6Rm0nlKDRHKrO9eL2Be5EnX29Z09CNPWgK7o4+I= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice v1.0.0 h1:kRX8I0dWAcpW6Vq0m90CgV+qw4O1vXodgwrhoPr1RWs= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice v1.0.0/go.mod h1:avvc5/7qR4taCvAhOM7KFXuEHhAU0Wek9YX7sh9H3EM= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization v1.0.0 h1:qtRcg5Y7jNJ4jEzPq4GpWLfTspHdNe2ZK6LjwGcjgmU= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization v1.0.0/go.mod h1:lPneRe3TwsoDRKY4O6YDLXHhEWrD+TIRa8XrV/3/fqw= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2 v2.2.0 h1:Hp+EScFOu9HeCbeW8WU2yQPJd4gGwhMgKxWe+G6jNzw= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2 v2.2.0/go.mod h1:/pz8dyNQe+Ey3yBp/XuYz7oqX8YDNWVpPB0hH3XWfbc= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation v0.9.0 h1:pzgp0VZDAnmgAkUPeedW1dTd7v3kSrwxFNabFAzB158= @@ -532,6 +534,7 @@ github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMe github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk= @@ -998,6 +1001,8 @@ github.com/opengovern/og-util v1.0.6-0.20241105221143-8665d83abd91 h1:ZIzcv1mD09 github.com/opengovern/og-util v1.0.6-0.20241105221143-8665d83abd91/go.mod h1:7l7fNhK6uewIwA0cs7QagJuhjt/E6hEAC01SR8Y0kKk= github.com/opengovern/og-util v1.0.6-0.20241105222646-0d15ca2bc5c5 h1:rfIElwBZ3EdvKX6gV/luUAdbrILVKyNpWP/VXHWb5ik= github.com/opengovern/og-util v1.0.6-0.20241105222646-0d15ca2bc5c5/go.mod h1:7l7fNhK6uewIwA0cs7QagJuhjt/E6hEAC01SR8Y0kKk= +github.com/opengovern/opengovernance v0.434.30-feat-integrations-service.1 h1:s9UbN5g8/44vus6b507vnHUmL4gF7BTdTkmqHc/P8Ec= +github.com/opengovern/opengovernance v0.434.30-feat-integrations-service.1/go.mod h1:TOmxA2GsntO8AncUBf/xQX+VRbTQz/NRqggXmBp3nDk= github.com/opensearch-project/opensearch-go/v2 v2.3.0 h1:nQIEMr+A92CkhHrZgUhcfsrZjibvB3APXf2a1VwCmMQ= github.com/opensearch-project/opensearch-go/v2 v2.3.0/go.mod h1:8LDr9FCgUTVoT+5ESjc2+iaZuldqE+23Iq0r1XeNue8= github.com/pganalyze/pg_query_go/v4 v4.2.3 h1:cNLqyiVMasV7YGWyYV+fkXyHp32gDfXVNCqoHztEGNk= @@ -1058,6 +1063,7 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/std-uritemplate/std-uritemplate/go v0.0.57 h1:GHGjptrsmazP4IVDlUprssiEf9ESVkbjx15xQXXzvq4= diff --git a/pkg/sdk/runable/steampipe_es_client_generator/main.go b/pkg/sdk/runable/steampipe_es_client_generator/main.go index 4a5badee..9ed75f2f 100755 --- a/pkg/sdk/runable/steampipe_es_client_generator/main.go +++ b/pkg/sdk/runable/steampipe_es_client_generator/main.go @@ -5,7 +5,7 @@ import ( "encoding/json" "flag" "fmt" - "github.com/opengovern/og-describer-entraid/provider/configs" + "github.com/opengovern/og-describer-azure/provider/configs" "go/ast" "go/format" "go/parser" diff --git a/provider/configs/credentials.go b/provider/configs/credentials.go index 1287e444..c77168b3 100644 --- a/provider/configs/credentials.go +++ b/provider/configs/credentials.go @@ -1,11 +1,7 @@ package configs +import "github.com/opengovern/opengovernance/services/integration/integration-type/azure_subscription/configs" + type IntegrationCredentials struct { - TenantID string `json:"tenant_id"` - ClientID string `json:"client_id"` - ClientSecret string `json:"client_secret"` - CertificatePath string `json:"certificate_path"` - CertificatePass string `json:"certificate_pass"` - Username string `json:"username"` - Password string `json:"password"` + configs.IntegrationCredentials } diff --git a/provider/configs/general.go b/provider/configs/general.go index f679440f..6377d3d0 100644 --- a/provider/configs/general.go +++ b/provider/configs/general.go @@ -1,9 +1,11 @@ package configs -import "github.com/opengovern/og-util/pkg/integration" +import ( + "github.com/opengovern/opengovernance/services/integration/integration-type/azure_subscription/configs" +) const ( - IntegrationTypeLower = "azure" // example: aws, azure - IntegrationName = integration.Type("AZURE_SUBSCRIPTION") // example: AWS_ACCOUNT, AZURE_SUBSCRIPTION + IntegrationTypeLower = "azure" // example: aws, azure + IntegrationName = configs.IntegrationName OGPluginRepoURL = "github.com/opengovern/og-describer-azure" // example: github.com/opengovern/og-describer-aws ) diff --git a/provider/configs/nats.go b/provider/configs/nats.go index a227278b..bcd142d3 100644 --- a/provider/configs/nats.go +++ b/provider/configs/nats.go @@ -1,9 +1,11 @@ package configs +import "github.com/opengovern/opengovernance/services/integration/integration-type/azure_subscription/configs" + const ( - StreamName = "og_azure_describer" - JobQueueTopic = "og_azure_describer_job_queue" - ConsumerGroup = "azure-describer" - JobQueueTopicManuals = "og_azure_describer_manuals_job_queue" - ConsumerGroupManuals = "azure-describer-manuals" + StreamName = configs.ConsumerGroup + JobQueueTopic = configs.JobQueueTopic + ConsumerGroup = configs.ConsumerGroup + JobQueueTopicManuals = configs.JobQueueTopicManuals + ConsumerGroupManuals = configs.ConsumerGroupManuals )