mirror of
https://github.com/mainflux/mainflux.git
synced 2025-05-01 13:48:56 +08:00

* Fix API docs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Provide secured bootstrapping Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix test and mock methods signatures Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix tests Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix typos Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Add encrypte bootstrap test Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update docs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove duplicated docs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Use secret key to encrypt bootstrap request Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Use secret key for secure bootstrapping Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Move encryption to ConfigReader Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove ConfigReader from Service Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix tests Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Add reader tests Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update API docs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Unset key env variable Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Add endpoint test for secure bootstrap Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
31 lines
982 B
Go
31 lines
982 B
Go
//
|
|
// Copyright (c) 2018
|
|
// Mainflux
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package bootstrap
|
|
|
|
import "strconv"
|
|
|
|
const (
|
|
// Inactive Thing is created, but not able to exchange messages using Mainflux.
|
|
Inactive State = iota
|
|
// Active Thing is created, configured, and whitelisted.
|
|
Active
|
|
)
|
|
|
|
// State represents corresponding Mainflux Thing state. The possible Config States
|
|
// as well as description of what that State represents are given in the table:
|
|
// | State | What it means |
|
|
// |----------+--------------------------------------------------------------------------------|
|
|
// | Inactive | Thing is created, but isn't able to communicate over Mainflux |
|
|
// | Active | Thing is able to communicate using Mainflux |
|
|
type State int
|
|
|
|
// String returns string representation of State.
|
|
func (s State) String() string {
|
|
return strconv.Itoa(int(s))
|
|
}
|