Mainflux.mainflux/provision/service.go

386 lines
11 KiB
Go
Raw Normal View History

package provision
import (
"encoding/json"
"fmt"
"github.com/mainflux/mainflux/logger"
"github.com/mainflux/mainflux/pkg/errors"
SDK "github.com/mainflux/mainflux/pkg/sdk/go"
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
)
const (
externalIDKey = "external_id"
gateway = "gateway"
Active = 1
control = "control"
data = "data"
export = "export"
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
)
var (
ErrFailedToCreateToken = errors.New("failed to create access token")
ErrEmptyThingsList = errors.New("things list in configuration empty")
ErrEmptyChannelsList = errors.New("channels list in configuration is empty")
ErrFailedChannelCreation = errors.New("failed to create channel")
ErrFailedChannelRetrieval = errors.New("failed to retrieve channel")
ErrFailedThingCreation = errors.New("failed to create thing")
ErrFailedThingRetrieval = errors.New("failed to retrieve thing")
ErrMissingCredentials = errors.New("missing credentials")
ErrFailedBootstrapRetrieval = errors.New("failed to retrieve bootstrap")
ErrFailedCertCreation = errors.New("failed to create certificates")
ErrFailedBootstrap = errors.New("failed to create bootstrap config")
ErrFailedBootstrapValidate = errors.New("failed to validate bootstrap config creation")
ErrGatewayUpdate = errors.New("failed to updated gateway metadata")
)
var _ Service = (*provisionService)(nil)
// Service specifies Provision service API.
type Service interface {
// Provision is the only method this API specifies. Depending on the configuration,
// the following actions will can be executed:
// - create a Thing based on external_id (eg. MAC address)
// - create multiple Channels
// - create Bootstrap configuration
// - whitelist Thing in Bootstrap configuration == connect Thing to Channels
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
Provision(token, name, externalID, externalKey string) (Result, error)
// Certs creates certificate for things that communicate over mTLS
// A duration string is a possibly signed sequence of decimal numbers,
// each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m".
// Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
// keyBits for certificate key
Cert(token, thingID, duration string, keyBits int) (string, string, error)
}
type provisionService struct {
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
logger logger.Logger
sdk SDK.SDK
conf Config
}
// Result represent what is created with additional info.
type Result struct {
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
Things []SDK.Thing `json:"things,omitempty"`
Channels []SDK.Channel `json:"channels,omitempty"`
ClientCert map[string]string `json:"client_cert,omitempty"`
ClientKey map[string]string `json:"client_key,omitempty"`
CACert string `json:"ca_cert,omitempty"`
Whitelisted map[string]bool `json:"whitelisted,omitempty"`
Error string `json:"error,omitempty"`
}
// New returns new provision service.
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
func New(cfg Config, sdk SDK.SDK, logger logger.Logger) Service {
return &provisionService{
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
logger: logger,
conf: cfg,
sdk: sdk,
}
}
// Provision is provision method for creating setup according to
// provision layout specified in config.toml
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
func (ps *provisionService) Provision(token, name, externalID, externalKey string) (res Result, err error) {
var channels []SDK.Channel
var things []SDK.Thing
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
defer ps.recover(&err, &things, &channels, &token)
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
token, err = ps.createTokenIfEmpty(token)
if err != nil {
return res, err
}
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
if len(ps.conf.Things) == 0 {
return res, ErrEmptyThingsList
}
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
if len(ps.conf.Channels) == 0 {
return res, ErrEmptyChannelsList
}
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
for _, thing := range ps.conf.Things {
// If thing in configs contains metadata with external_id
// set value for it from the provision request
if _, ok := thing.Metadata[externalIDKey]; ok {
thing.Metadata[externalIDKey] = externalID
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 - 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
th := SDK.Thing{
Metadata: thing.Metadata,
}
if name == "" {
name = thing.Name
}
th.Name = name
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
thID, err := ps.sdk.CreateThing(th, token)
if err != nil {
res.Error = err.Error()
return res, errors.Wrap(ErrFailedThingCreation, err)
}
// Get newly created thing (in order to get the key).
th, err = ps.sdk.Thing(thID, token)
if err != nil {
e := errors.Wrap(err, fmt.Errorf("thing id: %s", thID))
return res, errors.Wrap(ErrFailedThingRetrieval, e)
}
things = append(things, th)
}
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
for _, channel := range ps.conf.Channels {
ch := SDK.Channel{
Name: channel.Name,
Metadata: channel.Metadata,
}
chCreated, err := ps.sdk.CreateChannel(ch, token)
if err != nil {
return res, err
}
ch, err = ps.sdk.Channel(chCreated, token)
if err != nil {
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
e := errors.Wrap(err, fmt.Errorf("channel id: %s", chCreated))
return res, errors.Wrap(ErrFailedChannelRetrieval, e)
}
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
channels = append(channels, ch)
}
res = Result{
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
Things: things,
Channels: channels,
Whitelisted: map[string]bool{},
ClientCert: map[string]string{},
ClientKey: map[string]string{},
}
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
var cert SDK.Cert
var bsConfig SDK.BootstrapConfig
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
for _, thing := range things {
var chanIDs []string
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
for _, ch := range channels {
chanIDs = append(chanIDs, ch.ID)
}
content, err := json.Marshal(ps.conf.Bootstrap.Content)
if err != nil {
return Result{}, errors.Wrap(ErrFailedBootstrap, err)
}
if ps.conf.Bootstrap.Provision && needsBootstrap(thing) {
bsReq := SDK.BootstrapConfig{
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
ThingID: thing.ID,
ExternalID: externalID,
ExternalKey: externalKey,
Channels: chanIDs,
CACert: res.CACert,
ClientCert: cert.ClientCert,
ClientKey: cert.ClientKey,
Content: string(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
}
bsid, err := ps.sdk.AddBootstrap(token, bsReq)
if err != nil {
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
return Result{}, errors.Wrap(ErrFailedBootstrap, err)
}
bsConfig, err = ps.sdk.ViewBootstrap(token, bsid)
if err != nil {
return Result{}, errors.Wrap(ErrFailedBootstrapValidate, err)
}
}
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
if ps.conf.Bootstrap.X509Provision {
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
var cert SDK.Cert
cert, err = ps.sdk.IssueCert(thing.ID, ps.conf.Certs.KeyBits, ps.conf.Certs.KeyType, ps.conf.Certs.HoursValid, token)
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
if err != nil {
e := errors.Wrap(err, fmt.Errorf("thing id: %s", thing.ID))
return res, errors.Wrap(ErrFailedCertCreation, e)
}
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
res.ClientCert[thing.ID] = cert.ClientCert
res.ClientKey[thing.ID] = cert.ClientKey
res.CACert = cert.CACert
if needsBootstrap(thing) {
if err = ps.sdk.UpdateBootstrapCerts(token, bsConfig.MFThing, cert.ClientCert, cert.ClientKey, cert.CACert); err != nil {
return Result{}, errors.Wrap(ErrFailedCertCreation, err)
}
}
}
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
if ps.conf.Bootstrap.AutoWhiteList {
wlReq := SDK.BootstrapConfig{
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
MFThing: thing.ID,
State: Active,
}
if err := ps.sdk.Whitelist(token, wlReq); err != nil {
res.Error = err.Error()
return res, SDK.ErrFailedWhitelist
}
res.Whitelisted[thing.ID] = true
}
}
if err = ps.updateGateway(token, bsConfig, channels); err != nil {
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
return res, err
}
return res, nil
}
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
func (ps *provisionService) Cert(token, thingID, daysValid string, keyBits int) (string, string, error) {
token, err := ps.createTokenIfEmpty(token)
if err != nil {
return "", "", err
}
th, err := ps.sdk.Thing(thingID, token)
if err != nil {
return "", "", errors.Wrap(SDK.ErrUnauthorized, err)
}
cert, err := ps.sdk.IssueCert(th.ID, ps.conf.Certs.KeyBits, ps.conf.Certs.KeyType, ps.conf.Certs.HoursValid, token)
return cert.ClientCert, cert.ClientKey, err
}
func (ps *provisionService) createTokenIfEmpty(token string) (string, error) {
if token != "" {
return token, nil
}
// If no token in request is provided
// use API key provided in config file or env
if ps.conf.Server.MfAPIKey != "" {
return ps.conf.Server.MfAPIKey, nil
}
// If no API key use username and password provided to create access token.
if ps.conf.Server.MfUser == "" || ps.conf.Server.MfPass == "" {
return token, ErrMissingCredentials
}
u := SDK.User{
Email: ps.conf.Server.MfUser,
Password: ps.conf.Server.MfPass,
}
token, err := ps.sdk.CreateToken(u)
if err != nil {
return token, errors.Wrap(ErrFailedToCreateToken, err)
}
return token, nil
}
func (ps *provisionService) updateGateway(token string, bs SDK.BootstrapConfig, channels []SDK.Channel) error {
var gw Gateway
for _, ch := range channels {
switch ch.Metadata["type"] {
case control:
gw.CtrlChannelID = ch.ID
case data:
gw.DataChannelID = ch.ID
case export:
gw.ExportChannelID = ch.ID
}
}
gw.ExternalID = bs.ExternalID
gw.ExternalKey = bs.ExternalKey
gw.CfgID = bs.MFThing
gw.Type = gateway
th, err := ps.sdk.Thing(bs.MFThing, token)
if err != nil {
return errors.Wrap(ErrGatewayUpdate, err)
}
b, err := json.Marshal(gw)
if err != nil {
return errors.Wrap(ErrGatewayUpdate, err)
}
if err := json.Unmarshal(b, &th.Metadata); err != nil {
return errors.Wrap(ErrGatewayUpdate, err)
}
if err := ps.sdk.UpdateThing(th, token); err != nil {
return errors.Wrap(ErrGatewayUpdate, err)
}
return nil
}
func (ps *provisionService) errLog(err error) {
if err != nil {
ps.logger.Error(fmt.Sprintf("Error recovering: %s", err))
}
}
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
func clean(ps *provisionService, things []SDK.Thing, channels []SDK.Channel, token string) {
for _, t := range things {
ps.errLog(ps.sdk.DeleteThing(t.ID, token))
}
for _, c := range channels {
ps.errLog(ps.sdk.DeleteChannel(c.ID, token))
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 - 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
func (ps *provisionService) recover(e *error, ths *[]SDK.Thing, chs *[]SDK.Channel, tkn *string) {
things, channels, token, err := *ths, *chs, *tkn, *e
if e == nil {
return
}
if errors.Contains(err, ErrFailedThingRetrieval) || errors.Contains(err, ErrFailedChannelCreation) {
for _, th := range things {
ps.errLog(ps.sdk.DeleteThing(th.ID, token))
}
return
}
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
if errors.Contains(err, ErrFailedBootstrap) || errors.Contains(err, ErrFailedChannelRetrieval) {
clean(ps, things, channels, token)
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
return
}
if errors.Contains(err, ErrFailedBootstrapValidate) || errors.Contains(err, ErrFailedCertCreation) {
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
clean(ps, things, channels, token)
for _, th := range things {
if needsBootstrap(th) == true {
ps.errLog(ps.sdk.RemoveBootstrap(token, th.ID))
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 - 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
}
return
}
if errors.Contains(err, ErrFailedBootstrapValidate) || errors.Contains(err, ErrFailedCertCreation) {
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
clean(ps, things, channels, token)
for _, th := range things {
if needsBootstrap(th) == true {
bs, err := ps.sdk.ViewBootstrap(token, th.ID)
ps.errLog(errors.Wrap(ErrFailedBootstrapRetrieval, err))
ps.errLog(ps.sdk.RemoveBootstrap(token, bs.MFThing))
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
}
}
}
if errors.Contains(err, SDK.ErrFailedWhitelist) || errors.Contains(err, ErrGatewayUpdate) {
clean(ps, things, channels, token)
for _, th := range things {
if ps.conf.Bootstrap.X509Provision && needsBootstrap(th) {
ps.errLog(ps.sdk.RemoveCert(th.ID, token))
}
if needsBootstrap(th) == true {
bs, err := ps.sdk.ViewBootstrap(token, th.ID)
ps.errLog(errors.Wrap(ErrFailedBootstrapRetrieval, err))
ps.errLog(ps.sdk.RemoveBootstrap(token, bs.MFThing))
}
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
}
return
}
}
func needsBootstrap(th SDK.Thing) bool {
if th.Metadata == nil {
return false
}
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
if _, ok := th.Metadata[externalIDKey]; ok {
return true
}
return false
}