From 44319ffc320bcf7b2feec017396dfe5b522a197b Mon Sep 17 00:00:00 2001 From: Andrew M Date: Mon, 20 Jul 2020 11:45:42 -0400 Subject: [PATCH 01/11] default identityRoles to empty array instead of nil, fixes #142 --- ziti/cmd/ziti/cmd/edge_controller/create_ca.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ziti/cmd/ziti/cmd/edge_controller/create_ca.go b/ziti/cmd/ziti/cmd/edge_controller/create_ca.go index a14af5619..3e58274a7 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/create_ca.go +++ b/ziti/cmd/ziti/cmd/edge_controller/create_ca.go @@ -90,7 +90,7 @@ func newCreateCaCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.C cmd.Flags().BoolVarP(&options.authEnabled, "auth", "e", false, "Whether the CA can be used for authentication or not") cmd.Flags().BoolVarP(&options.ottCaEnrollment, "ottca", "o", false, "Whether the CA can be used for one-time-token CA enrollment") cmd.Flags().BoolVarP(&options.autoCaEnrollment, "autoca", "u", false, "Whether the CA can be used for auto CA enrollment") - cmd.Flags().StringSliceVarP(&options.identityRoles, "role-attributes", "a", nil, "A csv string of role attributes enrolling identities receive") + cmd.Flags().StringSliceVarP(&options.identityRoles, "role-attributes", "a", []string{}, "A csv string of role attributes enrolling identities receive") return cmd } From 22e206ffdf029b4d3bfd334332bce49900d2183f Mon Sep 17 00:00:00 2001 From: Andrew M Date: Mon, 20 Jul 2020 13:57:19 -0400 Subject: [PATCH 02/11] update release notes --- doc/release-notes.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/release-notes.md b/doc/release-notes.md index 8ca48bab6..7d24a9f3a 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -1,3 +1,12 @@ +# Release 0.15.2 + +* What's New: + + +* Bug Fixes: + * [#142](https://github.com/openziti/ziti/issues/142) - fix CLI ca create not defaulting identity roles + + # Release 0.15.1 * What's New: From 3a693af61dc360929729ac45c4b30a56727342a3 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Mon, 20 Jul 2020 15:27:08 -0400 Subject: [PATCH 03/11] Let ziti-fabric list services,router, terminators do queries. Default to returning all results. Fixes GH-144 --- doc/release-notes.md | 1 + ziti-fabric/subcmd/list_routers.go | 8 +++++++- ziti-fabric/subcmd/list_services.go | 8 +++++++- ziti-fabric/subcmd/list_terminators.go | 8 +++++++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/doc/release-notes.md b/doc/release-notes.md index 7d24a9f3a..ef6473a6e 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -5,6 +5,7 @@ * Bug Fixes: * [#142](https://github.com/openziti/ziti/issues/142) - fix CLI ca create not defaulting identity roles + * [#144](https://github.com/openziti/ziti/issues/144) - ziti-fabric is only returning first 10 results for lists of services, routers and terminators # Release 0.15.1 diff --git a/ziti-fabric/subcmd/list_routers.go b/ziti-fabric/subcmd/list_routers.go index 6a14a05c7..e6d082971 100644 --- a/ziti-fabric/subcmd/list_routers.go +++ b/ziti-fabric/subcmd/list_routers.go @@ -36,7 +36,13 @@ var listRouters = &cobra.Command{ Short: "List routers enrolled on the fabric", Run: func(cmd *cobra.Command, args []string) { if ch, err := listRoutersClient.Connect(); err == nil { - request := &mgmt_pb.ListRoutersRequest{} + query := "true limit none" + if len(args) > 0 { + query = args[0] + } + request := &mgmt_pb.ListRoutersRequest{ + Query: query, + } body, err := proto.Marshal(request) if err != nil { panic(err) diff --git a/ziti-fabric/subcmd/list_services.go b/ziti-fabric/subcmd/list_services.go index dc5660e90..e8d847cf0 100644 --- a/ziti-fabric/subcmd/list_services.go +++ b/ziti-fabric/subcmd/list_services.go @@ -36,7 +36,13 @@ var listServices = &cobra.Command{ Short: "Retrieve all service definitions", Run: func(cmd *cobra.Command, args []string) { if ch, err := listServicesClient.Connect(); err == nil { - request := &mgmt_pb.ListServicesRequest{} + query := "true limit none" + if len(args) > 0 { + query = args[0] + } + request := &mgmt_pb.ListServicesRequest{ + Query: query, + } body, err := proto.Marshal(request) if err != nil { panic(err) diff --git a/ziti-fabric/subcmd/list_terminators.go b/ziti-fabric/subcmd/list_terminators.go index 68b7b3545..9b65f0146 100644 --- a/ziti-fabric/subcmd/list_terminators.go +++ b/ziti-fabric/subcmd/list_terminators.go @@ -36,7 +36,13 @@ var listTerminators = &cobra.Command{ Short: "Retrieve terminator definitions", Run: func(cmd *cobra.Command, args []string) { if ch, err := listTerminatorsClient.Connect(); err == nil { - request := &mgmt_pb.ListTerminatorsRequest{} + query := "true limit none" + if len(args) > 0 { + query = args[0] + } + request := &mgmt_pb.ListTerminatorsRequest{ + Query: query, + } body, err := proto.Marshal(request) if err != nil { panic(err) From d00e9a82d94795bd14bd36bf197d22a7b8138787 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Mon, 20 Jul 2020 15:47:21 -0400 Subject: [PATCH 04/11] Use Detail rather than list to get JWT, otherwise paging causes failures. Fixes GH-146 --- .../ziti/cmd/edge_controller/create_edge_router.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/ziti/cmd/ziti/cmd/edge_controller/create_edge_router.go b/ziti/cmd/ziti/cmd/edge_controller/create_edge_router.go index 88af0c7dc..56e01d93e 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/create_edge_router.go +++ b/ziti/cmd/ziti/cmd/edge_controller/create_edge_router.go @@ -95,20 +95,11 @@ func runCreateEdgeRouter(o *createEdgeRouterOptions) error { } func getEdgeRouterJwt(o *createEdgeRouterOptions, id string) error { - list, _, err := listEntitiesOfType("edge-routers", nil, o.OutputJSONResponse, o.Out) + newRouter, err := DetailEntityOfType("edge-routers", id, o.OutputJSONResponse, o.Out) if err != nil { return err } - var newRouter *gabs.Container - for _, gw := range list { - gwId := gw.Path("id").Data().(string) - if gwId == id { - newRouter = gw - break - } - } - if newRouter == nil { return fmt.Errorf("no error during edge router creation, but edge router with id %v not found... unable to extract JWT", id) } From ae9734f39edea250300e3f2c632fdd2e057dcee7 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Mon, 20 Jul 2020 15:53:01 -0400 Subject: [PATCH 05/11] Fix paging output when using 'limit none'. Was showing large negative number. Fixes GH-147 --- ziti/cmd/ziti/cmd/edge_controller/list.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ziti/cmd/ziti/cmd/edge_controller/list.go b/ziti/cmd/ziti/cmd/edge_controller/list.go index 6d1b7d523..53766c780 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/list.go +++ b/ziti/cmd/ziti/cmd/edge_controller/list.go @@ -137,7 +137,7 @@ func (p *paging) output(o *commonOptions) { } else { first := p.offset + 1 last := p.offset + p.limit - if last > p.count { + if last > p.count || last < 0 { // if p.limit is maxint, last will rollover and be negative last = p.count } _, _ = fmt.Fprintf(o.Out, "results: %v-%v of %v\n", first, last, p.count) From 7cc5fd4fb0e0ceef04d6c159b959ee0294407e96 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Mon, 20 Jul 2020 15:54:26 -0400 Subject: [PATCH 06/11] Show isOnline when listing edge routers. Fixes GH-148 --- ziti/cmd/ziti/cmd/edge_controller/list.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ziti/cmd/ziti/cmd/edge_controller/list.go b/ziti/cmd/ziti/cmd/edge_controller/list.go index 53766c780..3edf2c730 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/list.go +++ b/ziti/cmd/ziti/cmd/edge_controller/list.go @@ -398,8 +398,9 @@ func outputEdgeRouters(o *commonOptions, children []*gabs.Container, pagingInfo for _, entity := range children { id, _ := entity.Path("id").Data().(string) name, _ := entity.Path("name").Data().(string) + isOnline, _ := entity.Path("isOnline").Data().(bool) roleAttributes := entity.Path("roleAttributes").String() - if _, err := fmt.Fprintf(o.Out, "id: %v name: %v role attributes: %v\n", id, name, roleAttributes); err != nil { + if _, err := fmt.Fprintf(o.Out, "id: %v name: %v isOnline: %v role attributes: %v\n", id, name, isOnline, roleAttributes); err != nil { return err } } From 7095bbd6106a707e3265b5b7cb309a73f6ab6f9b Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Mon, 20 Jul 2020 15:57:42 -0400 Subject: [PATCH 07/11] Update release notes --- doc/release-notes.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/release-notes.md b/doc/release-notes.md index ef6473a6e..57ec98c4e 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -6,6 +6,9 @@ * Bug Fixes: * [#142](https://github.com/openziti/ziti/issues/142) - fix CLI ca create not defaulting identity roles * [#144](https://github.com/openziti/ziti/issues/144) - ziti-fabric is only returning first 10 results for lists of services, routers and terminators + * [#146](https://github.com/openziti/ziti/issues/146) - Export edge router JWT fails sometimes when there are more than 10 edge routers + * [#147](https://github.com/openziti/ziti/issues/147) - Fix paging output when using 'limit none' + * [#148](https://github.com/openziti/ziti/issues/148) - Show isOnline in ziti edge list edge-routers # Release 0.15.1 From 407cce7fbdba1cf40235cda45149fe9a9bc2b318 Mon Sep 17 00:00:00 2001 From: Andrew M Date: Mon, 20 Jul 2020 18:00:23 -0400 Subject: [PATCH 08/11] update edge deps - propogates fix for openziti/edge#243 --- doc/release-notes.md | 1 + go.mod | 4 +++- go.sum | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/release-notes.md b/doc/release-notes.md index 57ec98c4e..f652e822b 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -9,6 +9,7 @@ * [#146](https://github.com/openziti/ziti/issues/146) - Export edge router JWT fails sometimes when there are more than 10 edge routers * [#147](https://github.com/openziti/ziti/issues/147) - Fix paging output when using 'limit none' * [#148](https://github.com/openziti/ziti/issues/148) - Show isOnline in ziti edge list edge-routers + * [edge#243](https://github.com/openziti/edge/issue/243) - Session creation only returns 10 edge routers # Release 0.15.1 diff --git a/go.mod b/go.mod index 17713b77d..f2e7798a9 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,8 @@ require ( github.com/blang/semver v3.5.1+incompatible github.com/fatih/color v1.7.0 github.com/go-ole/go-ole v1.2.4 // indirect + github.com/gobuffalo/packr v1.30.1 // indirect + github.com/golang-migrate/migrate v3.5.4+incompatible // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/protobuf v1.3.5 github.com/google/uuid v1.1.1 @@ -25,7 +27,7 @@ require ( github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19 github.com/michaelquigley/pfxlog v0.0.0-20190813191113-2be43bd0dccc - github.com/openziti/edge v0.15.16 + github.com/openziti/edge v0.15.19 github.com/openziti/fabric v0.11.53 github.com/openziti/foundation v0.11.11 github.com/openziti/sdk-golang v0.13.20 diff --git a/go.sum b/go.sum index 1a93cf612..6e89ee5fa 100644 --- a/go.sum +++ b/go.sum @@ -303,6 +303,7 @@ github.com/michaelquigley/pfxlog v0.0.0-20190813191113-2be43bd0dccc h1:PQrqw9XKY github.com/michaelquigley/pfxlog v0.0.0-20190813191113-2be43bd0dccc/go.mod h1:Z0K0l/NScHvLeGoy4SZTps+ZxGv85ql4AvZqTqOxBY8= github.com/miekg/dns v1.1.29 h1:xHBEhR+t5RzcFJjBLJlax2daXOrTYtr9z4WdKEfWFzg= github.com/miekg/dns v1.1.29/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= +github.com/miekg/dns v1.1.30/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/pkcs11 v1.0.3 h1:iMwmD7I5225wv84WxIG/bmxz9AXjWvTWIbM/TYHvWtw= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -324,6 +325,8 @@ github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/openziti/edge v0.15.16 h1:AcIjwtIAIxq5orV4LznP/jxQureAjQD6abDxs0n+l0E= github.com/openziti/edge v0.15.16/go.mod h1:2U7yCXxW6HLbSxvMC3fTS5UrHKvr3IkOuL5tCa/ijDU= +github.com/openziti/edge v0.15.19 h1:CWRMZoVHeEfGiUqjv+6lVjVu6lit6jUxXFbdPLd45+Q= +github.com/openziti/edge v0.15.19/go.mod h1:Pj9zdKe+8+emitT8czf/gm7l2da7LyKSngOhnzIQk04= github.com/openziti/fabric v0.11.53 h1:OVT71Hmbgf5gqsO7fz4iwsyP/T/ZzUfgOD0Bp39z/3U= github.com/openziti/fabric v0.11.53/go.mod h1:d0EueCQD4CIC3TLAMdw0EoYb+GsmwPrZz3BwRgtU28c= github.com/openziti/foundation v0.11.11 h1:GPASO0aTtzuzwQbfvu1OMOPdAKzi/DTkxKJ0y2NTzXU= From 0811b2a09ea5a21b1b21f5df05d4e2e396051c72 Mon Sep 17 00:00:00 2001 From: Andrew M Date: Mon, 20 Jul 2020 18:02:01 -0400 Subject: [PATCH 09/11] go mod tidy --- go.mod | 2 -- go.sum | 25 +------------------------ 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/go.mod b/go.mod index f2e7798a9..ecfc35d26 100644 --- a/go.mod +++ b/go.mod @@ -17,8 +17,6 @@ require ( github.com/blang/semver v3.5.1+incompatible github.com/fatih/color v1.7.0 github.com/go-ole/go-ole v1.2.4 // indirect - github.com/gobuffalo/packr v1.30.1 // indirect - github.com/golang-migrate/migrate v3.5.4+incompatible // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/protobuf v1.3.5 github.com/google/uuid v1.1.1 diff --git a/go.sum b/go.sum index 6e89ee5fa..920b236c1 100644 --- a/go.sum +++ b/go.sum @@ -44,13 +44,11 @@ github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wX github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-iptables v0.4.5 h1:DpHb9vJrZQEFMcVLFKAAGMUVX0XoRC0ptCthinRYm38= github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -165,23 +163,15 @@ github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxs github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/logger v1.0.0/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4= -github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= -github.com/gobuffalo/packr v1.30.1 h1:hu1fuVR3fXEZR7rXNW3h8rqSML8EVAf6KNm0NKO/wKg= -github.com/gobuffalo/packr v1.30.1/go.mod h1:ljMyFO2EcrnzsHsN99cvbq055Y9OhRrIaviy289eRuk= github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/packr/v2 v2.5.1/go.mod h1:8f9c96ITobJlPzI44jj+4tHnEKNt0xXWSVlXRN9X1Iw= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang-migrate/migrate v3.5.4+incompatible h1:R7OzwvCJTCgwapPCiX6DyBiu2czIUMDCB118gFTKTUA= -github.com/golang-migrate/migrate v3.5.4+incompatible/go.mod h1:IsVUlFN5puWOmXrqjgGUfIRIbU7mr8oNBE2tyERd9Wk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -240,7 +230,6 @@ github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uia github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kataras/go-events v0.0.3-0.20170604004442-17d67be645c3 h1:RGJQh17kB5HdupMRzKz89QzkYBnLRJJ+6SCurbvd0hw= github.com/kataras/go-events v0.0.3-0.20170604004442-17d67be645c3/go.mod h1:6IxMW59VJdEIqj3bjFGJvGLRdb0WHtrlxPZy9qXctcg= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= @@ -301,8 +290,7 @@ github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1f github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/michaelquigley/pfxlog v0.0.0-20190813191113-2be43bd0dccc h1:PQrqw9XKYcPRI9rKwoGZucMjWvfZpyfb5j8Lc13j8YY= github.com/michaelquigley/pfxlog v0.0.0-20190813191113-2be43bd0dccc/go.mod h1:Z0K0l/NScHvLeGoy4SZTps+ZxGv85ql4AvZqTqOxBY8= -github.com/miekg/dns v1.1.29 h1:xHBEhR+t5RzcFJjBLJlax2daXOrTYtr9z4WdKEfWFzg= -github.com/miekg/dns v1.1.29/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= +github.com/miekg/dns v1.1.30 h1:Qww6FseFn8PRfw07jueqIXqodm0JKiiKuK0DeXSqfyo= github.com/miekg/dns v1.1.30/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/pkcs11 v1.0.3 h1:iMwmD7I5225wv84WxIG/bmxz9AXjWvTWIbM/TYHvWtw= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= @@ -323,8 +311,6 @@ github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/openziti/edge v0.15.16 h1:AcIjwtIAIxq5orV4LznP/jxQureAjQD6abDxs0n+l0E= -github.com/openziti/edge v0.15.16/go.mod h1:2U7yCXxW6HLbSxvMC3fTS5UrHKvr3IkOuL5tCa/ijDU= github.com/openziti/edge v0.15.19 h1:CWRMZoVHeEfGiUqjv+6lVjVu6lit6jUxXFbdPLd45+Q= github.com/openziti/edge v0.15.19/go.mod h1:Pj9zdKe+8+emitT8czf/gm7l2da7LyKSngOhnzIQk04= github.com/openziti/fabric v0.11.53 h1:OVT71Hmbgf5gqsO7fz4iwsyP/T/ZzUfgOD0Bp39z/3U= @@ -391,8 +377,6 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v0.0.7 h1:FfTH+vuMXOas8jmfb5/M7dzEYx7LpcLb7a0LPe34uOU= github.com/spf13/cobra v0.0.7/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= @@ -400,7 +384,6 @@ github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb6 github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.5.0 h1:GpsTwfsQ27oS/Aha/6d1oD7tpKIqWnOA6tgOX9HHkt4= github.com/spf13/viper v1.5.0/go.mod h1:AkYRkVJF8TkSG/xet6PzXX+l39KhhXa2pdqVSxnTcn4= @@ -422,7 +405,6 @@ github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= @@ -447,7 +429,6 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -455,7 +436,6 @@ golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaE golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708 h1:pXVtWnwHkrWD9ru3sDxY/qFK/bfc0egRovX91EjWjf4= @@ -505,7 +485,6 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -515,7 +494,6 @@ golang.org/x/sys v0.0.0-20190411185658-b44545bcd369/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -547,7 +525,6 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= From 40b93e6ef2630896c77275a2c4c0fc2f5bacf006 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Tue, 21 Jul 2020 09:16:06 -0400 Subject: [PATCH 10/11] Update deps and release notes --- doc/release-notes.md | 4 +++- go.mod | 8 ++++---- go.sum | 16 ++++++++++------ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/doc/release-notes.md b/doc/release-notes.md index f652e822b..c25fbf098 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -10,7 +10,9 @@ * [#147](https://github.com/openziti/ziti/issues/147) - Fix paging output when using 'limit none' * [#148](https://github.com/openziti/ziti/issues/148) - Show isOnline in ziti edge list edge-routers * [edge#243](https://github.com/openziti/edge/issue/243) - Session creation only returns 10 edge routers - + * [edge#245](https://github.com/openziti/edge/issue/245) - fingerprint calculation changed from 0.14 to 0.15. Ensure 0.15 routers can work with 0.14 controllers + * [edge#248](https://github.com/openziti/edge/issue/248) - Edge Router Hello can time out on slow networks with many links to establish + * [foundation#103](https://github.com/openziti/foundation/issues/103) - Fix config file env injection for lists # Release 0.15.1 diff --git a/go.mod b/go.mod index ecfc35d26..9a9d18475 100644 --- a/go.mod +++ b/go.mod @@ -25,10 +25,10 @@ require ( github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19 github.com/michaelquigley/pfxlog v0.0.0-20190813191113-2be43bd0dccc - github.com/openziti/edge v0.15.19 - github.com/openziti/fabric v0.11.53 - github.com/openziti/foundation v0.11.11 - github.com/openziti/sdk-golang v0.13.20 + github.com/openziti/edge v0.15.20 + github.com/openziti/fabric v0.11.54 + github.com/openziti/foundation v0.11.12 + github.com/openziti/sdk-golang v0.13.21 github.com/pborman/uuid v1.2.0 github.com/pkg/errors v0.9.1 github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 diff --git a/go.sum b/go.sum index 920b236c1..09d02aed8 100644 --- a/go.sum +++ b/go.sum @@ -114,8 +114,8 @@ github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= github.com/go-openapi/runtime v0.19.15 h1:2GIefxs9Rx1vCDNghRtypRq+ig8KSLrjHbAYI/gCLCM= github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= -github.com/go-openapi/runtime v0.19.19 h1:PCaQSqG0HiCgpekchPrHO9AEc5ZUaAclOUp9T3RSKoQ= -github.com/go-openapi/runtime v0.19.19/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= +github.com/go-openapi/runtime v0.19.20 h1:J/t+QIjbcoq8WJvjGxRKiFBhqUE8slS9SbmD0Oi/raQ= +github.com/go-openapi/runtime v0.19.20/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= @@ -311,14 +311,18 @@ github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/openziti/edge v0.15.19 h1:CWRMZoVHeEfGiUqjv+6lVjVu6lit6jUxXFbdPLd45+Q= -github.com/openziti/edge v0.15.19/go.mod h1:Pj9zdKe+8+emitT8czf/gm7l2da7LyKSngOhnzIQk04= +github.com/openziti/edge v0.15.20 h1:AJRMgs7tz2HMSKzliaxBHxuAZqPd0NqnABhF6pmUyjM= +github.com/openziti/edge v0.15.20/go.mod h1:VzEl+g4zbiFAWy+QCBZa+LvyYV8vxFblKjlKlcqn/jk= github.com/openziti/fabric v0.11.53 h1:OVT71Hmbgf5gqsO7fz4iwsyP/T/ZzUfgOD0Bp39z/3U= github.com/openziti/fabric v0.11.53/go.mod h1:d0EueCQD4CIC3TLAMdw0EoYb+GsmwPrZz3BwRgtU28c= +github.com/openziti/fabric v0.11.54 h1:o7s5sy6nloYAfLjyru01xpgoWjemgro5Vmj+JMrbM84= +github.com/openziti/fabric v0.11.54/go.mod h1:AR9VallPHO6h/o3xeRS/yBJNLgq++Ip18u9k2sbHmYY= github.com/openziti/foundation v0.11.11 h1:GPASO0aTtzuzwQbfvu1OMOPdAKzi/DTkxKJ0y2NTzXU= github.com/openziti/foundation v0.11.11/go.mod h1:Qdd7eCuTrpRwEeDbvYy89sFbEY4+J7OuX8UygxNBsvY= -github.com/openziti/sdk-golang v0.13.20 h1:vnpGvaS/TBz2zd8lUO4cGVYmRWcnAX0v8k/P9+q36BI= -github.com/openziti/sdk-golang v0.13.20/go.mod h1:2cCcWJATUzfx8T9CjaERqersSbKT0r5DptUTcZvHOVs= +github.com/openziti/foundation v0.11.12 h1:Dmi0hRnZCtB8uXWxHgaFpXppX5UVml76lGJKd5xwyo8= +github.com/openziti/foundation v0.11.12/go.mod h1:Qdd7eCuTrpRwEeDbvYy89sFbEY4+J7OuX8UygxNBsvY= +github.com/openziti/sdk-golang v0.13.21 h1:suH2LgSUGQBfu8lGIotXSxQvRRSGjZORdE6UrqvZGCM= +github.com/openziti/sdk-golang v0.13.21/go.mod h1:BKHVNgpVUv9nGuwXFYVTDmdfGjreZvVf1/g1UA8Lm5s= github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6 h1:lNCW6THrCKBiJBpz8kbVGjC7MgdCGKwuvBgc7LoD6sw= github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= From 9b835218d6fe0538c14c2aea576f71d2c21d96e3 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Fri, 17 Jul 2020 10:56:50 -0400 Subject: [PATCH 11/11] Add flag to allow logging JSON requests from Ziti CLI. Fixes GH-140 --- doc/release-notes.md | 8 ++++---- ziti/cmd/ziti/cmd/edge_controller/create_ca.go | 2 +- .../cmd/ziti/cmd/edge_controller/create_config.go | 2 +- .../cmd/edge_controller/create_config_type.go | 2 +- .../cmd/edge_controller/create_edge_router.go | 3 ++- .../edge_controller/create_edge_router_policy.go | 2 +- .../ziti/cmd/edge_controller/create_identity.go | 3 +-- .../ziti/cmd/edge_controller/create_service.go | 2 +- .../create_service_edge_router_policy.go | 2 +- .../cmd/edge_controller/create_service_policy.go | 2 +- .../ziti/cmd/edge_controller/create_snapshot.go | 4 ++-- .../ziti/cmd/edge_controller/create_terminator.go | 2 +- ziti/cmd/ziti/cmd/edge_controller/delete.go | 2 +- ziti/cmd/ziti/cmd/edge_controller/list.go | 15 +++++---------- ziti/cmd/ziti/cmd/edge_controller/login.go | 4 ++-- .../ziti/cmd/edge_controller/policy_advisor.go | 4 ++-- ziti/cmd/ziti/cmd/edge_controller/root.go | 6 ++++++ ziti/cmd/ziti/cmd/edge_controller/update.go | 2 +- .../cmd/ziti/cmd/edge_controller/update_config.go | 2 +- .../cmd/edge_controller/update_edge_router.go | 2 +- .../edge_controller/update_edge_router_policy.go | 2 +- .../ziti/cmd/edge_controller/update_identity.go | 2 +- .../edge_controller/update_identity_configs.go | 3 ++- .../ziti/cmd/edge_controller/update_service.go | 2 +- .../update_service_edge_router_policy.go | 2 +- .../cmd/edge_controller/update_service_policy.go | 2 +- .../ziti/cmd/edge_controller/update_terminator.go | 2 +- ziti/cmd/ziti/cmd/edge_controller/verify_ca.go | 6 +++--- ziti/cmd/ziti/cmd/edge_controller/version.go | 2 +- ziti/cmd/ziti/util/rest.go | 9 +++++++-- 30 files changed, 55 insertions(+), 48 deletions(-) diff --git a/doc/release-notes.md b/doc/release-notes.md index c25fbf098..a6ae6fec3 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -1,19 +1,19 @@ # Release 0.15.2 * What's New: - + * [#140](https://github.com/openziti/ziti/issues/140) - Allow logging JSON request for Ziti CLI + * [#148](https://github.com/openziti/ziti/issues/148) - Show isOnline in ziti edge list edge-routers + * [#144](https://github.com/openziti/ziti/issues/144) - Allow ziti-fabric list to use queries. Default to `true limit none` * Bug Fixes: * [#142](https://github.com/openziti/ziti/issues/142) - fix CLI ca create not defaulting identity roles - * [#144](https://github.com/openziti/ziti/issues/144) - ziti-fabric is only returning first 10 results for lists of services, routers and terminators * [#146](https://github.com/openziti/ziti/issues/146) - Export edge router JWT fails sometimes when there are more than 10 edge routers * [#147](https://github.com/openziti/ziti/issues/147) - Fix paging output when using 'limit none' - * [#148](https://github.com/openziti/ziti/issues/148) - Show isOnline in ziti edge list edge-routers * [edge#243](https://github.com/openziti/edge/issue/243) - Session creation only returns 10 edge routers * [edge#245](https://github.com/openziti/edge/issue/245) - fingerprint calculation changed from 0.14 to 0.15. Ensure 0.15 routers can work with 0.14 controllers * [edge#248](https://github.com/openziti/edge/issue/248) - Edge Router Hello can time out on slow networks with many links to establish * [foundation#103](https://github.com/openziti/foundation/issues/103) - Fix config file env injection for lists - + # Release 0.15.1 * What's New: diff --git a/ziti/cmd/ziti/cmd/edge_controller/create_ca.go b/ziti/cmd/ziti/cmd/edge_controller/create_ca.go index 3e58274a7..dd41e2c52 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/create_ca.go +++ b/ziti/cmd/ziti/cmd/edge_controller/create_ca.go @@ -86,11 +86,11 @@ func newCreateCaCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.C // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) cmd.Flags().StringToStringVarP(&options.tags, "tags", "t", nil, "Add tags to service definition") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().BoolVarP(&options.authEnabled, "auth", "e", false, "Whether the CA can be used for authentication or not") cmd.Flags().BoolVarP(&options.ottCaEnrollment, "ottca", "o", false, "Whether the CA can be used for one-time-token CA enrollment") cmd.Flags().BoolVarP(&options.autoCaEnrollment, "autoca", "u", false, "Whether the CA can be used for auto CA enrollment") cmd.Flags().StringSliceVarP(&options.identityRoles, "role-attributes", "a", []string{}, "A csv string of role attributes enrolling identities receive") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/create_config.go b/ziti/cmd/ziti/cmd/edge_controller/create_config.go index a812bf320..09b38f06a 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/create_config.go +++ b/ziti/cmd/ziti/cmd/edge_controller/create_config.go @@ -61,7 +61,7 @@ func newCreateConfigCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cob // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) cmd.Flags().StringVarP(&options.jsonFile, "json-file", "f", "", "Read config JSON from a file instead of the command line") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/create_config_type.go b/ziti/cmd/ziti/cmd/edge_controller/create_config_type.go index 4d0fa816c..3e33c5e8c 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/create_config_type.go +++ b/ziti/cmd/ziti/cmd/edge_controller/create_config_type.go @@ -61,7 +61,7 @@ func newCreateConfigTypeCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) cmd.Flags().StringVarP(&options.schemaFile, "schema-file", "f", "", "Read config type JSON schema from a file instead of the command line") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/create_edge_router.go b/ziti/cmd/ziti/cmd/edge_controller/create_edge_router.go index 56e01d93e..0f858f977 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/create_edge_router.go +++ b/ziti/cmd/ziti/cmd/edge_controller/create_edge_router.go @@ -59,8 +59,9 @@ func newCreateEdgeRouterCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) cmd.Flags().StringSliceVarP(&options.roleAttributes, "role-attributes", "a", nil, "Role attributes of the new edge router") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().StringVarP(&options.jwtOutputFile, "jwt-output-file", "o", "", "File to which to output the JWT used for enrolling the edge router") + options.AddCommonFlags(cmd) + return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/create_edge_router_policy.go b/ziti/cmd/ziti/cmd/edge_controller/create_edge_router_policy.go index 42e163a01..184ba8b30 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/create_edge_router_policy.go +++ b/ziti/cmd/ziti/cmd/edge_controller/create_edge_router_policy.go @@ -59,7 +59,7 @@ func newCreateEdgeRouterPolicyCmd(f cmdutil.Factory, out io.Writer, errOut io.Wr cmd.Flags().SetInterspersed(true) cmd.Flags().StringSliceVarP(&options.edgeRouterRoles, "edge-router-roles", "e", nil, "Edge router roles of the new edge router policy") cmd.Flags().StringSliceVarP(&options.identityRoles, "identity-roles", "i", nil, "Identity roles of the new edge router policy") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/create_identity.go b/ziti/cmd/ziti/cmd/edge_controller/create_identity.go index 9631dab96..f6840f29d 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/create_identity.go +++ b/ziti/cmd/ziti/cmd/edge_controller/create_identity.go @@ -77,11 +77,10 @@ func newCreateIdentityOfTypeCmd(idType string, options *createIdentityOptions) * // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) - - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().BoolVarP(&options.isAdmin, "admin", "A", false, "Give the new identity admin privileges") cmd.Flags().StringSliceVarP(&options.roleAttributes, "role-attributes", "a", nil, "Role attributes of the new identity") cmd.Flags().StringVarP(&options.jwtOutputFile, "jwt-output-file", "o", "", "File to which to output the JWT used for enrolling the identity") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/create_service.go b/ziti/cmd/ziti/cmd/edge_controller/create_service.go index 27509a38c..01e32ddad 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/create_service.go +++ b/ziti/cmd/ziti/cmd/edge_controller/create_service.go @@ -64,10 +64,10 @@ func newCreateServiceCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) *co // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) cmd.Flags().StringToStringVarP(&options.tags, "tags", "t", nil, "Add tags to service definition") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().StringSliceVarP(&options.roleAttributes, "role-attributes", "a", nil, "Role attributes of the new service") cmd.Flags().StringSliceVarP(&options.configs, "configs", "c", nil, "Configuration id or names to be associated with the new service") cmd.Flags().StringVar(&options.terminatorStrategy, "terminator-strategy", "", "Specifies the terminator strategy for the service") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/create_service_edge_router_policy.go b/ziti/cmd/ziti/cmd/edge_controller/create_service_edge_router_policy.go index 4f6443a2a..dd8d86e71 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/create_service_edge_router_policy.go +++ b/ziti/cmd/ziti/cmd/edge_controller/create_service_edge_router_policy.go @@ -59,7 +59,7 @@ func newCreateServiceEdgeRouterPolicyCmd(f cmdutil.Factory, out io.Writer, errOu cmd.Flags().SetInterspersed(true) cmd.Flags().StringSliceVarP(&options.edgeRouterRoles, "edge-router-roles", "e", nil, "Edge router roles of the new service edge router policy") cmd.Flags().StringSliceVarP(&options.serviceRoles, "service-roles", "s", nil, "Identity roles of the new service edge router policy") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/create_service_policy.go b/ziti/cmd/ziti/cmd/edge_controller/create_service_policy.go index 0a9f19277..9b22ef736 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/create_service_policy.go +++ b/ziti/cmd/ziti/cmd/edge_controller/create_service_policy.go @@ -62,7 +62,7 @@ func newCreateServicePolicyCmd(f cmdutil.Factory, out io.Writer, errOut io.Write cmd.Flags().SetInterspersed(true) cmd.Flags().StringSliceVarP(&options.serviceRoles, "service-roles", "s", nil, "Service roles of the new service policy") cmd.Flags().StringSliceVarP(&options.identityRoles, "identity-roles", "i", nil, "Identity roles of the new service policy") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/create_snapshot.go b/ziti/cmd/ziti/cmd/edge_controller/create_snapshot.go index 2ade159e9..0e43b31e3 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/create_snapshot.go +++ b/ziti/cmd/ziti/cmd/edge_controller/create_snapshot.go @@ -53,13 +53,13 @@ func newSnapshotDbCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") + options.AddCommonFlags(cmd) return cmd } // runSnapshotDb create a new config on the Ziti Edge Controller func runSnapshotDb(o *snapshotDbOptions) error { - _, err := util.EdgeControllerUpdate("database/snapshot", "", o.Out, http.MethodPost, false) + _, err := util.EdgeControllerUpdate("database/snapshot", "", o.Out, http.MethodPost, false, false) return err } diff --git a/ziti/cmd/ziti/cmd/edge_controller/create_terminator.go b/ziti/cmd/ziti/cmd/edge_controller/create_terminator.go index a1843724f..c441cc3cd 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/create_terminator.go +++ b/ziti/cmd/ziti/cmd/edge_controller/create_terminator.go @@ -63,10 +63,10 @@ func newCreateTerminatorCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().StringVar(&options.binding, "binding", "transport", "Set the terminator binding") cmd.Flags().Int32VarP(&options.cost, "cost", "c", 0, "Set the terminator cost") cmd.Flags().StringVarP(&options.precedence, "precedence", "p", "", "Set the terminator precedence ('default', 'required' or 'failed')") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/delete.go b/ziti/cmd/ziti/cmd/edge_controller/delete.go index 67924316c..204e42a26 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/delete.go +++ b/ziti/cmd/ziti/cmd/edge_controller/delete.go @@ -87,7 +87,7 @@ func newDeleteCmdForEntityType(entityType string, command deleteCmdRunner, optio // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/list.go b/ziti/cmd/ziti/cmd/edge_controller/list.go index 3edf2c730..95b24c5d2 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/list.go +++ b/ziti/cmd/ziti/cmd/edge_controller/list.go @@ -179,8 +179,7 @@ func newListCmdForEntityType(entityType string, command listCommandRunner, optio // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) - - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") + options.AddCommonFlags(cmd) return cmd } @@ -208,12 +207,11 @@ func newListServicesCmd(options *commonOptions) *cobra.Command { // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) - - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().StringVar(&asIdentity, "as-identity", "", "Allow admins to see services as they would be seen by a different identity") cmd.Flags().StringSliceVar(&configTypes, "config-types", nil, "Override which config types to view on services") cmd.Flags().StringSliceVar(&roleFilters, "role-filters", nil, "Allow filtering by roles") cmd.Flags().StringVar(&roleSemantic, "role-semantic", "", "Specify which roles semantic to use ") + options.AddCommonFlags(cmd) return cmd } @@ -239,10 +237,9 @@ func newListEdgeRoutersCmd(options *commonOptions) *cobra.Command { // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) - - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().StringSliceVar(&roleFilters, "role-filters", nil, "Allow filtering by roles") cmd.Flags().StringVar(&roleSemantic, "role-semantic", "", "Specify which roles semantic to use ") + options.AddCommonFlags(cmd) return cmd } @@ -268,10 +265,9 @@ func newListIdentitiesCmd(options *commonOptions) *cobra.Command { // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) - - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().StringSliceVar(&roleFilters, "role-filters", nil, "Allow filtering by roles") cmd.Flags().StringVar(&roleSemantic, "role-semantic", "", "Specify which roles semantic to use ") + options.AddCommonFlags(cmd) return cmd } @@ -295,8 +291,7 @@ func newSubListCmdForEntityType(entityType string, subType string, outputF outpu // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) - - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/login.go b/ziti/cmd/ziti/cmd/edge_controller/login.go index fc471aa33..780352dd4 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/login.go +++ b/ziti/cmd/ziti/cmd/edge_controller/login.go @@ -19,11 +19,11 @@ package edge_controller import ( "fmt" "github.com/Jeffail/gabs" + "github.com/openziti/foundation/util/term" "github.com/openziti/ziti/ziti/cmd/ziti/cmd/common" cmdutil "github.com/openziti/ziti/ziti/cmd/ziti/cmd/factory" cmdhelper "github.com/openziti/ziti/ziti/cmd/ziti/cmd/helpers" "github.com/openziti/ziti/ziti/cmd/ziti/util" - "github.com/openziti/foundation/util/term" "github.com/spf13/cobra" "io" "path/filepath" @@ -70,7 +70,7 @@ func newLoginCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Comm cmd.Flags().StringVarP(&options.Password, "password", "p", "", "password to use for authenticating to the Ziti Edge Controller, if -u is supplied and -p is not, a value will be prompted for") cmd.Flags().StringVarP(&options.Cert, "cert", "c", "", "additional root certificates used by the Ziti Edge Controller") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/policy_advisor.go b/ziti/cmd/ziti/cmd/edge_controller/policy_advisor.go index 030443005..743cce755 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/policy_advisor.go +++ b/ziti/cmd/ziti/cmd/edge_controller/policy_advisor.go @@ -72,7 +72,7 @@ func newPolicyAdvisorIdentitiesCmd(f cmdutil.Factory, out io.Writer, errOut io.W // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") + options.AddCommonFlags(cmd) cmd.Flags().BoolVarP(&options.quiet, "quiet", "q", false, "Minimize output by hiding header") return cmd @@ -101,8 +101,8 @@ func newPolicyAdvisorServicesCmd(f cmdutil.Factory, out io.Writer, errOut io.Wri // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().BoolVarP(&options.quiet, "quiet", "q", false, "Minimize output by hiding header") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/root.go b/ziti/cmd/ziti/cmd/edge_controller/root.go index 9e94fc49f..cc895a6a0 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/root.go +++ b/ziti/cmd/ziti/cmd/edge_controller/root.go @@ -37,9 +37,15 @@ func NewCmdEdge(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Comma // commonOptions are common options for edge controller commands type commonOptions struct { common.CommonOptions + OutputJSONRequest bool OutputJSONResponse bool } +func (options *commonOptions) AddCommonFlags(cmd *cobra.Command) { + cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") + cmd.Flags().BoolVar(&options.OutputJSONRequest, "output-request-json", false, "Output the full JSON request to the Ziti Edge Controller") +} + // newCmdEdgeController creates a command object for the "edge controller" command func newCmdEdgeController(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command { cmd := util.NewEmptyParentCmd("controller", "Interact with a Ziti Edge Controller") diff --git a/ziti/cmd/ziti/cmd/edge_controller/update.go b/ziti/cmd/ziti/cmd/edge_controller/update.go index e92eefb4c..f1f26e71f 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/update.go +++ b/ziti/cmd/ziti/cmd/edge_controller/update.go @@ -71,7 +71,7 @@ func deleteEntityOfTypeWithBody(entityType string, body string, options *commonO // updateEntityOfType updates an entity of the given type on the Ziti Edge Controller func updateEntityOfType(entityType string, body string, options *commonOptions, method string) (*gabs.Container, error) { - return util.EdgeControllerUpdate(entityType, body, options.Out, method, options.OutputJSONResponse) + return util.EdgeControllerUpdate(entityType, body, options.Out, method, options.OutputJSONRequest, options.OutputJSONResponse) } func doRequest(entityType string, options *commonOptions, doRequest func(request *resty.Request, url string) (*resty.Response, error)) (*gabs.Container, error) { diff --git a/ziti/cmd/ziti/cmd/edge_controller/update_config.go b/ziti/cmd/ziti/cmd/edge_controller/update_config.go index aad0bed19..f4860257b 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/update_config.go +++ b/ziti/cmd/ziti/cmd/edge_controller/update_config.go @@ -65,7 +65,7 @@ func newUpdateConfigCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cob cmd.Flags().StringVarP(&options.name, "name", "n", "", "Set the name of the config") cmd.Flags().StringVarP(&options.data, "data", "d", "", "Set the data of the config") cmd.Flags().StringVarP(&options.jsonFile, "json-file", "f", "", "Read config JSON from a file instead of the command line") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/update_edge_router.go b/ziti/cmd/ziti/cmd/edge_controller/update_edge_router.go index 77aba67bc..8f9e15e5a 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/update_edge_router.go +++ b/ziti/cmd/ziti/cmd/edge_controller/update_edge_router.go @@ -59,9 +59,9 @@ func newUpdateEdgeRouterCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) cmd.Flags().StringVarP(&options.name, "name", "n", "", "Set the name of the edge router") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().StringSliceVarP(&options.roleAttributes, "role-attributes", "a", nil, "Set role attributes of the edge router. Use --role-attributes '' to set an empty list") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/update_edge_router_policy.go b/ziti/cmd/ziti/cmd/edge_controller/update_edge_router_policy.go index 713c7d7b9..f1452cb68 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/update_edge_router_policy.go +++ b/ziti/cmd/ziti/cmd/edge_controller/update_edge_router_policy.go @@ -60,9 +60,9 @@ func newUpdateEdgeRouterPolicyCmd(f cmdutil.Factory, out io.Writer, errOut io.Wr // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) cmd.Flags().StringVarP(&options.name, "name", "n", "", "Set the name of the edge router policy") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().StringSliceVarP(&options.edgeRouterRoles, "edge-router-roles", "e", nil, "Edge router roles of the edge router policy") cmd.Flags().StringSliceVarP(&options.identityRoles, "identity-roles", "i", nil, "Identity roles of the edge router policy") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/update_identity.go b/ziti/cmd/ziti/cmd/edge_controller/update_identity.go index abd464daa..ddff9c802 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/update_identity.go +++ b/ziti/cmd/ziti/cmd/edge_controller/update_identity.go @@ -56,10 +56,10 @@ func newUpdateIdentityCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) *c SuggestFor: []string{}, } + options.AddCommonFlags(cmd) // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) cmd.Flags().StringVarP(&options.name, "name", "n", "", "Set the name of the identity") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().StringSliceVarP(&options.roleAttributes, "role-attributes", "a", nil, "Set role attributes of the identity. Use --role-attributes '' to set an empty list") diff --git a/ziti/cmd/ziti/cmd/edge_controller/update_identity_configs.go b/ziti/cmd/ziti/cmd/edge_controller/update_identity_configs.go index 3279d10ff..d21223544 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/update_identity_configs.go +++ b/ziti/cmd/ziti/cmd/edge_controller/update_identity_configs.go @@ -52,9 +52,10 @@ func newUpdateIdentityConfigsCmd(f cmdutil.Factory, out io.Writer, errOut io.Wri SuggestFor: []string{}, } + options.AddCommonFlags(cmd) + // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().BoolVarP(&options.remove, "remove", "r", false, "Remove the sevice config override") return cmd diff --git a/ziti/cmd/ziti/cmd/edge_controller/update_service.go b/ziti/cmd/ziti/cmd/edge_controller/update_service.go index f500e31aa..40711955b 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/update_service.go +++ b/ziti/cmd/ziti/cmd/edge_controller/update_service.go @@ -61,9 +61,9 @@ func newUpdateServiceCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) *co cmd.Flags().SetInterspersed(true) cmd.Flags().StringVarP(&options.name, "name", "n", "", "Set the name of the service") cmd.Flags().StringVar(&options.terminatorStrategy, "terminator-strategy", "", "Specifies the terminator strategy for the service") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().StringSliceVarP(&options.roleAttributes, "role-attributes", "a", nil, "Set role attributes of the service. Use --role-attributes '' to set an empty list") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/update_service_edge_router_policy.go b/ziti/cmd/ziti/cmd/edge_controller/update_service_edge_router_policy.go index 5d0e706fb..3743908e6 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/update_service_edge_router_policy.go +++ b/ziti/cmd/ziti/cmd/edge_controller/update_service_edge_router_policy.go @@ -60,9 +60,9 @@ func newUpdateServiceEdgeRouterPolicyCmd(f cmdutil.Factory, out io.Writer, errOu // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) cmd.Flags().StringVarP(&options.name, "name", "n", "", "Set the name of the edge router policy") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().StringSliceVarP(&options.edgeRouterRoles, "edge-router-roles", "e", nil, "Edge router roles of the service edge router policy") cmd.Flags().StringSliceVarP(&options.serviceRoles, "service-roles", "s", nil, "Service roles of the service edge router policy") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/update_service_policy.go b/ziti/cmd/ziti/cmd/edge_controller/update_service_policy.go index d31e51821..4eae4eb7d 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/update_service_policy.go +++ b/ziti/cmd/ziti/cmd/edge_controller/update_service_policy.go @@ -60,9 +60,9 @@ func newUpdateServicePolicyCmd(f cmdutil.Factory, out io.Writer, errOut io.Write // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) cmd.Flags().StringVarP(&options.name, "name", "n", "", "Set the name of the service policy") - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().StringSliceVarP(&options.serviceRoles, "service-roles", "s", nil, "Service roles of the service policy") cmd.Flags().StringSliceVarP(&options.identityRoles, "identity-roles", "i", nil, "Identity roles of the service policy") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/update_terminator.go b/ziti/cmd/ziti/cmd/edge_controller/update_terminator.go index bb859598f..036dda589 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/update_terminator.go +++ b/ziti/cmd/ziti/cmd/edge_controller/update_terminator.go @@ -65,12 +65,12 @@ func newUpdateTerminatorCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().StringVar(&options.router, "router", "", "Set the terminator router") cmd.Flags().StringVar(&options.address, "address", "", "Set the terminator address") cmd.Flags().StringVar(&options.binding, "binding", "", "Set the terminator binding") cmd.Flags().Int32VarP(&options.cost, "cost", "c", 0, "Set the terminator cost") cmd.Flags().StringVarP(&options.precedence, "precedence", "p", "", "Set the terminator precedence ('default', 'required' or 'failed')") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/verify_ca.go b/ziti/cmd/ziti/cmd/edge_controller/verify_ca.go index d22085a69..078a7cdb1 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/verify_ca.go +++ b/ziti/cmd/ziti/cmd/edge_controller/verify_ca.go @@ -26,12 +26,12 @@ import ( "encoding/pem" "errors" "fmt" + nfpem "github.com/openziti/foundation/util/pem" + "github.com/openziti/foundation/util/term" "github.com/openziti/ziti/ziti/cmd/ziti/cmd/common" cmdutil "github.com/openziti/ziti/ziti/cmd/ziti/cmd/factory" cmdhelper "github.com/openziti/ziti/ziti/cmd/ziti/cmd/helpers" "github.com/openziti/ziti/ziti/cmd/ziti/util" - nfpem "github.com/openziti/foundation/util/pem" - "github.com/openziti/foundation/util/term" "github.com/spf13/cobra" "gopkg.in/resty.v1" "io" @@ -124,11 +124,11 @@ func newVerifyCaCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.C // allow interspersing positional args and flags cmd.Flags().SetInterspersed(true) - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") cmd.Flags().StringVarP(&options.certPath, "cert", "c", "", "The path to a cert with the CN set as the verification token and signed by the target CA") cmd.Flags().StringVarP(&options.caCertPath, "cacert", "a", "", "The path to the CA cert that should be used to generate and sign a verification cert") cmd.Flags().StringVarP(&options.caKeyPath, "cakey", "k", "", "The path to the CA key that should be used to generate and sign a verification cert") cmd.Flags().StringVarP(&options.caKeyPassword, "password", "p", "", "The password for the CA key if necessary") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/cmd/edge_controller/version.go b/ziti/cmd/ziti/cmd/edge_controller/version.go index a7fd5810a..16e16a09d 100644 --- a/ziti/cmd/ziti/cmd/edge_controller/version.go +++ b/ziti/cmd/ziti/cmd/edge_controller/version.go @@ -52,7 +52,7 @@ func newVersionCmd(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Co SuggestFor: []string{}, } - cmd.Flags().BoolVarP(&options.OutputJSONResponse, "output-json", "j", false, "Output the full JSON response from the Ziti Edge Controller") + options.AddCommonFlags(cmd) return cmd } diff --git a/ziti/cmd/ziti/util/rest.go b/ziti/cmd/ziti/util/rest.go index 9050c84ac..772791da4 100644 --- a/ziti/cmd/ziti/util/rest.go +++ b/ziti/cmd/ziti/util/rest.go @@ -618,7 +618,7 @@ func EdgeControllerDelete(entityType string, id string, out io.Writer, logJSON b } // EdgeControllerUpdate will update entities of the given type in the given Edge Controller -func EdgeControllerUpdate(entityType string, body string, out io.Writer, method string, logJSON bool) (*gabs.Container, error) { +func EdgeControllerUpdate(entityType string, body string, out io.Writer, method string, logRequestJson, logResponseJSON bool) (*gabs.Container, error) { session := &Session{} if err := session.Load(); err != nil { return nil, err @@ -630,6 +630,11 @@ func EdgeControllerUpdate(entityType string, body string, out io.Writer, method client.SetRootCertificate(session.Cert) } + if logRequestJson { + outputJson(out, []byte(body)) + fmt.Println() + } + resp, err := client. R(). SetHeader("Content-Type", "application/json"). @@ -646,7 +651,7 @@ func EdgeControllerUpdate(entityType string, body string, out io.Writer, method entityType, session.Host, resp.Status(), resp.String()) } - if logJSON { + if logResponseJSON { outputJson(out, resp.Body()) }