Commit Graph

7 Commits

Author SHA1 Message Date
Zoran Rebic 933b5dedce
MF-1197 - Add MQTT adapter tests (#1622)
* MF-1197 - add mqtt tests

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - add test cases

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - refactor tests

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Fix test names.Add const

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add mocks. Add publish test

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add buffer to logger

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add redis mock.Change logger error

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add new test cases

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Fix session fields

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Fix bad logs. Fix tests

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add new test case.Fix names.

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Fix test name

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Refactoring tests

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Wrap errors

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Wrap errors. Fix logs level

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Wrap errors.

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Fix var names

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-888 - Add clientID err check.Refactor tests

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Fix info and err names

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Remove redundant log and channel parts check

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Revert channel parts check

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add authorize test case

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Remove unused var

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Change var name

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 -Add missing test case.Change var name

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 -Add err case.

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 -Change var name

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Use logMsg for all logs

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Use logs instead of errors

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Use redis mock

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Return interface in constructor

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add missing test cases. Create consts

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add global vars

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Refactor code

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Remove unused var

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Remove unnecessary var

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Use created session client

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Refactor vars

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Separate constant

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>
2022-11-21 14:40:19 +01:00
Manuel Imperiale 9e0947a355
MF-1261 - Use StatusUnauthorized for authn and StatusForbidden for authz (#1538)
* MF-1261 - Use StatusUnauthorized for authn and StatusForbidden for authz

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

* ErrExternalKey typo

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

* Rename ErrUnauthorizedAcces -> ErrAuthentication

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

* Fix bootstrap error

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

* Fix status code in openapi

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

* Fix test description

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

* Fix test description

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

* Fix test description

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

* Add errors cases

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

* Fix status codes

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

* Add gRPC stutus code

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

* Fix tests description

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

* Fix openapi and encodeError

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

* Fix grpc message

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

* Fix test descriptions

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

* Revert sdk error

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

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-02-01 17:33:23 +01:00
Manuel Imperiale 6ad654d7cb
MF-1263 - Move repeating errors to the separate package (#1540)
* MF-1263 - Mv duplicated errors to pkg/errors

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

* Revert test build flags

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

* Fix merge

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

* Fix comment

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

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-01-27 17:03:57 +01:00
Dušan Borovčanin 516c02bebe
MF-1378 - Update dependencies (#1379)
* Update dependencies

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

* Fix compose files and configs

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

* Upgrade image versions

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

* Update Postgres version

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

* Update test dependencies

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

* Fix fkey error handling

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-05-20 20:53:56 +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
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