1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-28 13:48:49 +08:00
Mainflux.mainflux/pkg/sdk/go/responses.go
b1ackd0t 687505c833
NOISSUE - Remove Development Mode on Certs Creation (#1908)
* Fix certificate creation in development mode

This commit removes certificate creation in development mode. Previously, the `MF_CERTS_VAULT_HOST` environment variable was not being properly checked, resulting in incorrect behavior when issuing certificates. This commit ensures that the correct mode is set based on the value of `MF_CERTS_VAULT_HOST`.

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Fix certificate revocation in README.md

The README.md file has been updated to clarify the process of revoking certificates. The previous instructions were incorrect, and the correct method is now provided. The certificates can be revoked using the `certs` service by providing the `thing_id` of the thing for which the certificate was issued.

```
curl -s -S -X DELETE http://localhost:9019/certs/revoke -H "Authorization: Bearer $TOK" -H 'Content-Type: application/json' -d '{"thing_id":"c30b8842-507c-4bcd-973c-74008cef3be5"}'
```

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

---------

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2023-10-18 11:48:47 +02:00

94 lines
1.8 KiB
Go

// Copyright (c) Mainflux
// SPDX-License-Identifier: Apache-2.0
package sdk
import (
"time"
"github.com/mainflux/mainflux/pkg/transformers/senml"
)
type createThingsRes struct {
Things []Thing `json:"things"`
}
type createChannelsRes struct {
Channels []Channel `json:"channels"`
}
type pageRes struct {
Total uint64 `json:"total"`
Offset uint64 `json:"offset"`
Limit uint64 `json:"limit"`
}
// ThingsPage contains list of things in a page with proper metadata.
type ThingsPage struct {
Things []Thing `json:"things"`
pageRes
}
// ChannelsPage contains list of channels in a page with proper metadata.
type ChannelsPage struct {
Channels []Channel `json:"groups"`
pageRes
}
// MessagesPage contains list of messages in a page with proper metadata.
type MessagesPage struct {
Messages []senml.Message `json:"messages,omitempty"`
pageRes
}
type GroupsPage struct {
Groups []Group `json:"groups"`
pageRes
}
type UsersPage struct {
Users []User `json:"users"`
pageRes
}
type MembersPage struct {
Members []User `json:"members"`
pageRes
}
// MembershipsPage contains page related metadata as well as list of memberships that
// belong to this page.
type MembershipsPage struct {
pageRes
Memberships []Group `json:"memberships"`
}
type revokeCertsRes struct {
RevocationTime time.Time `json:"revocation_time"`
}
// BoostrapsPage contains list of boostrap configs in a page with proper metadata.
type BootstrapPage struct {
Configs []BootstrapConfig `json:"configs"`
pageRes
}
type CertSerials struct {
Certs []Cert `json:"certs"`
pageRes
}
type SubscriptionPage struct {
Subscriptions []Subscription `json:"subscriptions"`
pageRes
}
type identifyThingResp struct {
ID string `json:"id,omitempty"`
}
type canAccessRes struct {
ThingID string `json:"thing_id"`
Authorized bool `json:"authorized"`
}