87 Commits

Author SHA1 Message Date
Nataly Musilah 8203666e58 NOISSUE - Update READMEs (#380)
* fix web url

Signed-off-by: Musilah <nataleigh.nk@gmail.com>

* add new readmes

Signed-off-by: Musilah <nataleigh.nk@gmail.com>

* add other services

Signed-off-by: Musilah <nataleigh.nk@gmail.com>

* fix docker link

Signed-off-by: Musilah <nataleigh.nk@gmail.com>

* fix reports examples

Signed-off-by: Musilah <nataleigh.nk@gmail.com>

* revert go.sum change

Signed-off-by: Musilah <nataleigh.nk@gmail.com>

---------

Signed-off-by: Musilah <nataleigh.nk@gmail.com>
2026-01-22 14:16:52 +01:00
Arvindh 67180a55f7 NOISSUE - Update Errors (#374)
* update MG errors

Signed-off-by: Arvindh <arvindh91@gmail.com>

* update MG errors

Signed-off-by: Arvindh <arvindh91@gmail.com>

* sync with supermq main

Signed-off-by: Arvindh <arvindh91@gmail.com>

* update MG errors

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-12-31 16:57:06 +01:00
Steve Munene 517588b675 NOISSUE - Update API docs (#340)
* update rules api docs

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* update api docs

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix url

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

---------

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-10-31 13:09:42 +01:00
Dušan Borovčanin 7bdf4c681e NOISSUE - Update dependencies (#336)
* NOISSUE - Update dependencies

Signed-off-by: dusan <borovcanindusan1@gmail.com>

* Update go.mod

Signed-off-by: dusan <borovcanindusan1@gmail.com>

---------

Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-10-20 20:45:24 +02:00
Dušan Borovčanin be7ee7a877 NOISSUE - Fix bugs caused by SMQ update (#301)
* Fix SMQ-caused issues

Signed-off-by: dusan <borovcanindusan1@gmail.com>

* Fix tests

Signed-off-by: dusan <borovcanindusan1@gmail.com>

---------

Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-09-06 21:58:41 +02:00
Dušan Borovčanin 60e256c267 NOISSUE - Replace interface{} with any (#285)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-08-26 13:26:32 +02:00
Steve Munene 748a3dcb49 NOISSUE - Update mockery files (#251)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-07-14 10:35:47 +02:00
Dusan Borovcanin c35bc42210 NOISSUE - Fix typos
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-06-06 14:05:18 +02:00
Steve Munene 02da121280 MG-94 - Add backend support for reports (#107)
* initial implementation

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix missing variable

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix api and add report config to rule engine

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix repo command

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix failing linter

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix download request

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix download api

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix failing linter

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix add report config

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* remove unused parameters

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* add limit field to config

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* add test and address comments

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* remove unused code

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* add logger

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* remove logger

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* uncomment code

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* add status check

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* address comments

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* resolve conflicts

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix failing linter

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* rebase code

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix startdate when zero

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* remove unused code

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* address comments

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* add time expression parser and logics

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix postgres methods

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix failing linter

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix pdf and csv generation

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix failing linter

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* add description for reports

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* remove aggregation field

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* remove unused code

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* remove logs

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix go mod file

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix endpoint and postgres methods

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* address comments

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* update report config update methods

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix failing linter

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix service test

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* remove unnecessary check

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* address comments

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* remove endpoints

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* remove unused code

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix generate PDF and CSV

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* remove unused code

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* address comments

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix failing linter

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* revert UI variable

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* add empty line

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix go mod file

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* update download api

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* revert UI variable

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix download endpoint

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* update generateREport method

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix failing tests

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* refactor generate api

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix failing linter

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix failing linter

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix csv column

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* fix csv generator

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* remove logs

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

* updated reports logic and api

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix time conversion

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>

---------

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Arvindh <arvindh91@gmail.com>
2025-04-28 09:09:22 +02:00
Dušan Borovčanin b34a6cb457 NOISSUE - Simplify Mockery config (#101)
* Fix Mockery config

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Simplify Mockery config

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

---------

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-04-01 12:13:52 +02:00
Dušan Borovčanin d6477a484f NOISSUE - Update YAML files (#100)
* Rename yml to yaml extensions

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Update Docker project name

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Update SMQ YAML files

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Update Mockery

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Update Mockery version

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Remove mocks before running Mockery

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Update check order

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Fix tests

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

---------

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-04-01 10:41:26 +02:00
Dušan Borovčanin 8f9a496ed6 NOISSUE - Fix SMQ script and dependencies (#96)
* Update Makefile

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Update SMQ dependencies

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Fix Makefile

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Update CI linter

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Update Codecov version

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Update Mockery version

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

---------

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-03-28 19:38:37 +01:00
Ian Ngethe Muchiri 89eaa8e09f NOISSUE - Fix readers env Prefix(#46)
* update timescale

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* remove omitempty to mess resp

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* remove domain_id

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* update tests

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2025-01-24 10:56:54 +01:00
Felix Gateru cd528e75d3 NOISSUE - Add Readers and Consumers SDK (#33)
* refactor: aligh bootstrap with new supermq architecture

Signed-off-by: Felix Gateru <felix.gateru@gmail.com>

* refactor: rename env variables

Signed-off-by: Felix Gateru <felix.gateru@gmail.com>

* style: add empty line to config files and bootstrap docker compose file

Signed-off-by: Felix Gateru <felix.gateru@gmail.com>

* refactor: add supermq sdk to magistrala sdk

Signed-off-by: Felix Gateru <felix.gateru@gmail.com>

* refactor: extend supermq sdk in magistrala sdk

Signed-off-by: Felix Gateru <felix.gateru@gmail.com>

* reafctor: update responses

Signed-off-by: Felix Gateru <felix.gateru@gmail.com>

* feat: add readers and consumers sdk

Signed-off-by: Felix Gateru <felix.gateru@gmail.com>

* ci(messages.go): fix filename

Signed-off-by: Felix Gateru <felix.gateru@gmail.com>

* feat: add readers sdk

Signed-off-by: Felix Gateru <felix.gateru@gmail.com>

* refactor: remove notifier interface

Signed-off-by: Felix Gateru <felix.gateru@gmail.com>

* refactor: remove notifier interface

Signed-off-by: Felix Gateru <felix.gateru@gmail.com>

---------

Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-01-13 10:31:45 +01:00
Dušan Borovčanin 3ee7b13538 NOISSUE - Move SMPP notifier to Magistrala core (#26)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-12-31 18:59:23 +01:00
Dušan Borovčanin a34df79e9b NOISSUE - Use Magistrala packages instead of SMQ (#24)
* Use Magistrala packages where needed

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Move SMQ scripts to MG

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

---------

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-12-31 18:00:47 +01:00
Dušan Borovčanin 3bbb25bd64 NOISSUE - Remove SuperMQ duplicates (#23)
* Update docker-compose to use SuperMQ

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Remove duplicate services

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Update Bootstrap

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Update other services to use SMQ

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Switch config prefix to SMQ

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Remove leftovers

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Remove duplicate interface definitions

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Remove unused actions

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Remove unused API docs

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Resolve linter comments

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

* Fix provision

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>

---------

Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-12-31 11:04:17 +01:00
Steve Munene ca8ed3b006 MG-2441 - Add domain ID to API (#2442)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-10-23 21:40:13 +02:00
Dušan Borovčanin eb881690c7 MG-2443 - Move Auth to the middleware (#2444)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Felix Gateru <felix.gateru@gmail.com>
Co-authored-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Arvindh <30824765+arvindh123@users.noreply.github.com>
2024-10-17 16:24:53 +02:00
Felix Gateru 48c4a7e7d4 MG-2264 - Split Auth Client into Separate Clients for AuthN/AuthZ and Policy CRUD (#2392)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-09-03 16:50:28 +02:00
Dušan Borovčanin 5412bddfcf MG-2187 - Simplify Magistrala core repository (#2338)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-07-15 17:38:48 +02:00
JMboya 468362aac4 MG-2193 - Generate mocks for proto interface (#2324)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-07-12 10:36:12 +02:00
b1ackd0t ee3716623c MG-1557 - Export jaeger, metrics, postgres and apiutil packages (#2262)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2024-06-28 12:45:20 +02:00
Dušan Borovčanin be9bc22df4 NOISSUE - Update CI tools (#2314)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-06-25 13:45:11 +02:00
Dušan Borovčanin 6ea6d6756b NOISSUE - Fix failed log message (#2307)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-06-24 17:56:36 +02:00
b1ackd0t 19c1261e81 NOISSUE - Add property based testing to notifiers API (#2175)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-04-29 16:07:57 +02:00
Steve Munene 8915b73953 MG-2173 - Generate mocks with mockery for Twins service (#2174)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-04-23 14:18:42 +03:00
Steve Munene cf832af14b MG-2147 - Generate mocks with mockery for Consumer service (#2150)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-04-22 10:52:54 +02:00
Dušan Borovčanin 658003080e NOISSUE - Update Docker and Compose versions (#2159)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-04-10 12:02:36 +02:00
Dušan Borovčanin a39d46238b NOISSUE - Fix links in README.md file (#2129)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-04-03 11:55:06 +02:00
b1ackd0t 0ed79371a4 NOISSUE - Remove duplicate errors (#2086)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-02-21 14:31:11 +01:00
Felix Gateru 7a93e6a893 NOISSUE - Improve tests in Auth service (#262)
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2024-01-25 14:03:20 +01:00
Nataly Musilah 4a909a1ab2 MG-234 - Improve Logging Middleware (#272)
Signed-off-by: Musilah <nataleigh.nk@gmail.com>
2024-01-24 18:04:29 +01:00
Dušan Borovčanin 79ef28a9ce NOISSUE - Update dependencies (#2061)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-01-23 13:09:07 +01:00
Nataly Musilah 8c084b177e MG-234 - Improve Logging (#255)
Signed-off-by: Musilah <nataleigh.nk@gmail.co>
Signed-off-by: Musilah <nataleigh.nk@gmail.com>
Co-authored-by: Musilah <nataleigh.nk@gmail.co>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@abstractmachines.fr>
2024-01-18 15:28:04 +01:00
b1ackd0t 95f31d70a2 NOISSUE - Use methods for accessing in generated code (#204)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-01-18 13:57:22 +01:00
b1ackd0t 0016d67055 NOISSUE - Add Test for apiutil package (#195)
* Test for parsing and handling query parameters

The provided code includes test cases written that cover various scenarios for parsing and handling query parameters in HTTP requests.
These scenarios include valid and invalid queries, empty queries, and multiple queries with the same key.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* replace ReadUintQuery with ReadNumQuery

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-20 16:41:07 +01:00
b1ackd0t 0ecf5aa746 NOISSUE - Update mTLS support (#134)
Make sure MTLS support works after the new auth changes
2023-12-11 11:13:41 +01:00
Sammy Kerata Oina 6f0874c85a NOISSUE - Add Linters (#79)
* add linters

Signed-off-by: SammyOina <sammyoina@gmail.com>

* fix linting errors

Signed-off-by: sammy <sammyoina@gmail.com>

* fix linting

Signed-off-by: sammy <sammyoina@gmail.com>

* add callhome alias

Signed-off-by: sammy <sammyoina@gmail.com>

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: sammy <sammyoina@gmail.com>
2023-12-06 17:02:47 +01:00
Felix Gateru 3d1ce7c3c8 MG-31 - Fix Consumers tests (#101)
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-12-01 13:47:07 +01:00
Felix Gateru 004782dd49 MG-30 - Auth: Migrate from bone to chi (#47)
* Migrate from bone to chi

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Migrate from bone to chi

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Add subroutes

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Update auth service

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* update bootstrap

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Update multiplexer

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Refactor user and things handler

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

* Refactor user and things handler

Signed-off-by: felix.gateru <felix.gateru@gmail.com>

---------

Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-11-27 18:57:44 +01:00
b1ackd0t 01b312a01b NOISSUE - Fix Consumers Tests (#43)
Fix tests in consumers package by syncing with the new auth scheme
2023-11-21 13:50:14 +01:00
b1ackd0t 7c5ad097b9 NOISSUE - Fix loading Auth config (#64)
Fix bug in loading auth config and also refactor postgres connect
2023-11-20 14:06:00 +01:00
b1ackd0t a0c40ba462 NOISSUE - Update Copyright Notice (#39)
* chore(license): update copyright notices

Add CI check for non go files to check that the files contain a license

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* fix(ci): log failed files

When the CI fails during check for license header, log the failed file to console so that someone can check on the actual file. Also simplify the grep check to make it more human readable and understandable

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-11-17 12:37:30 +01:00
b1ackd0t 44408395e6 NOISSUE - Fix renaming issues (#17)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-11-02 14:48:13 +01:00
Dušan Borovčanin 254dbcd555 NOISSUE - Fix gRPC client naming (#22)
* Fix Auth gRPC server name

Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>

* Rename import aliases

Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>

* Rename issuer name to Magistrala

Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>

---------

Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
Co-authored-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
2023-11-01 19:17:24 +01:00
dusanb94 7066101996 Rename Mainflux to Magistrala
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2023-10-26 12:50:56 +02:00
b1ackd0t 790f8a6abf NOISSUE - Make MQTT Broker Configurable (#1904)
* Minor changes on mqtt publisher using nats

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Remove vernemq dependencies

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Restore VerneMQ config files

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Fix Makefile to support custom Docker profiles

The Makefile has been updated to support custom Docker profiles.
Previously, the Makefile only supported the default profiles for the
message broker and MQTT broker. Now, the Makefile allows for custom
profiles to be specified using environment variables. If the
MF_BROKER_TYPE or MF_MQTT_BROKER_TYPE variables are not set, the
default values "nats" and "nats" will be used, respectively. This
change enables more flexibility in configuring the Docker environment
for the project.

The `run` target has also been modified to use the correct broker
configuration file based on the MF_BROKER_TYPE variable. The sed
command in the `run` target now replaces the placeholder in the
docker/docker-compose.yml file with the appropriate broker
configuration file.

This commit improves the Makefile to support custom Docker profiles
and ensures the correct broker configuration file is used when
running the project.

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Fix queue binding issue in RabbitMQ pubsub

The commit fixes an issue in the RabbitMQ pubsub implementation where the queue binding was not correctly set up. Instead of using the topic as the queue name, the commit now uses a unique client ID generated by combining the topic and subscriber ID. This ensures that each subscriber has its own dedicated queue. The commit also updates the queue binding to use the correct queue name.

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Refactor Docker config editing in Makefile

The commit refactors the `edit_docker_config` function in the Makefile to improve readability and maintainability. The changes include:

- Removing unnecessary conditionals related to the `rabbitmq` broker

These changes ensure that the Docker configuration is correctly updated based on the specified MQTT broker type.

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Fix failing tests on RabbitMQ

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Refactor MQTT_BROKER comment in docker-compose.yml

The MQTT_BROKER comment in the docker-compose.yml file has been updated to provide a more accurate description of its functionality. The comment now states that the MQTT_BROKER handles MQTT communication between MQTT adapters and the message broker, instead of Mainflux services. This change improves clarity and aligns with the actual purpose of the MQTT_BROKER.

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Rename `MF_BROKER` to `MF_MESSAGE_BROKER`

The Makefile and Semaphore configuration files have been refactored to update the variable names related to the message broker type.

These changes ensure consistency and clarity in the codebase by using more descriptive variable names related to the message broker type.

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Fix Docker profile configuration for nats_rabbitmq

Update the Docker profile configuration for nats_rabbitmq by replacing the NATS URL in the .env file with the correct value.

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Rename MF_BROKER_URL to MF_MESSAGE_BROKER_URL

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Fix MQTT QoS level in pubsub.go

The MQTT QoS level in the pubsub.go file was set to 1, which is the
default level. However, since NATS supports up to QoS 1, I updated the
QoS level comment to reflect this.

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Refactor NewPublisher to accept QoS parameter

The NewPublisher function in the pkg/messaging/mqtt/publisher.go file has been refactored to accept a new parameter, qos, which represents the Quality of Service level for MQTT message publishing. This change allows for more flexibility in configuring the MQTT publisher.

The NewPublisher function now has the following signature:

```go
func NewPublisher(address string, qos uint8, timeout time.Duration) (messaging.Publisher, error)
```

This change ensures that the MQTT publisher can be created with the desired QoS level, enhancing the reliability and delivery guarantees of the published messages.

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Fix test assertions in pubsub_test.go

The test assertions in the pubsub_test.go file were incorrect. This commit fixes the assertions to properly compare the expected and received message values.

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>

* Test configurable MQTT broker

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

---------

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-10-19 21:01:09 +02:00
b1ackd0t 5e060d5620 NOISSUE - Add More Linters (#1924)
* Fix linting errors

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(linters): add ineffassign linter

This commit adds the `ineffassign` linter to the project's `.golangci.yml` configuration file. The `ineffassign` linter helps identify and flag assignments to variables that are never used, helping to improve code quality and maintainability.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* Add extra linters

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(golangci): Add header check

- Added goheader check to ensure all files have license headers
- Added build tags for "nats" in the .golangci.yml file to include the necessary dependencies for the "nats" package during the build process.
- Also, increased the maximum number of issues per linter and the maximum number of same issues reported by the linter to improve the code quality analysis.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(.golangci.yml): Add new linters

Add the following new linters to the .golangci.yml configuration file:
- asasalint
- asciicheck
- bidichk
- contextcheck
- decorder
- dogsled
- errchkjson
- errname
- execinquery
- exportloopref
- ginkgolinter
- gocheckcompilerdirectives

These linters will help improve code quality and catch potential issues during the code review process.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-16 11:43:33 +02:00
Dušan Borovčanin 3d3aa525a6 NOISSUE - Switch to Google Zanzibar Access control approach (#1919)
* Return Auth service

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

Update Compose to run with SpiceDB and Auth svc

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

Update auth gRPC API

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

Remove Users' policies

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

Move Groups to internal

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

Use shared groups in Users

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

Remove unused code

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

Use pkg Groups in Things

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

Remove Things groups

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

Make imports consistent

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

Update Groups networking

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

Remove things groups-specific API

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

Move Things Clients to the root

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

Move Clients to Users root

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

Temporarily remove tracing

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

Fix imports

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

Add buffer config for gRPC

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

Update auth type for Things

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

Use Auth for login

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

Add temporary solution for refresh token

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

Update Tokenizer interface

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

Updade tokens issuing

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

Fix token issuing

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

Update JWT validator and refactor Tokenizer

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

Rename access timeout

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

Rename login to authenticate

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

Update Identify to use SubjectID

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

Add Auth to Groups

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

Use the Auth service for Groups

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

Update auth schema

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

Fix Auth for Groups

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

Add auth for addons (#14)

Signed-off-by: Arvindh <arvindh91@gmail.com>

Speparate Login and Refresh tokens

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

Merge authN and authZ requests for things

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

Add connect and disconnect

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

Update sharing

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

Fix policies addition and removal

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

Update relation with roels

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

Add gRPC to Things

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

Assign and Unassign members to group and Listing of Group members (#15)

* add auth for addons

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add assign and unassign to group

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add group incomplete repo implementation

Signed-off-by: Arvindh <arvindh91@gmail.com>

* groups for users

Signed-off-by: Arvindh <arvindh91@gmail.com>

* groups for users

Signed-off-by: Arvindh <arvindh91@gmail.com>

* groups for users

Signed-off-by: Arvindh <arvindh91@gmail.com>

* groups for users

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>

Move coap mqtt and ws policies to spicedb (#16)

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

Remove old policies

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

NOISSUE - Things authorize to return thingID (#18)

This commit modifies the authorize endpoint to the grpc endpoint to return thingID. The authorize endpoint allows adapters to get the publisher of the message.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

Add Groups to users service (#17)

* add assign and unassign to group

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add group incomplete repo implementation

Signed-off-by: Arvindh <arvindh91@gmail.com>

* groups for users

Signed-off-by: Arvindh <arvindh91@gmail.com>

* groups for users

Signed-off-by: Arvindh <arvindh91@gmail.com>

* groups for users

Signed-off-by: Arvindh <arvindh91@gmail.com>

* groups for users

Signed-off-by: Arvindh <arvindh91@gmail.com>

* groups for users stable 1

Signed-off-by: Arvindh <arvindh91@gmail.com>

* groups for users stable 2

Signed-off-by: Arvindh <arvindh91@gmail.com>

* groups for users & things

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Amend signature

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix merge error

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

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

* NOISSUE - Fix es code (#21)

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* NOISSUE - Fix Bugs (#20)

* fix bugs

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix bugs

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

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

* NOISSUE - Test e2e (#19)

* fix: connect method

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* fix: e2e

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* fix changes in sdk and e2e

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(docker): remove unnecessary port mapping

Remove the port mapping for MQTT broker in the docker-compose.yml file.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* Enable group listing

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(responses): update ChannelsPage struct

The ChannelsPage struct in the responses.go file has been updated. The "Channels" field has been renamed to "Groups" to provide more accurate naming. This change ensures consistency and clarity in the codebase.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(things): add UpdateClientSecret method

Add the UpdateClientSecret method to the things service. This method allows updating the client secret for a specific client identified by the provided token, id, and key parameters.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Use smaller buffers for gRPC

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

* Clean up tests (#22)

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add Connect Disconnect endpoints (#23)

* fix bugs

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix bugs

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix list of things in a channel and Add connect disconnect endpoint

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix list of things in a channel and Add connect disconnect endpoint

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

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

* Add: Things share with users (#25)

* fix list of things in a channel and Add connect disconnect endpoint

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: things share with other users

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

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

* NOISSUE - Rename gRPC Services (#24)

* Rename things and users auth service

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* docs: add authorization docs for gRPC services

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* Rename things and users grpc services

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* Remove mainflux.env package

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add: Listing of things, channels, groups, users  (#26)

* add: listing of channels, users, groups, things

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: listing of channels, users, groups, things

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: listing of channels, users, groups, things

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: listing of channels, users, groups, things

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

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

* NOISSUE - Clean Up Users (#27)

* feat(groups): rename redis package to events

- Renamed the `redis` package to `events` in the `internal/groups` directory.
- Updated the file paths and names accordingly.
- This change reflects the more accurate purpose of the package and improves code organization.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(auth): Modify identity method

Change request and response of identity method

Add accessToken and refreshToken to Token response

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* clean up users, remove dead code

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(users): add unit tests for user service

This commit adds unit tests for the user service in the `users` package. The tests cover various scenarios and ensure the correct behavior of the service.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add: List of user groups & removed repeating code in groups (#29)

* removed repeating code in list groups

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: list of user group

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: otel handler operator name for endpoints

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

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

* NOISSUE - Clean Up Things Service (#28)

* Rework things service

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* add tests

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* NOISSUE - Clean Up Auth Service (#30)

* clean up auth service

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(auth): remove unused import

Remove the unused import of `emptypb` in `auth.pb.go`. This import is not being used in the codebase and can be safely removed.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* NOISSUE - Update API docs (#31)

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

* Remove TODO comments and cleanup the code

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

* Update dependenices

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Co-authored-by: b1ackd0t <28790446+rodneyosodo@users.noreply.github.com>
Co-authored-by: Arvindh <30824765+arvindh123@users.noreply.github.com>
2023-10-15 22:02:13 +02:00