Mainflux.mainflux/provision/config.go

94 lines
3.0 KiB
Go
Raw Normal View History

NOISSUE - Update provision service (#1133) * Add provision service Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * delete sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix envs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * deleete LICENSE Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactoring provison service Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test, and use sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove bootstrap mock Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * implement channel Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * export errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove docker-compse Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change dflt file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix content Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * cert sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix bootstraping Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update swagger Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix mproxy mod Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter messages Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove dead code Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add some space for readability Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remov thingids Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake_case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix var naming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix signature Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * aling with defaults Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging info Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tag Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-29 06:39:23 +08:00
// Copyright (c) Mainflux
// SPDX-License-Identifier: Apache-2.0
package provision
import (
"fmt"
"io/ioutil"
"github.com/mainflux/mainflux/pkg/errors"
NOISSUE - Add view and list serials endpoints in certs service (#1483) * NOISSUE - Add view and list serials endpoints in certs service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix vault-unseal.sh script Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename Cert field days_valid into hours_valid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix provision service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ownerID, rename daysValid -> hoursValid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add key_type to api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix tabulation Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add expiration date in view response Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> Expiration and remove unecessary expiration convertion Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ListSerials tests and fix mocks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix RetrieveByThing count Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ViewCert tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing error check Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify API Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert Makefile Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add view and list serials endpoints in certs service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix vault-unseal.sh script Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename Cert field days_valid into hours_valid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix provision service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ownerID, rename daysValid -> hoursValid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add key_type to api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix tabulation Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add expiration date in view response Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> Expiration and remove unecessary expiration convertion Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ListSerials tests and fix mocks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix RetrieveByThing count Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ViewCert tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing error check Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify API Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert Makefile Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm if else Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> TTL Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * revert typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * revert typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename hoursValid -> ttl Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-01-05 02:42:13 +08:00
"github.com/mainflux/mainflux/things"
NOISSUE - Update provision service (#1133) * Add provision service Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * delete sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix envs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * deleete LICENSE Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactoring provison service Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test, and use sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove bootstrap mock Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * implement channel Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * export errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove docker-compse Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change dflt file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix content Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * cert sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix bootstraping Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update swagger Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix mproxy mod Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter messages Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove dead code Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add some space for readability Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remov thingids Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake_case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix var naming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix signature Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * aling with defaults Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging info Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tag Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-29 06:39:23 +08:00
"github.com/pelletier/go-toml"
)
NOISSUE - Add view and list serials endpoints in certs service (#1483) * NOISSUE - Add view and list serials endpoints in certs service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix vault-unseal.sh script Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename Cert field days_valid into hours_valid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix provision service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ownerID, rename daysValid -> hoursValid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add key_type to api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix tabulation Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add expiration date in view response Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> Expiration and remove unecessary expiration convertion Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ListSerials tests and fix mocks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix RetrieveByThing count Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ViewCert tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing error check Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify API Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert Makefile Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add view and list serials endpoints in certs service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix vault-unseal.sh script Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename Cert field days_valid into hours_valid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix provision service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ownerID, rename daysValid -> hoursValid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add key_type to api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix tabulation Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add expiration date in view response Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> Expiration and remove unecessary expiration convertion Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ListSerials tests and fix mocks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix RetrieveByThing count Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ViewCert tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing error check Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify API Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert Makefile Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm if else Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> TTL Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * revert typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * revert typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename hoursValid -> ttl Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-01-05 02:42:13 +08:00
// ServiceConf represents service config.
NOISSUE - Update provision service (#1133) * Add provision service Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * delete sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix envs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * deleete LICENSE Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactoring provison service Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test, and use sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove bootstrap mock Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * implement channel Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * export errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove docker-compse Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change dflt file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix content Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * cert sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix bootstraping Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update swagger Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix mproxy mod Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter messages Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove dead code Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add some space for readability Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remov thingids Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake_case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix var naming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix signature Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * aling with defaults Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging info Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tag Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-29 06:39:23 +08:00
type ServiceConf struct {
Port string `toml:"port"`
LogLevel string `toml:"log_level"`
TLS bool `toml:"tls"`
ServerCert string `toml:"server_cert"`
ServerKey string `toml:"server_key"`
MF 1413 - Use per-service URL in SDK (#1444) * Use per-service URL in SDK Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> * Fix CLI Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com> * Fix CLI messaging Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com> * Fix message tests Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com> * Simplify Bootstrap Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com> * Update API doc and responses Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com> * fix failing certs, bootstrap tests Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix failing certs, bootstrap tests Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * Fix tests and rename to auth service Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com> * Clean the code Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com> * Remove unnecessary Repository logs Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Always return error in case of repo failure Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Cleanup SDK and CLI Update tests, remove linter warnings, remove dead code. Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Clean the code Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com> * Undo Bootstrap changes Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com> * Fix tests Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com> * Fix linter Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com> Co-authored-by: mteodor <mirko.teodorovic@gmail.com> Co-authored-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-08-11 22:58:10 +08:00
ThingsURL string `toml:"things_url"`
UsersURL string `toml:"users_url"`
NOISSUE - Update provision service (#1133) * Add provision service Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * delete sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix envs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * deleete LICENSE Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactoring provison service Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test, and use sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove bootstrap mock Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * implement channel Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * export errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove docker-compse Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change dflt file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix content Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * cert sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix bootstraping Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update swagger Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix mproxy mod Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter messages Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove dead code Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add some space for readability Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remov thingids Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake_case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix var naming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix signature Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * aling with defaults Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging info Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tag Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-29 06:39:23 +08:00
HTTPPort string `toml:"http_port"`
MfUser string `toml:"mf_user"`
MfPass string `toml:"mf_pass"`
MfAPIKey string `toml:"mf_api_key"`
MfBSURL string `toml:"mf_bs_url"`
MfWhiteListURL string `toml:"mf_white_list"`
NOISSUE - Update provision service (#1133) * Add provision service Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * delete sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix envs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * deleete LICENSE Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactoring provison service Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test, and use sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove bootstrap mock Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * implement channel Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * export errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove docker-compse Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change dflt file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix content Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * cert sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix bootstraping Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update swagger Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix mproxy mod Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter messages Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove dead code Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add some space for readability Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remov thingids Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake_case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix var naming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix signature Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * aling with defaults Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging info Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tag Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-29 06:39:23 +08:00
MfCertsURL string `toml:"mf_certs_url"`
}
NOISSUE - Add view and list serials endpoints in certs service (#1483) * NOISSUE - Add view and list serials endpoints in certs service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix vault-unseal.sh script Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename Cert field days_valid into hours_valid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix provision service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ownerID, rename daysValid -> hoursValid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add key_type to api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix tabulation Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add expiration date in view response Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> Expiration and remove unecessary expiration convertion Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ListSerials tests and fix mocks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix RetrieveByThing count Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ViewCert tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing error check Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify API Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert Makefile Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add view and list serials endpoints in certs service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix vault-unseal.sh script Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename Cert field days_valid into hours_valid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix provision service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ownerID, rename daysValid -> hoursValid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add key_type to api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix tabulation Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add expiration date in view response Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> Expiration and remove unecessary expiration convertion Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ListSerials tests and fix mocks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix RetrieveByThing count Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ViewCert tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing error check Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify API Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert Makefile Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm if else Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> TTL Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * revert typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * revert typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename hoursValid -> ttl Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-01-05 02:42:13 +08:00
// Bootstrap represetns the Bootstrap config
NOISSUE - Update provision service (#1133) * Add provision service Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * delete sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix envs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * deleete LICENSE Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactoring provison service Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test, and use sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove bootstrap mock Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * implement channel Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * export errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove docker-compse Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change dflt file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix content Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * cert sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix bootstraping Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update swagger Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix mproxy mod Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter messages Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove dead code Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add some space for readability Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remov thingids Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake_case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix var naming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix signature Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * aling with defaults Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging info Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tag Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-29 06:39:23 +08:00
type Bootstrap struct {
X509Provision bool `toml:"x509_provision"`
Provision bool `toml:"provision"`
AutoWhiteList bool `toml:"autowhite_list"`
Content map[string]interface{} `toml:"content"`
NOISSUE - Update provision service (#1133) * Add provision service Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * delete sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix envs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * deleete LICENSE Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactoring provison service Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test, and use sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove bootstrap mock Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * implement channel Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * export errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove docker-compse Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change dflt file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix content Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * cert sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix bootstraping Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update swagger Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix mproxy mod Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter messages Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove dead code Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add some space for readability Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remov thingids Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake_case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix var naming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix signature Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * aling with defaults Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging info Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tag Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-29 06:39:23 +08:00
}
NOISSUE - Add view and list serials endpoints in certs service (#1483) * NOISSUE - Add view and list serials endpoints in certs service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix vault-unseal.sh script Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename Cert field days_valid into hours_valid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix provision service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ownerID, rename daysValid -> hoursValid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add key_type to api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix tabulation Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add expiration date in view response Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> Expiration and remove unecessary expiration convertion Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ListSerials tests and fix mocks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix RetrieveByThing count Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ViewCert tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing error check Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify API Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert Makefile Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add view and list serials endpoints in certs service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix vault-unseal.sh script Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename Cert field days_valid into hours_valid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix provision service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ownerID, rename daysValid -> hoursValid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add key_type to api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix tabulation Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add expiration date in view response Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> Expiration and remove unecessary expiration convertion Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ListSerials tests and fix mocks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix RetrieveByThing count Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ViewCert tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing error check Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify API Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert Makefile Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm if else Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> TTL Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * revert typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * revert typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename hoursValid -> ttl Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-01-05 02:42:13 +08:00
// Gateway represetns the Gateway config
type Gateway struct {
Type string `toml:"type" json:"type"`
ExternalID string `toml:"external_id" json:"external_id"`
ExternalKey string `toml:"external_key" json:"external_key"`
CtrlChannelID string `toml:"ctrl_channel_id" json:"ctrl_channel_id"`
DataChannelID string `toml:"data_channel_id" json:"data_channel_id"`
ExportChannelID string `toml:"export_channel_id" json:"export_channel_id"`
CfgID string `toml:"cfg_id" json:"cfg_id"`
}
NOISSUE - Add view and list serials endpoints in certs service (#1483) * NOISSUE - Add view and list serials endpoints in certs service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix vault-unseal.sh script Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename Cert field days_valid into hours_valid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix provision service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ownerID, rename daysValid -> hoursValid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add key_type to api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix tabulation Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add expiration date in view response Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> Expiration and remove unecessary expiration convertion Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ListSerials tests and fix mocks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix RetrieveByThing count Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ViewCert tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing error check Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify API Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert Makefile Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add view and list serials endpoints in certs service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix vault-unseal.sh script Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename Cert field days_valid into hours_valid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix provision service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ownerID, rename daysValid -> hoursValid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add key_type to api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix tabulation Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add expiration date in view response Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> Expiration and remove unecessary expiration convertion Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ListSerials tests and fix mocks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix RetrieveByThing count Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ViewCert tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing error check Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify API Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert Makefile Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm if else Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> TTL Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * revert typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * revert typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename hoursValid -> ttl Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-01-05 02:42:13 +08:00
// Cert represetns the certificate config
type Cert struct {
TTL string `json:"ttl" toml:"ttl"`
KeyBits int `json:"key_bits" toml:"key_bits"`
KeyType string `json:"key_type"`
MF-1179 - Add a certificate service and certs endpoint to SDK (#1188) * adding certificate issuing Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding cert endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update envs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update envs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs creation to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs creation to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs creation to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix env vars Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add comment Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix vars Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add volumes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix merge config for int Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove env Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix error handling Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add cert test, change receiver to pointer Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add docs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix var naming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * correct error naming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding certs service Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add certs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add certs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change func receiever Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default cert issue method Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small fix Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove some testing code Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add cert issue Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add vault api client Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * additional endpoints Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add swagger for certs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove certs from provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * clean provision from certs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add list certificates endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add vault api in vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add certs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add revoke, fix bugs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix sdk for certs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * minor changes, add env, doc Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * minor changes, add env, doc Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * minor changes, add env, doc Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small changes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove CA for signing from provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add docker file for certs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix mock sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix RevokeCert Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renam ENV Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove tests temporarily Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix naming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renam vars Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add cli for issue cert Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add cli for issue cert Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add cli for issue cert Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add cli for issue cert Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove not needed envs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter errors, add cli Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter errors, add cli, var rename Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix reviews, add viewcert, fix view all certs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove view cert, as it will be retrieved from PKI Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change endpoints Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default env val Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove some errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor, make wrapper lib for vault Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor, make wrapper lib for vault Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor, make wrapper lib for vault Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix revoking Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor, make wrapper lib for vault Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix comment Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove unused Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove unused field Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor pki Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor pki Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor pki, update vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor pki Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix comment Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * minor fix Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove methods, use fields Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix comments and package desc Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix comments and package desc Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-07-21 18:53:21 +08:00
}
NOISSUE - Update provision service (#1133) * Add provision service Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * delete sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix envs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * deleete LICENSE Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactoring provison service Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test, and use sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove bootstrap mock Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * implement channel Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * export errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove docker-compse Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change dflt file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix content Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * cert sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix bootstraping Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update swagger Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix mproxy mod Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter messages Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove dead code Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add some space for readability Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remov thingids Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake_case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix var naming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix signature Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * aling with defaults Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging info Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tag Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-29 06:39:23 +08:00
// Config struct of Provision
type Config struct {
NOISSUE - Add view and list serials endpoints in certs service (#1483) * NOISSUE - Add view and list serials endpoints in certs service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix vault-unseal.sh script Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename Cert field days_valid into hours_valid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix provision service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ownerID, rename daysValid -> hoursValid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add key_type to api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix tabulation Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add expiration date in view response Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> Expiration and remove unecessary expiration convertion Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ListSerials tests and fix mocks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix RetrieveByThing count Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ViewCert tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing error check Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify API Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert Makefile Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add view and list serials endpoints in certs service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix vault-unseal.sh script Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename Cert field days_valid into hours_valid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix provision service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ownerID, rename daysValid -> hoursValid Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add key_type to api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix tabulation Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add expiration date in view response Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> Expiration and remove unecessary expiration convertion Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ListSerials tests and fix mocks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix RetrieveByThing count Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add ViewCert tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing error check Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify API Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert Makefile Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm if else Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename HoursValid -> TTL Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * revert typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * revert typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename hoursValid -> ttl Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-01-05 02:42:13 +08:00
File string `toml:"file"`
Server ServiceConf `toml:"server" mapstructure:"server"`
Bootstrap Bootstrap `toml:"bootstrap" mapstructure:"bootstrap"`
Things []things.Thing `toml:"things" mapstructure:"things"`
Channels []things.Channel `toml:"channels" mapstructure:"channels"`
Cert Cert `toml:"cert" mapstructure:"cert"`
NOISSUE - Update provision service (#1133) * Add provision service Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * delete sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix envs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * deleete LICENSE Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix modules Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactoring provison service Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test, and use sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove bootstrap mock Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * implement channel Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * export errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove docker-compse Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add new line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix load config Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * move certs to sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change dflt file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix content Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * cert sdk Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix bootstraping Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update swagger Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix mproxy mod Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter messages Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * upd vendor Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove dead code Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add some space for readability Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remov thingids Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * use snake_case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix var naming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix signature Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * aling with defaults Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging info Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix logging Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tag Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-29 06:39:23 +08:00
}
// Save - store config in a file
func Save(c Config, file string) error {
b, err := toml.Marshal(c)
if err != nil {
return errors.New(fmt.Sprintf("Error reading config file: %s", err))
}
if err := ioutil.WriteFile(file, b, 0644); err != nil {
return errors.New(fmt.Sprintf("Error writing toml: %s", err))
}
return nil
}
// Read - retrieve config from a file
func Read(file string) (Config, error) {
data, err := ioutil.ReadFile(file)
c := Config{}
if err != nil {
return c, errors.New(fmt.Sprintf("Error reading config file: %s", err))
}
if err := toml.Unmarshal(data, &c); err != nil {
return Config{}, errors.New(fmt.Sprintf("Error unmarshaling toml: %s", err))
}
return c, nil
}