From 62c01fbefc5a5b77737fd0df40a75ec78d608f5c Mon Sep 17 00:00:00 2001 From: ianmuchyri Date: Fri, 24 Nov 2023 10:57:42 +0300 Subject: [PATCH 1/4] fix sdk pgm from email to identity Signed-off-by: ianmuchyri --- pkg/sdk/go/sdk.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/sdk/go/sdk.go b/pkg/sdk/go/sdk.go index 6da9c0283..a85b2aa26 100644 --- a/pkg/sdk/go/sdk.go +++ b/pkg/sdk/go/sdk.go @@ -74,7 +74,7 @@ type PageMetadata struct { Offset uint64 `json:"offset"` Limit uint64 `json:"limit"` Level uint64 `json:"level,omitempty"` - Email string `json:"email,omitempty"` + Identity string `json:"identity,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Metadata Metadata `json:"metadata,omitempty"` @@ -91,6 +91,7 @@ type PageMetadata struct { Topic string `json:"topic,omitempty"` Contact string `json:"contact,omitempty"` State string `json:"state,omitempty"` + Order string `json:"order,omitempty"` } // Credentials represent client credentials: it contains @@ -1186,8 +1187,8 @@ func (pm PageMetadata) query() (string, error) { if pm.Level != 0 { q.Add("level", strconv.FormatUint(pm.Level, 10)) } - if pm.Email != "" { - q.Add("email", pm.Email) + if pm.Identity != "" { + q.Add("identity", pm.Identity) } if pm.Name != "" { q.Add("name", pm.Name) From 40cdb4ec7cc32f22b64a9d49d62218970d472fb8 Mon Sep 17 00:00:00 2001 From: ianmuchyri Date: Fri, 24 Nov 2023 12:01:16 +0300 Subject: [PATCH 2/4] fix linter error Signed-off-by: ianmuchyri --- provision/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provision/service.go b/provision/service.go index e7aea7c8b..bec90d5b8 100644 --- a/provision/service.go +++ b/provision/service.go @@ -96,7 +96,7 @@ func New(cfg Config, sdk sdk.SDK, logger mglog.Logger) Service { // Mapping retrieves current configuration. func (ps *provisionService) Mapping(token string) (map[string]interface{}, error) { userFilter := sdk.PageMetadata{ - Email: "", + Identity: "", Offset: uint64(offset), Limit: uint64(limit), Metadata: make(map[string]interface{}), From 0fef1b903ce9a63a9cd4da3f02dbdb944c7894c2 Mon Sep 17 00:00:00 2001 From: ianmuchyri Date: Fri, 24 Nov 2023 13:19:19 +0300 Subject: [PATCH 3/4] fi linter error Signed-off-by: ianmuchyri --- cli/users.go | 2 +- cli/utils.go | 4 ++-- cmd/cli/main.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/users.go b/cli/users.go index f21733e5a..4e952d3b9 100644 --- a/cli/users.go +++ b/cli/users.go @@ -63,7 +63,7 @@ var cmdUsers = []cobra.Command{ return } pageMetadata := mgxsdk.PageMetadata{ - Email: Email, + Identity: Identity, Offset: Offset, Limit: Limit, Metadata: metadata, diff --git a/cli/utils.go b/cli/utils.go index 997c8b11c..f18c28b08 100644 --- a/cli/utils.go +++ b/cli/utils.go @@ -20,8 +20,8 @@ var ( Offset uint64 = 0 // Name query parameter. Name string = "" - // Email query parameter. - Email string = "" + // Identity query parameter. + Identity string = "" // Metadata query parameter. Metadata string = "" // Status query parameter. diff --git a/cmd/cli/main.go b/cmd/cli/main.go index 88a6ff57f..776f6d64f 100644 --- a/cmd/cli/main.go +++ b/cmd/cli/main.go @@ -203,11 +203,11 @@ func main() { ) rootCmd.PersistentFlags().StringVarP( - &cli.Email, - "email", + &cli.Identity, + "identity", "e", "", - "User email query parameter", + "User identity query parameter", ) rootCmd.PersistentFlags().StringVarP( From c6f312d393cea381767636e6128ff4604a472de6 Mon Sep 17 00:00:00 2001 From: ianmuchyri Date: Fri, 24 Nov 2023 13:23:25 +0300 Subject: [PATCH 4/4] update identity shortform Signed-off-by: ianmuchyri --- cmd/cli/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/cli/main.go b/cmd/cli/main.go index 776f6d64f..d3137492f 100644 --- a/cmd/cli/main.go +++ b/cmd/cli/main.go @@ -205,7 +205,7 @@ func main() { rootCmd.PersistentFlags().StringVarP( &cli.Identity, "identity", - "e", + "I", "", "User identity query parameter", )