* 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>
* Change CanAccess to CanAccessByKey for things
Signed-off-by: Nick Neisen <nwneisen@gmail.com>
* Change CanAccess in remaining occurances
Signed-off-by: Nick Neisen <nwneisen@gmail.com>
* Regenerate generated files
Signed-off-by: Nick Neisen <nwneisen@gmail.com>
* Generate pb.go files with protoc 3.6.1
Signed-off-by: Nick Neisen <nwneisen@gmail.com>
* Add open tracing dependencies
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add open tracing to users service
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add open tracing to the things service
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add open tracing to the http adapter
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add open tracing to the ws adapter
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add open tracing to the CoAP adapter
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update LoRa adapter in accordance with changes
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update SDK tests in accordance with changes
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update bootstrap service in accordance with changes
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update reader services with accordance with changes
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update .env and docker-compose file
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add jaeger and timeout env vars
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Fix broken test for can access by id endpoint
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update deps with proto empty package
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add can access by things ID endpoint to things service
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add new auth endpoint to the swagger docs
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add test for the new endpoint of the things service
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Commit for mainflux-596
Modified and tested:
- cli
- http
- mqtt
- normalizer
- all readers
- sdk messages
- all writers
- ws
Missing:
- coap
- lora
Signed-off-by: ale <ale@metaverso.org>
* - fix subtopic name in, when starting with dot, http/ws/mqtt
- add some test on readers
Signed-off-by: ale <ale@metaverso.org>
* - fix string concatenation
- update http/transport regexp to match subtopic names with only \w-
- update ws/transport regexp like http ones with also the wildcard * and >
Signed-off-by: ale <ale@metaverso.org>
* added subtopic support to coap adapter
Signed-off-by: ale <ale@metaverso.org>
* - update replace functions with replaceall when needed
- renamed getDestChannel to fmtSubject
- update api/transport and ws/transport route to be more readable
- fix mqtt syntax
- renamed func andQuery to query as suggested by @anovakovic01
- have a nice we :)
Signed-off-by: ale <ale@metaverso.org>
* - fix error declaration on ws/nat/publisher
- fix regexp added missing allowed chars - and _ on coap/api/transport
- fix subtopic clean suffix / if present on coap/api/transport
- improve regexp on http and ws /api/transport, now does not accept url that do not strictly match
- add some ws subtopic tests
Signed-off-by: ale <ale@metaverso.org>
* - enabled wildcard chars on coap/api/transport
- allow use special chars on http and ws api/transport
Signed-off-by: ale <ale@metaverso.org>
* - use strings.Replace() insted ReplaceAll()
Signed-off-by: ale <ale@metaverso.org>
* - allow every chars on subtopics
- fix replace error on mqtt
Signed-off-by: ale <ale@metaverso.org>
* fix cassandra test
Signed-off-by: ale <ale@metaverso.org>
* fix ws test with invalid subtopic
Signed-off-by: ale <ale@metaverso.org>
* fix invalid GOCACHE in go1.12, replaced by -count 1, see https://golang.org/doc/go1.10#test
Signed-off-by: ale <ale@metaverso.org>
* - improve regexp on http/ws api/transport
- minor changes
Signed-off-by: ale <ale@metaverso.org>
* - add generic function parseSubtopic on ws/http adapters
Signed-off-by: ale <ale@metaverso.org>
* - add generic function fmtSubtopic on coap adapter
Signed-off-by: ale <ale@metaverso.org>
* Update increment ID to UUID in things service
Update increment ID to UUID for things and channels in things
service and proto files. Also, update ID type from uint to string.
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in http adapter
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in ws adapter
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in CoAP adapter
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in normalizer service
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in writer services
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in reader services
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in SDK
Update increment ID to UUID in SDK. Update id type to string.
Update tests.
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update increment ID to UUID in mqtt adapter
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Remove unnecessary case from influxdb reader
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update tests in order to increase code coverage
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update lora adapter to use string ID instead of unsigned int
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
* Update WS tests
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Use require in all writer tests
Refactor code.
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Ignore Mainflux generated pb.go files
Ignore *.pb.go files generated by Mainflux, but don't ignore vendored generated code.
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Return an exported ErrNotFound instead of the unexported one
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Update mocks to match the actual behaviour
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Update mocks error message
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Add auth service unavailable error test
Since this error is caused by gRPC server returning codes.Internal,
this behaviour is simulated using specific token. When that token is
passed as an auth header, the mock gRPC client returns aforementioned error.
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Use require package for postgres tests
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Remove redundant error checks in tests
Refactor tests.
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Rename error flag token
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
* Fix failed subscription handling in ws adapter
Fix unsubscribing bug in ws adapter.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add subscription fail and publish fail test cases
Update mock implementation to receive publish error in order to
support these test cases.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update mainflux version to 0.2.3
Update project version and load tests version to 0.2.3.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update version endpoint response format
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add websocket adapter
Add websocket adapter with basic logging and metrics middleware.
Add publish and subscribe to NATS subjects using websocket.
Add websocket handshake authorization over mainflux manager.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add test for websocket publish
Add test for websocket adapter's publish method. Add dependecy
injected logger to adapter. Remove unnecessary manager client
dependency from adapter.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add websocket library in dependencies
Add gorilla/websocket dependency in dep toml and lock file.
Add dependency in vendor dir.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add direct websocket connection
Add direct websocket connection. While messages are still beeing
published over NATS, they are not received over src.ws subject
in WebSocket adapter. Instead messages are sent directly over
websocket connection.
Add swagger file for WebSocket handshake endpoint. Update ReadMe
to reference new swagger file.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Refactore websocket adapter code
Extract listen part from handshake. Update WebSocket adapter code.
Fix subscribe to NATS subject, so that it is independent from other
adapters. Remove message base64 encoding from response..
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Remove connection management from websocket adapter
Align notion of channel with NATS topic. Remove connection
management from adapter logic. Add log messages to adapter's
transport layer.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update NATS subjects and add subscriber interface
Update NATS subject name to channel.<channel_id>. Add and implement
subscriber interface. Implement subscriber interface in adapter.
Update readme to use new make <service_name> command. Refactor code.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add basic tests for broadcast and subscribe
Improve mock implementation of NATS pubsub. Add multiple basic test
cases for broadcast and subscribe methods. Add logging for subscribe.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add listen method test
Add listen method test and refactor existing tests. Refactor listen
method in adapter.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Move broadcast method to message broker interface
Refactor broadcast method to receive send message callback and message
that needs to be sent. Update tests accordingly.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update pubsub API
Remove listen method from public API. Move listen call to subscribe
implementation. Update domain pubsub API in project root.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add connection error handlers to adapter API
Update publish and subscribe API to receive connection error handler.
Update tests accordingly. Handle NATS connection error.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update logs
Replace go-kit logger with custom mainflux logger. Update log messages
where needed..
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Refactor web socket adapter
Remove MessagePubSub interface. Remove unnecessary callbacks. Add
channels to web socket adapter implementation.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add API layer tests
Update existing tests and add API layer tests.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Update docs with web socket related data
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Refactor web socket adapter
Update subscription struct, and refactor listen and broadcast methods.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Add version and metrics endpoint to ws adapter
Update version to 0.2.0.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Fix race condition bug in ws adapter test
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
* Rename listen to broadcast and broadcast to listen
Switch names between listen and broadcast methods. Move channel
structure to service.go.
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>