98 Commits

Author SHA1 Message Date
Dušan Borovčanin 61d0427898 NOISSUE - Rename to Magistrala (#3427)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-04-06 15:23:42 +02:00
Dušan Borovčanin ef5c253c51 SMQ-3399 - Unify Magistrala and SuperMQ (#3400)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: dusan <borovcanindusan1@gmail.com>
Co-authored-by: Steve Munene <stevenyaga2014@gmail.com>
2026-04-01 09:55:11 +02:00
Felix Gateru 9c2608659f SMQ-1672 - Revoke refresh token (#3241)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Co-authored-by: nyagamunene <stevenyaga2014@gmail.com>
2026-03-03 15:22:28 +01:00
Steve Munene 15a6c026e9 NOISSUE - Seperate PAT from policy (#3330)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Arvindh <arvindh91@gmail.com>
2026-02-26 16:35:47 +01:00
Felix Gateru 6a5d28c65a SMQ-1672 - Add asymmetric key authentication (#3228)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-12-23 21:16:06 +01:00
Washington Kigani Kamadi 843a0cae1f SMQ-3234 - Add notifications service (#3254)
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: dusan <borovcanindusan1@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: dusan <borovcanindusan1@gmail.com>
2025-11-28 15:26:55 +01:00
Felix Gateru b031dc08b8 NOISSUE - Group service middleware into single folder (#2472)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-09-26 13:55:00 +02:00
Arvindh e57ad79cd4 SMQ-3093 - User email verification (#3101)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-09-05 15:23:58 +02:00
Washington Kigani Kamadi af35396601 NOISSUE - Obtain email host from env (#3098)
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
2025-09-01 15:21:01 +02:00
Dušan Borovčanin 9a9e22fbce SMQ-2869 - Switch to UTC time on backends (#2870)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-05-15 12:01:34 +02:00
Steve Munene 72c762f9cb SMQ-2671 - Add request ID and use it to correlate traces, logs, and events (#2709)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-02-19 13:42:06 +01:00
Felix Gateru 8e552d0a96 SMQ-2568 - Check Domain enabled / disabled status during Authn or Authz (#2586)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Arvindh <arvindh91@gmail.com>
2024-12-24 09:57:32 +01:00
Sammy Kerata Oina e95d1bfbcf NOISSUE - Move gRPC to api package (#2593)
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
2024-12-20 13:04:33 +01:00
Dušan Borovčanin f0d014eba2 NOISSUE - Move API to the common package (#2608)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-12-19 18:29:53 +01:00
Dušan Borovčanin 178aa46ad4 SMQ-2533 - Rename Magistrala to SuperMQ (#2560)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-12-04 11:17:09 +01:00
Dušan Borovčanin 243ccade0b MG-2456 - Refactor architecture (#2494)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
Co-authored-by: Arvindh <30824765+arvindh123@users.noreply.github.com>
Co-authored-by: Felix Gateru <felix.gateru@gmail.com>
2024-12-03 17:12:46 +01:00
Felix Gateru ba556e1e0d NOISSUE - Fix return role on user creation (#2551)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2024-11-26 09:39:52 +01:00
Nataly Musilah 0019f71b46 MG-2426 - Replace generic Clients in Users service (#2436)
Signed-off-by: Musilah <nataleigh.nk@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
Co-authored-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Felix Gateru <felix.gateru@gmail.com>
Co-authored-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-10-30 19:19:31 +01:00
Steve Munene f88e11bdb2 NOISSUE - Remove domain from token (#2468)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-10-25 14:41:51 +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
b1ackd0t 2098c85287 NOISSUE - Update redis, uuid and env dependecies (#2418)
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2024-09-13 14:57:34 +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
JMboya 6a41ea10a3 MG-2365 - Fix JaegerURL in readme.md and cmd/<svc>/main.go (#2366)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-08-02 16:28:26 +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
b1ackd0t 2fe2f850c2 MG-1529 - User Removal (#2122)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2024-06-28 11:13:04 +02:00
b1ackd0t 487dcc643c MG-2235 - Check gRPC service is healthy during setup (#2245)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-06-12 11:46:42 +02:00
b1ackd0t fbec74bd94 NOISSUE - Add Secret Validation on Registration (#2109)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-03-13 13:11:20 +01:00
b1ackd0t 0f05c10a38 MG-1887 - Add support for OAuth2.0 (#2103)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-03-01 10:51:34 +01: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 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
Arvindh 648655036e NOISSUE - Implementation of Group removal (#161)
* add: group delete flow

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

* sync with master

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

* improved grpc error handling

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

* gofumpt -ed

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

* changed database unassign parent group id

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

* seperate event for delete group

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

* change group event name

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

* update channel remove events

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

* fix: channels event

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

* add: sdk, sdk_tet, cli

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

* fix: sdk mock

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

* mockery

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

* convert to inline case

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

* change in group delete flow

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

* change return error in delete

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

* add: openapi

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

* rename events: from channel delete to channel remove

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-12-19 13:01:24 +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
b1ackd0t 39999ad5ee NOISSUE - Update self-registration configuration (#95)
This commit updates the self-registration configuration in the users module. The environment variable "MF_USERS_ALLOW_SELF_REGISTER" has been changed to "MG_USERS_ALLOW_SELF_REGISTER" to align with the naming convention used in other parts of the codebase.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-11-30 09:52:44 +01:00
b1ackd0t 4f1b7ea614 NOISSUE - Update env vars for events store (#91)
- Rename env vars `MG_ES_STORE_TYPE` to `MG_ES_TYPE`
- Rename env var `MG_ES_STORE_URL` to `MG_ES_URL`
- User one env variables `MG_ES_URL` instead of every service having their own env variables
- Config default env var for `MG_ES_URL` at code level to be `nats://localhost:4222` instead of `redis://localhost:6379/0`

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-11-29 11:29:22 +01:00
Arvindh eb019eefed NOISSUE - Fix domains bugs and feature to disable user self register (#74)
* fix: nginx entrypoint.sh file shebang

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

* fix: default domain users listing include membership

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

* fix: create same thing name, thing key and group name in different domain

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

* add: feature to disable user self register, user can add by only super admin

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

* add: feature to disable user self register, user can add by only super admin

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

* fix: Duplicate items in list domains response

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

* fix: users refresh & issue token api logging middleware

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

* add: comments

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-11-27 18:33:47 +01:00
b1ackd0t c5b34f0186 NOISSUE - Align Users documentation (#71)
Update the configuration settings summary document to include the latest information for the "users" service and the WebSocket adapter service.
This includes details on environment variables, default values, database connection details, email server settings, log levels, server certificates, and other settings.
Also, provide deployment instructions for running the services as Docker containers and reference the updated API documentation for more information.
2023-11-22 16:46:08 +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 7acf21a3e1 NOISSUE - Export Auth Package (#34)
* feat(auth): Export auth setup

Since auth is used by other external packages it is wise to export the package of how to connect to auth service so that other packages can be able to use it rather than to rewrite the code
Added envPrefix as a parameter as the user should be able to specify their own ev prefix

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

* feat: Add auth configuration loading and setup

This commit adds auth configuration loading and setup to the main.go files in different commands. The modifications include setting up authentication and authorization for various services, connecting to servers, and setting up authentication clients and handlers. Changes are made to the main function and other functions in different packages to set up auth clients and parse configuration options.

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 11:10:40 +01:00
b1ackd0t 2bccf0c85e NOISSUE - Remove internal env package (#32)
* refactor(env): Remove internal env package

- update env package to v10
- fix jaeger not sending traces
- added jaeger URL as url.URL rather than string value
- made changes to jaeger provider

* feat(auth): Modify env variables in .env file

Update the AccessDuration variable in main.go to reflect the desired token duration for authentication.
Additionally, modify various environment variables in the .env file related to the auth module.
These changes include updating configuration settings for auth and datastore services, such as token duration, logging level, database details, and server settings.
These modifications are necessary for proper functionality and are intended for use in a Docker Compose file.

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

* fix(docker): fix incorrect variable name in docker-compose.yml

Fixed an issue where the variable name for the PostgreSQL database was incorrect in the docker-compose.yml file. Updated the variable name from "MG_AUTH_DB" to "MG_AUTH_DB_NAME" to properly set the name of the database.

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-11-16 16:46:46 +01:00
Arvindh c294e84d24 NOISSUES - Implement Domains for access control (#14)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-11-16 15:39:05 +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
Sammy Kerata Oina 5a565a110a remove deprecated exporter (#13)
Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-10-27 15:52:07 +02:00
dusanb94 7066101996 Rename Mainflux to Magistrala
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2023-10-26 12:50:56 +02:00
b1ackd0t 8b185d205b MF - 1758 - Sync With Benchmark Testing (#1912)
* feat(docker): add trace ration and max conn

This adds a new environment variable `MF_JAEGER_TRACE_RATIO` to the `docker/.env` file. The variable is used to set the ratio of requests traced.

Additionally, this commit also adds a new environment variable `MF_POSTGRES_MAX_CONNECTIONS` for configuring the maximum number of connections for the Postgres database.

These changes are made to enhance the configuration and scalability of the core services.

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

* Remove comment to trace ratio

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

* Reduce postgres max connection to 100

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-10-24 18:59:49 +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
b1ackd0t 28f4965d26 NOISSUE - Add Event Sourcing Package (#1897)
* Add event sourcing package

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

* Move producer to es package

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

* Use redis URL to configure username, password and db

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

* Change the redis subscriber interface

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

* Clean up publisher inaterface

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

* Update redis version

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

* Add tests

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

* Rename factory functions of events store

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

* Rename redis package to events package

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

* Remove unnecessary alias on redis event store

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

* Minor cosmetic changes

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

* Remove stream length from factory function

Set the default stream length to 1e9 in the events package. This is
because the stream length is not a required parameter in the factory
function. This commit also removes the stream length from the factory
function.

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

* Remove group Name on subscribing

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

* Refactor package consumer to reflect changes in service name

The package consumer in the bootstrap/events/consumer/doc.go file has been modified to reflect the changes in the service name. The service name has been updated from "Things" to "Bootstrap". This change ensures that the package accurately represents the events consumer for the Bootstrap service.

This commit modifies the package consumer in the bootstrap/events/consumer/doc.go file to update the service name from "Things" to "Bootstrap". This change ensures that the package accurately represents the events consumer for the Bootstrap service.

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

* Refactor main to remove go routines

Remove go routines from main when subscribing to events. This is because
the event handlers are already running in their own go routines.

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

* Move cache to seperate package

This commit moves the cache package to a seperate package. This is
because the cache package is not the same as events package. The cache
package is used to store the data in memory while the events package is
used to send events to the event bus.

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

* Make startPublishingRoutine private

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

---------

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2023-09-20 12:12:17 +02:00
Washington Kigani Kamadi e2992cbede NOISSUE - Change import name aliases (#1868)
* Change import name aliases

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Change import name aliases

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Change import aliases

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Remove unused aliases

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

Fix aliases

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

FIx errors

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

Fix error

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

FIx merge

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

FIx merge

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

FIx merge

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Fix import alias

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Fix errors

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Fix linter

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Fix linter

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Fix import

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Add linter to CI pipeline

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Changes

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Remove unused aliases

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Fix merge issues

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Fix gci

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Fix gci

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Fix gci

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Add gofumpt

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Remove multiple gofupmt in CI

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Remove unnecessary changes

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Fix linter

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

* Fix CI pipeline

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>

---------

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
2023-08-11 11:30:25 +02:00