Commit Graph

432 Commits

Author SHA1 Message Date
Dejan Mijić 1bc4dc9575
NOISSUE - Add MQTT build steps into Makefile (#267) 2018-05-11 01:13:33 +02:00
Dejan Mijić bca3d0774f
MF-201 - Replace ORM with SQL (#265) 2018-05-11 01:00:10 +02:00
Aleksandar Novaković 816c172823 MF-164 - Split manager service (#266) 2018-05-10 23:53:25 +02:00
Dušan Borovčanin 6a361209c8 NOISSUE - Automate Dashflux container deployment (#261) 2018-05-10 10:39:48 +02:00
Dušan Borovčanin 27e1be23f5 NOISSUE - Integrate MQTT adapter to monorepo (#260) 2018-05-09 14:22:03 +02:00
Dušan Borovčanin c9bf245010 NOISSUE - Update CoAP docs (#257) 2018-05-09 12:56:20 +02:00
Dušan Borovčanin ff30957614 MF-244 - Integrate Dashflux (#258) 2018-05-09 12:32:49 +02:00
Dušan Borovčanin db6165aa6b MF-168 - Refactor CoAP adapter (#186) 2018-05-08 16:00:25 +02:00
Aleksandar Novaković c088e664c3 NOISSUE - Fix run and compile commands in README files (#249) 2018-05-02 09:41:21 +02:00
Dejan Mijić d499068e43
Update protobuf to 1.1.0 (#251) 2018-05-02 08:49:39 +02:00
Dušan Borovčanin 38d4c3fcea MF-136 - Setup staging and test environments (#226) 2018-04-30 13:32:38 +02:00
Aleksandar Novaković aea7db14b7 NOISSUE - Raise code coverage in ws adapter (#242)
* 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>
2018-04-24 13:56:13 +02:00
Aleksandar Novaković 58f3c735a0 NOISSUE - Fix Content-Type in examples (#243)
* Update content-type header in load tests

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>

* Remove charset from content type header in documentation

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2018-04-24 13:42:36 +02:00
Dušan Borovčanin 789963447a Add service name to version response (#241)
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
2018-04-24 13:39:15 +02:00
Dušan Borovčanin 2dc7f3eea1 NOISSUE - Raise endpoint test coverage (#240)
Ramove unnecessary checks from decodeList.
Cover some edge cases and fix decodeList to always return same error.

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
2018-04-23 15:17:30 +02:00
Aleksandar Novaković 62297fedec MF-134 - Evaluate system's performance (#225)
* Add initial load tests

Add initial load tests for client creation and message publishing.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>

* Make load tests executable as stand-alone application

Move code from test to main. Make code runnable with sbt run command.
Remove unnecessary config files.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>

* Add native packager support

Add native packager plugin. Update sbt config to support native
packager. Update paths in Engine.scala.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>

* Move files back to test folder and remove native packager support

Remove nativa packager plugin. Add gatling plugin and move files to
test folder where they belong. Read vars from JAVA_OPTS instead of
environment variables.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>

* Add readme file for load tests

Add readme file for load tests with usage instructions.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>

* Add number of requests per second as test parameter

Add number of requests per second as parameter. Update read me according
to this addition.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>

* Add load test section in docs

Create documentation skeleton for load tests.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>

* Reformat logger config file

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>

* Update documentation skeleton

Move results section to scenarios. Move test environment to intro.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>

* Align test version with mainflux version

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>

* Update mainflux version to 0.2.2

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2018-04-23 15:13:43 +02:00
Dejan Mijić f449f8b9c8
NOISSUE - Fix Content-Type header check (#238)
* Remove charset from required content type

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Bump version to 0.2.1

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Move constant to transport.go

Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2018-04-22 16:48:06 +02:00
Dejan Mijić 544ba57850
NOISSUE - Ignore logging & metrics for code coverage (#233)
Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2018-04-19 13:40:22 +02:00
Dejan Mijić e858e86ed9 NOISSUE - Fix paging (#232)
* Fix docs errors

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Fix edge case for limit check

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Explain limit value

Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2018-04-18 23:06:11 +02:00
Dušan Borovčanin 84679ed42a MF-200 - Enable pagination of result sets (#227)
* Add pagination to clients and channels endpoints

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>

* Refactor code

Change method signature and rename Bulk methods back to All.

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>

* Rename transport_test.go to endpoint_test.go

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>

* Fix manager tests to support pagination

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>

* Add default offset and limit support

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>

* Update docs

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>

* Update tests to support pagination

- Move maxLimitSize checking to request validation.
- Add tests to support pagination.

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>

* Fix handling query params for pagination

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>

* Fix empty result set

Return empty results if invalid offset and limit is passed to channel and client repository.
Update tests accordingly.

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>

* Update manager API docs

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>

* Fix response to invalid limit query param

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>

* Remove offset and limmit checks in repository methods

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
2018-04-18 22:36:24 +02:00
Aleksandar Novaković b0610f034c Fix http publish example in docs (#231)
Fix http publish example in docs. Fix docker-compose example in docs
and README.md.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2018-04-18 16:49:10 +02:00
Dejan Mijić cb9c0ee32a Specify targets for releasing docker containers (#230)
New targets will allow Makefile to be used as primary option for
releasing docker containers, both as 'latest' and versioned.

Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2018-04-18 14:13:38 +02:00
Aleksandar Novaković 3a5f4395e4 MF-171 - Extract websocket adapter as separate service (#188)
* 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>
2018-04-18 13:09:01 +02:00
Aleksandar Novaković 36a00f3464 Update project documentation with example requests and responses (#220)
Update documentation with example requests and responses in accordance
with new API changes. Add detailed flow explanation. Update readme with
valid snippet.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2018-04-11 14:30:37 +02:00
Aleksandar Novaković 703d0543af Add HTTP adapter API test (#224)
Add HTTP adapter API tests. Fix Manager API tests.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2018-04-11 14:29:04 +02:00
Aleksandar Novaković fb3619645d Add channel Id validation (#223)
Add channel id validation and remove unnecessary error. Update
swagger doc accordingly.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2018-04-11 13:48:09 +02:00
Dejan Mijić 46a9cc086d Remove unhandled missing key error (#222)
Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2018-04-11 11:44:15 +02:00
Dejan Mijić 367d3edbef Set JWT provider secret (#221)
Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2018-04-10 17:30:13 +02:00
Dejan Mijić d5b913d432 MF-199 - Create documentation skeleton (#218)
* Copy basic docs contents to the main repo

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Include licensing and contributing info to docs

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Create documentation skeleton

Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2018-04-08 23:03:12 +02:00
Aleksandar Novaković 2dace5564f MF-170 - Add manager API unit tests (#211)
* Fix connection request validation and EOF error handling

Fix validation of connection and client id in connection request.
Fix EOF error handling by returning HTTP status Bad Request.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>

* Add manager API tests and update swagger

Implement unit tests for every manager API endpoint. Update client
and connection mock implementations by switching to UUIDs. Update
swagger file with correct status codes.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>

* Add content type check and update documentation

Add content type check in implementation and update documentation
accordingly. Refactor tests and add empty content type test cases.
Add code coverage badge to readme.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2018-04-08 22:57:56 +02:00
Aleksandar Novaković 88b30626dd MF-174 - Add logger interface and go-kit logger implementation (#212)
* Add logger interface and go-kit logger implementation

Add wrapper logger interface and wrap go-kit logger in it. Add
tests for info, warn, error and log methods. Add log filtering by
level.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>

* Refactor logger and replace go-kit logger with wrapper

Replace go-kit logger from services with logger wrapper. Refactor
code in logger wrapper. Remove unnecessary subpackage, methods and
log levels.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2018-04-04 10:15:23 +02:00
Drasko DRASKOVIC 301d855015
Add CA cert (#215)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-04-04 02:29:29 +02:00
Dušan Borovčanin 7a193829f4 MF-139 - Expose metrics from all services (#213)
* Expose metrics from normalizer service

Add service interface in order to expose method to be monitored.

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>

* Refactor normalizer

Add metrics to normalizer service without exporting its internals.

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
2018-04-03 20:25:49 +02:00
Dejan Mijić 523716b090 Rename NATS subjects for HTTP & normalizer (#207)
* Change NATS subject name

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Change normalizer subscription name

Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2018-03-22 23:59:15 +01:00
Dejan Mijić 36ca9015ff Handle wrong type unmarshalling (#206)
* Update the contributing guide

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Handle wrong type unmarshalling

Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2018-03-22 23:53:43 +01:00
Drasko DRASKOVIC a6dfc26959 Simplify Makefile (#205)
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2018-03-22 13:10:11 +01:00
Dušan Borovčanin 924f6f120a Fix blinker tests (#193)
* Fix blinker tests

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>

* Add protobuf generated files to .gitignore

Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
2018-03-20 09:14:54 +01:00
Drasko DRASKOVIC 2c1c94af9b
Fix #195 (#196)
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2018-03-20 00:09:44 +01:00
Dejan Mijić f5fbd6f22a Add protobuf (#192)
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2018-03-19 10:14:43 +01:00
Aleksandar Novaković 55bdc029c3 Add service startup message (#190)
* Add service startup message

Add startup message to manager, http, coap and normalizer services.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>

* Remove startup message from CoAP adapter

Remove startup message from CoAP adapter. Remove overhead startup
message variable.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2018-03-18 13:54:54 +01:00
Dejan Mijić e42d422410 Fix golint warnings (#189)
* Fix goling warnings

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Bump version to 0.1.2

Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2018-03-16 14:06:12 +01:00
Nikola Marčetić bf5d1544b6 Fixed docker composition (#187)
Signed-off-by: nmarcetic <n.marcetic86@gmail.com>
2018-03-16 13:52:51 +01:00
Max Peng 8876acbfec Fix docker compose failing start issue (#185)
* Fix docker compose failing start issue

* Delete unused code

* Fix nginx config issue
2018-03-16 09:59:13 +01:00
anovakovic01 250505700b Fix normalizer output queue (#184)
Fix normalizer output queue by changing subject to normalized.
Version updated from 0.1.0 to 0.1.1.

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2018-03-15 14:23:20 +01:00
Drasko DRASKOVIC 5cb169f7f8 Add Makefile and ARM support (#178)
* Add Makefile and ARM support

Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>

* Add Docker build

Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2018-03-13 09:26:59 +01:00
Dejan Mijić ccd8965d6f Use PostgreSQL as primary persistence solution (#175)
* Use normalizer as stream source

Renamed 'writer' service to 'normalizer' and dropped Cassandra
facilities from it. Extracted the common dependencies to 'mainflux'
package for easier sharing. Fixed the API docs and unified environment
variables.

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Use docker build arguments to specify build

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Remove cassandra libraries

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Update go-kit version to 0.6.0

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Fix manager configuration

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Refactor docker-compose

Merged individual compose files and dropped external links. Remove CoAP
container since it is not referenced from NginX config at the moment.
Update port mapping in compose and nginx.conf. Dropped bin scripts.
Updated service documentation.

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Drop content-type check

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Implement users data access layer in PostgreSQL

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Bump version to 0.1.0

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Use go-kit logger everywhere (except CoAP)

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Improve factory methods naming

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Implement clients data access layer on PostgreSQL

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Make tests stateless

All tests are refactored to use map-based table-driven tests. No
cross-tests dependencies is present anymore.

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Remove gitignore

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Fix nginx proxying

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Mark client-user FK explicit

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Update API documentation

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Update channel model

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Add channel PostgreSQL repository tests

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Implement PostgreSQL channels DAO

Replaced update queries with raw SQL. Explicitly defined M2M table due
to difficulties of ensuring the referential integrity through GORM.

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Expose connection endpoints

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Fix swagger docs and remove DB logging

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Fix nested query remarks

Signed-off-by: Dejan Mijic <dejan@mainflux.com>

* Add unique indices

Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2018-03-11 18:06:01 +01:00
Drasko DRASKOVIC b23ecb64e5
Merge pull request #167 from mainflux/coap
Update CoAP README
2018-02-17 16:15:26 +01:00
Drasko DRASKOVIC 03b020ae87 Update CoAP README
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2018-02-17 16:14:28 +01:00
Drasko DRASKOVIC 255d1c03b1
Merge pull request #162 from chombium/mainflux-161
replaced glide with dep dependency manager
2018-02-14 22:23:58 +01:00
Jovan Kostovski 7fe8100d6b replaced glide with dep dependency manager
Signed-off-by: Jovan Kostovski <chombium@gmail.com>
2018-02-14 18:28:42 +01:00