Commit Graph

170 Commits

Author SHA1 Message Date
Manuel Imperiale 0fe9f55bae
NOISSUE - Add tests and connection route-map to lora-adapter (#1404)
* NOISSUE - Add tests and connection route-map to lora-adapter

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename LoraServer -> ChirpStack and fix links

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove ctx arg from Publish method

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert LoRa Server

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix links

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Check ids before to modify connection route-map

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Log conn errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-04-14 22:26:49 +02:00
Mirko Teodorovic 74aa93fbb6
NOISSUE - Certs service refactor (#1369)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add certs mock

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove not wanted changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor certs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* addint tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* addint tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add certs test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add certs test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add cert test, remove default implementation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix default value for vault host

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add cert test, remove default implementation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* linter cleaning

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comments, and logging

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* use mocks from other services

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename struct and url path params

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve minor comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* align url params naming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix typo

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove struct revoke

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor certRes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-03-15 12:27:32 +01:00
Ivan Milošević a1e18a770a
init commmit (#1385)
Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-03-10 11:52:33 +01:00
Mirko Teodorovic 530f925c4d
MF-1346 - Create Groups API - add grouping of entities (#1334)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users endpoint for retrieving users from group

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove  groups from things and users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move groups into auth

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* separate endpoints for users and things

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix problems with retrieving members

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add groups test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove groups from users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove groups from things

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename constant

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add new errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove unnecessary constants

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix validation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* create groups db mock

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert changes to docker related files

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove groups endpoints from users openapi

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove groups endpoints from users openapi

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move constant from postgres to groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move constant from postgres to groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move constant from postgres to groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove testing group

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renam typ to groupType

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add error for max level

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove print

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove groups.Member interface

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix query building and add test cases

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* uncomment tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move groups package

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove group type, add bulk assign and unassign

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update openapi, remove parentID from create request, reorder endpoints

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update openapi

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update openapi for users and things

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix groups test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix linter errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename assignReq structure

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor mocks, response, remove type from endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* some refactor, renaming, errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* simplify check

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove package alias

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix naming and comment

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* additional comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add members grpc endpoint test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix retrieving members for different types

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix retrieving members for different types

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove unecessary structure

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix api grpc

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename const

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactore retrieve parents and children with common function

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small changes for errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix compile error

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix sorting in mock

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove regexp for groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert as change is made by mistake

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert as change is made by mistake

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor groups and keys package

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix naming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix naming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test for timestamp compare

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix error handling

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove errors not being used

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* var renaming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add endpoints for groups into nginx

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize endpoints, remove some errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize endpoints, remove some errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small fix

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix linter errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix group save path problem

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* description constant

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename variables

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix validation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* get back return

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix compile

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-03-04 10:29:03 +01:00
Mirko Teodorovic 6b1f4d54f8
NOISSUE - Fix certs and vault deployment, reorganize and remove unnecessary vars (#1368)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix certs, fix scripts, reorganize env vars

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* set pki path vars

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add certs mock

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove not wanted changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update readme

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* correct rsa_bits to key_bits

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix tabulation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* hardcode vault version

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add env desc

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renam variables

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* use Mainflux Labs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* replace BG with Belgrade

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-03-02 12:20:52 +01:00
Ivan Milošević 7bcaa323d4
MF-1317 - Configurable regexp rule for password (#1355)
* read and validate regex envar

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* pass regexp to user/api

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* resolve conflicts

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* use exported regexp variable

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* move password validation from users package

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove dead code

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* add password change request

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* move regexp from api to users package

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* fix tests

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove commented code

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* add regexp as field in userService, remove it as user exported global var

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* add passwd validation in service

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Add psswd validation for change password in service

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* add password validation in password reset

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Remove password validation from user validation test

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Replace email and passwords in test with constants

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* compile error not fail silently

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* fix tempate path

Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-03-01 15:22:57 +01:00
Mirko Teodorovic 0432b2aa03
NOISSUE - Fix default values for port and x509 provision (#1367)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix default port and certs settings

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small typo fix

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor env vars

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-02-27 01:01:48 +01:00
Dušan Borovčanin 24b902d049
Fix env configuration and documentation (#1360)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-02-08 22:38:52 +01:00
Dušan Borovčanin 13c426c09c
NOISSUE - Support disabling Email Agent authentication (#1356)
* Fix mailer configuration

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove unused Driver option

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add Email Agent README

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-02-08 13:21:52 +01:00
Manuel Imperiale ca5ff63dfb
NOISSUE - Upgrade Mongo, Cassandra and Influx docker images (#1354)
* NOISSUE - Upgrade Mongo, Cassandra and Influx docker images

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use cassandra version 3.11.9

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add MF_INFLUXDB_HTTP_AUTH_ENABLED envar

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use influxdb 1.8.4-alpine

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use influxdb 1.8.4

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-02-05 12:32:21 +01:00
Dušan Borovčanin a3dbfecb2d
MF-1311 - Add Notifications service (#1324)
* Add repo to Notify

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove notify

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add initial repo implementation

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add Subscriptions repo implementation

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add working version of main method

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add Notifier API

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add API layer

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add Notifier interface

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix SMTP notifier main

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix email sending

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix main log

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add Readme and fix env vars

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update README

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove commented code

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Rename notifiers to notify

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Move Consumer API to writers

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix contact naming

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix spacing in init.go

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix API

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add mocks

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add initial service test

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Use pagination

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update List method

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix listing

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Rename SubscriptionPage to Page

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Finish service tests

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add DB tests

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add API tests

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add more API tests

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove Things dependency

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add API docs

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add docs

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix Things references

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix AuthN typo

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix linter warnings

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add license comments

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix test order

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Use service error for wrappers

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix repo setup test

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Use total const in tests

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Use constant contacts

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix code formatting

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Rename notifier implementation

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Rename Notify to Notifiers

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Resolve remarks

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix naming and docs

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix docker-compose

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Rename Subscriptions to Notifiers service

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix logging

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix formatting and typo

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Resolve remarks

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix topic request

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-02-01 14:08:10 +01:00
Manuel Imperiale 8c87ee8328
NOISSUE - Revert cli to use user token from command args (#1339)
* NOISSUE - Revert cli to use user token from command args

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove CLI binary

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add offset, limit, name and rawOutput to config file

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert cli.ParseConfig()

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Check config values before to use them

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-01-28 11:29:32 +01:00
Dušan Borovčanin 5cfc9305e5
Make Transformer type configurable (#1331)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-01-20 13:10:40 +01:00
Manuel Imperiale 0f856f5667
NOISSUE - Rename package aliases uuidProvider into uuid (#1323)
* NOISSUE - Rename pkg aliases uuidProvider into uuid and fix authn typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add missing error checks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use global uuidProvider

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use expTime globally

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix user uuid provider

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix review

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use idProvider name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use idProvider instead of uuidProvider

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use idProvider instead of uuidProvider

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-01-17 23:12:45 +01:00
Ivan Milošević 0516fe2fd7
MF-1034 - Wrapping MQTT client (#1318)
* use subscribe interface

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* delete old implementation

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* add subscribeToLoRaBroker method
change declaration

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove alias for package

Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-01-15 23:22:18 +01:00
Dušan Borovčanin 6b7dc54c8b
NOISSUE - Switch to Consumers interface (#1316)
* Replace Writer with Consumer

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add Notifications package

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update Consumer Start

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix Readers

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix Consumer naming

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add repo to Notify

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove notify

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Rename consumer field in middlewares

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix remarks and add Readme

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-01-11 23:55:34 +01:00
Manuel Imperiale ac09815457
NOISSUE - Fix Auth typo (#1319)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-01-11 10:00:13 +01:00
Ivan Milošević 3eca6920e1
NOISSUE - Add health check for MQTT broker (#1305)
* Add health check

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* update readme
use constants

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* close body after each HEAD request

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* log and close health check response body

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* use healthcheck endpoint instead ping for docker healthcheck

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove for loop, only one check and exit if failed healthcheck

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* changed cmd for healthcheck
new version of verne image

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* use false instead exit 1

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* return for loop

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* review

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* add continue after unsuccesful http.get

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Use backoff package

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* extracting healtcheck function outside main()

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* go mod vendor

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* go mod tidy

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* go mod vendor

Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-01-05 19:45:09 +01:00
Dušan Borovčanin e326494166
MF-1264 - Add support for JSON readers (#1295)
* MF-1254 - Create universal JSON writer (#1260)

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add JSON support to Readers

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix Influx Reader tests

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix messages format query

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix Postgres reader

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix Cassandra Readers and writers

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix Mongo reader

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Extract utility method to the JSON transformer

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix Influx and Postgres count

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update JSON transformer

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix Influxdb Reader total count

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Refactor init.go for Cassandra writer

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Create a Payload type

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add comments for defaults

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix variable declarations

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Replace interface{} with a new type

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Don't set channel just to overwrite it later

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix range search

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Rename Messages field

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

Co-authored-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-12-30 15:43:04 +01:00
Mirko Teodorovic 47217cb5b9
NOISSUE - Merge authz and authn into new service auth (#1313)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move authz into authn and merge into new service

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add groups endpoints

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add group type

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding mocks, some renaming, refactor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update proto

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding mocks, some renaming, refactor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix linter err,and comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* undo renaming, add interface for authn and authz

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renam some variables

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove extra slashes from comment

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolving small remarks

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-12-29 23:02:35 +01:00
Mirko Teodorovic fbba7aaa1a
MF-1248 - Add access policies for users (#1246)
* authz service init

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* authz service init

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add proto

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add proto

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* authorize method

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add casbib

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add casbib

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add casbib

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add policy grpc

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add policy grpc

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix db connection, add environment variables, docker-compose

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add model.conf policy

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add model.conf policy

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding tests, and token for auth

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix auth service

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small changes, add model conf env var

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove users grpc for now

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix error

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* some cosmetics

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolvin minor comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change endpoint, add file to fix test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix docker env

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix alignment and path for model.conf

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-12-08 17:04:09 +01:00
Mirko Teodorovic 7195cad0f6
MF-397 - Introduce Thing Groups (#1259)
* add things group

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add things group repository

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add things group repository

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add things group repository

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add parents and children methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add parents and children methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix logging message and temporary test fix

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix bootstrap test fail

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move groups to pkg

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move groups to pkg

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move groups to pkg

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move groups to internal

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move groups to internal

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix import

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix linter errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments, add hierarchy info when retrieving groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* code refactor, separate http into multiple files

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* code refactor, separate http into multiple files

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix group update

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* use user id when saving

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* use user id when saving

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move code

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move code

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove temporary test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add groups test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comments, fix responses in api for groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add checks for name length

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

fix validation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

small change to response

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add comment for Level

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add level to limit hierarchy retrieval

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

tidy vendor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add level to limit hierarchy retrieval

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

mod tidy

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

revert

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

small naming and code organize refactor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

revert Member type

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

fix typo

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

use ltree

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

use ltree

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add level for retrieving

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add level

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add ltre

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

upgrade postgres version in test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add ltre

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

remove test for now

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

minor fixes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

fix id setting

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

fix tree endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

minor style changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small changes, adding new lines

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change function signature

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change primary key

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change function signature

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* simplufy code

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove groups test for now

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix tabulation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix whitespace

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove white space, fix grammar

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix sqls so that not additional retrieve is needed

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix sqls so that not additional retrieve is needed

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

fix primary key

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

remove retrive by name

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove name and parent update

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix cound sql

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add line

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* simplify sql, fix table name

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add date

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add date

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add timestamp to api

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix var name

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix var name

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-11-23 11:34:29 +01:00
João Matos 3273c30d8b
MF-1268 - CLI improvements (#1274)
* Prefix error messages in CLI with a bold "error: ".

Signed-off-by: Joao Matos <joao@tritao.eu>

* Remove duplicated "Usage: " from groups command help.

Signed-off-by: Joao Matos <joao@tritao.eu>

* Add a raw output mode for CLI and use it on logCreated.

Signed-off-by: Joao Matos <joao@tritao.eu>

* Add CLI global flag for user auth token.

Signed-off-by: Joao Matos <joao@tritao.eu>

* Add CLI config flag and parsing logic.

Signed-off-by: Joao Matos <joao@tritao.eu>

* Refactor CLI users commands outside array structure.

Signed-off-by: Joao Matos <joao@tritao.eu>

* Refactor CLI certificates commands using flags.

Signed-off-by: Joao Matos <joao@tritao.eu>

* Refactor CLI things create command using flags.

Signed-off-by: Joao Matos <joao@tritao.eu>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2020-11-01 00:29:06 +01:00
Manuel Imperiale 420b598ac7
NOISSUE - Rm users http package (#1256)
* NOISSUE - Mv users http gokit layers to http package

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove users/api/http dir

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-10-16 18:00:24 +02:00
Ivan Milošević bc41c32cf5
update mproxy version (#1251)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-10-09 01:55:09 +02:00
Mirko Teodorovic 8ea26c5ab7
NOISSUE - Add user groups (#1228)
* adding group

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding user group

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding group

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add retrieve methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default admin user

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default admin user

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding endpoints

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding endpoints

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* changes signature for AssignUser

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* bug fixing retrieving groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove unused code

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* bug fixing retrieving groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* retrieve groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change environment for admin

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change environment for admin

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* retrieve groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove adding default group

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* expose port for debugging purposes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix tests, and linter errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add prefix Users for groups endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix linter problems

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix endpoint prefix url

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix endpoint test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add group features in cli

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove println

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* when user is created return id in response

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* when user is created return id in response

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding default admin env

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* proper alignment

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* proper alignment

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename  method

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* return user id when created

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* return user id when created

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove unused variable

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix to retrieve whole tree starting from parent

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add endpoint to list groups for user

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add readme for groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fixing bugs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fixing bugs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add group commands for add and remove user

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* replace default email, use example.com

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix capital letters beginning of sentence

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove warning for deprecated api, mistakenly copied

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* simplify repo methods, rely on db driver rather than the check before operation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* check if group is valid

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* openapi spec 3.0

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove check for existing users in groups before delete

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change func signature

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change func signature

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix bugs, resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix bugs, resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix alignment

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add missing command

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize envs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix doc

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix compile

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize cli commands

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor corrections

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix naming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments, minor changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-09-23 23:18:53 +02:00
Dušan Borovčanin f10e49e6b5
MF-928 - Change CoAP lib (#1233)
* Switch CoAP lib

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Revert removed adapter code

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* WIP CoAP refactor

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add auth key

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix observers map

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix reading message body

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix subtopic parsing

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix error handling

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix multi-protocol communication

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Separate client from observer

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove unused config

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove TCP option

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Inline error check

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add logging client errors

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Replace RWMutex since we're not using RLock

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Inline error handling

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Inline error handling

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2020-09-22 11:59:10 +02:00
Mirko Teodorovic 3694a82de6
NOISSUE - Fix certs update in bootstrap config and make content handling in config.toml user friendly (#1221)
* adding certificate issuing

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add certs update

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix minor comments, default env vars, add agent and export config into config.toml for provision

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* simplify check

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-07-29 14:20:43 +02:00
Mirko Teodorovic b91024465c
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 12:53:21 +02:00
Mirko Teodorovic 381a15a695
MF-1025 - timeout env in sec, use parseduration (#1206)
* timeout env in sec, use parsduration

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* timeout env in sec, use parsduration

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename var

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-06-08 18:17:16 +02:00
Manuel Imperiale a7b81dc37a
MF-1201 - Fix MF_THINGS_AUTH_GRPC_URL mongo reader ENVAR (#1203)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-06-05 17:39:22 +02:00
Darko Draskovic 340e685d70
MF-1180 - Add redis based twins and states cache (#1184)
* Add twins redis cache

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add connectToRedis to twins main and twinCache to twins service

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add tracing to twins cache

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add twins cache mock and test setup for redis cache

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add TestTwinSave to redis twins cache tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add remove twin redis cache test

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add channels param to CreateDefinition helper method in mocks

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add IDs test to redis twins cache

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Simplify senml rec array and attribute creation funcs by removing unnecessary params

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Align cache remove twin method with service remove twin method

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add cache funcs to twins save, update and remove

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add def SaveIDs to redis cache and ref to service SaveStates

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add TwinSaveIDs tests for redis cache

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add cache related env vars desc to README.md

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add twinid bson key constant

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add Update method to cache

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Integrate uuid unification related changes

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Use named arguments in interface method declarations

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add env vars to docker-compose file

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Make parameter names in interface methods and implementations consistent

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Wrap vars and consts in var and const blocks

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-06-05 11:42:16 +02:00
Ivan Milošević 7f3e2c1b21
NOISSUE - Fix default db name for storage databases (#1194)
* Fix db name in influxdb

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Align db name and namespace from .env with default values  in mongodb and cassandra also

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Rename databases' names to mainflux

Signed-off-by: Ivan Milošević <iva@blokovi.com>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2020-06-03 20:33:52 +02:00
Manuel Imperiale a7c3cfcf1c
MF-1154 - Move UUID provider to project root (#1172)
* MF-1154 - Move UUID provider to project root

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use naming uuidProvider/up instead of identityProvider/idp

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Mutualize UUID mocks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Move uuid into pkg directory

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-06-03 18:49:44 +02:00
Dušan Borovčanin ea3a891c91
MF-1190 - Add pkg for library packages (#1191)
* Move messaging to pkg

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Move errors to pkg

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Move Transformers to pkg

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Move SDK to pkg

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove Transformers from root

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix make proto

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add copyrights header

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix CI

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Move Auth client to pkg

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix dependencies

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update dependencies and vendors

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix CI

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2020-06-03 15:16:19 +02:00
Dušan Borovčanin c26c7f34cd
MF-1177 - Implement caching in MQTT adapter (#1187)
* Add auth cache to MQTT adapter

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove unused fields from MQTT adapter

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix removal from Things cache bug

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Use Auth cache naming

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Parse duration instead of int

This is more convenient because duration contains unit.

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove commented code

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove unused environment variables

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update README.md

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove unused code

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix Things mocks

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix README timeouts

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove WS Scheme

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove address from the mProxy target

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2020-06-02 21:21:30 +02:00
Darko Draskovic 877005538c
MF-994 - Add tracing middleware for twins and states repos (#1181)
* Add tracing for twin repository

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add state repository tracer

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove unused tracer meant for NATS publisher

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-05-21 13:06:31 +02:00
Dušan Borovčanin b8be18129c
MF-1079 - Add MQTT forwarder (#1164)
* Add MQTT forwarder

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Cleanup forwarder code

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use MQTT Publisher in MQTT forwarder

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Cleanup MQTT messaging

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add Paho client timeout errors

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Simplify MQTT fowarder

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix naming in main method

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use interface and struct instead of function

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use Mainflux errors package

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename `tkn` to `token`

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use "/" instead of "." as topic separator

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use async MQTT Publisher

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix timeout errors messages

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add connect token check

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename package alias

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-05-07 09:34:09 +02:00
Mirko Teodorovic f9432c6525
MF-1159 - add gateway metadata update in provision method (#1160)
* provision fix

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update config

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix naming, Boostrap to Bootstrap

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add name as param

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add name as param

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix typo, and remove some props

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add name as param

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add name as param

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix typo

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix typo

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor service

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* improve gateway provision

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert content

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change docs, and error in service

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change docs, and error in service

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-05-06 16:53:32 +02:00
Mirko Teodorovic bf189fbd23
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 00:39:23 +02:00
Dušan Borovčanin c3019fffb6
NOISSUE - Refactor messaging (#1141)
* Refactor messaging

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename SubscribeHandler to MessageHandler

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove `Auth` event logs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update message pubsub APi

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix topics handling

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update CoAP adapter

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update Twins service

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update LoRa adapter

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update OPC UA adapter

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove broker package

Package `broker` is conceptually renamed to package `nats`.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update makefile

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add comment explanation

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix MQTT adapter

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix typo

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Move NATS pub/sub implementation to pubsub pkg

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove an empty line in main methods

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Move messaging-related code to messaging package

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix Twins mocks

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Change Occurred back to Created

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix tranformer test

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix message proto commands

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Replace string literal with constant

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove alias from main method

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Change messaging pubsub alias

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename occured to created

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Handle NATS connection in the NATS PubSub

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename n to pub/pubSub

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix typos

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-28 11:02:35 +02:00
Dušan Borovčanin cb3b70d567
NOISSUE - Update mProxy version (#1137)
* Use Events interface in MQTT adapter

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Switch to the new version of mProxy

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update vendor

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update mProxy version

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-22 20:41:51 +02:00
Manuel Imperiale 7a18d3fa56
MF-1088 - Remove message payload content type (#1121)
* MF-1088 - Remove message payload content type

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add default contentFormat

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-21 19:33:11 +02:00
Dušan Borovčanin 88fa724fc3
MF-1123 - Move Provision service to monorepo (#1132)
* Add provision service

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix Provision service initial version

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-21 16:05:11 +02:00
Manuel Imperiale 01aa4190c5
MF-1087 - Remove WebSocket adapter (#1120)
* MF-1087 - Remove WebSocket adapter

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm all ws directory

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert authorization.js

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove /ws endpoint from ssl/authorization.js

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm gorilla from vendor

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert gorilla to vendor

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-17 13:16:21 +02:00
Manuel Imperiale 4c970a8079
MF-862 - Add boostrap CRUD to SDK and CLI (#1114)
* MF-862 - Add boostrap CRUD to SDK and CLI

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert ReaderPrefix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-15 17:38:20 +02:00
Ivan Milošević 537d73d0c6
Fix prometheus namespace in postgres reader & writer (#1109)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-04-13 14:01:59 +02:00
Ivan Milošević 880e193b0a
NOISSUE - Implement errors package in senml transformer, readers and writers (#1108)
* Implement errors package in senml transformer, readers and writers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove unused const
Return wrapped error in postgres writer

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix default db host in postgres writer

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix capital letters in errors messages

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* use svcName instead of postgres for Promethius initialization

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-04-13 12:57:53 +02:00
Manuel Imperiale 6c39c85cc8
MF-1096 - Fix AuthN and Things Auth ENVARS (#1066)
* NOISSUE - Fix AuthN and Things Auth ENVARS

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add DB envars to env.go

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix envars

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add DefLogLLevelError

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix DB names

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix DB names

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix DB names and HTTP ports

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix .env

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert writers DB names

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm unused Twins envars

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove definitions from env.go

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert HTTP gRPC ports

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use default NATS URL as string

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert default ports

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix cassandra ENVARS

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix cassandra reader ENVARS

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix readers and writers envars

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix readers and writers .env

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-07 12:02:17 +02:00
Manuel Imperiale fff492bd50
NOISSUE - Create broker package for NATS (#1080)
* NOISSUEE - Create broker package for NATS

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Create funcs to return NATS connection

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* mv os.exit to main

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix Reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix tests and typos

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix CI

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Unify Publisher and Subscriber interfaces

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename Nats interface

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Mv message.pb.go, messsage.proto and topics.go to broker directory

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix go.mod

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use mainflux broker for writers and twins services

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix go.mod

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix twins tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix make proto

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix message.proto

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix golangcibot

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* regenerate message.pb.go

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix make proto

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add NATS errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-01 21:22:13 +02:00