From d01759e00ec0a687e3e8721f79f27a31bde87c0c Mon Sep 17 00:00:00 2001 From: Jordan Refaeli Date: Mon, 1 Jan 2024 17:37:02 +0200 Subject: [PATCH 01/10] Add support for create GitHub integrations (#144) --- .../create/create-github-integration.go | 17 +++++++++++++++++ .../integrations/create/create-integration.go | 1 + 2 files changed, 18 insertions(+) create mode 100644 src/cmd/integrations/create/create-github-integration.go diff --git a/src/cmd/integrations/create/create-github-integration.go b/src/cmd/integrations/create/create-github-integration.go new file mode 100644 index 0000000..2575838 --- /dev/null +++ b/src/cmd/integrations/create/create-github-integration.go @@ -0,0 +1,17 @@ +package create + +import ( + "github.com/otterize/otterize-cli/src/pkg/output" + "github.com/spf13/cobra" +) + +var CreateGithubIntegrationCmd = &cobra.Command{ + Use: "github", + Short: "Create a GitHub integration", + Args: cobra.NoArgs, + SilenceUsage: true, + RunE: func(_ *cobra.Command, args []string) error { + output.PrintStdout("To create a GitHub integration, you need to authorize Otterize Cloud on your GitHub account. To do that, use Otterize Cloud at https://app.otterize.com/integrations") + return nil + }, +} diff --git a/src/cmd/integrations/create/create-integration.go b/src/cmd/integrations/create/create-integration.go index 48fc689..9230660 100644 --- a/src/cmd/integrations/create/create-integration.go +++ b/src/cmd/integrations/create/create-integration.go @@ -13,4 +13,5 @@ func init() { CreateIntegrationCmd.AddCommand(CreateKubernetesIntegrationCmd) CreateIntegrationCmd.AddCommand(CreateGenericIntegrationCmd) CreateIntegrationCmd.AddCommand(CreateDatabaseIntegrationCmd) + CreateIntegrationCmd.AddCommand(CreateGithubIntegrationCmd) } From 24ba3242d7410ee5d335895266d67d107335cfe2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 09:01:21 +0000 Subject: [PATCH 02/10] Bump golang.org/x/image from 0.5.0 to 0.10.0 (#146) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c6deff5..6b87fca 100644 --- a/go.mod +++ b/go.mod @@ -110,7 +110,7 @@ require ( github.com/vektah/gqlparser v1.3.1 // indirect github.com/vektah/gqlparser/v2 v2.5.10 // indirect golang.org/x/crypto v0.16.0 // indirect - golang.org/x/image v0.5.0 // indirect + golang.org/x/image v0.10.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/go.sum b/go.sum index 0fe08fe..90285ef 100644 --- a/go.sum +++ b/go.sum @@ -591,8 +591,8 @@ golang.org/x/exp v0.0.0-20230124195608-d38c7dcee874/go.mod h1:CxIveKay+FTh1D0yPZ 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/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.5.0 h1:5JMiNunQeQw++mMOz48/ISeNu3Iweh/JaZU8ZLqHRrI= -golang.org/x/image v0.5.0/go.mod h1:FVC7BI/5Ym8R25iw5OLsgshdUBbT1h5jZTpA+mvAdZ4= +golang.org/x/image v0.10.0 h1:gXjUUtwtx5yOE0VKWq1CH4IJAClq4UGgUA3i+rpON9M= +golang.org/x/image v0.10.0/go.mod h1:jtrku+n79PfroUbvDdeUWMAI+heR786BofxrbiSF+J0= 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= @@ -617,6 +617,7 @@ 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/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -671,6 +672,7 @@ golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -709,6 +711,7 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -788,10 +791,12 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -804,6 +809,7 @@ 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.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -868,6 +874,7 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 7ce354fb691d524bbcf9e2569622316c39e70dcd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 09:07:51 +0000 Subject: [PATCH 03/10] Bump golang.org/x/crypto from 0.16.0 to 0.17.0 (#145) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6b87fca..d073bf4 100644 --- a/go.mod +++ b/go.mod @@ -109,7 +109,7 @@ require ( github.com/valyala/fasttemplate v1.2.2 // indirect github.com/vektah/gqlparser v1.3.1 // indirect github.com/vektah/gqlparser/v2 v2.5.10 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/image v0.10.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/go.sum b/go.sum index 90285ef..5b874e2 100644 --- a/go.sum +++ b/go.sum @@ -574,8 +574,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= From 8c08886bd548091f2bbafa4c771c2ef0fdf12aaf Mon Sep 17 00:00:00 2001 From: omris94 <46892443+omris94@users.noreply.github.com> Date: Tue, 30 Jan 2024 01:26:10 +0200 Subject: [PATCH 04/10] Use default kubectl config loading rules (#147) --- src/pkg/kafkamapper/mapper.go | 11 ++++++++--- src/pkg/portforwarder/portforwarder.go | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/pkg/kafkamapper/mapper.go b/src/pkg/kafkamapper/mapper.go index 9212216..d251b64 100644 --- a/src/pkg/kafkamapper/mapper.go +++ b/src/pkg/kafkamapper/mapper.go @@ -13,8 +13,6 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/clientcmd" - "k8s.io/client-go/util/homedir" - "path/filepath" ) var ( @@ -41,7 +39,14 @@ type Mapper struct { } func NewMapper() (*Mapper, error) { - config, err := clientcmd.BuildConfigFromFlags("", filepath.Join(homedir.HomeDir(), ".kube", "config")) + loadingRules := clientcmd.NewDefaultClientConfigLoadingRules() + // if you want to change the loading rules (which files in which order), you can do so here + + configOverrides := &clientcmd.ConfigOverrides{} + // if you want to change override values or bind them to flags, there are methods to help you + + kubeConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, configOverrides) + config, err := kubeConfig.ClientConfig() if err != nil { return nil, err } diff --git a/src/pkg/portforwarder/portforwarder.go b/src/pkg/portforwarder/portforwarder.go index 6077512..a074d9a 100644 --- a/src/pkg/portforwarder/portforwarder.go +++ b/src/pkg/portforwarder/portforwarder.go @@ -12,11 +12,9 @@ import ( "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/portforward" "k8s.io/client-go/transport/spdy" - "k8s.io/client-go/util/homedir" "net/http" "net/url" "os" - "path/filepath" ) type PortForwarder struct { @@ -34,7 +32,14 @@ func NewPortForwarder(namespace string, serviceName string, servicePort int) *Po } func (p *PortForwarder) Start(ctx context.Context) (localPort int, err error) { - config, err := clientcmd.BuildConfigFromFlags("", filepath.Join(homedir.HomeDir(), ".kube", "config")) + loadingRules := clientcmd.NewDefaultClientConfigLoadingRules() + // if you want to change the loading rules (which files in which order), you can do so here + + configOverrides := &clientcmd.ConfigOverrides{} + // if you want to change override values or bind them to flags, there are methods to help you + + kubeConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, configOverrides) + config, err := kubeConfig.ClientConfig() if err != nil { return 0, err } From f096a8eebb982893582ac602e520a4152bd79299 Mon Sep 17 00:00:00 2001 From: otterizebot Date: Tue, 30 Jan 2024 10:22:31 +0000 Subject: [PATCH 05/10] Update otterize-cli version to v1.0.3 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 78ee7b9..89c90f3 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ brew install otterize/otterize/otterize-cli ``` Linux 64-bit ```bash -wget https://get.otterize.com/otterize-cli/v1.0.2/otterize_linux_x86_64.tar.gz +wget https://get.otterize.com/otterize-cli/v1.0.3/otterize_linux_x86_64.tar.gz tar xf otterize_linux_x86_64.tar.gz sudo cp otterize /usr/local/bin ``` From 16eb9814724c1be3a2e991d637fae11ec04cf28f Mon Sep 17 00:00:00 2001 From: Netanel Bollag <54136032+NetanelBollag@users.noreply.github.com> Date: Sun, 18 Feb 2024 11:26:17 +0100 Subject: [PATCH 06/10] Fix bug where mapper list command print line in wrong order when intents have HTTP resources (#148) --- src/pkg/intentsoutput/intentslister/lister.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pkg/intentsoutput/intentslister/lister.go b/src/pkg/intentsoutput/intentslister/lister.go index e47b788..bc57bf0 100644 --- a/src/pkg/intentsoutput/intentslister/lister.go +++ b/src/pkg/intentsoutput/intentslister/lister.go @@ -13,10 +13,10 @@ func ListFormattedIntents(intents []v1alpha3.ClientIntents) { for _, call := range intent.GetCallsList() { output.PrintStdout(" - %s in namespace %s", call.GetTargetServerName(), call.GetTargetServerNamespace(intent.GetNamespace())) for _, topic := range call.Topics { - output.PrintStderr(" - Kafka topic: %s, operations: %s", topic.Name, topic.Operations) + output.PrintStdout(" - Kafka topic: %s, operations: %s", topic.Name, topic.Operations) } for _, resource := range call.HTTPResources { - output.PrintStderr(" - path %s, methods: %s", resource.Path, strings.ReplaceAll(fmt.Sprintf("%s", resource.Methods), " ", ",")) + output.PrintStdout(" - path %s, methods: %s", resource.Path, strings.ReplaceAll(fmt.Sprintf("%s", resource.Methods), " ", ",")) } } } From a1761898b5d69bc9f7fc8222594c6be954c79310 Mon Sep 17 00:00:00 2001 From: otterizebot Date: Sun, 18 Feb 2024 16:00:50 +0000 Subject: [PATCH 07/10] Update otterize-cli version to v1.0.4 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 89c90f3..535ac31 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ brew install otterize/otterize/otterize-cli ``` Linux 64-bit ```bash -wget https://get.otterize.com/otterize-cli/v1.0.3/otterize_linux_x86_64.tar.gz +wget https://get.otterize.com/otterize-cli/v1.0.4/otterize_linux_x86_64.tar.gz tar xf otterize_linux_x86_64.tar.gz sudo cp otterize /usr/local/bin ``` From c88410b35e92f9095f3415854688d1d3cbba5e85 Mon Sep 17 00:00:00 2001 From: Jordan Refaeli Date: Sun, 25 Feb 2024 18:57:38 +0200 Subject: [PATCH 08/10] Combine the clusters and integrations commands (#149) --- .../create/create-kubernetes-integration.go | 12 +- .../update/update-kubernetes-integration.go | 6 +- src/pkg/cloudclient/graphql/generated.go | 19 +- src/pkg/cloudclient/graphql/schema.graphql | 269 +++++- .../cloudclient/restapi/cloudapi/api.gen.go | 827 ++++++++++++++++-- .../cloudclient/restapi/cloudapi/openapi.json | 695 ++++++++++++--- src/pkg/mapperclient/generated.go | 7 +- src/pkg/mapperclient/schema.graphql | 13 +- src/pkg/telemetry/telemetrygql/generated.go | 13 +- src/pkg/telemetry/telemetrygql/schema.graphql | 269 +++++- 10 files changed, 1839 insertions(+), 291 deletions(-) diff --git a/src/cmd/integrations/create/create-kubernetes-integration.go b/src/cmd/integrations/create/create-kubernetes-integration.go index 80e2c18..0a5cd62 100644 --- a/src/cmd/integrations/create/create-kubernetes-integration.go +++ b/src/cmd/integrations/create/create-kubernetes-integration.go @@ -12,8 +12,9 @@ import ( ) const ( - EnvironmentIDKey = "env-id" - ClusterIDKey = "cluster-id" + EnvironmentIDKey = "env-id" + IntegrationNameKey = "name" + IntegrationNameShorthand = "n" ) var CreateKubernetesIntegrationCmd = &cobra.Command{ @@ -33,7 +34,7 @@ var CreateKubernetesIntegrationCmd = &cobra.Command{ r, err := c.CreateKubernetesIntegrationMutationWithResponse(ctxTimeout, cloudapi.CreateKubernetesIntegrationMutationJSONRequestBody{ EnvironmentId: lo.Ternary(viper.IsSet(EnvironmentIDKey), lo.ToPtr(viper.GetString(EnvironmentIDKey)), nil), - ClusterId: viper.GetString(ClusterIDKey), + Name: viper.GetString(IntegrationNameKey), }) if err != nil { return err @@ -46,6 +47,7 @@ var CreateKubernetesIntegrationCmd = &cobra.Command{ func init() { CreateKubernetesIntegrationCmd.Flags().String(EnvironmentIDKey, "", "default environment id") - CreateKubernetesIntegrationCmd.Flags().String(ClusterIDKey, "", "cluster id") - cobra.CheckErr(CreateKubernetesIntegrationCmd.MarkFlagRequired(ClusterIDKey)) + CreateKubernetesIntegrationCmd.Flags().StringP(IntegrationNameKey, IntegrationNameShorthand, "", "integration name") + cobra.CheckErr(CreateKubernetesIntegrationCmd.MarkFlagRequired(EnvironmentIDKey)) + cobra.CheckErr(CreateKubernetesIntegrationCmd.MarkFlagRequired(IntegrationNameKey)) } diff --git a/src/cmd/integrations/update/update-kubernetes-integration.go b/src/cmd/integrations/update/update-kubernetes-integration.go index cf5c8eb..5fe7b8b 100644 --- a/src/cmd/integrations/update/update-kubernetes-integration.go +++ b/src/cmd/integrations/update/update-kubernetes-integration.go @@ -13,7 +13,9 @@ import ( ) const ( - EnvironmentIdKey = "env-id" + EnvironmentIdKey = "env-id" + IntegrationNameKey = "name" + IntegrationNameShorthand = "n" ) var UpdateKubernetesIntegrationCmd = &cobra.Command{ @@ -34,6 +36,7 @@ var UpdateKubernetesIntegrationCmd = &cobra.Command{ id, cloudapi.UpdateKubernetesIntegrationMutationJSONRequestBody{ EnvironmentId: lo.Ternary(viper.IsSet(EnvironmentIdKey), lo.ToPtr(viper.GetString(EnvironmentIdKey)), nil), + Name: lo.ToPtr(viper.GetString(IntegrationNameKey)), }, ) if err != nil { @@ -48,4 +51,5 @@ var UpdateKubernetesIntegrationCmd = &cobra.Command{ func init() { UpdateKubernetesIntegrationCmd.Flags().String(EnvironmentIdKey, "", "new default environment") + UpdateKubernetesIntegrationCmd.Flags().StringP(IntegrationNameKey, IntegrationNameShorthand, "", "integration name") } diff --git a/src/pkg/cloudclient/graphql/generated.go b/src/pkg/cloudclient/graphql/generated.go index d703796..c274795 100644 --- a/src/pkg/cloudclient/graphql/generated.go +++ b/src/pkg/cloudclient/graphql/generated.go @@ -129,13 +129,8 @@ func (v *MeFieldsUser) GetEmail() string { return v.Email } // GetName returns MeFieldsUser.Name, and is useful for accessing the field via an interface. func (v *MeFieldsUser) GetName() string { return v.Name } -func CreateUserFromAuth0User( - ctx context.Context, - client graphql.Client, -) (*CreateUserFromAuth0UserResponse, error) { - req := &graphql.Request{ - OpName: "CreateUserFromAuth0User", - Query: ` +// The query or mutation executed by CreateUserFromAuth0User. +const CreateUserFromAuth0User_Operation = ` mutation CreateUserFromAuth0User { me { registerUser { @@ -153,7 +148,15 @@ fragment MeFields on Me { id } } -`, +` + +func CreateUserFromAuth0User( + ctx context.Context, + client graphql.Client, +) (*CreateUserFromAuth0UserResponse, error) { + req := &graphql.Request{ + OpName: "CreateUserFromAuth0User", + Query: CreateUserFromAuth0User_Operation, } var err error diff --git a/src/pkg/cloudclient/graphql/schema.graphql b/src/pkg/cloudclient/graphql/schema.graphql index 2f69667..0672d96 100644 --- a/src/pkg/cloudclient/graphql/schema.graphql +++ b/src/pkg/cloudclient/graphql/schema.graphql @@ -7,6 +7,12 @@ directive @constraint( example: String! ) on ENUM_VALUE +"""The @defer directive may be specified on a fragment spread to imply de-prioritization, that causes the fragment to be omitted in the initial response, and delivered as a subsequent response afterward. A query with @defer directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred delivered in a subsequent response. @include and @skip take precedence over @defer.""" +directive @defer( + if: Boolean + label: String +) on FRAGMENT_SPREAD | INLINE_FRAGMENT + """The @deprecated built-in directive is used within the type system definition language to indicate deprecated portions of a GraphQL service's schema, such as deprecated fields on a type, arguments on a field, input fields on an input type, or values of an enum type.""" directive @deprecated( reason: String @@ -106,9 +112,9 @@ type AccessGraphEdge { client: Service! server: Service! discoveredIntents: [Intent!]! - externalTrafficDiscoveredIntents: [ExternalTrafficIntent!]! appliedIntents: [Intent!]! accessStatus: EdgeAccessStatus! + accessStatuses: EdgeAccessStatuses! } type AccessGraphFilter { @@ -137,6 +143,21 @@ enum ApiMethod { DELETE } +enum AwsIamStep { + CREATE_CLUSTER + CONNECT_CLUSTER + DEPLOY_OTTERIZE_FOR_AWS_IAM + CREATE_S3_BUCKET + DEPLOY_SAMPLE_SERVER + VIEW_LOGS + LABEL_THE_SERVER_POD + SEE_THE_CREATED_ROLE + SEE_THE_SERVICE_ACCOUNT + APPLY_INTENTS + QUERY_S3_BUCKET_CONTENT + COMPLETED +} + """The `Boolean` scalar type represents `true` or `false`.""" scalar Boolean @@ -212,6 +233,8 @@ type ClusterConfiguration { useNetworkPoliciesInAccessGraphStates: Boolean! useIstioPoliciesInAccessGraphStates: Boolean! useKafkaACLsInAccessGraphStates: Boolean! + useAWSIAMInAccessGraphStates: Boolean! + useDatabaseInAccessGraphStates: Boolean! clusterFormSettings: ClusterFormSettings! } @@ -219,8 +242,10 @@ input ClusterConfigurationInput { globalDefaultDeny: Boolean! istioGlobalDefaultDeny: Boolean useNetworkPoliciesInAccessGraphStates: Boolean! - useIstioPoliciesInAccessGraphStates: Boolean - useKafkaACLsInAccessGraphStates: Boolean + useIstioPoliciesInAccessGraphStates: Boolean! + useKafkaACLsInAccessGraphStates: Boolean! + useAWSIAMInAccessGraphStates: Boolean + useDatabaseInAccessGraphStates: Boolean clusterFormSettings: ClusterFormSettingsInput } @@ -259,6 +284,11 @@ enum ComponentType { NETWORK_MAPPER } +type CreateGithubIntegrationResponse { + integration: Integration! + nextURL: String! +} + type CredentialsOperatorComponent { type: ComponentType! status: ComponentStatus! @@ -278,11 +308,6 @@ enum DBPermissionChange { DELETE } -type DNSIPPair { - dnsName: String! - ips: [String!] -} - input DNSIPPairInput { dnsName: String! ips: [String!] @@ -314,14 +339,14 @@ type DatabaseInfo { address: String! databaseType: DatabaseType! credentials: DatabaseCredentials! - logConsumerSettings: GCPCloudSQLConsumerSettings + visibility: DatabaseVisibilitySettings } input DatabaseInfoInput { address: String! databaseType: DatabaseType! credentials: DatabaseCredentialsInput! - logConsumerSettings: GCPCloudSQLConsumerSettingsInput + visibility: DatabaseVisibilitySettingsInput } enum DatabaseOperation { @@ -336,6 +361,20 @@ enum DatabaseType { POSTGRESQL } +type DatabaseVisibilitySettings { + source: DatabaseVisibilitySource + gcpPubSub: GCPPubSubLogConsumerSettings +} + +input DatabaseVisibilitySettingsInput { + source: DatabaseVisibilitySource + gcpPubSub: GCPPubSubLogConsumerSettingsInput +} + +enum DatabaseVisibilitySource { + GCP_PUBSUB +} + input DiscoveredIntentInput { discoveredAt: Time! intent: IntentInput! @@ -355,6 +394,7 @@ enum EdgeAccessStatusReason { ALLOWED_BY_APPLIED_INTENTS_OVERLY_PERMISSIVE ALLOWED_BY_APPLIED_INTENTS_HTTP_OVERLY_PERMISSIVE ALLOWED_BY_APPLIED_INTENTS_KAFKA_OVERLY_PERMISSIVE + ALLOWED_BY_APPLIED_INTENTS_DATABASE_OVERLY_PERMISSIVE ALLOWED_BY_EXTERNAL_TRAFFIC_NETWORK_POLICY BLOCKED_BY_APPLIED_INTENTS_UNDER_PERMISSIVE BLOCKED_BY_APPLIED_INTENTS_RESOURCE_MISMATCH @@ -363,6 +403,9 @@ enum EdgeAccessStatusReason { BLOCKED_BY_APPLIED_INTENTS_KAFKA_UNDER_PERMISSIVE BLOCKED_BY_APPLIED_INTENTS_KAFKA_RESOURCE_MISMATCH BLOCKED_BY_KAFKA_ENFORCEMENT_CONFIG_MISSING_APPLIED_INTENTS + BLOCKED_BY_APPLIED_INTENTS_DATABASE_UNDER_PERMISSIVE + BLOCKED_BY_APPLIED_INTENTS_DATABASE_RESOURCE_MISMATCH + BLOCKED_BY_DATABASE_ENFORCEMENT_CONFIG_MISSING_APPLIED_INTENTS BLOCKED_BY_DEFAULT_DENY SHARED_SERVICE_ACCOUNT CLIENT_ISTIO_SIDECAR_MISSING @@ -377,6 +420,7 @@ enum EdgeAccessStatusReason { INTERNET_ACCESS_STATUS_UNKNOWN NO_INTENTS_FOUND_OF_RELEVANT_TYPE IGNORED_IN_CALCULATION + INTERNET_INTENTS_ENFORCEMENT_DISABLED } enum EdgeAccessStatusVerdict { @@ -387,6 +431,14 @@ enum EdgeAccessStatusVerdict { UNKNOWN } +type EdgeAccessStatuses { + networkPolicies: EdgeAccessStatus! + kafkaACLs: EdgeAccessStatus! + istioPolicies: EdgeAccessStatus! + awsIam: EdgeAccessStatus! + database: EdgeAccessStatus! +} + type Environment { id: ID! name: String! @@ -402,6 +454,7 @@ enum EventType { INTENTS_APPLIED_KAFKA INTENTS_APPLIED_HTTP INTENTS_APPLIED_DATABASE + INTENTS_APPLIED_INTERNET INTENTS_DISCOVERED INTENTS_DISCOVERED_SOCKET_SCAN INTENTS_DISCOVERED_CAPTURE @@ -430,13 +483,6 @@ input ExternalTrafficDiscoveredIntentInput { intent: ExternalTrafficIntentInput! } -type ExternalTrafficIntent { - id: ID! - server: Service! - client: Service! - target: DNSIPPair! -} - input ExternalTrafficIntentInput { namespace: String! clientName: String! @@ -446,16 +492,48 @@ input ExternalTrafficIntentInput { """The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).""" scalar Float -type GCPCloudSQLConsumerSettings { +type GCPPubSubLogConsumerSettings { projectId: String! topic: String! } -input GCPCloudSQLConsumerSettingsInput { +input GCPPubSubLogConsumerSettingsInput { projectId: String! topic: String! } +type GitHubRepoFilterPair { + filter: AccessGraphFilter! + repoInfo: GitHubRepoInfo! +} + +input GitHubRepoFilterPairInput { + filter: InputAccessGraphFilter! + repoInfo: GitHubRepoInfoInput! +} + +type GitHubRepoInfo { + repository: String! + baseBranch: String! + intentsPath: String! +} + +input GitHubRepoInfoInput { + repository: String! + baseBranch: String! + intentsPath: String! +} + +type GitHubSettings { + isActive: Boolean! + repoFilterPairs: [GitHubRepoFilterPair!]! +} + +input GitHubSettingsInput { + isActive: Boolean! + repoFilterPairs: [GitHubRepoFilterPairInput!]! +} + type HTTPConfig { path: String! methods: [HTTPMethod!] @@ -503,6 +581,8 @@ type Integration { cluster: Cluster databaseInfo: DatabaseInfo awsInfo: AWSInfo + githubSettings: GitHubSettings + organizationId: String! } type IntegrationComponents { @@ -521,6 +601,7 @@ enum IntegrationType { KUBERNETES DATABASE AWS + GITHUB } type Intent { @@ -532,6 +613,7 @@ type Intent { httpResources: [HTTPConfig!] databaseResources: [DatabaseConfig!] awsActions: [String!] + internet: InternetConfig status: IntentStatus } @@ -545,6 +627,7 @@ input IntentInput { resources: [HTTPConfigInput!] databaseResources: [DatabaseConfigInput!] awsActions: [String!] + internet: InternetConfigInput status: IntentStatusInput } @@ -565,6 +648,7 @@ enum IntentType { DATABASE AWS S3 + INTERNET } type IntentsOperatorComponent { @@ -578,8 +662,11 @@ type IntentsOperatorConfiguration { networkPolicyEnforcementEnabled: Boolean! kafkaACLEnforcementEnabled: Boolean! istioPolicyEnforcementEnabled: Boolean! + awsIAMPolicyEnforcementEnabled: Boolean! + databaseEnforcementEnabled: Boolean! protectedServicesEnabled: Boolean! protectedServices: [Service!]! + egressNetworkPolicyEnforcementEnabled: Boolean! } input IntentsOperatorConfigurationInput { @@ -588,6 +675,20 @@ input IntentsOperatorConfigurationInput { kafkaACLEnforcementEnabled: Boolean istioPolicyEnforcementEnabled: Boolean protectedServicesEnabled: Boolean + egressNetworkPolicyEnforcementEnabled: Boolean + awsIAMPolicyEnforcementEnabled: Boolean + databaseEnforcementEnabled: Boolean +} + +type InternetConfig { + dnsName: String! + ips: [String!] + ports: [Int!] +} + +input InternetConfigInput { + ips: [String!]! + ports: [Int!] } type Invite { @@ -725,6 +826,10 @@ type Mutation { createCluster( name: String! ): Cluster! + createClusterAndUpdateUserTutorial( + name: String! + userTutorialId: ID! + ): Cluster! """Delete cluster""" deleteCluster( id: ID! @@ -786,6 +891,17 @@ type Mutation { name: String! awsIntegration: AWSInfoInput! ): Integration +"""Create a new Github integration""" + createGithubIntegration( + name: String! + githubSettings: GitHubSettingsInput! + ): CreateGithubIntegrationResponse +"""Update Github integration""" + updateGithubIntegration( + id: ID! + name: String! + githubSettings: GitHubSettingsInput! + ): Integration """Update AWS integration""" updateAWSIntegration( id: ID! @@ -886,6 +1002,33 @@ type Mutation { sendCLITelemetries( telemetries: [CLITelemetry!]! ): Boolean! + saveOnboardingFeedback( + userEmail: String! + feedback: String! + ): Boolean! + createUserTutorial( + tutorialName: TutorialName! + ): Boolean! + updateUserTutorialCluster( + userTutorialId: ID! + clusterId: ID! + ifClusterNotExists: Boolean! + ): Boolean! + activateUserTutorial( + tutorialName: TutorialName! + ): Boolean! + resetUserTutorial( + userTutorialId: ID! + ): Boolean! + notifyUserTutorialEvent( + userTutorialId: ID! + event: TutorialEvent! + ): Boolean! + notifyUserTutorialStepSeen( + userTutorialId: ID! + tutorialName: TutorialName! + step: String! + ): Boolean! notifyQuestLogStepAdvanced( id: ID! step: QuestLogStep! @@ -894,14 +1037,6 @@ type Mutation { id: ID! step: QuestLogStep! ): Boolean! - saveOnboardingSelection( - id: ID! - selection: OnboardingSelection! - ): Boolean! - saveOnboardingSelectionOther( - id: ID! - selection: String! - ): Boolean! } type Namespace { @@ -923,6 +1058,21 @@ type NetworkMapperComponent { status: ComponentStatus! } +enum NetworkPoliciesStep { +"""Connect cluster""" + CREATE_CLUSTER + CONNECT_CLUSTER +"""Get to know your network map""" + EXPLORE_NETWORK_MAP_ADD_NS_FILTER + EXPLORE_NETWORK_MAP_ADD_SVC_FILTER + EXPLORE_NETWORK_MAP_CLEAR_FILTERS +"""Declare intents""" + DECLARE_INTENTS_CLICK_ON_SERVICE + DECLARE_INTENTS_DOWNLOAD_YAML + DECLARE_INTENTS_DO_APPLY + COMPLETED +} + input NetworkPolicyInput { namespace: String! name: String! @@ -930,12 +1080,6 @@ input NetworkPolicyInput { externalNetworkTrafficPolicy: Boolean! } -enum OnboardingSelection { - DEFAULT - AWS_IAM - OTHER -} - type Organization { id: ID! name: String @@ -955,7 +1099,9 @@ type Query { ): AccessGraph! serviceClientIntents( id: ID! + asServiceId: ID lastSeenAfter: Time! + clusterIds: [ID!] ): ServiceClientIntents! """Get cluster""" cluster( @@ -1004,6 +1150,10 @@ type Query { databaseInfo: DatabaseInfoInput! integrationId: ID ): TestDatabaseConnectionResponse! +"""Test database visibility connectivity""" + testDatabaseVisibilityConnection( + databaseInfo: DatabaseInfoInput! + ): TestDatabaseConnectionResponse! """List user invites""" invites( email: String @@ -1042,6 +1192,8 @@ type Query { organization( id: ID! ): Organization! +"""Checks the availability of the API server""" + ping: Boolean! """Get service""" service( id: ID! @@ -1077,8 +1229,6 @@ enum QuestLogStep { DECLARE_INTENTS_CLICK_ON_SERVICE DECLARE_INTENTS_DOWNLOAD_YAML DECLARE_INTENTS_DO_APPLY -"""Enable intents""" - ENABLE_ENFORCEMENT_CREATE_PROTECTED_SERVICE COMPLETED } @@ -1129,6 +1279,7 @@ enum ServerProtectionStatusReason { IGNORED_IN_CALCULATION PROTECTED_BY_DATABASE_INTEGRATION PROTECTED_BY_AWS_IAM_INTEGRATION + PROTECTED_BY_INTERNET_INTENTS } enum ServerProtectionStatusVerdict { @@ -1153,6 +1304,7 @@ type Service { certificateInformation: CertificateInformation serviceAccount: String awsResource: AWSResource + discoveredByIntegration: Integration tlsKeyPair: KeyPair! userAndPassword: UserAndPassword! } @@ -1181,11 +1333,14 @@ type ServiceClientIntents { } enum ServiceType { + NODE_GROUP + PREFIX_GROUP KUBERNETES KAFKA AWS DATABASE INTERNET + DATABASE_USER } """The `String`scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.""" @@ -1215,16 +1370,44 @@ type TestDatabaseConnectionResponse { scalar Time +enum TutorialEvent { + CLUSTER_CREATED + CLUSTER_CONNECTED + NS_FILTER_CLICKED + SVC_FILTER_CLICKED + FILTER_CLEARED + SERVICE_CLICKED + YAML_DOWNLOADED + INTENTS_APPLIED + TUTORIAL_COMPLETED + S3_BUCKET_CREATED + AWS_IAM_INTEGRATION_CREATED + SERVICE_DEPLOYED + LOGS_VIEWED + SERVER_POD_LABELED + AWS_IAM_ROLE_LIST_QUERIED + K8S_SERVICE_ACCOUNT_QUERIED + AWS_IAM_INTENTS_APPLIED + S3_BUCKET_CONTENT_QUERIED +} + +enum TutorialName { + NETWORK_POLICIES + AWS_IAM + POSTGRESQL + ISTIO_AUTH_POLICY_AUTOMATION + KAFKA_ACCESS_AUTOMATE_OTTERIZE_CLOUD +} + type User { id: ID! email: String! name: String! imageURL: String! authProviderUserId: String! + tutorials: [UserTutorial!] questLogStep: QuestLogStep! questLogStepSeen: QuestLogStep! - onboardingSelection: OnboardingSelection! - onboardingSelectionOther: String! } type UserAndPassword { @@ -1243,4 +1426,16 @@ enum UserErrorType { APPLIED_INTENTS_ERROR } +type UserTutorial { + id: ID! + userId: ID! + clusterId: ID! + clusterName: String! + name: TutorialName! + isActive: Boolean! + isCompleted: Boolean! + step: String! + stepSeen: String! +} + diff --git a/src/pkg/cloudclient/restapi/cloudapi/api.gen.go b/src/pkg/cloudclient/restapi/cloudapi/api.gen.go index 26a65c7..f2deda5 100644 --- a/src/pkg/cloudclient/restapi/cloudapi/api.gen.go +++ b/src/pkg/cloudclient/restapi/cloudapi/api.gen.go @@ -20,6 +20,7 @@ import ( const ( AccessTokenCookieScopes = "accessTokenCookie.Scopes" + BearerAuthScopes = "bearerAuth.Scopes" Oauth2Scopes = "oauth2.Scopes" OrganizationHeaderScopes = "organizationHeader.Scopes" ) @@ -62,19 +63,28 @@ const ( DatabaseInfoInputDatabaseTypePOSTGRESQL DatabaseInfoInputDatabaseType = "POSTGRESQL" ) +// Defines values for DatabaseVisibilitySettingsSource. +const ( + GCPPUBSUB DatabaseVisibilitySettingsSource = "GCP_PUBSUB" +) + // Defines values for EdgeAccessStatusReason. const ( EdgeAccessStatusReasonALLOWEDBYAPPLIEDINTENTS EdgeAccessStatusReason = "ALLOWED_BY_APPLIED_INTENTS" + EdgeAccessStatusReasonALLOWEDBYAPPLIEDINTENTSDATABASEOVERLYPERMISSIVE EdgeAccessStatusReason = "ALLOWED_BY_APPLIED_INTENTS_DATABASE_OVERLY_PERMISSIVE" EdgeAccessStatusReasonALLOWEDBYAPPLIEDINTENTSHTTPOVERLYPERMISSIVE EdgeAccessStatusReason = "ALLOWED_BY_APPLIED_INTENTS_HTTP_OVERLY_PERMISSIVE" EdgeAccessStatusReasonALLOWEDBYAPPLIEDINTENTSKAFKAOVERLYPERMISSIVE EdgeAccessStatusReason = "ALLOWED_BY_APPLIED_INTENTS_KAFKA_OVERLY_PERMISSIVE" EdgeAccessStatusReasonALLOWEDBYAPPLIEDINTENTSOVERLYPERMISSIVE EdgeAccessStatusReason = "ALLOWED_BY_APPLIED_INTENTS_OVERLY_PERMISSIVE" EdgeAccessStatusReasonALLOWEDBYEXTERNALTRAFFICNETWORKPOLICY EdgeAccessStatusReason = "ALLOWED_BY_EXTERNAL_TRAFFIC_NETWORK_POLICY" + EdgeAccessStatusReasonBLOCKEDBYAPPLIEDINTENTSDATABASERESOURCEMISMATCH EdgeAccessStatusReason = "BLOCKED_BY_APPLIED_INTENTS_DATABASE_RESOURCE_MISMATCH" + EdgeAccessStatusReasonBLOCKEDBYAPPLIEDINTENTSDATABASEUNDERPERMISSIVE EdgeAccessStatusReason = "BLOCKED_BY_APPLIED_INTENTS_DATABASE_UNDER_PERMISSIVE" EdgeAccessStatusReasonBLOCKEDBYAPPLIEDINTENTSHTTPRESOURCEMISMATCH EdgeAccessStatusReason = "BLOCKED_BY_APPLIED_INTENTS_HTTP_RESOURCE_MISMATCH" EdgeAccessStatusReasonBLOCKEDBYAPPLIEDINTENTSHTTPUNDERPERMISSIVE EdgeAccessStatusReason = "BLOCKED_BY_APPLIED_INTENTS_HTTP_UNDER_PERMISSIVE" EdgeAccessStatusReasonBLOCKEDBYAPPLIEDINTENTSKAFKARESOURCEMISMATCH EdgeAccessStatusReason = "BLOCKED_BY_APPLIED_INTENTS_KAFKA_RESOURCE_MISMATCH" EdgeAccessStatusReasonBLOCKEDBYAPPLIEDINTENTSKAFKAUNDERPERMISSIVE EdgeAccessStatusReason = "BLOCKED_BY_APPLIED_INTENTS_KAFKA_UNDER_PERMISSIVE" EdgeAccessStatusReasonBLOCKEDBYAPPLIEDINTENTSRESOURCEMISMATCH EdgeAccessStatusReason = "BLOCKED_BY_APPLIED_INTENTS_RESOURCE_MISMATCH" EdgeAccessStatusReasonBLOCKEDBYAPPLIEDINTENTSUNDERPERMISSIVE EdgeAccessStatusReason = "BLOCKED_BY_APPLIED_INTENTS_UNDER_PERMISSIVE" + EdgeAccessStatusReasonBLOCKEDBYDATABASEENFORCEMENTCONFIGMISSINGAPPLIEDINTENTS EdgeAccessStatusReason = "BLOCKED_BY_DATABASE_ENFORCEMENT_CONFIG_MISSING_APPLIED_INTENTS" EdgeAccessStatusReasonBLOCKEDBYDEFAULTDENY EdgeAccessStatusReason = "BLOCKED_BY_DEFAULT_DENY" EdgeAccessStatusReasonBLOCKEDBYKAFKAENFORCEMENTCONFIGMISSINGAPPLIEDINTENTS EdgeAccessStatusReason = "BLOCKED_BY_KAFKA_ENFORCEMENT_CONFIG_MISSING_APPLIED_INTENTS" EdgeAccessStatusReasonCLIENTISTIOSIDECARMISSING EdgeAccessStatusReason = "CLIENT_ISTIO_SIDECAR_MISSING" @@ -84,6 +94,7 @@ const ( EdgeAccessStatusReasonINTENTSOPERATORNOTENFORCINGKAFKAINTENTSNOTREQUIREDFORTOPIC EdgeAccessStatusReason = "INTENTS_OPERATOR_NOT_ENFORCING_KAFKA_INTENTS_NOT_REQUIRED_FOR_TOPIC" EdgeAccessStatusReasonINTENTSOPERATORNOTENFORCINGMISSINGAPPLIEDINTENT EdgeAccessStatusReason = "INTENTS_OPERATOR_NOT_ENFORCING_MISSING_APPLIED_INTENT" EdgeAccessStatusReasonINTERNETACCESSSTATUSUNKNOWN EdgeAccessStatusReason = "INTERNET_ACCESS_STATUS_UNKNOWN" + EdgeAccessStatusReasonINTERNETINTENTSENFORCEMENTDISABLED EdgeAccessStatusReason = "INTERNET_INTENTS_ENFORCEMENT_DISABLED" EdgeAccessStatusReasonMISSINGAPPLIEDINTENT EdgeAccessStatusReason = "MISSING_APPLIED_INTENT" EdgeAccessStatusReasonNETWORKMAPPERNEVERCONNECTED EdgeAccessStatusReason = "NETWORK_MAPPER_NEVER_CONNECTED" EdgeAccessStatusReasonNOINTENTSFOUNDOFRELEVANTTYPE EdgeAccessStatusReason = "NO_INTENTS_FOUND_OF_RELEVANT_TYPE" @@ -95,16 +106,20 @@ const ( // Defines values for EdgeAccessStatusReasons. const ( EdgeAccessStatusReasonsALLOWEDBYAPPLIEDINTENTS EdgeAccessStatusReasons = "ALLOWED_BY_APPLIED_INTENTS" + EdgeAccessStatusReasonsALLOWEDBYAPPLIEDINTENTSDATABASEOVERLYPERMISSIVE EdgeAccessStatusReasons = "ALLOWED_BY_APPLIED_INTENTS_DATABASE_OVERLY_PERMISSIVE" EdgeAccessStatusReasonsALLOWEDBYAPPLIEDINTENTSHTTPOVERLYPERMISSIVE EdgeAccessStatusReasons = "ALLOWED_BY_APPLIED_INTENTS_HTTP_OVERLY_PERMISSIVE" EdgeAccessStatusReasonsALLOWEDBYAPPLIEDINTENTSKAFKAOVERLYPERMISSIVE EdgeAccessStatusReasons = "ALLOWED_BY_APPLIED_INTENTS_KAFKA_OVERLY_PERMISSIVE" EdgeAccessStatusReasonsALLOWEDBYAPPLIEDINTENTSOVERLYPERMISSIVE EdgeAccessStatusReasons = "ALLOWED_BY_APPLIED_INTENTS_OVERLY_PERMISSIVE" EdgeAccessStatusReasonsALLOWEDBYEXTERNALTRAFFICNETWORKPOLICY EdgeAccessStatusReasons = "ALLOWED_BY_EXTERNAL_TRAFFIC_NETWORK_POLICY" + EdgeAccessStatusReasonsBLOCKEDBYAPPLIEDINTENTSDATABASERESOURCEMISMATCH EdgeAccessStatusReasons = "BLOCKED_BY_APPLIED_INTENTS_DATABASE_RESOURCE_MISMATCH" + EdgeAccessStatusReasonsBLOCKEDBYAPPLIEDINTENTSDATABASEUNDERPERMISSIVE EdgeAccessStatusReasons = "BLOCKED_BY_APPLIED_INTENTS_DATABASE_UNDER_PERMISSIVE" EdgeAccessStatusReasonsBLOCKEDBYAPPLIEDINTENTSHTTPRESOURCEMISMATCH EdgeAccessStatusReasons = "BLOCKED_BY_APPLIED_INTENTS_HTTP_RESOURCE_MISMATCH" EdgeAccessStatusReasonsBLOCKEDBYAPPLIEDINTENTSHTTPUNDERPERMISSIVE EdgeAccessStatusReasons = "BLOCKED_BY_APPLIED_INTENTS_HTTP_UNDER_PERMISSIVE" EdgeAccessStatusReasonsBLOCKEDBYAPPLIEDINTENTSKAFKARESOURCEMISMATCH EdgeAccessStatusReasons = "BLOCKED_BY_APPLIED_INTENTS_KAFKA_RESOURCE_MISMATCH" EdgeAccessStatusReasonsBLOCKEDBYAPPLIEDINTENTSKAFKAUNDERPERMISSIVE EdgeAccessStatusReasons = "BLOCKED_BY_APPLIED_INTENTS_KAFKA_UNDER_PERMISSIVE" EdgeAccessStatusReasonsBLOCKEDBYAPPLIEDINTENTSRESOURCEMISMATCH EdgeAccessStatusReasons = "BLOCKED_BY_APPLIED_INTENTS_RESOURCE_MISMATCH" EdgeAccessStatusReasonsBLOCKEDBYAPPLIEDINTENTSUNDERPERMISSIVE EdgeAccessStatusReasons = "BLOCKED_BY_APPLIED_INTENTS_UNDER_PERMISSIVE" + EdgeAccessStatusReasonsBLOCKEDBYDATABASEENFORCEMENTCONFIGMISSINGAPPLIEDINTENTS EdgeAccessStatusReasons = "BLOCKED_BY_DATABASE_ENFORCEMENT_CONFIG_MISSING_APPLIED_INTENTS" EdgeAccessStatusReasonsBLOCKEDBYDEFAULTDENY EdgeAccessStatusReasons = "BLOCKED_BY_DEFAULT_DENY" EdgeAccessStatusReasonsBLOCKEDBYKAFKAENFORCEMENTCONFIGMISSINGAPPLIEDINTENTS EdgeAccessStatusReasons = "BLOCKED_BY_KAFKA_ENFORCEMENT_CONFIG_MISSING_APPLIED_INTENTS" EdgeAccessStatusReasonsCLIENTISTIOSIDECARMISSING EdgeAccessStatusReasons = "CLIENT_ISTIO_SIDECAR_MISSING" @@ -114,6 +129,7 @@ const ( EdgeAccessStatusReasonsINTENTSOPERATORNOTENFORCINGKAFKAINTENTSNOTREQUIREDFORTOPIC EdgeAccessStatusReasons = "INTENTS_OPERATOR_NOT_ENFORCING_KAFKA_INTENTS_NOT_REQUIRED_FOR_TOPIC" EdgeAccessStatusReasonsINTENTSOPERATORNOTENFORCINGMISSINGAPPLIEDINTENT EdgeAccessStatusReasons = "INTENTS_OPERATOR_NOT_ENFORCING_MISSING_APPLIED_INTENT" EdgeAccessStatusReasonsINTERNETACCESSSTATUSUNKNOWN EdgeAccessStatusReasons = "INTERNET_ACCESS_STATUS_UNKNOWN" + EdgeAccessStatusReasonsINTERNETINTENTSENFORCEMENTDISABLED EdgeAccessStatusReasons = "INTERNET_INTENTS_ENFORCEMENT_DISABLED" EdgeAccessStatusReasonsMISSINGAPPLIEDINTENT EdgeAccessStatusReasons = "MISSING_APPLIED_INTENT" EdgeAccessStatusReasonsNETWORKMAPPERNEVERCONNECTED EdgeAccessStatusReasons = "NETWORK_MAPPER_NEVER_CONNECTED" EdgeAccessStatusReasonsNOINTENTSFOUNDOFRELEVANTTYPE EdgeAccessStatusReasons = "NO_INTENTS_FOUND_OF_RELEVANT_TYPE" @@ -136,6 +152,7 @@ const ( IntegrationTypeAWS IntegrationType = "AWS" IntegrationTypeDATABASE IntegrationType = "DATABASE" IntegrationTypeGENERIC IntegrationType = "GENERIC" + IntegrationTypeGITHUB IntegrationType = "GITHUB" IntegrationTypeKUBERNETES IntegrationType = "KUBERNETES" ) @@ -191,6 +208,7 @@ const ( ServerProtectionStatusReasonPROTECTEDBYAWSIAMINTEGRATION ServerProtectionStatusReason = "PROTECTED_BY_AWS_IAM_INTEGRATION" ServerProtectionStatusReasonPROTECTEDBYDATABASEINTEGRATION ServerProtectionStatusReason = "PROTECTED_BY_DATABASE_INTEGRATION" ServerProtectionStatusReasonPROTECTEDBYDEFAULTDENY ServerProtectionStatusReason = "PROTECTED_BY_DEFAULT_DENY" + ServerProtectionStatusReasonPROTECTEDBYINTERNETINTENTS ServerProtectionStatusReason = "PROTECTED_BY_INTERNET_INTENTS" ServerProtectionStatusReasonPROTECTEDBYKAFKAIDENTITYREQUIREDNOINTENTSREQUIRED ServerProtectionStatusReason = "PROTECTED_BY_KAFKA_IDENTITY_REQUIRED_NO_INTENTS_REQUIRED" ServerProtectionStatusReasonPROTECTEDBYKAFKAINTENTSREQUIRED ServerProtectionStatusReason = "PROTECTED_BY_KAFKA_INTENTS_REQUIRED" ServerProtectionStatusReasonPROTECTEDBYSERVERISTIOPOLICY ServerProtectionStatusReason = "PROTECTED_BY_SERVER_ISTIO_POLICY" @@ -211,44 +229,38 @@ const ( // Defines values for ServiceAccessGraphTypes. const ( - ServiceAccessGraphTypesAWS ServiceAccessGraphTypes = "AWS" - ServiceAccessGraphTypesDATABASE ServiceAccessGraphTypes = "DATABASE" - ServiceAccessGraphTypesINTERNET ServiceAccessGraphTypes = "INTERNET" - ServiceAccessGraphTypesKAFKA ServiceAccessGraphTypes = "KAFKA" - ServiceAccessGraphTypesKUBERNETES ServiceAccessGraphTypes = "KUBERNETES" -) - -// Defines values for UserOnboardingSelection. -const ( - AWSIAM UserOnboardingSelection = "AWS_IAM" - DEFAULT UserOnboardingSelection = "DEFAULT" - OTHER UserOnboardingSelection = "OTHER" + ServiceAccessGraphTypesAWS ServiceAccessGraphTypes = "AWS" + ServiceAccessGraphTypesDATABASE ServiceAccessGraphTypes = "DATABASE" + ServiceAccessGraphTypesDATABASEUSER ServiceAccessGraphTypes = "DATABASE_USER" + ServiceAccessGraphTypesINTERNET ServiceAccessGraphTypes = "INTERNET" + ServiceAccessGraphTypesKAFKA ServiceAccessGraphTypes = "KAFKA" + ServiceAccessGraphTypesKUBERNETES ServiceAccessGraphTypes = "KUBERNETES" + ServiceAccessGraphTypesNODEGROUP ServiceAccessGraphTypes = "NODE_GROUP" + ServiceAccessGraphTypesPREFIXGROUP ServiceAccessGraphTypes = "PREFIX_GROUP" ) // Defines values for UserQuestLogStep. const ( - UserQuestLogStepCOMPLETED UserQuestLogStep = "COMPLETED" - UserQuestLogStepCONNECTCLUSTER UserQuestLogStep = "CONNECT_CLUSTER" - UserQuestLogStepDECLAREINTENTSCLICKONSERVICE UserQuestLogStep = "DECLARE_INTENTS_CLICK_ON_SERVICE" - UserQuestLogStepDECLAREINTENTSDOAPPLY UserQuestLogStep = "DECLARE_INTENTS_DO_APPLY" - UserQuestLogStepDECLAREINTENTSDOWNLOADYAML UserQuestLogStep = "DECLARE_INTENTS_DOWNLOAD_YAML" - UserQuestLogStepENABLEENFORCEMENTCREATEPROTECTEDSERVICE UserQuestLogStep = "ENABLE_ENFORCEMENT_CREATE_PROTECTED_SERVICE" - UserQuestLogStepEXPLORENETWORKMAPADDNSFILTER UserQuestLogStep = "EXPLORE_NETWORK_MAP_ADD_NS_FILTER" - UserQuestLogStepEXPLORENETWORKMAPADDSVCFILTER UserQuestLogStep = "EXPLORE_NETWORK_MAP_ADD_SVC_FILTER" - UserQuestLogStepEXPLORENETWORKMAPCLEARFILTERS UserQuestLogStep = "EXPLORE_NETWORK_MAP_CLEAR_FILTERS" + UserQuestLogStepCOMPLETED UserQuestLogStep = "COMPLETED" + UserQuestLogStepCONNECTCLUSTER UserQuestLogStep = "CONNECT_CLUSTER" + UserQuestLogStepDECLAREINTENTSCLICKONSERVICE UserQuestLogStep = "DECLARE_INTENTS_CLICK_ON_SERVICE" + UserQuestLogStepDECLAREINTENTSDOAPPLY UserQuestLogStep = "DECLARE_INTENTS_DO_APPLY" + UserQuestLogStepDECLAREINTENTSDOWNLOADYAML UserQuestLogStep = "DECLARE_INTENTS_DOWNLOAD_YAML" + UserQuestLogStepEXPLORENETWORKMAPADDNSFILTER UserQuestLogStep = "EXPLORE_NETWORK_MAP_ADD_NS_FILTER" + UserQuestLogStepEXPLORENETWORKMAPADDSVCFILTER UserQuestLogStep = "EXPLORE_NETWORK_MAP_ADD_SVC_FILTER" + UserQuestLogStepEXPLORENETWORKMAPCLEARFILTERS UserQuestLogStep = "EXPLORE_NETWORK_MAP_CLEAR_FILTERS" ) // Defines values for UserQuestLogStepSeen. const ( - UserQuestLogStepSeenCOMPLETED UserQuestLogStepSeen = "COMPLETED" - UserQuestLogStepSeenCONNECTCLUSTER UserQuestLogStepSeen = "CONNECT_CLUSTER" - UserQuestLogStepSeenDECLAREINTENTSCLICKONSERVICE UserQuestLogStepSeen = "DECLARE_INTENTS_CLICK_ON_SERVICE" - UserQuestLogStepSeenDECLAREINTENTSDOAPPLY UserQuestLogStepSeen = "DECLARE_INTENTS_DO_APPLY" - UserQuestLogStepSeenDECLAREINTENTSDOWNLOADYAML UserQuestLogStepSeen = "DECLARE_INTENTS_DOWNLOAD_YAML" - UserQuestLogStepSeenENABLEENFORCEMENTCREATEPROTECTEDSERVICE UserQuestLogStepSeen = "ENABLE_ENFORCEMENT_CREATE_PROTECTED_SERVICE" - UserQuestLogStepSeenEXPLORENETWORKMAPADDNSFILTER UserQuestLogStepSeen = "EXPLORE_NETWORK_MAP_ADD_NS_FILTER" - UserQuestLogStepSeenEXPLORENETWORKMAPADDSVCFILTER UserQuestLogStepSeen = "EXPLORE_NETWORK_MAP_ADD_SVC_FILTER" - UserQuestLogStepSeenEXPLORENETWORKMAPCLEARFILTERS UserQuestLogStepSeen = "EXPLORE_NETWORK_MAP_CLEAR_FILTERS" + UserQuestLogStepSeenCOMPLETED UserQuestLogStepSeen = "COMPLETED" + UserQuestLogStepSeenCONNECTCLUSTER UserQuestLogStepSeen = "CONNECT_CLUSTER" + UserQuestLogStepSeenDECLAREINTENTSCLICKONSERVICE UserQuestLogStepSeen = "DECLARE_INTENTS_CLICK_ON_SERVICE" + UserQuestLogStepSeenDECLAREINTENTSDOAPPLY UserQuestLogStepSeen = "DECLARE_INTENTS_DO_APPLY" + UserQuestLogStepSeenDECLAREINTENTSDOWNLOADYAML UserQuestLogStepSeen = "DECLARE_INTENTS_DOWNLOAD_YAML" + UserQuestLogStepSeenEXPLORENETWORKMAPADDNSFILTER UserQuestLogStepSeen = "EXPLORE_NETWORK_MAP_ADD_NS_FILTER" + UserQuestLogStepSeenEXPLORENETWORKMAPADDSVCFILTER UserQuestLogStepSeen = "EXPLORE_NETWORK_MAP_ADD_SVC_FILTER" + UserQuestLogStepSeenEXPLORENETWORKMAPCLEARFILTERS UserQuestLogStepSeen = "EXPLORE_NETWORK_MAP_CLEAR_FILTERS" ) // Defines values for OneIntegrationQueryParamsIntegrationType. @@ -256,6 +268,7 @@ const ( OneIntegrationQueryParamsIntegrationTypeAWS OneIntegrationQueryParamsIntegrationType = "AWS" OneIntegrationQueryParamsIntegrationTypeDATABASE OneIntegrationQueryParamsIntegrationType = "DATABASE" OneIntegrationQueryParamsIntegrationTypeGENERIC OneIntegrationQueryParamsIntegrationType = "GENERIC" + OneIntegrationQueryParamsIntegrationTypeGITHUB OneIntegrationQueryParamsIntegrationType = "GITHUB" OneIntegrationQueryParamsIntegrationTypeKUBERNETES OneIntegrationQueryParamsIntegrationType = "KUBERNETES" ) @@ -264,6 +277,7 @@ const ( IntegrationsQueryParamsIntegrationTypeAWS IntegrationsQueryParamsIntegrationType = "AWS" IntegrationsQueryParamsIntegrationTypeDATABASE IntegrationsQueryParamsIntegrationType = "DATABASE" IntegrationsQueryParamsIntegrationTypeGENERIC IntegrationsQueryParamsIntegrationType = "GENERIC" + IntegrationsQueryParamsIntegrationTypeGITHUB IntegrationsQueryParamsIntegrationType = "GITHUB" IntegrationsQueryParamsIntegrationTypeKUBERNETES IntegrationsQueryParamsIntegrationType = "KUBERNETES" ) @@ -317,7 +331,8 @@ type AccessGraph struct { // AccessGraphEdge defines model for AccessGraphEdge. type AccessGraphEdge struct { - AccessStatus EdgeAccessStatus `json:"accessStatus"` + AccessStatus EdgeAccessStatus `json:"accessStatus"` + AccessStatuses EdgeAccessStatuses `json:"accessStatuses"` AppliedIntents []struct { Id string `json:"id"` } `json:"appliedIntents"` @@ -327,9 +342,6 @@ type AccessGraphEdge struct { DiscoveredIntents []struct { Id string `json:"id"` } `json:"discoveredIntents"` - ExternalTrafficDiscoveredIntents []struct { - Id string `json:"id"` - } `json:"externalTrafficDiscoveredIntents"` Server struct { Id string `json:"id"` } `json:"server"` @@ -379,6 +391,8 @@ type ClusterConfiguration struct { ClusterFormSettings ClusterFormSettings `json:"clusterFormSettings"` GlobalDefaultDeny bool `json:"globalDefaultDeny"` IstioGlobalDefaultDeny bool `json:"istioGlobalDefaultDeny"` + UseAWSIAMInAccessGraphStates bool `json:"useAWSIAMInAccessGraphStates"` + UseDatabaseInAccessGraphStates bool `json:"useDatabaseInAccessGraphStates"` UseIstioPoliciesInAccessGraphStates bool `json:"useIstioPoliciesInAccessGraphStates"` UseKafkaACLsInAccessGraphStates bool `json:"useKafkaACLsInAccessGraphStates"` UseNetworkPoliciesInAccessGraphStates bool `json:"useNetworkPoliciesInAccessGraphStates"` @@ -389,8 +403,10 @@ type ClusterConfigurationInput struct { ClusterFormSettings *map[string]interface{} `json:"clusterFormSettings,omitempty"` GlobalDefaultDeny bool `json:"globalDefaultDeny"` IstioGlobalDefaultDeny *bool `json:"istioGlobalDefaultDeny,omitempty"` - UseIstioPoliciesInAccessGraphStates *bool `json:"useIstioPoliciesInAccessGraphStates,omitempty"` - UseKafkaACLsInAccessGraphStates *bool `json:"useKafkaACLsInAccessGraphStates,omitempty"` + UseAWSIAMInAccessGraphStates *bool `json:"useAWSIAMInAccessGraphStates,omitempty"` + UseDatabaseInAccessGraphStates *bool `json:"useDatabaseInAccessGraphStates,omitempty"` + UseIstioPoliciesInAccessGraphStates bool `json:"useIstioPoliciesInAccessGraphStates"` + UseKafkaACLsInAccessGraphStates bool `json:"useKafkaACLsInAccessGraphStates"` UseNetworkPoliciesInAccessGraphStates bool `json:"useNetworkPoliciesInAccessGraphStates"` } @@ -412,6 +428,14 @@ type ComponentStatus struct { // ComponentStatusType defines model for ComponentStatus.Type. type ComponentStatusType string +// CreateGithubIntegrationResponse defines model for CreateGithubIntegrationResponse. +type CreateGithubIntegrationResponse struct { + Integration struct { + Id string `json:"id"` + } `json:"integration"` + NextURL string `json:"nextURL"` +} + // CredentialsOperatorComponent defines model for CredentialsOperatorComponent. type CredentialsOperatorComponent struct { Status ComponentStatus `json:"status"` @@ -429,10 +453,10 @@ type DatabaseCredentials struct { // DatabaseInfo defines model for DatabaseInfo. type DatabaseInfo struct { - Address string `json:"address"` - Credentials DatabaseCredentials `json:"credentials"` - DatabaseType DatabaseInfoDatabaseType `json:"databaseType"` - LogConsumerSettings *GCPCloudSQLConsumerSettings `json:"logConsumerSettings,omitempty"` + Address string `json:"address"` + Credentials DatabaseCredentials `json:"credentials"` + DatabaseType DatabaseInfoDatabaseType `json:"databaseType"` + Visibility *DatabaseVisibilitySettings `json:"visibility,omitempty"` } // DatabaseInfoDatabaseType defines model for DatabaseInfo.DatabaseType. @@ -440,15 +464,24 @@ type DatabaseInfoDatabaseType string // DatabaseInfoInput defines model for DatabaseInfoInput. type DatabaseInfoInput struct { - Address string `json:"address"` - Credentials map[string]interface{} `json:"credentials"` - DatabaseType DatabaseInfoInputDatabaseType `json:"databaseType"` - LogConsumerSettings *map[string]interface{} `json:"logConsumerSettings,omitempty"` + Address string `json:"address"` + Credentials map[string]interface{} `json:"credentials"` + DatabaseType DatabaseInfoInputDatabaseType `json:"databaseType"` + Visibility *map[string]interface{} `json:"visibility,omitempty"` } // DatabaseInfoInputDatabaseType defines model for DatabaseInfoInput.DatabaseType. type DatabaseInfoInputDatabaseType string +// DatabaseVisibilitySettings defines model for DatabaseVisibilitySettings. +type DatabaseVisibilitySettings struct { + GcpPubSub *GCPPubSubLogConsumerSettings `json:"gcpPubSub,omitempty"` + Source *DatabaseVisibilitySettingsSource `json:"source,omitempty"` +} + +// DatabaseVisibilitySettingsSource defines model for DatabaseVisibilitySettings.Source. +type DatabaseVisibilitySettingsSource string + // EdgeAccessStatus defines model for EdgeAccessStatus. type EdgeAccessStatus struct { Reason EdgeAccessStatusReason `json:"reason"` @@ -468,6 +501,15 @@ type EdgeAccessStatusReasons string // EdgeAccessStatusVerdict defines model for EdgeAccessStatus.Verdict. type EdgeAccessStatusVerdict string +// EdgeAccessStatuses defines model for EdgeAccessStatuses. +type EdgeAccessStatuses struct { + AwsIam EdgeAccessStatus `json:"awsIam"` + Database EdgeAccessStatus `json:"database"` + IstioPolicies EdgeAccessStatus `json:"istioPolicies"` + KafkaACLs EdgeAccessStatus `json:"kafkaACLs"` + NetworkPolicies EdgeAccessStatus `json:"networkPolicies"` +} + // Environment defines model for Environment. type Environment struct { AppliedIntentsCount int32 `json:"appliedIntentsCount"` @@ -485,12 +527,37 @@ type Error struct { Message string `json:"message"` } -// GCPCloudSQLConsumerSettings defines model for GCPCloudSQLConsumerSettings. -type GCPCloudSQLConsumerSettings struct { +// GCPPubSubLogConsumerSettings defines model for GCPPubSubLogConsumerSettings. +type GCPPubSubLogConsumerSettings struct { ProjectId string `json:"projectId"` Topic string `json:"topic"` } +// GitHubRepoFilterPair defines model for GitHubRepoFilterPair. +type GitHubRepoFilterPair struct { + Filter AccessGraphFilter `json:"filter"` + RepoInfo GitHubRepoInfo `json:"repoInfo"` +} + +// GitHubRepoInfo defines model for GitHubRepoInfo. +type GitHubRepoInfo struct { + BaseBranch string `json:"baseBranch"` + IntentsPath string `json:"intentsPath"` + Repository string `json:"repository"` +} + +// GitHubSettings defines model for GitHubSettings. +type GitHubSettings struct { + IsActive bool `json:"isActive"` + RepoFilterPairs []GitHubRepoFilterPair `json:"repoFilterPairs"` +} + +// GitHubSettingsInput defines model for GitHubSettingsInput. +type GitHubSettingsInput struct { + IsActive bool `json:"isActive"` + RepoFilterPairs []map[string]interface{} `json:"repoFilterPairs"` +} + // InputAccessGraphFilter defines model for InputAccessGraphFilter. type InputAccessGraphFilter struct { ClusterIds *[]string `json:"clusterIds,omitempty"` @@ -513,9 +580,11 @@ type Integration struct { DefaultEnvironment *struct { Id string `json:"id"` } `json:"defaultEnvironment,omitempty"` - Id string `json:"id"` - Name string `json:"name"` - Type IntegrationType `json:"type"` + GithubSettings *GitHubSettings `json:"githubSettings,omitempty"` + Id string `json:"id"` + Name string `json:"name"` + OrganizationId string `json:"organizationId"` + Type IntegrationType `json:"type"` } // IntegrationType defines model for Integration.Type. @@ -546,11 +615,14 @@ type IntentsOperatorComponentType string // IntentsOperatorConfiguration defines model for IntentsOperatorConfiguration. type IntentsOperatorConfiguration struct { - GlobalEnforcementEnabled bool `json:"globalEnforcementEnabled"` - IstioPolicyEnforcementEnabled bool `json:"istioPolicyEnforcementEnabled"` - KafkaACLEnforcementEnabled bool `json:"kafkaACLEnforcementEnabled"` - NetworkPolicyEnforcementEnabled bool `json:"networkPolicyEnforcementEnabled"` - ProtectedServices []struct { + AwsIAMPolicyEnforcementEnabled bool `json:"awsIAMPolicyEnforcementEnabled"` + DatabaseEnforcementEnabled bool `json:"databaseEnforcementEnabled"` + EgressNetworkPolicyEnforcementEnabled bool `json:"egressNetworkPolicyEnforcementEnabled"` + GlobalEnforcementEnabled bool `json:"globalEnforcementEnabled"` + IstioPolicyEnforcementEnabled bool `json:"istioPolicyEnforcementEnabled"` + KafkaACLEnforcementEnabled bool `json:"kafkaACLEnforcementEnabled"` + NetworkPolicyEnforcementEnabled bool `json:"networkPolicyEnforcementEnabled"` + ProtectedServices []struct { Id string `json:"id"` } `json:"protectedServices"` ProtectedServicesEnabled bool `json:"protectedServicesEnabled"` @@ -673,9 +745,12 @@ type ServerProtectionStatuses struct { // Service defines model for Service. type Service struct { - AwsResource *AWSResource `json:"awsResource,omitempty"` - CertificateInformation *CertificateInformation `json:"certificateInformation,omitempty"` - Environment struct { + AwsResource *AWSResource `json:"awsResource,omitempty"` + CertificateInformation *CertificateInformation `json:"certificateInformation,omitempty"` + DiscoveredByIntegration *struct { + Id string `json:"id"` + } `json:"discoveredByIntegration,omitempty"` + Environment struct { Id string `json:"id"` } `json:"environment"` Id string `json:"id"` @@ -712,20 +787,18 @@ type ServiceAccessStatus struct { // User defines model for User. type User struct { - AuthProviderUserId string `json:"authProviderUserId"` - Email string `json:"email"` - Id string `json:"id"` - ImageURL string `json:"imageURL"` - Name string `json:"name"` - OnboardingSelection UserOnboardingSelection `json:"onboardingSelection"` - OnboardingSelectionOther string `json:"onboardingSelectionOther"` - QuestLogStep UserQuestLogStep `json:"questLogStep"` - QuestLogStepSeen UserQuestLogStepSeen `json:"questLogStepSeen"` + AuthProviderUserId string `json:"authProviderUserId"` + Email string `json:"email"` + Id string `json:"id"` + ImageURL string `json:"imageURL"` + Name string `json:"name"` + QuestLogStep UserQuestLogStep `json:"questLogStep"` + QuestLogStepSeen UserQuestLogStepSeen `json:"questLogStepSeen"` + Tutorials *[]struct { + Id string `json:"id"` + } `json:"tutorials,omitempty"` } -// UserOnboardingSelection defines model for User.OnboardingSelection. -type UserOnboardingSelection string - // UserQuestLogStep defines model for User.QuestLogStep. type UserQuestLogStep string @@ -868,15 +941,29 @@ type UpdateGenericIntegrationMutationJSONBody struct { Name *string `json:"name,omitempty"` } +// UpdateGithubIntegrationMutationJSONBody defines parameters for UpdateGithubIntegrationMutation. +type UpdateGithubIntegrationMutationJSONBody struct { + GithubSettings GitHubSettingsInput `json:"githubSettings"` + Id string `json:"id"` + Name string `json:"name"` +} + +// CreateGithubIntegrationMutationJSONBody defines parameters for CreateGithubIntegrationMutation. +type CreateGithubIntegrationMutationJSONBody struct { + GithubSettings GitHubSettingsInput `json:"githubSettings"` + Name string `json:"name"` +} + // CreateKubernetesIntegrationMutationJSONBody defines parameters for CreateKubernetesIntegrationMutation. type CreateKubernetesIntegrationMutationJSONBody struct { - ClusterId string `json:"clusterId"` EnvironmentId *string `json:"environmentId,omitempty"` + Name string `json:"name"` } // UpdateKubernetesIntegrationMutationJSONBody defines parameters for UpdateKubernetesIntegrationMutation. type UpdateKubernetesIntegrationMutationJSONBody struct { EnvironmentId *string `json:"environmentId,omitempty"` + Name *string `json:"name,omitempty"` } // OneInviteQueryParams defines parameters for OneInviteQuery. @@ -985,6 +1072,12 @@ type CreateGenericIntegrationMutationJSONRequestBody CreateGenericIntegrationMut // UpdateGenericIntegrationMutationJSONRequestBody defines body for UpdateGenericIntegrationMutation for application/json ContentType. type UpdateGenericIntegrationMutationJSONRequestBody UpdateGenericIntegrationMutationJSONBody +// UpdateGithubIntegrationMutationJSONRequestBody defines body for UpdateGithubIntegrationMutation for application/json ContentType. +type UpdateGithubIntegrationMutationJSONRequestBody UpdateGithubIntegrationMutationJSONBody + +// CreateGithubIntegrationMutationJSONRequestBody defines body for CreateGithubIntegrationMutation for application/json ContentType. +type CreateGithubIntegrationMutationJSONRequestBody CreateGithubIntegrationMutationJSONBody + // CreateKubernetesIntegrationMutationJSONRequestBody defines body for CreateKubernetesIntegrationMutation for application/json ContentType. type CreateKubernetesIntegrationMutationJSONRequestBody CreateKubernetesIntegrationMutationJSONBody @@ -1172,6 +1265,16 @@ type ClientInterface interface { UpdateGenericIntegrationMutation(ctx context.Context, id string, body UpdateGenericIntegrationMutationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // UpdateGithubIntegrationMutation request with any body + UpdateGithubIntegrationMutationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateGithubIntegrationMutation(ctx context.Context, body UpdateGithubIntegrationMutationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateGithubIntegrationMutation request with any body + CreateGithubIntegrationMutationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateGithubIntegrationMutation(ctx context.Context, body CreateGithubIntegrationMutationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreateKubernetesIntegrationMutation request with any body CreateKubernetesIntegrationMutationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1246,6 +1349,9 @@ type ClientInterface interface { // RemoveUserFromOrganizationMutation request RemoveUserFromOrganizationMutation(ctx context.Context, id string, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) + // PingQuery request + PingQuery(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + // OneServiceQuery request OneServiceQuery(ctx context.Context, params *OneServiceQueryParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1682,6 +1788,54 @@ func (c *Client) UpdateGenericIntegrationMutation(ctx context.Context, id string return c.Client.Do(req) } +func (c *Client) UpdateGithubIntegrationMutationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateGithubIntegrationMutationRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateGithubIntegrationMutation(ctx context.Context, body UpdateGithubIntegrationMutationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateGithubIntegrationMutationRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateGithubIntegrationMutationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateGithubIntegrationMutationRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateGithubIntegrationMutation(ctx context.Context, body CreateGithubIntegrationMutationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateGithubIntegrationMutationRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) CreateKubernetesIntegrationMutationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateKubernetesIntegrationMutationRequestWithBody(c.Server, contentType, body) if err != nil { @@ -2006,6 +2160,18 @@ func (c *Client) RemoveUserFromOrganizationMutation(ctx context.Context, id stri return c.Client.Do(req) } +func (c *Client) PingQuery(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPingQueryRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) OneServiceQuery(ctx context.Context, params *OneServiceQueryParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewOneServiceQueryRequest(c.Server, params) if err != nil { @@ -3138,6 +3304,86 @@ func NewUpdateGenericIntegrationMutationRequestWithBody(server string, id string return req, nil } +// NewUpdateGithubIntegrationMutationRequest calls the generic UpdateGithubIntegrationMutation builder with application/json body +func NewUpdateGithubIntegrationMutationRequest(server string, body UpdateGithubIntegrationMutationJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateGithubIntegrationMutationRequestWithBody(server, "application/json", bodyReader) +} + +// NewUpdateGithubIntegrationMutationRequestWithBody generates requests for UpdateGithubIntegrationMutation with any type of body +func NewUpdateGithubIntegrationMutationRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/integrations/github") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PATCH", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewCreateGithubIntegrationMutationRequest calls the generic CreateGithubIntegrationMutation builder with application/json body +func NewCreateGithubIntegrationMutationRequest(server string, body CreateGithubIntegrationMutationJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateGithubIntegrationMutationRequestWithBody(server, "application/json", bodyReader) +} + +// NewCreateGithubIntegrationMutationRequestWithBody generates requests for CreateGithubIntegrationMutation with any type of body +func NewCreateGithubIntegrationMutationRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/integrations/github") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + // NewCreateKubernetesIntegrationMutationRequest calls the generic CreateKubernetesIntegrationMutation builder with application/json body func NewCreateKubernetesIntegrationMutationRequest(server string, body CreateKubernetesIntegrationMutationJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader @@ -4029,6 +4275,33 @@ func NewRemoveUserFromOrganizationMutationRequest(server string, id string, user return req, nil } +// NewPingQueryRequest generates requests for PingQuery +func NewPingQueryRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/ping") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewOneServiceQueryRequest generates requests for OneServiceQuery func NewOneServiceQueryRequest(server string, params *OneServiceQueryParams) (*http.Request, error) { var err error @@ -4418,6 +4691,16 @@ type ClientWithResponsesInterface interface { UpdateGenericIntegrationMutationWithResponse(ctx context.Context, id string, body UpdateGenericIntegrationMutationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGenericIntegrationMutationResponse, error) + // UpdateGithubIntegrationMutation request with any body + UpdateGithubIntegrationMutationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateGithubIntegrationMutationResponse, error) + + UpdateGithubIntegrationMutationWithResponse(ctx context.Context, body UpdateGithubIntegrationMutationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGithubIntegrationMutationResponse, error) + + // CreateGithubIntegrationMutation request with any body + CreateGithubIntegrationMutationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateGithubIntegrationMutationResponse, error) + + CreateGithubIntegrationMutationWithResponse(ctx context.Context, body CreateGithubIntegrationMutationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateGithubIntegrationMutationResponse, error) + // CreateKubernetesIntegrationMutation request with any body CreateKubernetesIntegrationMutationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateKubernetesIntegrationMutationResponse, error) @@ -4492,6 +4775,9 @@ type ClientWithResponsesInterface interface { // RemoveUserFromOrganizationMutation request RemoveUserFromOrganizationMutationWithResponse(ctx context.Context, id string, userId string, reqEditors ...RequestEditorFn) (*RemoveUserFromOrganizationMutationResponse, error) + // PingQuery request + PingQueryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PingQueryResponse, error) + // OneServiceQuery request OneServiceQueryWithResponse(ctx context.Context, params *OneServiceQueryParams, reqEditors ...RequestEditorFn) (*OneServiceQueryResponse, error) @@ -5198,6 +5484,66 @@ func (r UpdateGenericIntegrationMutationResponse) StatusCode() int { return 0 } +type UpdateGithubIntegrationMutationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Integration + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON409 *Error + JSON422 *Error + JSON500 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r UpdateGithubIntegrationMutationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateGithubIntegrationMutationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateGithubIntegrationMutationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *CreateGithubIntegrationResponse + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON409 *Error + JSON422 *Error + JSON500 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r CreateGithubIntegrationMutationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateGithubIntegrationMutationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type CreateKubernetesIntegrationMutationResponse struct { Body []byte HTTPResponse *http.Response @@ -5798,10 +6144,10 @@ func (r RemoveUserFromOrganizationMutationResponse) StatusCode() int { return 0 } -type OneServiceQueryResponse struct { +type PingQueryResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Service + JSON200 *bool JSON400 *Error JSON401 *Error JSON403 *Error @@ -5813,7 +6159,7 @@ type OneServiceQueryResponse struct { } // Status returns HTTPResponse.Status -func (r OneServiceQueryResponse) Status() string { +func (r PingQueryResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -5821,17 +6167,17 @@ func (r OneServiceQueryResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r OneServiceQueryResponse) StatusCode() int { +func (r PingQueryResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ServicesQueryResponse struct { +type OneServiceQueryResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *[]Service + JSON200 *Service JSON400 *Error JSON401 *Error JSON403 *Error @@ -5843,7 +6189,7 @@ type ServicesQueryResponse struct { } // Status returns HTTPResponse.Status -func (r ServicesQueryResponse) Status() string { +func (r OneServiceQueryResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -5851,17 +6197,17 @@ func (r ServicesQueryResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ServicesQueryResponse) StatusCode() int { +func (r OneServiceQueryResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ServiceQueryResponse struct { +type ServicesQueryResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Service + JSON200 *[]Service JSON400 *Error JSON401 *Error JSON403 *Error @@ -5873,7 +6219,37 @@ type ServiceQueryResponse struct { } // Status returns HTTPResponse.Status -func (r ServiceQueryResponse) Status() string { +func (r ServicesQueryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ServicesQueryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ServiceQueryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Service + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON409 *Error + JSON422 *Error + JSON500 *Error + JSONDefault *Error +} + +// Status returns HTTPResponse.Status +func (r ServiceQueryResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -6251,6 +6627,40 @@ func (c *ClientWithResponses) UpdateGenericIntegrationMutationWithResponse(ctx c return ParseUpdateGenericIntegrationMutationResponse(rsp) } +// UpdateGithubIntegrationMutationWithBodyWithResponse request with arbitrary body returning *UpdateGithubIntegrationMutationResponse +func (c *ClientWithResponses) UpdateGithubIntegrationMutationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateGithubIntegrationMutationResponse, error) { + rsp, err := c.UpdateGithubIntegrationMutationWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateGithubIntegrationMutationResponse(rsp) +} + +func (c *ClientWithResponses) UpdateGithubIntegrationMutationWithResponse(ctx context.Context, body UpdateGithubIntegrationMutationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGithubIntegrationMutationResponse, error) { + rsp, err := c.UpdateGithubIntegrationMutation(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateGithubIntegrationMutationResponse(rsp) +} + +// CreateGithubIntegrationMutationWithBodyWithResponse request with arbitrary body returning *CreateGithubIntegrationMutationResponse +func (c *ClientWithResponses) CreateGithubIntegrationMutationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateGithubIntegrationMutationResponse, error) { + rsp, err := c.CreateGithubIntegrationMutationWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateGithubIntegrationMutationResponse(rsp) +} + +func (c *ClientWithResponses) CreateGithubIntegrationMutationWithResponse(ctx context.Context, body CreateGithubIntegrationMutationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateGithubIntegrationMutationResponse, error) { + rsp, err := c.CreateGithubIntegrationMutation(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateGithubIntegrationMutationResponse(rsp) +} + // CreateKubernetesIntegrationMutationWithBodyWithResponse request with arbitrary body returning *CreateKubernetesIntegrationMutationResponse func (c *ClientWithResponses) CreateKubernetesIntegrationMutationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateKubernetesIntegrationMutationResponse, error) { rsp, err := c.CreateKubernetesIntegrationMutationWithBody(ctx, contentType, body, reqEditors...) @@ -6487,6 +6897,15 @@ func (c *ClientWithResponses) RemoveUserFromOrganizationMutationWithResponse(ctx return ParseRemoveUserFromOrganizationMutationResponse(rsp) } +// PingQueryWithResponse request returning *PingQueryResponse +func (c *ClientWithResponses) PingQueryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PingQueryResponse, error) { + rsp, err := c.PingQuery(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParsePingQueryResponse(rsp) +} + // OneServiceQueryWithResponse request returning *OneServiceQueryResponse func (c *ClientWithResponses) OneServiceQueryWithResponse(ctx context.Context, params *OneServiceQueryParams, reqEditors ...RequestEditorFn) (*OneServiceQueryResponse, error) { rsp, err := c.OneServiceQuery(ctx, params, reqEditors...) @@ -8418,6 +8837,170 @@ func ParseUpdateGenericIntegrationMutationResponse(rsp *http.Response) (*UpdateG return response, nil } +// ParseUpdateGithubIntegrationMutationResponse parses an HTTP response from a UpdateGithubIntegrationMutationWithResponse call +func ParseUpdateGithubIntegrationMutationResponse(rsp *http.Response) (*UpdateGithubIntegrationMutationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateGithubIntegrationMutationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Integration + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + +// ParseCreateGithubIntegrationMutationResponse parses an HTTP response from a CreateGithubIntegrationMutationWithResponse call +func ParseCreateGithubIntegrationMutationResponse(rsp *http.Response) (*CreateGithubIntegrationMutationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateGithubIntegrationMutationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest CreateGithubIntegrationResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + // ParseCreateKubernetesIntegrationMutationResponse parses an HTTP response from a CreateKubernetesIntegrationMutationWithResponse call func ParseCreateKubernetesIntegrationMutationResponse(rsp *http.Response) (*CreateKubernetesIntegrationMutationResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -10058,6 +10641,88 @@ func ParseRemoveUserFromOrganizationMutationResponse(rsp *http.Response) (*Remov return response, nil } +// ParsePingQueryResponse parses an HTTP response from a PingQueryWithResponse call +func ParsePingQueryResponse(rsp *http.Response) (*PingQueryResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PingQueryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest bool + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSONDefault = &dest + + } + + return response, nil +} + // ParseOneServiceQueryResponse parses an HTTP response from a OneServiceQueryWithResponse call func ParseOneServiceQueryResponse(rsp *http.Response) (*OneServiceQueryResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/src/pkg/cloudclient/restapi/cloudapi/openapi.json b/src/pkg/cloudclient/restapi/cloudapi/openapi.json index 3853792..75bc376 100644 --- a/src/pkg/cloudclient/restapi/cloudapi/openapi.json +++ b/src/pkg/cloudclient/restapi/cloudapi/openapi.json @@ -230,6 +230,9 @@ "accessStatus": { "$ref": "#/components/schemas/EdgeAccessStatus" }, + "accessStatuses": { + "$ref": "#/components/schemas/EdgeAccessStatuses" + }, "appliedIntents": { "items": { "properties": { @@ -269,20 +272,6 @@ }, "type": "array" }, - "externalTrafficDiscoveredIntents": { - "items": { - "properties": { - "id": { - "type": "string" - } - }, - "required": [ - "id" - ], - "type": "object" - }, - "type": "array" - }, "server": { "properties": { "id": { @@ -299,9 +288,9 @@ "client", "server", "discoveredIntents", - "externalTrafficDiscoveredIntents", "appliedIntents", - "accessStatus" + "accessStatus", + "accessStatuses" ], "type": "object" }, @@ -457,6 +446,12 @@ "istioGlobalDefaultDeny": { "type": "boolean" }, + "useAWSIAMInAccessGraphStates": { + "type": "boolean" + }, + "useDatabaseInAccessGraphStates": { + "type": "boolean" + }, "useIstioPoliciesInAccessGraphStates": { "type": "boolean" }, @@ -473,6 +468,8 @@ "useNetworkPoliciesInAccessGraphStates", "useIstioPoliciesInAccessGraphStates", "useKafkaACLsInAccessGraphStates", + "useAWSIAMInAccessGraphStates", + "useDatabaseInAccessGraphStates", "clusterFormSettings" ], "type": "object" @@ -488,6 +485,12 @@ "istioGlobalDefaultDeny": { "type": "boolean" }, + "useAWSIAMInAccessGraphStates": { + "type": "boolean" + }, + "useDatabaseInAccessGraphStates": { + "type": "boolean" + }, "useIstioPoliciesInAccessGraphStates": { "type": "boolean" }, @@ -500,7 +503,9 @@ }, "required": [ "globalDefaultDeny", - "useNetworkPoliciesInAccessGraphStates" + "useNetworkPoliciesInAccessGraphStates", + "useIstioPoliciesInAccessGraphStates", + "useKafkaACLsInAccessGraphStates" ], "type": "object" }, @@ -566,6 +571,29 @@ ], "type": "object" }, + "CreateGithubIntegrationResponse": { + "properties": { + "integration": { + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "nextURL": { + "type": "string" + } + }, + "required": [ + "integration", + "nextURL" + ], + "type": "object" + }, "CredentialsOperatorComponent": { "properties": { "status": { @@ -586,23 +614,6 @@ ], "type": "object" }, - "DNSIPPair": { - "properties": { - "dnsName": { - "type": "string" - }, - "ips": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "dnsName" - ], - "type": "object" - }, "DatabaseConfig": { "properties": { "dbname": { @@ -675,8 +686,8 @@ ], "type": "string" }, - "logConsumerSettings": { - "$ref": "#/components/schemas/GCPCloudSQLConsumerSettings" + "visibility": { + "$ref": "#/components/schemas/DatabaseVisibilitySettings" } }, "required": [ @@ -700,7 +711,7 @@ ], "type": "string" }, - "logConsumerSettings": { + "visibility": { "type": "object" } }, @@ -711,6 +722,34 @@ ], "type": "object" }, + "DatabaseVisibilitySettings": { + "properties": { + "gcpPubSub": { + "$ref": "#/components/schemas/GCPPubSubLogConsumerSettings" + }, + "source": { + "enum": [ + "GCP_PUBSUB" + ], + "type": "string" + } + }, + "type": "object" + }, + "DatabaseVisibilitySettingsInput": { + "properties": { + "gcpPubSub": { + "type": "object" + }, + "source": { + "enum": [ + "GCP_PUBSUB" + ], + "type": "string" + } + }, + "type": "object" + }, "EdgeAccessStatus": { "properties": { "reason": { @@ -719,6 +758,7 @@ "ALLOWED_BY_APPLIED_INTENTS_OVERLY_PERMISSIVE", "ALLOWED_BY_APPLIED_INTENTS_HTTP_OVERLY_PERMISSIVE", "ALLOWED_BY_APPLIED_INTENTS_KAFKA_OVERLY_PERMISSIVE", + "ALLOWED_BY_APPLIED_INTENTS_DATABASE_OVERLY_PERMISSIVE", "ALLOWED_BY_EXTERNAL_TRAFFIC_NETWORK_POLICY", "BLOCKED_BY_APPLIED_INTENTS_UNDER_PERMISSIVE", "BLOCKED_BY_APPLIED_INTENTS_RESOURCE_MISMATCH", @@ -727,6 +767,9 @@ "BLOCKED_BY_APPLIED_INTENTS_KAFKA_UNDER_PERMISSIVE", "BLOCKED_BY_APPLIED_INTENTS_KAFKA_RESOURCE_MISMATCH", "BLOCKED_BY_KAFKA_ENFORCEMENT_CONFIG_MISSING_APPLIED_INTENTS", + "BLOCKED_BY_APPLIED_INTENTS_DATABASE_UNDER_PERMISSIVE", + "BLOCKED_BY_APPLIED_INTENTS_DATABASE_RESOURCE_MISMATCH", + "BLOCKED_BY_DATABASE_ENFORCEMENT_CONFIG_MISSING_APPLIED_INTENTS", "BLOCKED_BY_DEFAULT_DENY", "SHARED_SERVICE_ACCOUNT", "CLIENT_ISTIO_SIDECAR_MISSING", @@ -740,7 +783,8 @@ "NETWORK_MAPPER_NEVER_CONNECTED", "INTERNET_ACCESS_STATUS_UNKNOWN", "NO_INTENTS_FOUND_OF_RELEVANT_TYPE", - "IGNORED_IN_CALCULATION" + "IGNORED_IN_CALCULATION", + "INTERNET_INTENTS_ENFORCEMENT_DISABLED" ], "type": "string" }, @@ -751,6 +795,7 @@ "ALLOWED_BY_APPLIED_INTENTS_OVERLY_PERMISSIVE", "ALLOWED_BY_APPLIED_INTENTS_HTTP_OVERLY_PERMISSIVE", "ALLOWED_BY_APPLIED_INTENTS_KAFKA_OVERLY_PERMISSIVE", + "ALLOWED_BY_APPLIED_INTENTS_DATABASE_OVERLY_PERMISSIVE", "ALLOWED_BY_EXTERNAL_TRAFFIC_NETWORK_POLICY", "BLOCKED_BY_APPLIED_INTENTS_UNDER_PERMISSIVE", "BLOCKED_BY_APPLIED_INTENTS_RESOURCE_MISMATCH", @@ -759,6 +804,9 @@ "BLOCKED_BY_APPLIED_INTENTS_KAFKA_UNDER_PERMISSIVE", "BLOCKED_BY_APPLIED_INTENTS_KAFKA_RESOURCE_MISMATCH", "BLOCKED_BY_KAFKA_ENFORCEMENT_CONFIG_MISSING_APPLIED_INTENTS", + "BLOCKED_BY_APPLIED_INTENTS_DATABASE_UNDER_PERMISSIVE", + "BLOCKED_BY_APPLIED_INTENTS_DATABASE_RESOURCE_MISMATCH", + "BLOCKED_BY_DATABASE_ENFORCEMENT_CONFIG_MISSING_APPLIED_INTENTS", "BLOCKED_BY_DEFAULT_DENY", "SHARED_SERVICE_ACCOUNT", "CLIENT_ISTIO_SIDECAR_MISSING", @@ -772,7 +820,8 @@ "NETWORK_MAPPER_NEVER_CONNECTED", "INTERNET_ACCESS_STATUS_UNKNOWN", "NO_INTENTS_FOUND_OF_RELEVANT_TYPE", - "IGNORED_IN_CALCULATION" + "IGNORED_IN_CALCULATION", + "INTERNET_INTENTS_ENFORCEMENT_DISABLED" ], "type": "string" }, @@ -808,6 +857,33 @@ ], "type": "object" }, + "EdgeAccessStatuses": { + "properties": { + "awsIam": { + "$ref": "#/components/schemas/EdgeAccessStatus" + }, + "database": { + "$ref": "#/components/schemas/EdgeAccessStatus" + }, + "istioPolicies": { + "$ref": "#/components/schemas/EdgeAccessStatus" + }, + "kafkaACLs": { + "$ref": "#/components/schemas/EdgeAccessStatus" + }, + "networkPolicies": { + "$ref": "#/components/schemas/EdgeAccessStatus" + } + }, + "required": [ + "networkPolicies", + "kafkaACLs", + "istioPolicies", + "awsIam", + "database" + ], + "type": "object" + }, "Environment": { "properties": { "appliedIntentsCount": { @@ -865,46 +941,22 @@ ], "type": "object" }, - "ExternalTrafficIntent": { + "GCPPubSubLogConsumerSettings": { "properties": { - "client": { - "properties": { - "id": { - "type": "string" - } - }, - "required": [ - "id" - ], - "type": "object" - }, - "id": { + "projectId": { "type": "string" }, - "server": { - "properties": { - "id": { - "type": "string" - } - }, - "required": [ - "id" - ], - "type": "object" - }, - "target": { - "$ref": "#/components/schemas/DNSIPPair" + "topic": { + "type": "string" } }, "required": [ - "id", - "server", - "client", - "target" + "projectId", + "topic" ], "type": "object" }, - "GCPCloudSQLConsumerSettings": { + "GCPPubSubLogConsumerSettingsInput": { "properties": { "projectId": { "type": "string" @@ -919,18 +971,107 @@ ], "type": "object" }, - "GCPCloudSQLConsumerSettingsInput": { + "GitHubRepoFilterPair": { "properties": { - "projectId": { + "filter": { + "$ref": "#/components/schemas/AccessGraphFilter" + }, + "repoInfo": { + "$ref": "#/components/schemas/GitHubRepoInfo" + } + }, + "required": [ + "filter", + "repoInfo" + ], + "type": "object" + }, + "GitHubRepoFilterPairInput": { + "properties": { + "filter": { + "type": "object" + }, + "repoInfo": { + "type": "object" + } + }, + "required": [ + "filter", + "repoInfo" + ], + "type": "object" + }, + "GitHubRepoInfo": { + "properties": { + "baseBranch": { "type": "string" }, - "topic": { + "intentsPath": { + "type": "string" + }, + "repository": { "type": "string" } }, "required": [ - "projectId", - "topic" + "repository", + "baseBranch", + "intentsPath" + ], + "type": "object" + }, + "GitHubRepoInfoInput": { + "properties": { + "baseBranch": { + "type": "string" + }, + "intentsPath": { + "type": "string" + }, + "repository": { + "type": "string" + } + }, + "required": [ + "repository", + "baseBranch", + "intentsPath" + ], + "type": "object" + }, + "GitHubSettings": { + "properties": { + "isActive": { + "type": "boolean" + }, + "repoFilterPairs": { + "items": { + "$ref": "#/components/schemas/GitHubRepoFilterPair" + }, + "type": "array" + } + }, + "required": [ + "isActive", + "repoFilterPairs" + ], + "type": "object" + }, + "GitHubSettingsInput": { + "properties": { + "isActive": { + "type": "boolean" + }, + "repoFilterPairs": { + "items": { + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "isActive", + "repoFilterPairs" ], "type": "object" }, @@ -1046,18 +1187,25 @@ ], "type": "object" }, + "githubSettings": { + "$ref": "#/components/schemas/GitHubSettings" + }, "id": { "type": "string" }, "name": { "type": "string" }, + "organizationId": { + "type": "string" + }, "type": { "enum": [ "GENERIC", "KUBERNETES", "DATABASE", - "AWS" + "AWS", + "GITHUB" ], "type": "string" } @@ -1066,7 +1214,8 @@ "id", "name", "type", - "credentials" + "credentials", + "organizationId" ], "type": "object" }, @@ -1138,6 +1287,9 @@ "id": { "type": "string" }, + "internet": { + "$ref": "#/components/schemas/InternetConfig" + }, "kafkaTopics": { "items": { "$ref": "#/components/schemas/KafkaConfig" @@ -1164,7 +1316,8 @@ "KAFKA", "DATABASE", "AWS", - "S3" + "S3", + "INTERNET" ], "type": "string" } @@ -1224,6 +1377,15 @@ }, "IntentsOperatorConfiguration": { "properties": { + "awsIAMPolicyEnforcementEnabled": { + "type": "boolean" + }, + "databaseEnforcementEnabled": { + "type": "boolean" + }, + "egressNetworkPolicyEnforcementEnabled": { + "type": "boolean" + }, "globalEnforcementEnabled": { "type": "boolean" }, @@ -1259,8 +1421,35 @@ "networkPolicyEnforcementEnabled", "kafkaACLEnforcementEnabled", "istioPolicyEnforcementEnabled", + "awsIAMPolicyEnforcementEnabled", + "databaseEnforcementEnabled", "protectedServicesEnabled", - "protectedServices" + "protectedServices", + "egressNetworkPolicyEnforcementEnabled" + ], + "type": "object" + }, + "InternetConfig": { + "properties": { + "dnsName": { + "type": "string" + }, + "ips": { + "items": { + "type": "string" + }, + "type": "array" + }, + "ports": { + "items": { + "format": "int32", + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "dnsName" ], "type": "object" }, @@ -1589,7 +1778,8 @@ "SERVER_HAS_NO_KAFKA_SERVER_CONFIG", "IGNORED_IN_CALCULATION", "PROTECTED_BY_DATABASE_INTEGRATION", - "PROTECTED_BY_AWS_IAM_INTEGRATION" + "PROTECTED_BY_AWS_IAM_INTEGRATION", + "PROTECTED_BY_INTERNET_INTENTS" ], "type": "string" }, @@ -1635,6 +1825,17 @@ "certificateInformation": { "$ref": "#/components/schemas/CertificateInformation" }, + "discoveredByIntegration": { + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ], + "type": "object" + }, "environment": { "properties": { "id": { @@ -1701,11 +1902,14 @@ "types": { "items": { "enum": [ + "NODE_GROUP", + "PREFIX_GROUP", "KUBERNETES", "KAFKA", "AWS", "DATABASE", - "INTERNET" + "INTERNET", + "DATABASE_USER" ], "type": "string" }, @@ -1773,17 +1977,6 @@ "name": { "type": "string" }, - "onboardingSelection": { - "enum": [ - "DEFAULT", - "AWS_IAM", - "OTHER" - ], - "type": "string" - }, - "onboardingSelectionOther": { - "type": "string" - }, "questLogStep": { "enum": [ "CONNECT_CLUSTER", @@ -1793,7 +1986,6 @@ "DECLARE_INTENTS_CLICK_ON_SERVICE", "DECLARE_INTENTS_DOWNLOAD_YAML", "DECLARE_INTENTS_DO_APPLY", - "ENABLE_ENFORCEMENT_CREATE_PROTECTED_SERVICE", "COMPLETED" ], "type": "string" @@ -1807,10 +1999,23 @@ "DECLARE_INTENTS_CLICK_ON_SERVICE", "DECLARE_INTENTS_DOWNLOAD_YAML", "DECLARE_INTENTS_DO_APPLY", - "ENABLE_ENFORCEMENT_CREATE_PROTECTED_SERVICE", "COMPLETED" ], "type": "string" + }, + "tutorials": { + "items": { + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "type": "array" } }, "required": [ @@ -1820,9 +2025,57 @@ "imageURL", "authProviderUserId", "questLogStep", - "questLogStepSeen", - "onboardingSelection", - "onboardingSelectionOther" + "questLogStepSeen" + ], + "type": "object" + }, + "UserTutorial": { + "properties": { + "clusterId": { + "type": "string" + }, + "clusterName": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "isCompleted": { + "type": "boolean" + }, + "name": { + "enum": [ + "NETWORK_POLICIES", + "AWS_IAM", + "POSTGRESQL", + "ISTIO_AUTH_POLICY_AUTOMATION", + "KAFKA_ACCESS_AUTOMATE_OTTERIZE_CLOUD" + ], + "type": "string" + }, + "step": { + "type": "string" + }, + "stepSeen": { + "type": "string" + }, + "userId": { + "type": "string" + } + }, + "required": [ + "id", + "userId", + "clusterId", + "clusterName", + "name", + "isActive", + "isCompleted", + "step", + "stepSeen" ], "type": "object" } @@ -1834,6 +2087,12 @@ "name": "access_token", "type": "apiKey" }, + "bearerAuth": { + "bearerFormat": "JWT", + "description": "Otterize user JWT token.", + "scheme": "bearer", + "type": "http" + }, "oauth2": { "description": "Use client ID and client secret from an Otterize integration to authenticate.", "flows": { @@ -1856,7 +2115,7 @@ "info": { "title": "Otterize API Server", "version": "v1beta", - "x-revision": "7c65a7f11dfe7b0d0358fdc2f2e576394de69c91" + "x-revision": "04a8dbb4928aa277965a605782f556a479c40232" }, "openapi": "3.0.0", "paths": { @@ -2866,7 +3125,8 @@ "GENERIC", "KUBERNETES", "DATABASE", - "AWS" + "AWS", + "GITHUB" ], "type": "string" } @@ -2972,7 +3232,8 @@ "GENERIC", "KUBERNETES", "DATABASE", - "AWS" + "AWS", + "GITHUB" ], "type": "string" } @@ -3493,10 +3754,10 @@ ] } }, - "/integrations/kubernetes": { - "post": { - "description": "Create a new Kubernetes integration", - "operationId": "createKubernetesIntegration_mutation", + "/integrations/github": { + "patch": { + "description": "Update Github integration", + "operationId": "updateGithubIntegration_mutation", "parameters": [ ], "requestBody": { @@ -3504,21 +3765,167 @@ "application/json": { "schema": { "properties": { - "clusterId": { + "githubSettings": { + "$ref": "#/components/schemas/GitHubSettingsInput" + }, + "id": { "example": "obj_12345", "format": "id", "pattern": "^[A-Za-z_]+_[a-z0-9]+$", "type": "string" }, + "name": { + "example": "Object name", + "format": "custom-name", + "pattern": "^[A-Za-z][A-Za-z0-9- _]{0,61}[A-Za-z0-9]$", + "type": "string" + } + }, + "required": [ + "id", + "name", + "githubSettings" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Integration" + } + } + }, + "description": "Update Github integration" + }, + "400": { + "$ref": "#/components/responses/APPLIED_INTENTS_ERROR" + }, + "401": { + "$ref": "#/components/responses/UNAUTHENTICATED" + }, + "403": { + "$ref": "#/components/responses/FORBIDDEN" + }, + "404": { + "$ref": "#/components/responses/NOT_FOUND" + }, + "409": { + "$ref": "#/components/responses/CONFLICT" + }, + "422": { + "$ref": "#/components/responses/BAD_USER_INPUT" + }, + "500": { + "$ref": "#/components/responses/INTERNAL_SERVER_ERROR" + }, + "default": { + "$ref": "#/components/responses/UNEXPECTED_ERROR" + } + }, + "summary": "Update Github integration", + "tags": [ + "integrations" + ] + }, + "post": { + "description": "Create a new Github integration", + "operationId": "createGithubIntegration_mutation", + "parameters": [ + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "githubSettings": { + "$ref": "#/components/schemas/GitHubSettingsInput" + }, + "name": { + "type": "string" + } + }, + "required": [ + "name", + "githubSettings" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateGithubIntegrationResponse" + } + } + }, + "description": "Create a new Github integration" + }, + "400": { + "$ref": "#/components/responses/APPLIED_INTENTS_ERROR" + }, + "401": { + "$ref": "#/components/responses/UNAUTHENTICATED" + }, + "403": { + "$ref": "#/components/responses/FORBIDDEN" + }, + "404": { + "$ref": "#/components/responses/NOT_FOUND" + }, + "409": { + "$ref": "#/components/responses/CONFLICT" + }, + "422": { + "$ref": "#/components/responses/BAD_USER_INPUT" + }, + "500": { + "$ref": "#/components/responses/INTERNAL_SERVER_ERROR" + }, + "default": { + "$ref": "#/components/responses/UNEXPECTED_ERROR" + } + }, + "summary": "Create a new Github integration", + "tags": [ + "integrations" + ] + } + }, + "/integrations/kubernetes": { + "post": { + "description": "Create a new Kubernetes integration", + "operationId": "createKubernetesIntegration_mutation", + "parameters": [ + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { "environmentId": { "example": "obj_12345", "format": "id", "pattern": "^[A-Za-z_]+_[a-z0-9]+$", "type": "string" + }, + "name": { + "example": "Object name", + "format": "custom-name", + "pattern": "^[A-Za-z][A-Za-z0-9- _]{0,61}[A-Za-z0-9]$", + "type": "string" } }, "required": [ - "clusterId" + "name" ], "type": "object" } @@ -3594,6 +4001,12 @@ "format": "id", "pattern": "^[A-Za-z_]+_[a-z0-9]+$", "type": "string" + }, + "name": { + "example": "Object name", + "format": "custom-name", + "pattern": "^[A-Za-z][A-Za-z0-9- _]{0,61}[A-Za-z0-9]$", + "type": "string" } }, "type": "object" @@ -4228,9 +4641,9 @@ "name": "name", "required": false, "schema": { - "example": "objects_name", + "example": "objects-name", "format": "k8s-name", - "pattern": "^[a-z0-9][a-z0-9-.]{0,252}$", + "pattern": "^[a-z0-9][a-z0-9-_.]{0,252}$", "type": "string" } } @@ -4309,9 +4722,9 @@ "name": "name", "required": false, "schema": { - "example": "objects_name", + "example": "objects-name", "format": "k8s-name", - "pattern": "^[a-z0-9][a-z0-9-.]{0,252}$", + "pattern": "^[a-z0-9][a-z0-9-_.]{0,252}$", "type": "string" } } @@ -4814,6 +5227,54 @@ ] } }, + "/ping": { + "get": { + "description": "Checks the availability of the API server", + "operationId": "ping_query", + "parameters": [ + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + }, + "description": "Checks the availability of the API server" + }, + "400": { + "$ref": "#/components/responses/APPLIED_INTENTS_ERROR" + }, + "401": { + "$ref": "#/components/responses/UNAUTHENTICATED" + }, + "403": { + "$ref": "#/components/responses/FORBIDDEN" + }, + "404": { + "$ref": "#/components/responses/NOT_FOUND" + }, + "409": { + "$ref": "#/components/responses/CONFLICT" + }, + "422": { + "$ref": "#/components/responses/BAD_USER_INPUT" + }, + "500": { + "$ref": "#/components/responses/INTERNAL_SERVER_ERROR" + }, + "default": { + "$ref": "#/components/responses/UNEXPECTED_ERROR" + } + }, + "summary": "Checks the availability of the API server", + "tags": [ + "health" + ] + } + }, "/service": { "get": { "description": "Get service by filters", @@ -4846,9 +5307,9 @@ "name": "name", "required": false, "schema": { - "example": "objects_name", + "example": "objects-name", "format": "k8s-name", - "pattern": "^[a-z0-9][a-z0-9-.]{0,252}$", + "pattern": "^[a-z0-9][a-z0-9-_.]{0,252}$", "type": "string" } } @@ -4927,9 +5388,9 @@ "name": "name", "required": false, "schema": { - "example": "objects_name", + "example": "objects-name", "format": "k8s-name", - "pattern": "^[a-z0-9][a-z0-9-.]{0,252}$", + "pattern": "^[a-z0-9][a-z0-9-_.]{0,252}$", "type": "string" } } @@ -5159,6 +5620,12 @@ ], "organizationHeader": [ ] + }, + { + "bearerAuth": [ + ], + "organizationHeader": [ + ] } ], "servers": [ diff --git a/src/pkg/mapperclient/generated.go b/src/pkg/mapperclient/generated.go index e3e968f..7e2feef 100644 --- a/src/pkg/mapperclient/generated.go +++ b/src/pkg/mapperclient/generated.go @@ -26,8 +26,11 @@ const ( type IntentType string const ( - IntentTypeKafka IntentType = "KAFKA" - IntentTypeHttp IntentType = "HTTP" + IntentTypeHttp IntentType = "HTTP" + IntentTypeKafka IntentType = "KAFKA" + IntentTypeDatabase IntentType = "DATABASE" + IntentTypeAws IntentType = "AWS" + IntentTypeS3 IntentType = "S3" ) // IntentsIntentsIntent includes the requested fields of the GraphQL type Intent. diff --git a/src/pkg/mapperclient/schema.graphql b/src/pkg/mapperclient/schema.graphql index 6768d52..f1f2cf3 100644 --- a/src/pkg/mapperclient/schema.graphql +++ b/src/pkg/mapperclient/schema.graphql @@ -48,8 +48,11 @@ type OtterizeServiceIdentity { } enum IntentType { - KAFKA HTTP + KAFKA + DATABASE + AWS + S3 } enum KafkaOperation { @@ -94,6 +97,7 @@ type Intent { type: IntentType kafkaTopics: [KafkaConfig!] httpResources: [HttpResource!] + awsActions: [String!] } type ServiceIntents { @@ -128,6 +132,12 @@ input IstioConnectionResults { results: [IstioConnection!]! } +input AWSOperation { + resource: String! + actions: [String!]! + srcIp: String! +} + input ServerFilter { name: String! namespace: String! @@ -167,4 +177,5 @@ type Mutation { reportSocketScanResults(results: SocketScanResults!): Boolean! reportKafkaMapperResults(results: KafkaMapperResults!): Boolean! reportIstioConnectionResults(results: IstioConnectionResults!): Boolean! + reportAWSOperation(operation: [AWSOperation!]!): Boolean! } \ No newline at end of file diff --git a/src/pkg/telemetry/telemetrygql/generated.go b/src/pkg/telemetry/telemetrygql/generated.go index 43f608c..741e7e5 100644 --- a/src/pkg/telemetry/telemetrygql/generated.go +++ b/src/pkg/telemetry/telemetrygql/generated.go @@ -65,6 +65,13 @@ type __SendCLITelemetryInput struct { // GetTelemetry returns __SendCLITelemetryInput.Telemetry, and is useful for accessing the field via an interface. func (v *__SendCLITelemetryInput) GetTelemetry() CLITelemetry { return v.Telemetry } +// The query or mutation executed by SendCLITelemetry. +const SendCLITelemetry_Operation = ` +mutation SendCLITelemetry ($telemetry: CLITelemetry!) { + sendCLITelemetries(telemetries: [$telemetry]) +} +` + func SendCLITelemetry( ctx context.Context, client graphql.Client, @@ -72,11 +79,7 @@ func SendCLITelemetry( ) (*SendCLITelemetryResponse, error) { req := &graphql.Request{ OpName: "SendCLITelemetry", - Query: ` -mutation SendCLITelemetry ($telemetry: CLITelemetry!) { - sendCLITelemetries(telemetries: [$telemetry]) -} -`, + Query: SendCLITelemetry_Operation, Variables: &__SendCLITelemetryInput{ Telemetry: telemetry, }, diff --git a/src/pkg/telemetry/telemetrygql/schema.graphql b/src/pkg/telemetry/telemetrygql/schema.graphql index 2f69667..0672d96 100644 --- a/src/pkg/telemetry/telemetrygql/schema.graphql +++ b/src/pkg/telemetry/telemetrygql/schema.graphql @@ -7,6 +7,12 @@ directive @constraint( example: String! ) on ENUM_VALUE +"""The @defer directive may be specified on a fragment spread to imply de-prioritization, that causes the fragment to be omitted in the initial response, and delivered as a subsequent response afterward. A query with @defer directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred delivered in a subsequent response. @include and @skip take precedence over @defer.""" +directive @defer( + if: Boolean + label: String +) on FRAGMENT_SPREAD | INLINE_FRAGMENT + """The @deprecated built-in directive is used within the type system definition language to indicate deprecated portions of a GraphQL service's schema, such as deprecated fields on a type, arguments on a field, input fields on an input type, or values of an enum type.""" directive @deprecated( reason: String @@ -106,9 +112,9 @@ type AccessGraphEdge { client: Service! server: Service! discoveredIntents: [Intent!]! - externalTrafficDiscoveredIntents: [ExternalTrafficIntent!]! appliedIntents: [Intent!]! accessStatus: EdgeAccessStatus! + accessStatuses: EdgeAccessStatuses! } type AccessGraphFilter { @@ -137,6 +143,21 @@ enum ApiMethod { DELETE } +enum AwsIamStep { + CREATE_CLUSTER + CONNECT_CLUSTER + DEPLOY_OTTERIZE_FOR_AWS_IAM + CREATE_S3_BUCKET + DEPLOY_SAMPLE_SERVER + VIEW_LOGS + LABEL_THE_SERVER_POD + SEE_THE_CREATED_ROLE + SEE_THE_SERVICE_ACCOUNT + APPLY_INTENTS + QUERY_S3_BUCKET_CONTENT + COMPLETED +} + """The `Boolean` scalar type represents `true` or `false`.""" scalar Boolean @@ -212,6 +233,8 @@ type ClusterConfiguration { useNetworkPoliciesInAccessGraphStates: Boolean! useIstioPoliciesInAccessGraphStates: Boolean! useKafkaACLsInAccessGraphStates: Boolean! + useAWSIAMInAccessGraphStates: Boolean! + useDatabaseInAccessGraphStates: Boolean! clusterFormSettings: ClusterFormSettings! } @@ -219,8 +242,10 @@ input ClusterConfigurationInput { globalDefaultDeny: Boolean! istioGlobalDefaultDeny: Boolean useNetworkPoliciesInAccessGraphStates: Boolean! - useIstioPoliciesInAccessGraphStates: Boolean - useKafkaACLsInAccessGraphStates: Boolean + useIstioPoliciesInAccessGraphStates: Boolean! + useKafkaACLsInAccessGraphStates: Boolean! + useAWSIAMInAccessGraphStates: Boolean + useDatabaseInAccessGraphStates: Boolean clusterFormSettings: ClusterFormSettingsInput } @@ -259,6 +284,11 @@ enum ComponentType { NETWORK_MAPPER } +type CreateGithubIntegrationResponse { + integration: Integration! + nextURL: String! +} + type CredentialsOperatorComponent { type: ComponentType! status: ComponentStatus! @@ -278,11 +308,6 @@ enum DBPermissionChange { DELETE } -type DNSIPPair { - dnsName: String! - ips: [String!] -} - input DNSIPPairInput { dnsName: String! ips: [String!] @@ -314,14 +339,14 @@ type DatabaseInfo { address: String! databaseType: DatabaseType! credentials: DatabaseCredentials! - logConsumerSettings: GCPCloudSQLConsumerSettings + visibility: DatabaseVisibilitySettings } input DatabaseInfoInput { address: String! databaseType: DatabaseType! credentials: DatabaseCredentialsInput! - logConsumerSettings: GCPCloudSQLConsumerSettingsInput + visibility: DatabaseVisibilitySettingsInput } enum DatabaseOperation { @@ -336,6 +361,20 @@ enum DatabaseType { POSTGRESQL } +type DatabaseVisibilitySettings { + source: DatabaseVisibilitySource + gcpPubSub: GCPPubSubLogConsumerSettings +} + +input DatabaseVisibilitySettingsInput { + source: DatabaseVisibilitySource + gcpPubSub: GCPPubSubLogConsumerSettingsInput +} + +enum DatabaseVisibilitySource { + GCP_PUBSUB +} + input DiscoveredIntentInput { discoveredAt: Time! intent: IntentInput! @@ -355,6 +394,7 @@ enum EdgeAccessStatusReason { ALLOWED_BY_APPLIED_INTENTS_OVERLY_PERMISSIVE ALLOWED_BY_APPLIED_INTENTS_HTTP_OVERLY_PERMISSIVE ALLOWED_BY_APPLIED_INTENTS_KAFKA_OVERLY_PERMISSIVE + ALLOWED_BY_APPLIED_INTENTS_DATABASE_OVERLY_PERMISSIVE ALLOWED_BY_EXTERNAL_TRAFFIC_NETWORK_POLICY BLOCKED_BY_APPLIED_INTENTS_UNDER_PERMISSIVE BLOCKED_BY_APPLIED_INTENTS_RESOURCE_MISMATCH @@ -363,6 +403,9 @@ enum EdgeAccessStatusReason { BLOCKED_BY_APPLIED_INTENTS_KAFKA_UNDER_PERMISSIVE BLOCKED_BY_APPLIED_INTENTS_KAFKA_RESOURCE_MISMATCH BLOCKED_BY_KAFKA_ENFORCEMENT_CONFIG_MISSING_APPLIED_INTENTS + BLOCKED_BY_APPLIED_INTENTS_DATABASE_UNDER_PERMISSIVE + BLOCKED_BY_APPLIED_INTENTS_DATABASE_RESOURCE_MISMATCH + BLOCKED_BY_DATABASE_ENFORCEMENT_CONFIG_MISSING_APPLIED_INTENTS BLOCKED_BY_DEFAULT_DENY SHARED_SERVICE_ACCOUNT CLIENT_ISTIO_SIDECAR_MISSING @@ -377,6 +420,7 @@ enum EdgeAccessStatusReason { INTERNET_ACCESS_STATUS_UNKNOWN NO_INTENTS_FOUND_OF_RELEVANT_TYPE IGNORED_IN_CALCULATION + INTERNET_INTENTS_ENFORCEMENT_DISABLED } enum EdgeAccessStatusVerdict { @@ -387,6 +431,14 @@ enum EdgeAccessStatusVerdict { UNKNOWN } +type EdgeAccessStatuses { + networkPolicies: EdgeAccessStatus! + kafkaACLs: EdgeAccessStatus! + istioPolicies: EdgeAccessStatus! + awsIam: EdgeAccessStatus! + database: EdgeAccessStatus! +} + type Environment { id: ID! name: String! @@ -402,6 +454,7 @@ enum EventType { INTENTS_APPLIED_KAFKA INTENTS_APPLIED_HTTP INTENTS_APPLIED_DATABASE + INTENTS_APPLIED_INTERNET INTENTS_DISCOVERED INTENTS_DISCOVERED_SOCKET_SCAN INTENTS_DISCOVERED_CAPTURE @@ -430,13 +483,6 @@ input ExternalTrafficDiscoveredIntentInput { intent: ExternalTrafficIntentInput! } -type ExternalTrafficIntent { - id: ID! - server: Service! - client: Service! - target: DNSIPPair! -} - input ExternalTrafficIntentInput { namespace: String! clientName: String! @@ -446,16 +492,48 @@ input ExternalTrafficIntentInput { """The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).""" scalar Float -type GCPCloudSQLConsumerSettings { +type GCPPubSubLogConsumerSettings { projectId: String! topic: String! } -input GCPCloudSQLConsumerSettingsInput { +input GCPPubSubLogConsumerSettingsInput { projectId: String! topic: String! } +type GitHubRepoFilterPair { + filter: AccessGraphFilter! + repoInfo: GitHubRepoInfo! +} + +input GitHubRepoFilterPairInput { + filter: InputAccessGraphFilter! + repoInfo: GitHubRepoInfoInput! +} + +type GitHubRepoInfo { + repository: String! + baseBranch: String! + intentsPath: String! +} + +input GitHubRepoInfoInput { + repository: String! + baseBranch: String! + intentsPath: String! +} + +type GitHubSettings { + isActive: Boolean! + repoFilterPairs: [GitHubRepoFilterPair!]! +} + +input GitHubSettingsInput { + isActive: Boolean! + repoFilterPairs: [GitHubRepoFilterPairInput!]! +} + type HTTPConfig { path: String! methods: [HTTPMethod!] @@ -503,6 +581,8 @@ type Integration { cluster: Cluster databaseInfo: DatabaseInfo awsInfo: AWSInfo + githubSettings: GitHubSettings + organizationId: String! } type IntegrationComponents { @@ -521,6 +601,7 @@ enum IntegrationType { KUBERNETES DATABASE AWS + GITHUB } type Intent { @@ -532,6 +613,7 @@ type Intent { httpResources: [HTTPConfig!] databaseResources: [DatabaseConfig!] awsActions: [String!] + internet: InternetConfig status: IntentStatus } @@ -545,6 +627,7 @@ input IntentInput { resources: [HTTPConfigInput!] databaseResources: [DatabaseConfigInput!] awsActions: [String!] + internet: InternetConfigInput status: IntentStatusInput } @@ -565,6 +648,7 @@ enum IntentType { DATABASE AWS S3 + INTERNET } type IntentsOperatorComponent { @@ -578,8 +662,11 @@ type IntentsOperatorConfiguration { networkPolicyEnforcementEnabled: Boolean! kafkaACLEnforcementEnabled: Boolean! istioPolicyEnforcementEnabled: Boolean! + awsIAMPolicyEnforcementEnabled: Boolean! + databaseEnforcementEnabled: Boolean! protectedServicesEnabled: Boolean! protectedServices: [Service!]! + egressNetworkPolicyEnforcementEnabled: Boolean! } input IntentsOperatorConfigurationInput { @@ -588,6 +675,20 @@ input IntentsOperatorConfigurationInput { kafkaACLEnforcementEnabled: Boolean istioPolicyEnforcementEnabled: Boolean protectedServicesEnabled: Boolean + egressNetworkPolicyEnforcementEnabled: Boolean + awsIAMPolicyEnforcementEnabled: Boolean + databaseEnforcementEnabled: Boolean +} + +type InternetConfig { + dnsName: String! + ips: [String!] + ports: [Int!] +} + +input InternetConfigInput { + ips: [String!]! + ports: [Int!] } type Invite { @@ -725,6 +826,10 @@ type Mutation { createCluster( name: String! ): Cluster! + createClusterAndUpdateUserTutorial( + name: String! + userTutorialId: ID! + ): Cluster! """Delete cluster""" deleteCluster( id: ID! @@ -786,6 +891,17 @@ type Mutation { name: String! awsIntegration: AWSInfoInput! ): Integration +"""Create a new Github integration""" + createGithubIntegration( + name: String! + githubSettings: GitHubSettingsInput! + ): CreateGithubIntegrationResponse +"""Update Github integration""" + updateGithubIntegration( + id: ID! + name: String! + githubSettings: GitHubSettingsInput! + ): Integration """Update AWS integration""" updateAWSIntegration( id: ID! @@ -886,6 +1002,33 @@ type Mutation { sendCLITelemetries( telemetries: [CLITelemetry!]! ): Boolean! + saveOnboardingFeedback( + userEmail: String! + feedback: String! + ): Boolean! + createUserTutorial( + tutorialName: TutorialName! + ): Boolean! + updateUserTutorialCluster( + userTutorialId: ID! + clusterId: ID! + ifClusterNotExists: Boolean! + ): Boolean! + activateUserTutorial( + tutorialName: TutorialName! + ): Boolean! + resetUserTutorial( + userTutorialId: ID! + ): Boolean! + notifyUserTutorialEvent( + userTutorialId: ID! + event: TutorialEvent! + ): Boolean! + notifyUserTutorialStepSeen( + userTutorialId: ID! + tutorialName: TutorialName! + step: String! + ): Boolean! notifyQuestLogStepAdvanced( id: ID! step: QuestLogStep! @@ -894,14 +1037,6 @@ type Mutation { id: ID! step: QuestLogStep! ): Boolean! - saveOnboardingSelection( - id: ID! - selection: OnboardingSelection! - ): Boolean! - saveOnboardingSelectionOther( - id: ID! - selection: String! - ): Boolean! } type Namespace { @@ -923,6 +1058,21 @@ type NetworkMapperComponent { status: ComponentStatus! } +enum NetworkPoliciesStep { +"""Connect cluster""" + CREATE_CLUSTER + CONNECT_CLUSTER +"""Get to know your network map""" + EXPLORE_NETWORK_MAP_ADD_NS_FILTER + EXPLORE_NETWORK_MAP_ADD_SVC_FILTER + EXPLORE_NETWORK_MAP_CLEAR_FILTERS +"""Declare intents""" + DECLARE_INTENTS_CLICK_ON_SERVICE + DECLARE_INTENTS_DOWNLOAD_YAML + DECLARE_INTENTS_DO_APPLY + COMPLETED +} + input NetworkPolicyInput { namespace: String! name: String! @@ -930,12 +1080,6 @@ input NetworkPolicyInput { externalNetworkTrafficPolicy: Boolean! } -enum OnboardingSelection { - DEFAULT - AWS_IAM - OTHER -} - type Organization { id: ID! name: String @@ -955,7 +1099,9 @@ type Query { ): AccessGraph! serviceClientIntents( id: ID! + asServiceId: ID lastSeenAfter: Time! + clusterIds: [ID!] ): ServiceClientIntents! """Get cluster""" cluster( @@ -1004,6 +1150,10 @@ type Query { databaseInfo: DatabaseInfoInput! integrationId: ID ): TestDatabaseConnectionResponse! +"""Test database visibility connectivity""" + testDatabaseVisibilityConnection( + databaseInfo: DatabaseInfoInput! + ): TestDatabaseConnectionResponse! """List user invites""" invites( email: String @@ -1042,6 +1192,8 @@ type Query { organization( id: ID! ): Organization! +"""Checks the availability of the API server""" + ping: Boolean! """Get service""" service( id: ID! @@ -1077,8 +1229,6 @@ enum QuestLogStep { DECLARE_INTENTS_CLICK_ON_SERVICE DECLARE_INTENTS_DOWNLOAD_YAML DECLARE_INTENTS_DO_APPLY -"""Enable intents""" - ENABLE_ENFORCEMENT_CREATE_PROTECTED_SERVICE COMPLETED } @@ -1129,6 +1279,7 @@ enum ServerProtectionStatusReason { IGNORED_IN_CALCULATION PROTECTED_BY_DATABASE_INTEGRATION PROTECTED_BY_AWS_IAM_INTEGRATION + PROTECTED_BY_INTERNET_INTENTS } enum ServerProtectionStatusVerdict { @@ -1153,6 +1304,7 @@ type Service { certificateInformation: CertificateInformation serviceAccount: String awsResource: AWSResource + discoveredByIntegration: Integration tlsKeyPair: KeyPair! userAndPassword: UserAndPassword! } @@ -1181,11 +1333,14 @@ type ServiceClientIntents { } enum ServiceType { + NODE_GROUP + PREFIX_GROUP KUBERNETES KAFKA AWS DATABASE INTERNET + DATABASE_USER } """The `String`scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.""" @@ -1215,16 +1370,44 @@ type TestDatabaseConnectionResponse { scalar Time +enum TutorialEvent { + CLUSTER_CREATED + CLUSTER_CONNECTED + NS_FILTER_CLICKED + SVC_FILTER_CLICKED + FILTER_CLEARED + SERVICE_CLICKED + YAML_DOWNLOADED + INTENTS_APPLIED + TUTORIAL_COMPLETED + S3_BUCKET_CREATED + AWS_IAM_INTEGRATION_CREATED + SERVICE_DEPLOYED + LOGS_VIEWED + SERVER_POD_LABELED + AWS_IAM_ROLE_LIST_QUERIED + K8S_SERVICE_ACCOUNT_QUERIED + AWS_IAM_INTENTS_APPLIED + S3_BUCKET_CONTENT_QUERIED +} + +enum TutorialName { + NETWORK_POLICIES + AWS_IAM + POSTGRESQL + ISTIO_AUTH_POLICY_AUTOMATION + KAFKA_ACCESS_AUTOMATE_OTTERIZE_CLOUD +} + type User { id: ID! email: String! name: String! imageURL: String! authProviderUserId: String! + tutorials: [UserTutorial!] questLogStep: QuestLogStep! questLogStepSeen: QuestLogStep! - onboardingSelection: OnboardingSelection! - onboardingSelectionOther: String! } type UserAndPassword { @@ -1243,4 +1426,16 @@ enum UserErrorType { APPLIED_INTENTS_ERROR } +type UserTutorial { + id: ID! + userId: ID! + clusterId: ID! + clusterName: String! + name: TutorialName! + isActive: Boolean! + isCompleted: Boolean! + step: String! + stepSeen: String! +} + From 9e9fff7a0a3cf2bc9c12634468f8b7eead618ab3 Mon Sep 17 00:00:00 2001 From: otterizebot Date: Sun, 25 Feb 2024 17:10:21 +0000 Subject: [PATCH 09/10] Update otterize-cli version to v1.0.5 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 535ac31..b0eec88 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ brew install otterize/otterize/otterize-cli ``` Linux 64-bit ```bash -wget https://get.otterize.com/otterize-cli/v1.0.4/otterize_linux_x86_64.tar.gz +wget https://get.otterize.com/otterize-cli/v1.0.5/otterize_linux_x86_64.tar.gz tar xf otterize_linux_x86_64.tar.gz sudo cp otterize /usr/local/bin ``` From a1f64119e09f58b466d6753d877a030f97fe439e Mon Sep 17 00:00:00 2001 From: Amit Lichtenberg Date: Mon, 15 Jul 2024 14:45:08 +0300 Subject: [PATCH 10/10] Add Markdown linter & go vet GitHub actions and fix lint issues detected by it, upgrade to GoReleaser configuration to v2 (#152) --- .../workflows/{golangci-lint.yml => lint.yml} | 28 ++++++- .goreleaser.yaml | 83 ++++++++++--------- .markdownlint.json | 5 ++ CODE_OF_CONDUCT.md | 6 +- README.md | 18 +++- 5 files changed, 93 insertions(+), 47 deletions(-) rename .github/workflows/{golangci-lint.yml => lint.yml} (67%) create mode 100644 .markdownlint.json diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/lint.yml similarity index 67% rename from .github/workflows/golangci-lint.yml rename to .github/workflows/lint.yml index e7642d6..d0394e0 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/lint.yml @@ -11,15 +11,23 @@ permissions: contents: read # Optional: allow read access to pull request. Use with `only-new-issues` option. # pull-requests: read + jobs: golangci: - name: lint + name: golangci runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + - uses: actions/setup-go@v3 with: go-version: 1.21 - - uses: actions/checkout@v3 + + - name: go vet + run: go vet ./... + working-directory: . + - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: @@ -43,4 +51,18 @@ jobs: # skip-pkg-cache: true # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. - # skip-build-cache: true \ No newline at end of file + # skip-build-cache: true + + markdownlint: + name: Check for Markdown errors + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + # Tip: run the markdown lint action locally with '--fix' to automatically fix some of the issues: + # docker run -v $PWD:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix + - uses: articulate/actions-markdownlint@v1 + with: + config: .markdownlint.json + files: '**/*.md' \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 1d94424..42cd5db 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,5 +1,8 @@ # This is an example .goreleaser.yml file with some sensible defaults. # Make sure to check the documentation at https://goreleaser.com + +version: 2 + builds: - id: linux goos: @@ -137,7 +140,7 @@ brews: # GitHub/GitLab repository to push the formula to # Gitea is not supported yet, but the support coming - tap: + repository: owner: otterize name: homebrew-otterize @@ -151,7 +154,7 @@ brews: # Folder inside the repository to put the formula. # Default is the root folder. - folder: Formula + directory: Formula # Your app's homepage. # Default is empty. @@ -164,43 +167,45 @@ brews: # Default is empty. license: "Apache-2.0" -scoop: - # Template for the url which is determined by the given Token (github or gitlab) - # Default for github is "https://github.com///releases/download/{{ .Tag }}/{{ .ArtifactName }}" - # Default for gitlab is "https://gitlab.com///-/releases/{{ .Tag }}/downloads/{{ .ArtifactName }}" - # Default for gitea is "https://gitea.com///releases/download/{{ .Tag }}/{{ .ArtifactName }}" - url_template: "https://get.otterize.com/{{ .ProjectName }}/{{ .Tag }}/{{ .ArtifactName }}" - name: otterize-cli - - # Repository to push the app manifest to. - bucket: - owner: otterize - name: scoop-otterize-cli - - # Optionally a branch can be provided. - # Defaults to the default repository branch. - branch: main - - # Git author used to commit to the repository. - # Defaults are shown. - commit_author: - name: otterizebot - email: otterizebot@users.noreply.github.com - - # The project name and current git tag are used in the format string. - commit_msg_template: "Scoop update for {{ .ProjectName }} version {{ .Tag }}" - - # Your app's homepage. - # Default is empty. - homepage: "https://github.com/otterize/otterize-cli" - - # Your app's description. - # Default is empty. - description: "Otterize CLI" - - # Your app's license - # Default is empty. - license: "Apache-2.0" +scoops: + # You can have multiple scoop configs + - + # Template for the url which is determined by the given Token (github or gitlab) + # Default for github is "https://github.com///releases/download/{{ .Tag }}/{{ .ArtifactName }}" + # Default for gitlab is "https://gitlab.com///-/releases/{{ .Tag }}/downloads/{{ .ArtifactName }}" + # Default for gitea is "https://gitea.com///releases/download/{{ .Tag }}/{{ .ArtifactName }}" + url_template: "https://get.otterize.com/{{ .ProjectName }}/{{ .Tag }}/{{ .ArtifactName }}" + name: otterize-cli + + # Repository to push the app manifest to. + repository: + owner: otterize + name: scoop-otterize-cli + + # Optionally a branch can be provided. + # Defaults to the default repository branch. + branch: main + + # Git author used to commit to the repository. + # Defaults are shown. + commit_author: + name: otterizebot + email: otterizebot@users.noreply.github.com + + # The project name and current git tag are used in the format string. + commit_msg_template: "Scoop update for {{ .ProjectName }} version {{ .Tag }}" + + # Your app's homepage. + # Default is empty. + homepage: "https://github.com/otterize/otterize-cli" + + # Your app's description. + # Default is empty. + description: "Otterize CLI" + + # Your app's license + # Default is empty. + license: "Apache-2.0" blobs: # You can have multiple blob configs diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..632ae1f --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,5 @@ +{ + "default": true, + "MD013": false, + "MD033": false +} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 3eb7540..631a8a3 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -55,7 +55,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at help@otterize.com. All +reported by contacting the project team at . All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. @@ -68,9 +68,9 @@ members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html +available at [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq + diff --git a/README.md b/README.md index b0eec88..0c879b8 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ The Otterize CLI is a command-line utility used to control and interact with the See the [CLI command reference](https://docs.otterize.com/reference/cli) for how to use it. Example output from running the network mapper on the [Google Cloud microservices demo](https://github.com/GoogleCloudPlatform/microservices-demo): + ```bash $ otterize mapper list cartservice in namespace ecommerce calls: @@ -37,44 +38,57 @@ recommendationservice in namespace ecommerce calls: ``` ## Installation instructions & usage with the network mapper + ### Install the network mapper using Helm + ```bash helm repo add otterize https://helm.otterize.com helm repo update helm install network-mapper otterize/network-mapper -n otterize-system --create-namespace --wait ``` + ### Install Otterize CLI to query data from the network mapper + Mac + ```bash brew install otterize/otterize/otterize-cli ``` + Linux 64-bit + ```bash wget https://get.otterize.com/otterize-cli/v1.0.5/otterize_linux_x86_64.tar.gz tar xf otterize_linux_x86_64.tar.gz sudo cp otterize /usr/local/bin ``` + Windows + ```bash scoop bucket add otterize-cli https://github.com/otterize/scoop-otterize-cli scoop update scoop install otterize-cli ``` -For more platforms, see [the installation guide](https://docs.otterize.com/installation#install-the-otterize-cli). +For more platforms, see [the installation guide](https://docs.otterize.com/installation#install-the-otterize-cli). ## Contributing + 1. Feel free to fork and open a pull request! Include tests and document your code in [Godoc style](https://go.dev/blog/godoc) 2. In your pull request, please refer to an existing issue or open a new one. 3. See our [Contributor License Agreement](https://github.com/otterize/cla/). ## Slack + [Join the Otterize Slack!](https://joinslack.otterize.com) -## Usage Telemetry +## Usage Telemetry + The CLI reports anonymous usage information back to the Otterize team, to help the team understand how the software is used in the community and what aspects users find useful. No personal or organizational identifying information is transmitted in these metrics: they only reflect patterns of usage. You may opt out at any time through a single configuration flag. To **disable** sending usage information: + - Using a flag: `--telemetry-enabled=false`. - Via an environment variable: `OTTERIZE_TELEMETRY_ENABLED=false`.