From 2cfcbfb1e223667b4405b36f4fe91565ff377196 Mon Sep 17 00:00:00 2001 From: b1ackd0t Date: Tue, 10 Jan 2023 13:13:09 +0300 Subject: [PATCH 1/2] NOISSUE - Fix Bootstrap CLI (#1695) Reorder SDK params (external id and key) for Bootstrap service. --- pkg/sdk/go/bootstrap.go | 5 +++-- pkg/sdk/go/sdk.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/sdk/go/bootstrap.go b/pkg/sdk/go/bootstrap.go index 61d5e3050d5..55aae01f2fa 100644 --- a/pkg/sdk/go/bootstrap.go +++ b/pkg/sdk/go/bootstrap.go @@ -9,6 +9,7 @@ import ( "net/http" "strings" + "github.com/mainflux/mainflux/internal/apiutil" "github.com/mainflux/mainflux/pkg/errors" ) @@ -125,9 +126,9 @@ func (sdk mfSDK) RemoveBootstrap(id, token string) errors.SDKError { return err } -func (sdk mfSDK) Bootstrap(externalKey, externalID string) (BootstrapConfig, errors.SDKError) { +func (sdk mfSDK) Bootstrap(externalID, externalKey string) (BootstrapConfig, errors.SDKError) { url := fmt.Sprintf("%s/%s/%s", sdk.bootstrapURL, bootstrapEndpoint, externalID) - _, body, err := sdk.processRequest(http.MethodGet, url, externalKey, string(CTJSON), nil, http.StatusOK) + _, body, err := sdk.processRequest(http.MethodGet, url, apiutil.ThingPrefix+externalKey, string(CTJSON), nil, http.StatusOK) if err != nil { return BootstrapConfig{}, err } diff --git a/pkg/sdk/go/sdk.go b/pkg/sdk/go/sdk.go index 21591adb63d..24ffcb6c2cf 100644 --- a/pkg/sdk/go/sdk.go +++ b/pkg/sdk/go/sdk.go @@ -230,7 +230,7 @@ type SDK interface { RemoveBootstrap(id, token string) errors.SDKError // Bootstrap returns Config to the Thing with provided external ID using external key. - Bootstrap(externalKey, externalID string) (BootstrapConfig, errors.SDKError) + Bootstrap(externalID, externalKey string) (BootstrapConfig, errors.SDKError) // Whitelist updates Thing state Config with given ID belonging to the user identified by the given token. Whitelist(cfg BootstrapConfig, token string) errors.SDKError From b502af65fe5d66fbc6b9c2cec5821409cb366be0 Mon Sep 17 00:00:00 2001 From: b1ackd0t Date: Tue, 10 Jan 2023 14:00:12 +0300 Subject: [PATCH 2/2] NOISSUE - Update Read Message CLI (#1696) Signed-off-by: rodneyosodo Signed-off-by: rodneyosodo Co-authored-by: rodneyosodo --- cli/message.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/message.go b/cli/message.go index e69a3310a6d..4c690a9d04b 100644 --- a/cli/message.go +++ b/cli/message.go @@ -25,7 +25,7 @@ var cmdMessages = []cobra.Command{ }, }, { - Use: "read ", + Use: "read ", Short: "Read messages", Long: `Reads all channel messages`, Run: func(cmd *cobra.Command, args []string) {