From 8edd05c4c827a86f9d5d958eeff3c7e8dd156581 Mon Sep 17 00:00:00 2001 From: Mathieu Gilet Date: Wed, 16 Oct 2024 16:03:53 +0200 Subject: [PATCH] Test --- Makefile | 2 +- go.mod | 2 +- go.sum | 4 ++++ metabase/table_metabase_permission.go | 9 +++++++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 6f828ab..5744045 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,2 @@ install: - go build -o ~/.steampipe/plugins/hub.steampipe.io/plugins/1024pix/metabase@latest/steampipe-plugin-metabase.plugin *.go + go build -o ~/.steampipe/plugins/hub.steampipe.io/plugins/1024pix/metabase@ce6b0f9ad22647ca6321fb2c9bfa21169eed5861/steampipe-plugin-metabase.plugin *.go diff --git a/go.mod b/go.mod index 2c2b0d1..23ef1ea 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.4 toolchain go1.23.1 require ( - github.com/1024pix/go-metabase v1.2.1 + github.com/1024pix/go-metabase v1.2.2-0.20241016140730-0ae2fe27b22c github.com/grokify/goauth v0.20.12 github.com/turbot/steampipe-plugin-sdk/v5 v5.10.4 ) diff --git a/go.sum b/go.sum index 4cafdb5..1ce1f1f 100644 --- a/go.sum +++ b/go.sum @@ -219,6 +219,10 @@ github.com/1024pix/go-metabase v1.2.0 h1:kLtX1RVss66o4NeYXI6gVEXBnNtl3QbQ+vbrKQR github.com/1024pix/go-metabase v1.2.0/go.mod h1:wBjwHqp2yUhtJgUSWoiNb+oq8n3XIlQIIRpzEvo/yE0= github.com/1024pix/go-metabase v1.2.1 h1:0qmZdkEwpcElKZ7wmwrENtp2ZV3hlzCabc7yRgzNp1s= github.com/1024pix/go-metabase v1.2.1/go.mod h1:wBjwHqp2yUhtJgUSWoiNb+oq8n3XIlQIIRpzEvo/yE0= +github.com/1024pix/go-metabase v1.2.2-0.20241016132446-a8541f68dd3c h1:8xvPOBWmWzBW90uUmzTUxI9TkagUYXRO66qw0wt3Q7Q= +github.com/1024pix/go-metabase v1.2.2-0.20241016132446-a8541f68dd3c/go.mod h1:wBjwHqp2yUhtJgUSWoiNb+oq8n3XIlQIIRpzEvo/yE0= +github.com/1024pix/go-metabase v1.2.2-0.20241016140730-0ae2fe27b22c h1:aE5IMX/5pVtVRRFXq7W3RtQAlZRq5pzE7qEIl/KQI4A= +github.com/1024pix/go-metabase v1.2.2-0.20241016140730-0ae2fe27b22c/go.mod h1:wBjwHqp2yUhtJgUSWoiNb+oq8n3XIlQIIRpzEvo/yE0= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= diff --git a/metabase/table_metabase_permission.go b/metabase/table_metabase_permission.go index 182d357..ab3c722 100644 --- a/metabase/table_metabase_permission.go +++ b/metabase/table_metabase_permission.go @@ -4,7 +4,9 @@ import ( "context" "fmt" "strconv" + "encoding/json" + go_kit "github.com/turbot/go-kit/types" "github.com/1024pix/go-metabase/metabase" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" @@ -15,7 +17,7 @@ type Permission struct { GroupID int DbId int ViewData *string - CreateQueries *string + CreateQueries *interface{} } func tableMetabasePermission() *plugin.Table { @@ -94,11 +96,14 @@ func createPermission(methodCallStack string, ctx context.Context, groups *map[s return nil, err } + var createQueries interface{} + json.Unmarshal([]byte(go_kit.SafeString(data.CreateQueries)), &createQueries) + permissions = append(permissions, Permission{ GroupID: gId, DbId: dId, ViewData: data.ViewData, - CreateQueries: data.CreateQueries, + CreateQueries: createQueries, }) } }