Compare commits

...

1306 Commits

Author SHA1 Message Date
dusan e8cf13c7f3 NOISSUE - Update FMQ version
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-08-05 17:59:48 +02:00
Dušan Borovčanin 10791c1e28 NOISSUE - Preserve message origin (#3565) 2026-08-05 16:53:52 +02:00
Filip Bugarski d63bbe1f93 NOISSUE - Mark Rules Engine, Alarms, and Audit Logs as Enterprise Edition in README (#3562)
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-05 10:26:54 +02:00
dependabot[bot] f8fab301de NOISSUE - Bump the go-dependency group across 1 directory with 2 updates (#3560)
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-04 19:27:35 +02:00
Dušan Borovčanin 135490f680 NOISSUE - Use internal principals for services communication (#3564)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-08-04 19:20:44 +02:00
dusan dcd6e85afd Update compose and deployments
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-08-03 15:40:26 +02:00
dusan 0ba7994db9 Update FMQ version
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-08-01 14:00:45 +02:00
Dušan Borovčanin 880634e009 MG-3486 - RE Loop Prevention (#3559)
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-08-01 02:33:52 +02:00
Dušan Borovčanin 168e8b90cb NOISSUE - Move rules engine, alarms, reports, journal and notifications to EE (#3552)
Property Based Tests / api-test (push) Has been cancelled
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-07-30 17:55:57 +02:00
dependabot[bot] 6429f16233 Bump the go-dependency group with 3 updates (#3558)
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-27 09:03:43 +02:00
b1ackd0t d40757f36f NOISSUE - Reject empty username/password in gRPC early (#3554)
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2026-07-22 09:55:49 +02:00
dependabot[bot] c09020a29c Bump actions/setup-go from 6 to 7 in /.github/workflows in the gh-dependency group (#3553)
Property Based Tests / api-test (push) Has been cancelled
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dusan <borovcanindusan1@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dusan <borovcanindusan1@gmail.com>
2026-07-20 12:07:22 +02:00
dependabot[bot] 2320ec96c0 NOISSUE - Bump the go-dependency group across 1 directory with 5 updates (#3551)
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-18 18:54:18 +02:00
Filip Bugarski 14d6db9684 NOISSUE - Add multi-publisher filter to readers PageMetadata (#3550)
Property Based Tests / api-test (push) Has been cancelled
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: fbugarski <filipbugarski@gmail.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-16 11:04:56 +02:00
Arvindh 513a84361b NOISSUE - Remove unwanted alarms operations (#3548)
Property Based Tests / api-test (push) Has been cancelled
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: Arvindh <arvindh91@gmail.com>
2026-07-08 12:27:47 +02:00
Dušan Borovčanin 6ed7ca6a42 NOISSUE - Limit pdf-generator memory (#3547)
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-07-07 18:59:26 +02:00
Arvindh 52645e2c39 NOISSUE - Fix Alarms roles (#3546)
Property Based Tests / api-test (push) Has been cancelled
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: Arvindh <arvindh91@gmail.com>
2026-07-06 17:26:39 +02:00
dependabot[bot] e078e00f73 NOISSUE - Bump the go-dependency group across 1 directory with 4 updates (#3545)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-06 16:44:19 +02:00
dependabot[bot] c3b9c20cc0 NOISSUE - Bump golangci/golangci-lint-action from 9.2.1 to 9.3.0 in /.github/workflows in the gh-dependency group (#3542)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-06 16:37:53 +02:00
Arvindh 36fb079563 NOISSUE - Fix Alarms roles (#3544)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2026-07-06 16:36:55 +02:00
Arvindh 4d20126e75 NOISSUE - Add messaging hooks endpoints (#3541)
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: Arvindh <arvindh91@gmail.com>
2026-07-04 19:33:46 +02:00
Dušan Borovčanin 09a56575c1 NOISSUE - Use Atom access tokens (#3540)
Property Based Tests / api-test (push) Has been cancelled
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-07-01 19:41:01 +02:00
Arvindh 3b5f646719 NOISSUE - Fix client keys (#3539)
Property Based Tests / api-test (push) Has been cancelled
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: Arvindh <arvindh91@gmail.com>
2026-06-30 20:10:33 +02:00
dusan ededf5308c Fix migrations
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-06-30 15:38:42 +02:00
dusan bc7c9096f9 NOISSUE - Improve migration scripts
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-06-30 13:50:43 +02:00
dusan c405028fc5 NOISSUE - Revert alarms approach
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Property Based Tests / api-test (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-06-29 19:16:16 +02:00
dusan cdc065a7b2 NOISSUE - Revert alarms Atom migration
This reverts commits afd2665c9c and 45c426c8bf.
2026-06-29 17:51:51 +02:00
dependabot[bot] 3cf6b2f0f4 NOISSUE - Bump the go-dependency group with 3 updates (#3538)
Property Based Tests / api-test (push) Has been cancelled
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-29 11:55:22 +02:00
dusan afd2665c9c NOISSUE - Simplify alarms
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-06-29 10:16:27 +02:00
dusan 45c426c8bf NOISSUE - Remove alarms
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-06-29 08:36:37 +02:00
Arvindh 16ba29cf4a MG-3537 - Migrate Magistrala to ATOM for identity & authorization (#3532)
Property Based Tests / api-test (push) Has been cancelled
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusan <borovcanindusan1@gmail.com>
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@absmach.eu>
Co-authored-by: Rodney Osodo <socials@rodneyosodo.com>
Co-authored-by: dusan <borovcanindusan1@gmail.com>
2026-06-26 22:06:57 +02:00
dependabot[bot] 19ed0de788 NOISSUE - Bump github.com/opencontainers/runc from 1.2.8 to 1.3.6 (#3535)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-26 19:33:22 +02:00
dependabot[bot] 7efeb875de NOISSUE - Bump the go-dependency group across 1 directory with 4 updates (#3534)
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-23 10:03:31 +02:00
dusan 935a0950f9 NOISSUE - Fix Bootstrap rendering test
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-06-23 10:00:15 +02:00
dependabot[bot] d4f0d8fdef NOISSUE - Bump the go-dependency group across 1 directory with 3 updates (#3531)
Property Based Tests / api-test (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
Continuous Delivery / lint-and-build (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-19 17:13:43 +02:00
dependabot[bot] aaa718bdf6 Bump actions/checkout from 6 to 7 in /.github/workflows in the gh-dependency group across 1 directory (#3530)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-19 17:08:11 +02:00
dusan 91e010128d NOISSUE - Fix proto
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-06-19 16:52:13 +02:00
dependabot[bot] 5d7d3d412b NOISSUE - Bump github.com/slack-go/slack from 0.25.0 to 0.26.0 in the go-dependency group (#3529)
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-16 16:23:06 +02:00
dusan cb364d0426 NOISSUE - Update FluxMQ dependency
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-06-12 13:43:21 +02:00
dependabot[bot] b68c9fe79e NOISSUE - Bump the go-dependency group with 4 updates (#3528)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-12 13:22:02 +02:00
dusan 0d5048941e NOISSUE - Update FMQ version
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-06-09 16:04:42 +02:00
dependabot[bot] 24edbe6ad8 NOISSUE - Bump golang from 1.26.3-alpine3.22 to 1.26.4-alpine3.22 in /docker in the docker-dependency group (#3527)
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-09 16:04:04 +02:00
dependabot[bot] 610da72779 NOISSUE - Bump codecov/codecov-action from 6 to 7 in /.github/workflows in the gh-dependency group across 1 directory (#3525)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-09 15:57:55 +02:00
dependabot[bot] 90672e5fc7 NOISSUE - Bump the go-dependency group across 1 directory with 12 updates (#3526)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-09 15:39:54 +02:00
b1ackd0t 5821d2a513 NOISSUE - Sign server certificate with SANs for container hostnames (#3524)
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2026-06-03 13:40:34 +02:00
Dušan Borovčanin 49488738df NOISSUE - Fix queue subscriptions (#3522)
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-05-27 00:50:36 +02:00
dusan 493073ae49 NOISSUE - Update dependencies
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-05-25 11:17:47 +02:00
dependabot[bot] 5a528dd138 NOISSUE - Bump golangci/golangci-lint-action from 9.2.0 to 9.2.1 in /.github/workflows in the gh-dependency group (#3520)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@absmach.eu>
2026-05-25 10:40:30 +02:00
Steve Munene 377b8dfc08 MG-3509 - Add FluxMQ m stream queue to fix messages not appearing in web UI (#3518)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2026-05-25 10:28:40 +02:00
dependabot[bot] 03b33fee9e NOISSUE - Bump the go-dependency group with 5 updates (#3521)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-25 10:25:58 +02:00
dusan af75ac730c NOISSUE - Update FluxMQ version
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-05-22 12:51:20 +02:00
dusan 70d879275a NOISSUE - Improve certbot script
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-05-20 23:09:35 +02:00
Dušan Borovčanin 353e050a39 NOISSUE - Add a fast Certbot startup (#3517)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-05-20 19:23:19 +02:00
Steve Munene 683809dc6b NOISSUE - Update bootstrap content format, update profile method and add profile search (#3515)
Property Based Tests / api-test (push) Has been cancelled
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2026-05-19 09:02:45 +02:00
dependabot[bot] f380c8d360 NOISSUE - Bump the go-dependency group across 1 directory with 7 updates (#3516)
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-18 16:52:02 +02:00
Steve Munene 78804278d4 MG-3512 - Add rendered context field to update endpoint (#3513)
Property Based Tests / api-test (push) Has been cancelled
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2026-05-14 21:51:35 +02:00
dependabot[bot] 426532099a Bump golang from 1.26.2-alpine3.22 to 1.26.3-alpine3.22 in /docker in the docker-dependency group (#3511)
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-14 13:56:23 +02:00
Steve Munene 7f03134d8e NOISSUE - Update bootstrap and provision service (#3476)
Property Based Tests / api-test (push) Has been cancelled
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Co-authored-by: JeffMboya <jangina.mboya@gmail.com>
2026-05-08 10:35:00 +02:00
dependabot[bot] f736bca7c1 Bump the go-dependency group with 7 updates (#3508)
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-05 12:39:13 +02:00
Arvindh d840aeb1b9 NOISSUE - Add migration scripts for Rules, Alarms and Reports (#3482)
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Co-authored-by: nyagamunene <stevenyaga2014@gmail.com>
2026-04-30 08:46:50 +02:00
Ian Ngethe Muchiri a0bc7c2108 NOISSUE - Update ui env variables and remove unused and repeated variables (#3507)
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2026-04-29 12:46:39 +02:00
dependabot[bot] df242f6179 NOISSUE - Bump the go-dependency group with 3 updates (#3506)
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-28 12:34:32 +02:00
dependabot[bot] 3f256ddcf6 NOISSUE - Bump github.com/jackc/pgx/v5 from 5.9.1 to 5.9.2 in the go-dependency group (#3479)
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-20 09:51:44 +02:00
dependabot[bot] e294963450 NOISSUE - Bump the go-dependency group across 1 directory with 7 updates (#3477)
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-17 13:51:36 +02:00
JeffMboya 12180707d2 NOISSUE - Configure RE and reports billing callout (#3478)
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Co-authored-by: nyagamunene <stevenyaga2014@gmail.com>
2026-04-17 13:34:44 +02:00
dependabot[bot] 68befa023c NOISSUE - Bump golang from 1.26.1-alpine3.22 to 1.26.2-alpine3.22 in /docker in the docker-dependency group (#3471)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-17 11:51:03 +02:00
Steve Munene dc72811048 NOISSUE - Update superadmin check (#3394)
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2026-04-16 18:08:14 +02:00
dependabot[bot] 92b2993366 NOISSUE - Bump github.com/authzed/spicedb from 1.51.0 to 1.51.1 (#3475)
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-16 10:53:31 +02:00
Steve Munene f3a7230cc0 NOISSUE - Add PAT support for rules and reports (#3466)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2026-04-16 10:01:03 +02:00
Steve Munene ac8dadefc6 NOISSUE - Fix refreshKey method (#3472)
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Property Based Tests / api-test (push) Has been cancelled
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2026-04-15 13:30:00 +02:00
dusan 3541ea8678 NOISSUE - Fix Docker publish error
Property Based Tests / api-test (push) Has been cancelled
Continuous Delivery / lint-and-build (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-04-08 22:41:41 +02:00
dusan 125e311eda NOISSUE - Fix token revoked erro on refresh
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-04-08 18:48:42 +02:00
Steve Munene c9bf5beba2 NOISSUE - Add missing role fields to re and reports (#3435)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2026-04-08 10:40:27 +02:00
dusan c5fc0b64d4 NOISSUE - Remove Make and UPX dependencies in build
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-04-07 13:29:05 +02:00
Arvindh 6c7e5d893d SMQ-3415 - Return correct error in auth gRPC response (#3416)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2026-04-07 10:37:55 +02:00
dependabot[bot] 69d02ed58e NOISSUE - Bump the go-dependency group with 9 updates (#3434)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-07 10:37:22 +02:00
Dušan Borovčanin 3f329eb3c2 NOISSUE - Update CI scripts (#3433)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-04-07 10:33:04 +02:00
dusan b753294101 NOISSUE - Update README
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-04-07 09:36:17 +02:00
dusan 6dd470a41e NOISSUE - Update Docker CI
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-04-06 18:51:03 +02:00
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 fc679e9982 NOISSUE - Use Github for Docker images (#3419)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-04-06 10:19:30 +02:00
Dušan Borovčanin 791e084de6 NOISSUE - Switch to / delimiter (#3424)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-04-03 18:37:00 +02:00
dependabot[bot] 6a3319828e NOISSUE - Bump github.com/go-jose/go-jose/v4 from 4.1.3 to 4.1.4 (#3425)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-03 14:47:47 +02:00
Steve Munene 5f230f9446 NOISSUE - Fix listing members for rule and reports methods (#3423)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2026-04-02 22:56:31 +02:00
dependabot[bot] 03893cf9e5 NOISSUE - Bump github.com/yuin/gopher-lua from 1.1.1 to 1.1.2 (#3422)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-02 14:10:04 +02:00
dependabot[bot] 560e90aa96 NOISSUE - Bump google.golang.org/grpc from 1.79.3 to 1.80.0 (#3421)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-02 12:41:06 +02:00
dependabot[bot] 2687a31ac2 NOISSUE - Bump the gh-dependency group with 3 updates (#3414)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-02 12:36:20 +02:00
dusan b70004500e NOISSUE - Update FMQ
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-04-02 12:14:22 +02:00
dependabot[bot] c336bf2bb6 NOISSUE - Bump github.com/nats-io/nats.go from 1.49.0 to 1.50.0 (#3407)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-02 12:14:18 +02:00
dependabot[bot] 74832cc081 NOISSUE - Bump github.com/plgd-dev/go-coap/v3 from 3.4.2 to 3.5.0 (#3408)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-02 12:12:19 +02:00
dependabot[bot] 468457c303 NOISSUE - Bump github.com/authzed/spicedb from 1.50.0 to 1.51.0 (#3409)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-02 12:11:56 +02:00
dependabot[bot] b062fb22ee NOISSUE - Bump github.com/slack-go/slack from 0.19.0 to 0.20.0 (#3413)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-02 12:11:42 +02:00
dependabot[bot] fad25c9092 NOISSUE - Bump github.com/lib/pq from 1.12.0 to 1.12.1 (#3412)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-02 12:11:26 +02:00
Arvindh 8e774b3398 NOISSUE - Add access control listing in alarms, rules engine and reports (#3417)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2026-04-02 11:51:26 +02:00
dusan cc84466e7d NOISSUE - Fix refresh token
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-04-01 18:06:21 +02:00
dusan 351b25cd85 Add writers and alarms to the config
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-04-01 15:53:05 +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
dependabot[bot] 08249c045b NOISSUE - Bump github.com/authzed/spicedb from 1.49.2 to 1.50.0 (#3402)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-24 09:38:45 +01:00
dependabot[bot] e3be8d5f91 NOISSUE - Bump github.com/lib/pq from 1.11.2 to 1.12.0 (#3403)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-24 09:38:13 +01:00
dependabot[bot] cf7cd15a14 NOISSUE - Bump github.com/fatih/color from 1.18.0 to 1.19.0 (#3404)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-24 09:37:56 +01:00
dependabot[bot] 8f1ae9fd03 NOISSUE - Bump github.com/jackc/pgx/v5 from 5.8.0 to 5.9.1 (#3405)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-24 09:24:03 +01:00
dependabot[bot] 0f7ad10534 NOISSUE - Bump google.golang.org/grpc from 1.79.2 to 1.79.3 (#3398)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-20 13:13:32 +01:00
dusan fade98b84e NOISSUE - Update Certs
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-03-17 19:56:10 +01:00
dependabot[bot] 492965d379 NOISSUE - Bump golang.org/x/crypto from 0.48.0 to 0.49.0 (#3396)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-17 17:58:22 +01:00
dusan 6969fd2ce8 NOISSUE - Update Certs version
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-03-17 17:23:21 +01:00
dusan 9c6ad9744e NOISSUE - Fix fetching connected clients
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-03-11 17:25:47 +01:00
dusan df2446c2cc NOISSUE - Rename Admin to SuperAdmin role
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-03-11 16:52:34 +01:00
Ian Ngethe Muchiri 28ae84286e SMQ-416 - Return roles and actions in channel list for non-superadmin users (#3388)
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2026-03-11 10:59:11 +01:00
Dušan Borovčanin 487dbbb44c NOISSUE - Fix refresh token bug (#3392)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-03-10 10:30:55 +01:00
dependabot[bot] ea3925e3e2 NOISSUE - Bump golang.org/x/oauth2 from 0.35.0 to 0.36.0 (#3389)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-09 18:06:06 +01:00
dependabot[bot] 3fc2dabf8a NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.66.0 to 0.67.0 (#3390)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-09 17:58:09 +01:00
dependabot[bot] e3902256ef NOISSUE - Bump golang.org/x/sync from 0.19.0 to 0.20.0 (#3391)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-09 17:57:48 +01:00
dependabot[bot] 215218495d NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.65.0 to 0.67.0 (#3383)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-09 17:38:35 +01:00
dependabot[bot] ff581b8736 NOISSUE - Bump golang from 1.26.0-alpine3.22 to 1.26.1-alpine3.22 in /docker in the docker-dependency group (#3381)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-09 17:33:55 +01:00
dependabot[bot] 4bd1694cd5 NOISSUE - Bump the gh-dependency group in /.github/workflows with 2 updates (#3387)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-09 17:33:35 +01:00
dependabot[bot] efba921328 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.40.0 to 1.42.0 (#3385)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-09 17:31:34 +01:00
dependabot[bot] 373aab73ae NOISSUE - Bump go.opentelemetry.io/otel/sdk from 1.41.0 to 1.42.0 (#3386)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-09 11:37:16 +01:00
Dušan Borovčanin abd669c610 NOISSUE - Improve SQL queries performance and safety (#3378)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-03-06 11:09:40 +01:00
dependabot[bot] cef4b1d14d NOISSUE - Bump github.com/docker/cli from 27.4.1+incompatible to 29.2.0+incompatible (#3377)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-06 08:59:21 +01:00
Felix Gateru f8410b8940 SMQ-3338 - Add created at period filter to entities (#3339)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2026-03-04 12:37:35 +01:00
dependabot[bot] 2260293dfc NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace from 1.40.0 to 1.41.0 (#3374)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-03 15:32:32 +01:00
dependabot[bot] c9f34e3759 NOISSUE - Bump github.com/authzed/spicedb from 1.49.1 to 1.49.2 (#3372)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-03 15:31:41 +01:00
dependabot[bot] aeb1d9d0a1 NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.65.0 to 0.66.0 (#3371)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-03 15:29:25 +01:00
dependabot[bot] 03a8feb679 NOISSUE - Bump go.opentelemetry.io/otel/sdk from 1.40.0 to 1.41.0 (#3375)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-03 15:26:08 +01: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 2c476c17ee NOISSUE - Update tags filtering (#3376)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2026-03-03 15:14:02 +01:00
Dušan Borovčanin 3b2dd09ab4 NOISSUE - Update script dependencies (#3370)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-03-02 18:32:06 +01:00
dependabot[bot] 5255d887ef NOISSUE - Bump github.com/nats-io/nats.go from 1.48.0 to 1.49.0 (#3369)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-02 15:39:42 +01:00
dependabot[bot] bb8917cc34 NOISSUE - Bump golang from 1.25.7-alpine3.22 to 1.26.0-alpine3.22 in /docker in the docker-dependency group (#3367)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-02 11:23:24 +01:00
dependabot[bot] 4792a99c9a NOISSUE - Bump the gh-dependency group in /.github/workflows with 2 updates (#3368)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-02 11:19:44 +01:00
dusan fe49305238 Update dependencies version
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-03-02 11:17:34 +01:00
Steve Munene 03143d4142 NOISSUE - Add migrations for UI metadata (#3366)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2026-02-27 17:00:04 +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
dependabot[bot] 175f0e08ab NOISSUE - Bump google.golang.org/grpc from 1.78.0 to 1.79.1 (#3355)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-26 10:10:57 +01:00
dependabot[bot] 41526634f8 NOISSUE - Bump github.com/redis/go-redis/v9 from 9.17.3 to 9.18.0 (#3356)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-26 10:09:57 +01:00
dependabot[bot] 73a640e646 NOISSUE - Bump github.com/lib/pq from 1.11.1 to 1.11.2 (#3358)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-26 10:07:51 +01:00
dependabot[bot] 6ca535155a NOISSUE - Bump github.com/caarlos0/env/v11 from 11.3.1 to 11.4.0 (#3363)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-25 14:19:03 +01:00
dependabot[bot] 4a449629b3 NOISUE - Bump github.com/authzed/authzed-go from 1.7.0 to 1.8.0 (#3362)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-24 09:02:40 +01:00
dependabot[bot] 1cd00fbd83 NOISSUE - Bump github.com/pion/dtls/v3 from 3.1.1 to 3.1.2 (#3357)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-23 16:29:10 +01:00
Felix Gateru a871fa926e SMQ-3361 - Enable TLS and mTLS termination on MQTT adapter (#3360)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2026-02-23 16:14:31 +01:00
dependabot[bot] c7fad0d2ca Bump github.com/pion/dtls/v3 from 3.1.0 to 3.1.1 (#3351)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-16 19:47:31 +01:00
dependabot[bot] 51e782693d NOISSUE - Bump github.com/pion/dtls/v3 from 3.0.10 to 3.1.0 (#3350)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-12 14:53:31 +01:00
Dušan Borovčanin e3a3e052d2 NOISSUE - Use the latest stable Go version instead of RC (#3349)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-02-10 13:12:46 +01:00
dependabot[bot] 1e8437cfc2 NOISSUE - Bump github.com/authzed/spicedb from 1.48.0 to 1.49.1 (#3347)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-10 12:51:10 +01:00
dependabot[bot] f8f4ccac79 NOISSUE - Bump golang.org/x/crypto from 0.47.0 to 0.48.0 (#3348)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-10 12:29:04 +01:00
dependabot[bot] 56bb07273d NOISSUE - Bump github.com/go-chi/chi/v5 from 5.2.4 to 5.2.5 (#3344)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
2026-02-09 17:48:37 +01:00
dependabot[bot] aba4d6a0b7 NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.64.0 to 0.65.0 (#3345)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-09 17:47:29 +01:00
dependabot[bot] b948edc573 Bump golang.org/x/oauth2 from 0.34.0 to 0.35.0 (#3346)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-09 12:26:38 +01:00
Arvindh 20bafe0077 NOISSUE - Fix Invitations and remove Domain check in AuthZ (#3340)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2026-02-04 20:56:41 +01:00
Felix Gateru 4e77ae65e2 SMQ-2875 - Add listing entities by multiple tag values with support for AND/OR conditions (#3154)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2026-02-04 17:13:48 +01:00
Steve Munene 61c120f947 SMQ-2627 - Align PATs with new architecture (#3295)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2026-02-03 14:06:30 +01:00
dependabot[bot] 0d4f4c9266 NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.64.0 to 0.65.0 (#3334)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-03 11:42:55 +01:00
dependabot[bot] 668338dfa2 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.39.0 to 1.40.0 (#3335)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-03 11:41:17 +01:00
dependabot[bot] 38ea004e30 NOISSUE - Bump go.opentelemetry.io/otel/sdk from 1.39.0 to 1.40.0 (#3337)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-03 11:30:51 +01:00
dependabot[bot] 7b99baeb02 NOISSUE - Bump github.com/lib/pq from 1.10.9 to 1.11.1 (#3331)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-02 15:06:31 +01:00
Steve Munene cd31b1c6bd NOISSUE - Refactor makefile (#3318)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: dorcaslitunya <anonolitunya@gmail.com>
Co-authored-by: dorcaslitunya <anonolitunya@gmail.com>
2026-01-29 09:50:15 +01:00
dependabot[bot] 1a348b11dd NOISSUE - Bump github.com/dgraph-io/ristretto/v2 from 2.3.0 to 2.4.0 (#3324)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-27 13:57:19 +01:00
dependabot[bot] f552e08661 NOISSUE - Bump github.com/redis/go-redis/v9 from 9.17.2 to 9.17.3 (#3325)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-27 12:17:45 +01:00
dependabot[bot] 5606cdbe47 NOISSUE - Bump github.com/plgd-dev/go-coap/v3 from 3.4.1 to 3.4.2 (#3326)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-27 12:00:39 +01:00
Felix Gateru 59d9f91813 NOISSUE - Remove public metadata, introduce private metadata (#3322)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2026-01-23 14:42:54 +01:00
Felix Gateru 5b913dd46b SMQ-3108 - Add support for public and private metadata for users and clients (#3155)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2026-01-22 08:55:25 +01:00
Steve Munene 9293de7636 NOISSUE - Fix certs network (#3321)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2026-01-21 14:06:55 +01:00
Steve Munene 2dd8c44aa3 NOISSUE - Fix certs override file (#3317)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2026-01-21 09:40:54 +01:00
Felix Gateru 28fc9738df SMQ-3303 - Update API schema request bodies (#3309)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2026-01-19 12:10:46 +01:00
Steve Munene ad1d67a678 NOISSUE - Fetch certs (#3316)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2026-01-19 11:38:20 +01:00
dependabot[bot] 1086f3e208 NOISSUE - Bump golang.org/x/crypto from 0.46.0 to 0.47.0 (#3308)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-19 09:59:59 +01:00
dependabot[bot] b896c03f5f NOISSUE - Bump golang from 1.25.5-alpine3.22 to 1.26rc2-alpine3.22 in /docker in the docker-dependency group (#3314)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-19 09:38:40 +01:00
dependabot[bot] d78c1e8d20 NOISSUE - Bump github.com/go-chi/chi/v5 from 5.2.3 to 5.2.4 (#3315)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-19 09:38:11 +01:00
Felix Gateru 551d44d58e NOISSUE - Fix publisher id on message published by user (#3312)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2026-01-15 17:34:11 +01:00
Felix Gateru 927230dbb4 NOISSUE - Allow superadmin to send messages over channel (#3310)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2026-01-14 18:38:44 +01:00
dependabot[bot] c7996ce6cf NOISSUE - Bump github.com/pion/dtls/v3 from 3.0.9 to 3.0.10 (#3307)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-12 08:52:20 +01:00
dusan bf7a965195 NOISSUE - Update license file
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-12-31 10:52:10 +01:00
Felix Gateru 67c28ff134 SMQ-2800 - Add WebSocket support to HTTP adapter (#2937)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Arvindh <arvindh91@gmail.com>
2025-12-31 10:43:52 +01:00
Arvindh a526a2ccd5 NOISSUE - Add internal type to find NestError and Add Auth key algorithm to journal docker compose (#3304)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-12-30 16:20:35 +01:00
dependabot[bot] c679224596 NOISSUE - Bump google.golang.org/grpc from 1.77.0 to 1.78.0 (#3306)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-29 12:11:18 +01:00
dependabot[bot] e1c881d2ad NOISSUE - Bump github.com/jackc/pgx/v5 from 5.7.6 to 5.8.0 (#3305)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-29 11:38:25 +01:00
dusan 9a0d8062be NOISSUE - Add make_stable target
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-12-29 10:40:08 +01:00
dusan 25d8b86f2b Revert "NOISSUE - Use fixed version in default Docker config"
This reverts commit 24ca513eff.

We are going to stick with the latest for dev env.
2025-12-29 09:40:56 +01:00
dusan 24ca513eff NOISSUE - Use fixed version in default Docker config
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-12-29 09:32:55 +01:00
Dušan Borovčanin 52510d8c62 NOISSUE - Improve JWKS (#3301)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-12-26 18:15:12 +01:00
Dušan Borovčanin 6b6bab79c6 NOISSUE - Update Auth service tests (#3300)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-12-24 18:44:26 +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
Felix Gateru 59f8d4e4d7 NOISSUE : Revert removal of errors Unwrap function (#3299)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-12-23 15:37:51 +01:00
Felix Gateru e23555ee2a SMQ-3036 - Add events tests for channels,clients, domains and groups (#3279)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-12-23 12:18:39 +01:00
Felix Gateru cb337a38fd SMQ-3036 - Add nested mocks and generated proto files to ignore in codecov.yaml (#3280)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-12-23 12:17:38 +01:00
Felix Gateru f9b503f1d6 SMQ-3125 - Add ordering tests (#3297)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-12-22 15:01:57 +01:00
Steve Munene 0fe5a6d6e8 SMQ-2632 - Remove PAT logics from middleware (#3291)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-12-22 11:10:16 +01:00
dependabot[bot] f612109f24 NOISSUE - Bump github.com/nats-io/nats.go from 1.47.0 to 1.48.0 (#3296)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-22 08:48:27 +01:00
Arvindh 3fcf2e5369 SMQ-1744 - Error handling with TypedError created on top existing Error (#3170)
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Co-authored-by: Felix Gateru <felix.gateru@gmail.com>
2025-12-22 08:31:52 +01:00
Steve Munene 1355bc8bb7 SMQ-2757 - Combine Authorization and AuthorizationPAT to single gRPC endpoint and combine service functions (#3292)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-12-19 17:51:06 +01:00
Veddy 1e7e65d642 SMQ-3290 - Fix the bug that groups queries too slowly at multiple levels (#3293)
Signed-off-by: Veddy <veddy@qq.com>
Co-authored-by: veddy <veddy@qq.com>
2025-12-18 09:47:36 +01:00
Steve Munene 3a5c1e12df NOISSUE - New operation permission (#3281)
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Co-authored-by: Arvindh <arvindh91@gmail.com>
2025-12-17 14:29:28 +01:00
dependabot[bot] 61b95a28c2 NOISSUE - Bump google.golang.org/protobuf from 1.36.10 to 1.36.11 (#3288)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-17 13:10:41 +01:00
dependabot[bot] 4c40b8b82c NOISSUE - Bump github.com/authzed/spicedb from 1.47.1 to 1.48.0 (#3289)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-17 13:10:05 +01:00
dependabot[bot] 955c556fe6 NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.63.0 to 0.64.0 (#3283)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 18:40:45 +01:00
dependabot[bot] dc437a8296 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.38.0 to 1.39.0 (#3284)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 18:38:18 +01:00
dependabot[bot] 314537f7c5 NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.63.0 to 0.64.0 (#3286)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 18:36:43 +01:00
dependabot[bot] 7e5fd0cfa8 NOISSUE - Bump github.com/pion/dtls/v3 from 3.0.8 to 3.0.9 (#3287)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 17:25:45 +01:00
dependabot[bot] 6a2c8a3ca6 NOISSUE - Bump the gh-dependency group in /.github/workflows with 2 updates (#3285)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 17:21:26 +01:00
dependabot[bot] 2bea4412d8 NOISSUE - Bump golang.org/x/crypto from 0.45.0 to 0.46.0 (#3282)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 17:20:51 +01:00
dusan c8cb0daa6c NOISSUE - Update Go version detection
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-12-09 12:28:25 +01:00
dusan f8017c8b9f NOISSUE - Update Go version
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-12-09 12:18:01 +01:00
dependabot[bot] 27fc32c153 NOISSUE - Bump golang from 1.25.4-alpine3.22 to 1.25.5-alpine3.22 in /docker in the docker-dependency group (#3271)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-09 12:11:37 +01:00
dependabot[bot] 9aa9487207 NOISSUE - Bump golang.org/x/oauth2 from 0.33.0 to 0.34.0 (#3276)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-09 12:11:08 +01:00
dependabot[bot] 1292095cdb NOISSUE - Bump github.com/pion/dtls/v3 from 3.0.7 to 3.0.8 (#3273)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-09 12:06:04 +01:00
dependabot[bot] 856ef1ba49 NOISSUE - Bump github.com/spf13/cobra from 1.10.1 to 1.10.2 (#3272)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-09 12:04:25 +01:00
dependabot[bot] 146028fb98 NOISSUE - Bump golang.org/x/sync from 0.18.0 to 0.19.0 (#3277)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-09 12:01:20 +01:00
dependabot[bot] 6cb3e635c9 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace from 1.38.0 to 1.39.0 (#3278)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-08 22:02:00 +01:00
dependabot[bot] 175d27c4b6 NOISSUE - Bump the gh-dependency group in /.github/workflows with 2 updates (#3274)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-08 18:44:39 +01:00
Arvindh eec6b8be07 NOISSUE - Fix migrations error (#3275)
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Co-authored-by: Felix Gateru <felix.gateru@gmail.com>
2025-12-08 18:43:51 +01:00
Dušan Borovčanin e48e5dee1f NOISSUE - Improve CI (#3270)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-12-08 10:12:12 +01:00
Dušan Borovčanin 0df8e8451c NOISSUE - Make CI scripts run in parallel (#3269)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-12-02 22:58:23 +01:00
dependabot[bot] e77e3a3bb6 NOISSUE - Bump github.com/redis/go-redis/v9 from 9.17.1 to 9.17.2 (#3268)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-02 01:37:53 +01:00
Dušan Borovčanin 3e6b771850 NOISSUE - Improve Swagger GH actions (#3267)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-12-02 00:13:42 +01:00
Nataly Musilah 15e756a5a3 SMQ-3026 - Update READMEs and make them use the same l&f (#3239)
Signed-off-by: Musilah <nataleigh.nk@gmail.com>
2025-12-01 18:52:53 +01:00
Steve Munene c5a4336d43 SMQ-3094 - Improve test coverage in channels and journals (#3238)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-12-01 18:15:57 +01:00
Felix Gateru b05ae65e24 SMQ-3095 - Improve test coverage in clients repository (#3156)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-12-01 17:57:43 +01:00
Felix Gateru 1a8d11acdd SMQ-3095 - Add users events tests (#3240)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-12-01 17:51:24 +01:00
Steve Munene 27b72db52e SMQ-3233 - Move callout to seperate middleware (#3244)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-12-01 17:40:49 +01:00
dependabot[bot] e75ce59998 NOISSUE - Bump github.com/redis/go-redis/v9 from 9.17.0 to 9.17.1 (#3263)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-01 17:13:36 +01:00
Felix Gateru cd281c2589 SMQ-2799 - Add support for basic auth for HTTP and WS adapters (#3049)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-12-01 16:51:49 +01:00
Felix Gateru 9d13d5b528 SMQ-3224 - Add consistent error for assigning channel and client with parent group to parent group (#3225)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-12-01 16:32:58 +01:00
Felix Gateru f7dcaa949b SMQ-2997 - Allow listing root groups with groups that the user has access to (#3226)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-12-01 14:15:31 +01:00
dusan fa080ab0f8 NOISSUE - Add DeepWiki link
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-11-29 14:08:35 +01:00
dusan 5807cf1754 NOISSUE - Add HTTP server timeouts
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-11-28 18:21:25 +01:00
dusan f96ddab9dd NOISSUE - Update Abstract Machines link
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-11-28 15:34:19 +01:00
Steve Munene 914d491a13 NOISSUE - Update search in CLI (#3261)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-11-28 15:31:21 +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
Arvindh 9ba9a12084 NOISSUE - Enable oAuth users to change and reset password (#3259)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-11-27 18:02:57 +01:00
Steve Munene 5ed6b258a0 NOISSUE - Update health sdk (#3256)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-11-26 15:39:34 +01:00
Steve Munene eb83edbcde SMQ-3253 - Update CLI usage (#3252)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-11-25 20:02:23 +01:00
dependabot[bot] 5c12bc8c91 NOISSUE - Bump github.com/plgd-dev/go-coap/v3 from 3.4.0 to 3.4.1 (#3246)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-25 12:44:33 +01:00
dependabot[bot] 589209eae2 NOISSUE - Bump github.com/redis/go-redis/v9 from 9.16.0 to 9.17.0 (#3247)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-25 12:44:00 +01:00
dependabot[bot] a2e660b8a1 NOISSUE - Bump google.golang.org/grpc from 1.76.0 to 1.77.0 (#3249)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-25 12:42:43 +01:00
dependabot[bot] 21731aef37 NOISSUE - Bump github.com/rubenv/sql-migrate from 1.8.0 to 1.8.1 (#3248)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-25 12:42:11 +01:00
dependabot[bot] 2f55947305 NOISSUE - Bump actions/checkout from 5 to 6 in /.github/workflows in the gh-dependency group (#3251)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-25 11:42:34 +01:00
dependabot[bot] 80806c4745 NOISSUE - Bump github.com/authzed/authzed-go from 1.6.0 to 1.7.0 (#3250)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-25 11:20:29 +01:00
dependabot[bot] 1947f6e78e NOISSUE - Bump github.com/authzed/spicedb from 1.47.0 to 1.47.1 (#3245)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-23 22:29:55 +01:00
Dušan Borovčanin 5b0c556b60 NOISSUE - Security fixes (#3243)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-11-20 23:51:23 +01:00
dependabot[bot] 5891e4bb75 NOISSUE - Bump golang.org/x/crypto from 0.44.0 to 0.45.0 (#3242)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-20 10:19:46 +01:00
dependabot[bot] 299742096a NOISSUE - Bump golang.org/x/crypto from 0.43.0 to 0.44.0 (#3236)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-19 09:20:17 +01:00
dependabot[bot] 27c57b192b NOISSUE - Bump golang from 1.25.3-alpine to 1.25.4-alpine in /docker in the docker-dependency group (#3229)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-11 22:06:12 +01:00
dependabot[bot] 8083cec373 NOISSUE - Bump golang.org/x/oauth2 from 0.32.0 to 0.33.0 (#3231)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-11 21:49:12 +01:00
dependabot[bot] e2d9b1ddf9 NOISSUe - Bump golangci/golangci-lint-action from 8 to 9 in /.github/workflows in the gh-dependency group (#3232)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-10 13:56:39 +01:00
dependabot[bot] 6092bc2cf0 NOISSUE - Bump golang.org/x/sync from 0.17.0 to 0.18.0 (#3230)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-10 13:55:45 +01:00
b1ackd0t 071d23a5f0 SMQ-3173 - Use buildx for Multi-Platform Docker Image Support (#3181)
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2025-11-10 13:42:42 +01:00
dependabot[bot] 7bb4b298c5 NOISSUE - Bump github.com/opencontainers/runc from 1.2.3 to 1.2.8 (#3227)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-07 16:09:41 +01:00
dependabot[bot] cac6c648d3 NOISSUE - Bump github.com/gofrs/uuid/v5 from 5.3.2 to 5.4.0 (#3223)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-04 11:07:32 +01:00
dependabot[bot] 4ee7736b32 NOISSUE - Bump github.com/redis/go-redis/v9 from 9.14.1 to 9.16.0 (#3206)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-03 15:18:05 +01:00
dependabot[bot] 8ed8915e4f NOISSUE - Bump github.com/authzed/spicedb from 1.46.0 to 1.47.0 (#3208)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-03 12:40:48 +01:00
Dušan Borovčanin 65c6a4d8f4 NOISSUE - Update mGate version (#3217)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-10-31 16:21:25 +01:00
Sammy Kerata Oina ec223e7467 NOISSUE - Update dependencies in go.mod and go.sum (#3215)
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
2025-10-31 12:47:47 +01:00
Dušan Borovčanin aa3cc3d7ee NOISSUE - Fix API docs (#3212)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-10-30 18:16:29 +01:00
Steve Munene 9650dde716 NOISSUE - Update API docs (#3211)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-10-30 17:37:01 +01:00
Arvindh d02747a56f NOISSUE - Fix mqtt adapter target ws server protcol and update mgate version (#3209)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-10-29 14:30:23 +01:00
Felix Gateru dc0df1c955 SMQ-3137 - Proxy CoAP using mgate (#2222)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-10-24 17:55:02 +02:00
Steve Munene 64b4497ad4 NOISSUE - Increase NGINX client body size (#3204)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-10-22 15:55:37 +02:00
Dušan Borovčanin 1b26264495 NOISSUE - Fix SSO User metadata update (#3203)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-10-22 15:32:55 +02:00
Felix Gateru 69366d77cc SMQ-3171 - Add domain ID to channel authorization request (#3179)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-10-22 12:53:37 +02:00
Washington Kigani Kamadi fa8862cbc8 NOISSUE - Add auth_provider field to sdk (#3202)
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
2025-10-22 12:51:38 +02:00
Dušan Borovčanin 15b8901853 NOISSUE - Fix password reset (#3200)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-10-21 19:44:41 +02:00
Dušan Borovčanin 9258237cb6 NOISSUE - Add domain field in domains callouts (#3199)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-10-21 14:31:11 +02:00
Dušan Borovčanin 2adeecd9ec NOISSUE - Update call-home (#3198)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-10-20 20:44:46 +02:00
Dušan Borovčanin c5eee6d8fd NOISSUE - Update dependencies (#3197)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-10-20 16:54:01 +02:00
dependabot[bot] 648edbd386 NOISSUE - Bump github.com/nats-io/nats.go from 1.46.1 to 1.47.0 (#3195)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-20 12:45:33 +02:00
dependabot[bot] 35fb296318 NOISSUE - Bump github.com/redis/go-redis/v9 from 9.14.0 to 9.14.1 (#3196)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-20 12:44:21 +02:00
dependabot[bot] a98777b191 NOISSUE - Bump golang from 1.25.1-alpine to 1.25.3-alpine in /docker in the docker-dependency group (#3194)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-20 12:07:32 +02:00
Dušan Borovčanin 3c693a7b41 NOISSUE - Fix key logging (#3193)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-10-17 15:24:24 +02:00
Dušan Borovčanin c230a24b7d NOISSUE - Use structured requests in callouts (#3191)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-10-17 13:11:20 +02:00
Steve Munene 42b2a8c166 NOISSUE - Close PATs sql rows (#3190)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-10-16 16:32:54 +02:00
Dušan Borovčanin 6468ebe749 NOISSUE - Fix Domain creation callout (#3189)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-10-16 15:38:51 +02:00
b1ackd0t 1adbe1ff24 NOISSUE - Enhance docker-compose and Makefile configurations (#3153)
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2025-10-15 14:41:16 +02:00
Arvindh 27995cb093 NOISSUE - Add Auth provider in profile view response (#3187)
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Co-authored-by: nyagamunene <stevenyaga2014@gmail.com>
2025-10-15 14:17:37 +02:00
dependabot[bot] 5833bafbee NOISSUE - Bump golang.org/x/oauth2 from 0.31.0 to 0.32.0 (#3183)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-15 14:09:44 +02:00
dependabot[bot] 6394908b2c NOISSUE - Bump golang.org/x/crypto from 0.42.0 to 0.43.0 (#3182)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-15 10:27:49 +02:00
dependabot[bot] 0e0598c6d8 NOISSUE - Bump github.com/authzed/spicedb from 1.45.4 to 1.46.0 (#3184)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-15 10:26:21 +02:00
dependabot[bot] 3e400da5ad NOISSUE - Bump google.golang.org/grpc from 1.75.1 to 1.76.0 (#3185)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-15 10:25:56 +02:00
Arvindh 2112281171 NOISSUE - Auto generation username for oauth user during singup (#3178)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-10-09 15:19:46 +02:00
Arvindh 6f40c7fa1e NOISSUE - Handle Domain & Channel Route not available error during creation (#3180)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-10-09 15:06:06 +02:00
Arvindh b0e9e43b9e NOISSUE - Handle user registration errors (#3177)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-10-08 19:56:54 +02:00
Felix Gateru bc7727c275 SMQ-3175 - Fix clearing domain metadata on domain name and tags update (#3176)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-10-08 17:36:03 +02:00
Arvindh 8d1c3c41b5 NOISSUE - Fix OAuth auto verification on register (#3174)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-10-07 18:24:23 +02:00
dependabot[bot] d84df8604f NOISSUE - Bump github.com/authzed/authzed-go from 1.5.1-0.20250909211335-16b58d03994c to 1.6.0 (#3168)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-06 11:04:55 +02:00
dependabot[bot] d4d8bc5351 NOISSUE - Bump google.golang.org/protobuf from 1.36.9 to 1.36.10 (#3167)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-06 10:55:26 +02:00
dependabot[bot] ac9bc9aad6 NOISSUE - Bump github.com/nats-io/nats.go from 1.46.0 to 1.46.1 (#3166)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-06 10:48:52 +02:00
dependabot[bot] 4b83301f69 NOISSUE - Bump peter-evans/repository-dispatch from 3 to 4 in /.github/workflows in the gh-dependency group (#3161)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-02 13:18:19 +02:00
Arvindh b746a8679f NOISSUE - Fixing auto verification unverified users flow (#3163)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-10-02 13:17:32 +02:00
Arvindh e6022542b9 NOISSUE - Auto verify OAuth user during OAuth Callback (#3162)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-10-02 11:14:06 +02:00
Arvindh 6c77e1b738 SMQ-3159 - Return specific error on non-existent user during login (#3160)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-10-01 18:51:50 +02:00
Steve Munene 04774ae972 NOISSUE - Remove empty file (#3157)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-10-01 11:44:26 +02:00
Steve Munene ae7c93020a SMQ-3028 - Unify SMQ certs with Absmach Certs (#3146)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-10-01 11:08:33 +02: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
dependabot[bot] 0465ceb7a3 NOISSUE - Bump github.com/nats-io/nats.go from 1.45.0 to 1.46.0 (#3152)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-25 16:47:52 +02:00
dependabot[bot] af424ee2cb NOISSUE - Bump github.com/authzed/spicedb from 1.45.3 to 1.45.4 (#3150)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-21 19:43:31 +03:00
dependabot[bot] 96a15b32dd NOISSUE - Bump github.com/eclipse/paho.mqtt.golang from 1.5.0 to 1.5.1 (#3151)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-21 19:20:37 +03:00
Felix Gateru 61f1e9aca2 MG-314 - Update API docs related for listing entities (#3149)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-09-18 12:18:00 +02:00
Nataly Musilah 29f7063c15 NOISSUE - Fix Groups and Channels Users Listing (#3138)
Signed-off-by: musilah <nataleigh.nk@gmail.com>
2025-09-18 11:28:40 +02:00
Felix Gateru 1f48a73677 SMQ-2945 - Add channels events consumer (#2951)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-09-16 17:23:01 +02:00
Felix Gateru cd9cb9e1d5 SMQ-2944 - Add client events consumer (#2947)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-09-16 17:21:39 +02:00
dependabot[bot] 8d9e92f228 NOISSUE - Bump google.golang.org/protobuf from 1.36.8 to 1.36.9 (#3142)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-15 12:41:24 +02:00
dependabot[bot] ad685c27ad NOISSUE - Bump github.com/redis/go-redis/v9 from 9.13.0 to 9.14.0 (#3141)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-15 12:24:53 +02:00
dependabot[bot] 44485cacec NOISSUE - Bump google.golang.org/grpc from 1.75.0 to 1.75.1 (#3143)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-15 12:24:13 +02:00
Felix Gateru 7fac6ff4c4 SMQ-2801 - Add health check endpoint with client authentication to CoAP adapter (#3139)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-09-15 12:23:36 +02:00
Felix Gateru 1930a0c8f2 SMQ-2801 - Add health check endpoint to WS adapter (#3144)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-09-15 10:33:39 +02:00
Felix Gateru 9eac9366ba SMQ-2801 - Add health check endpoint to HTTP adapter (#3140)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-09-12 12:14:14 +02:00
Felix Gateru ad191c4609 SMQ-2801 - Add health check endpoint for MQTT adapter (#3024)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-09-12 11:37:29 +02:00
dependabot[bot] 1d935f0519 NOISSUE - Bump golang.org/x/crypto from 0.41.0 to 0.42.0 (#3133)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-09 08:54:25 +02:00
dependabot[bot] bc1ccace4a NOISSUE - Bump github.com/absmach/callhome from 0.14.0 to 0.18.1 (#3134)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-09 08:53:53 +02:00
dependabot[bot] 89fdb4e6c7 NOISSUE - Bump golang.org/x/oauth2 from 0.30.0 to 0.31.0 (#3135)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-09 08:52:42 +02:00
dependabot[bot] 44e44639aa NOISSUE - Bump github.com/jackc/pgx/v5 from 5.7.5 to 5.7.6 (#3136)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-09 08:52:08 +02:00
dependabot[bot] d31c66174e NOISSUE - Bump actions/setup-go from 5 to 6 in /.github/workflows in the gh-dependency group (#3131)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-06 18:05:13 +02:00
dependabot[bot] e6d7a07277 NOISSUE - Bump golang from 1.25.0-alpine to 1.25.1-alpine in /docker in the docker-dependency group (#3127)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-06 18:03:18 +02:00
dependabot[bot] a2ea92a5ba NOISSUE - Bump github.com/prometheus/client_golang from 1.23.0 to 1.23.2 (#3130)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-06 18:01:27 +02:00
dependabot[bot] 3320a716f3 NOISSUE - Bump github.com/redis/go-redis/v9 from 9.12.1 to 9.13.0 (#3128)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-06 18:00:49 +02:00
Felix Gateru a70b838f1c SMQ-2924 - Allow bulk deleting of invitations from repository (#2942)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-09-05 19:26:45 +02:00
Nataly Musilah c50221a042 NOISSUE - Update entity sorting (#3076)
Signed-off-by: Musilah <nataleigh.nk@gmail.com>
Signed-off-by: musilah <nataleigh.nk@gmail.com>
2025-09-05 15:58:03 +02:00
Arvindh 1efa8b5bce NOISSUE - Allow unverified users by default in docker compose (#3124)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-09-05 15:40:47 +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
Sammy Kerata Oina 22616911d2 NOISSUE - Change email body format from plain text to HTML in Send method (#3118)
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
2025-09-04 19:54:01 +02:00
Steve Munene 766bb5519a SMQ-2275 - Update SDK godocs (#3119)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-09-04 11:35:12 +02:00
Steve Munene fbcdef9693 SMQ-3061 - Separate CLI command for Domain and User Invitations (#3117)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-09-03 13:00:23 +02:00
dependabot[bot] 9aacde7c5b NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.62.0 to 0.63.0 (#3115)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-03 10:43:14 +02:00
dependabot[bot] cdf26051f6 NOISSUE - Bump github.com/openbao/openbao/api/v2 from 2.3.1 to 2.4.0 (#3112)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-03 10:30:12 +02:00
dependabot[bot] a9a412e909 NOISSUE - Bump github.com/spf13/cobra from 1.9.1 to 1.10.1 (#3111)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-03 10:28:43 +02:00
dependabot[bot] 0754fa1126 NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.62.0 to 0.63.0 (#3116)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-03 10:28:20 +02:00
Steve Munene ec75f4eadb SMQ-3062 - Update Domain Invitation Deletion Endpoint (#3110)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-09-02 10:16:49 +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
dependabot[bot] 6a27594751 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.37.0 to 1.38.0 (#3105)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-01 14:52:42 +02:00
dependabot[bot] 555d89d358 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace from 1.37.0 to 1.38.0 (#3103)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-01 10:41:50 +02:00
dependabot[bot] c3c9dcf318 NOISSUE - Bump github.com/go-chi/chi/v5 from 5.2.2 to 5.2.3 (#3104)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-01 10:35:19 +02:00
dependabot[bot] 5a75772f62 NOISSUE - Bump go.opentelemetry.io/otel from 1.37.0 to 1.38.0 (#3107)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-01 10:35:01 +02:00
Steve Munene b9ac94f058 SMQ-2495 - Refactor CLI to use entity IDs (#3100)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-09-01 10:22:14 +02:00
Felix Gateru 8ab1f4c408 SMQ-2836 - Skip checking super admin if the role in JWT is not super admin (#3099)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-08-29 12:09:31 +02:00
Dušan Borovčanin e842bfaab6 NOISSUE - Update Protobufs (#3091)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-08-26 13:31:08 +02:00
dependabot[bot] 886cd63415 NOISSUE - Bump github.com/stretchr/testify from 1.10.0 to 1.11.0 (#3089)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-26 12:29:54 +02:00
dependabot[bot] 9cd22910d8 NOISSUE - Bump github.com/dgraph-io/ristretto/v2 from 2.2.0 to 2.3.0 (#3090)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-26 12:27:28 +02:00
Felix Gateru 906e365adf NOISSUE - Fix clients listing repository tests (#3088)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-08-26 12:25:57 +02:00
dependabot[bot] 8e7e897906 NOISSUE - Bump github.com/authzed/authzed-go from 1.4.1 to 1.5.0 (#3084)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-26 00:13:39 +02:00
dependabot[bot] 4b50ef93a2 NOISSUE - Bump actions/checkout from 4 to 5 in /.github/workflows in the gh-dependency group (#3080)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-25 23:54:33 +02:00
dependabot[bot] 73c2d76b58 NOISSUE - Bump google.golang.org/grpc from 1.74.2 to 1.75.0 (#3083)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-25 23:53:02 +02:00
dependabot[bot] 473338527a NOISSUE - Bump google.golang.org/protobuf from 1.36.7 to 1.36.8 (#3082)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-25 23:29:09 +02:00
dependabot[bot] 12d1a0de32 NOISSUE - Bump github.com/authzed/spicedb from 1.45.1 to 1.45.3 (#3085)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-25 23:27:48 +02:00
dependabot[bot] b4e0e89c38 NOISSUE - Bump github.com/nats-io/nats.go from 1.44.0 to 1.45.0 (#3086)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-25 23:20:39 +02:00
dependabot[bot] 6f5e535b30 NOISSUE - Bump golang from 1.24.5-alpine to 1.25.0-alpine in /docker in the docker-dependency group (#3081)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-25 23:19:09 +02:00
Dušan Borovčanin fb1062a98a NOISSUE - Fix linters and Mockery (#3087)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-08-25 23:15:38 +02:00
dusan c56a5ae577 NOISSUE - Update Go version
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-08-25 18:37:56 +02:00
Dušan Borovčanin a19cd9c97b NOISSUE - Replace interface{} with any (#3079)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-08-25 18:06:41 +02:00
Felix Gateru 0e1a090f16 SMQ-3070 - Fix property based tests (#3078)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-08-25 16:17:19 +02:00
dependabot[bot] ef712443e1 NOISSUE - Bump github.com/go-viper/mapstructure/v2 from 2.3.0 to 2.4.0 (#3077)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-25 13:24:09 +02:00
Smith Jilks 248b708909 NOISSUE - Update callouts client tls config (#3068)
Signed-off-by: Jilks Smith <smithjilks@gmail.com>
2025-08-21 16:44:11 +02:00
Felix Gateru c63c936b36 SMQ-3073 - Enable user messaging through WS and HTTP protocols (#3075)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-08-21 16:10:34 +02:00
Felix Gateru 4927333691 NOISSUE - Update SMQ version in docs (#3072)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-08-20 15:56:54 +02:00
dependabot[bot] 5acc8f96a6 NOISSUE - Bump golang.org/x/crypto from 0.40.0 to 0.41.0 (#3059)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-19 18:28:33 +02:00
dependabot[bot] 9d91740063 NOISSUE - Bump google.golang.org/protobuf from 1.36.6 to 1.36.7 (#3060)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-19 14:06:20 +02:00
dependabot[bot] 1951f206cb NOISSUE - Bump github.com/docker/docker from 27.1.1+incompatible to 28.0.0+incompatible (#3067)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-19 14:00:08 +02:00
dependabot[bot] 441feb8578 NOISSUE - Bump github.com/redis/go-redis/v9 from 9.11.0 to 9.12.1 (#3058)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-19 13:57:48 +02:00
dependabot[bot] 7d11f16988 NOISSUE - Bump github.com/absmach/certs from 0.0.0-20250602111612-89538302ad6a to 0.17.0 (#3057)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-19 13:56:36 +02:00
Nataly Musilah 2e3f52fdbf NOISSUE - Allow sorting (#3052)
Signed-off-by: Musilah <nataleigh.nk@gmail.com>
2025-08-18 14:54:26 +02:00
Felix Gateru b942a42271 SMQ-3053 - Fix listing subgroups for users with subgroup related actions (#3066)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-08-18 09:24:23 +02:00
Steve Munene 0178594c25 SMQ-3056 - Fix exposed secret in MQTT (#3065)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-08-18 09:23:01 +02:00
Steve Munene 3dbd617ed0 SMQ-3050 - Fix PAT redis connection (#3051)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-08-13 14:50:20 +02:00
Felix Gateru 8188da16b3 NOISSUE - Update removal of view invitation endpoint in sdk and cli (#3055)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-08-13 14:48:12 +02:00
Smith Jilks bc7b988098 NOISSUE - Add ability to handle both tls cert file and raw cert data (#2871)
Signed-off-by: Jilks Smith <smithjilks@gmail.com>
2025-08-08 15:48:36 +02:00
Felix Gateru a0b3970ad6 SMQ-3032 - Remove view invitations endpoint (#3042)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-08-07 20:31:15 +02:00
Felix Gateru 0f20663cfb SMQ-2704 - Update listing of group hierarchy (#2710)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-08-07 11:53:23 +02:00
Felix Gateru 4dc98763a6 SMQ-3044 - Fix listing channel logs with operation query parameter (#3043)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-08-05 20:55:09 +02:00
Filip Bugarski 230be1d13b NOISSUE - Fix typos (#2927)
Signed-off-by: fbugarski <filipbugarski@gmail.com>
2025-08-03 15:56:45 +02:00
Arvindh 99493d86ff NOISSUE - Fix callout test (#3041)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-08-01 14:28:49 +02:00
Arvindh 4ffb1fe422 NOISSUE - Handle callout error (#3039)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-08-01 13:53:21 +02:00
Washington Kigani Kamadi f4417ecb78 NOISSUE - List domain invitations on SDK (#3038)
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
2025-08-01 09:48:32 +02:00
Dušan Borovčanin 9b77130f6e SMQ-2866 - MQTT auth fails with identical secrets across different domains (#3030)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-07-31 14:55:37 +02:00
dependabot[bot] 71ea84c3ec NOISSUE - Bump github.com/prometheus/client_golang from 1.22.0 to 1.23.0 (#3033)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-31 13:04:23 +02:00
dependabot[bot] 36c138688d NOISSUE - Bump github.com/nats-io/nats.go from 1.43.0 to 1.44.0 (#3034)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-31 13:00:20 +02:00
Washington Kigani Kamadi 86afe1736f NOISSUE - Add domain name to invitation (#3031)
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
2025-07-30 18:32:49 +02:00
Steve Munene 8e70e1113e SMQ-3201 - Replace Vault with openbao (#3019)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-07-28 12:03:50 +02:00
b1ackd0t a379d11035 NOISSUE - Fix mTLS setup (#3029)
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2025-07-23 12:58:15 +02:00
dependabot[bot] 45a5c42ea4 NOISSUE - Bump google.golang.org/grpc from 1.73.0 to 1.74.2 (#3027)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-23 10:08:17 +02:00
Felix Gateru 99a55a6e24 SMQ-2801 - Add health check endpoint for CoAP adapter (#3022)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-07-21 18:14:55 +02:00
Felix Gateru 6e404caa32 NOISSUE - Move codecov yaml file (#3020)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-07-17 11:18:01 +02:00
Felix Gateru 898048cb8b SMQ-2967- Rename RetrieveByRoute method to RetrieveIDByRoute (#2972)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-07-15 12:05:39 +02:00
Felix Gateru 0794c2828e SMQ-2966 - Rename domains RetrieveEntity to RetrieveStatus (#2973)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-07-15 11:24:41 +02:00
dependabot[bot] 7be4ec6890 NOISSUE - Bump github.com/absmach/senml from 1.0.7 to 1.0.8 (#3018)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-15 10:58:33 +02:00
Felix Gateru 5669e8a76e SMQ-2977 - Add cache for message topic caching (#3000)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-07-15 10:46:45 +02:00
Steve Munene d4dc7ffe35 SMQ-2873 - Switch to TIMESTAMPZ in Postgres (#3015)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-07-14 23:35:47 +02:00
Felix Gateru b6080bc42b SMQ-3016 - Fix false positive http logging (#3017)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-07-14 17:25:42 +02:00
Felix Gateru 0dea465fb3 SMQ-2958 - Fix failing reset password flow (#2970)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-07-14 16:37:09 +02:00
dependabot[bot] 879225f7a8 NOISSUE - Bump golang.org/x/crypto from 0.39.0 to 0.40.0 (#3013)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-14 10:03:08 +02:00
dependabot[bot] f8a7a75486 NOISSUE - Bump github.com/authzed/spicedb from 1.44.4 to 1.45.1 (#3014)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-14 09:05:34 +02:00
Felix Gateru fb0b188d4e SMQ-2985 - Use coap mux.Handler instead of coap mux.HandlerFunc (#2992)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-07-10 17:57:22 +02:00
Steve Munene 376bc8b9c4 SMQ-2840 - Retrieve entity total with filter options (#2961)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-07-10 17:36:31 +02:00
JeffMboya da319a1aa9 NOISSUE - Fix db connection leaks (#3009)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2025-07-10 13:26:37 +02:00
Felix Gateru 2ab3db79e5 SMQ-2997 - Use nlevel to filter root groups (#3005)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-07-10 12:46:31 +02:00
Dusan Borovcanin 33e8d4f47e NOISSUE - Update Go version
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-07-10 12:27:48 +02:00
dependabot[bot] 902e85e648 NOISSUE - Bump golang from 1.24.4-alpine to 1.24.5-alpine in /docker in the docker-dependency group (#3006)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-10 12:25:15 +02:00
dependabot[bot] afb28667c4 NOISSUE - Bump golang.org/x/sync from 0.15.0 to 0.16.0 (#3008)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-10 12:23:24 +02:00
dependabot[bot] 26feb34f8d NOISSUE - Bump github.com/plgd-dev/go-coap/v3 from 3.3.6 to 3.4.0 (#3007)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-10 12:15:45 +02:00
Steve Munene bdfdb67998 SMQ-3001 - Fix issue token return error (#3004)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-07-09 20:39:26 +02:00
Felix Gateru 1c0400d3a5 SMQ-2260 - Log full errors in logging middleware (#3003)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-07-09 15:21:16 +02:00
Dusan Borovcanin fa5b6b86c6 NOISSUE - Fix Swagger docs dir
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-07-07 10:42:44 +02:00
Dusan Borovcanin 16f1b411ec NOISSUE - Update Swagger UI
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-07-07 10:23:17 +02:00
Dušan Borovčanin be66701b15 NOISSUE - Update nullable handling (#2999)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-07-04 17:34:31 +02:00
Felix Gateru 0a18a580eb SMQ-2865 - Fix listing indirect groups and group related listing of channels and clients (#2976)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-07-04 17:33:58 +02:00
Dušan Borovčanin a0044c51be NOISSUE - Fix Domain mocks (#2998)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-07-03 18:18:50 +02:00
Steve Munene 788d8334f7 SMQ-2743 - Update group description to nullable string (#2968)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-07-03 18:15:31 +02:00
Felix Gateru 7ecdd7ebe3 SMQ-2971 - Bump mockery version to 3.5.0 (#2991)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-07-03 15:14:14 +02:00
dependabot[bot] dda01ff4a1 NOISSUE - Bump schemathesis/action from 2.0.1 to 2.1.0 in /.github/workflows in the gh-dependency group (#2993)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-02 15:50:10 +02:00
Felix Gateru 5d04de4ffa SMQ-2719 - Update list domain invitations endpoint (#2965)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-07-01 19:03:33 +02:00
dependabot[bot] f6e8db4c09 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.36.0 to 1.37.0 (#2989)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-01 16:20:05 +02:00
dependabot[bot] 0f9ae05615 NOISSUE - Bump github.com/redis/go-redis/v9 from 9.10.0 to 9.11.0 (#2988)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-01 16:12:29 +02:00
dependabot[bot] bcba9e962e NOISSUE - Bump github.com/authzed/authzed-go from 1.4.0 to 1.4.1 (#2990)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-01 16:10:49 +02:00
unwynd 191f8a1e0f SMQ-2862 - Update OpenAPI spec for Journal service (#2938)
Signed-off-by: Abdullah Elmarghany <abdullah@elmarghany.com>
2025-07-01 15:04:52 +02:00
Felix Gateru 0d1aafcbbf SMQ-2956 - Add routes resolver to abstract topic resolution logic (#2960)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-07-01 15:04:01 +02:00
Steve Munene 9a194a86df SMQ-2987 - Fix view domain roles using roleID (#2986)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-06-30 19:09:21 +02:00
dependabot[bot] 668013cbad NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.61.0 to 0.62.0 (#2982)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 10:08:15 +02:00
dependabot[bot] d83f0b8559 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace from 1.36.0 to 1.37.0 (#2980)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 10:04:32 +02:00
dependabot[bot] c198e8093b NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.61.0 to 0.62.0 (#2983)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 10:01:08 +02:00
dependabot[bot] 12a562284e NOISSUE - Bump go.opentelemetry.io/otel/sdk from 1.36.0 to 1.37.0 (#2984)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 09:48:25 +02:00
dependabot[bot] 54c1ff0587 NOISSUE - Bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.3.0 (#2979)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-28 12:58:54 +02:00
Steve Munene d9cf3851a1 SMQ-2974 - Fix listing entities from different domains (#2975)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-06-26 14:12:57 +02:00
Felix Gateru 9abdf39fd6 SMQ-2962 - Add constraints to username creation (#2963)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-06-24 13:55:02 +02:00
Felix Gateru d8e895970c NOISSUE - Fix listing groups audit logs (#2940)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-06-23 11:58:28 +02:00
dependabot[bot] f7f399a5a5 NOISSUE - Bump schemathesis/action from 2.0.0 to 2.0.1 in /.github/workflows in the gh-dependency group (#2959)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 10:17:23 +02:00
dependabot[bot] 3a1b9ce20b NOISSUE - Bump github.com/go-chi/chi/v5 from 5.2.1 to 5.2.2 (#2957)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 09:41:11 +02:00
JeffMboya 8d04e7adbe SMQ-2905 - Add repo dispatch to trigger stage deployment (#2906)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2025-06-20 16:11:09 +02:00
Felix Gateru 707ca54ef9 NOISSUE - Bump Schemathesis action from v1 to v2.0.0 (#2954)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-06-20 15:57:45 +02:00
Felix Gateru ca93b8865a SMQ-2702 - Add cache for channel and domain routes (#2914)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-06-20 14:10:20 +02:00
Smith Jilks 86dd4ede3a NOISSUE - Update issue token in oauth2CallbackHandler (#2955)
Signed-off-by: Jilks Smith <smithjilks@gmail.com>
2025-06-20 09:58:21 +02:00
Felix Gateru 5b7b759131 SMQ-2761 - Support domain and channel routes in message topic (#2775)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-06-20 09:57:36 +02:00
dependabot[bot] 2aa247b3c3 NOISSUE - Bump github.com/authzed/spicedb from 1.44.3 to 1.44.4 (#2948)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-19 16:41:07 +02:00
Dusan Borovcanin ec126a5976 NOISSUE - Fix certs compose
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-06-18 18:40:06 +02:00
Arvindh c8814237cf NOISSUE - Increase NATS message payload size (#2950)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-06-17 12:18:37 +02:00
Arvindh e98b6576f1 NOISSUE - Add Message Details to NATS Subscriber Handler Logs (#2941)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-06-16 11:55:52 +02:00
dependabot[bot] c429b1d5ff NOISSUE - Bump github.com/authzed/spicedb from 1.44.2 to 1.44.3 (#2943)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-16 09:56:15 +02:00
dorcaslitunya 09de0cf2f5 SMQ-2909 Allow different formats for user profile from different oauth providers (#2923)
Signed-off-by: Dorcas Litunya <anonolitunya@gmail.com>
Co-authored-by: Dorcas Litunya <dolitunya@microsoft.com>
2025-06-12 12:05:48 +03:00
Arvindh a01d933218 NOISSUE - Add Message error type (#2939)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-06-12 12:02:53 +03:00
JeffMboya d8b7af424e SMQ-2739 - Prevent removing of all users from Built in admin role (#2835)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2025-06-10 10:54:27 +03:00
Felix Gateru 798ed3a2dd NOISSUE - Update mGate version (#2925)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-06-09 19:39:28 +02:00
Dušan Borovčanin d3c9e0bbcd NOISSUE - Add ACK type for message broker handler (#2928)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-06-09 12:33:08 +02:00
Dusan Borovcanin b69947fc57 NOISSUE - Update Go version
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-06-09 11:10:17 +02:00
dependabot[bot] e4553f27d1 NOISSUE - Bump golang from 1.24.3-alpine to 1.24.4-alpine in /docker in the docker-dependency group (#2931)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-09 11:01:37 +02:00
dependabot[bot] cf68a07b00 NOISSUE - Bump golang.org/x/crypto from 0.38.0 to 0.39.0 (#2933)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-09 10:49:34 +02:00
dependabot[bot] c691fb779a NOISSUE - Bump google.golang.org/grpc from 1.72.2 to 1.73.0 (#2934)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-09 10:36:24 +02:00
dependabot[bot] a93fccc234 NOISSUE - Bump github.com/hashicorp/vault/api/auth/approle from 0.9.0 to 0.10.0 (#2935)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-09 10:35:31 +02:00
Felix Gateru 4bea349b04 NOISSUE - Add request ID to role based events (#2890)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-06-09 10:17:47 +02:00
dependabot[bot] ab41689a9b NOISSUE - Bump github.com/redis/go-redis/v9 from 9.9.0 to 9.10.0 (#2936)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-09 09:58:58 +02:00
dependabot[bot] 921e5111b5 NOISSUE - Bump github.com/authzed/spicedb from 1.44.0 to 1.44.2 (#2929)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-07 17:04:50 +02:00
Arvindh 21c7b1019e SMQ-2888 - Change internal message topic format (#2889)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-06-05 09:48:56 +02:00
Dušan Borovčanin d64a74b1be NOISSUE - Update Go versions in mod.go and Dockerfile (#2922)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-06-04 14:30:07 +02:00
Steve Munene 343a771c4f SMQ-2893 - Add callout to roles (#2907)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-06-03 20:01:44 +02:00
dependabot[bot] 5e96516bf6 NOISSUE - Bump github.com/redis/go-redis/v9 from 9.8.0 to 9.9.0 (#2916)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-02 11:58:25 +02:00
Arvindh 582b764679 NOISSUE - Fix clients and channels listing (#2913)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-05-29 15:54:48 +02:00
Arvindh 56528ee68a NOISSUE - Fix clients and channels listing (#2912)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-05-29 14:58:11 +02:00
dependabot[bot] 8856a26869 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.35.0 to 1.36.0 (#2903)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-27 19:55:23 +02:00
dependabot[bot] b2eb51c155 NOISSUE - Bump google.golang.org/grpc from 1.72.1 to 1.72.2 (#2904)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-27 19:52:11 +02:00
dependabot[bot] a95d1bb672 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace from 1.35.0 to 1.36.0 (#2901)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-26 14:38:21 +02:00
dependabot[bot] 5b572cd5fc NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.60.0 to 0.61.0 (#2902)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-26 14:36:35 +02:00
dependabot[bot] 8fce6fc8d4 NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.60.0 to 0.61.0 (#2900)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-26 13:38:17 +02:00
Nin Tran d2eabd1836 SMQ-2885 - Fix PKI: load env file early and allow any CN in server cert role (#2886)
Signed-off-by: Nin Tran <nin.tran52@gmail.com>
2025-05-26 10:46:34 +02:00
dependabot[bot] 8c3f621e21 NOISSUE - Bump go.opentelemetry.io/otel from 1.35.0 to 1.36.0 (#2899)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-26 10:40:31 +02:00
dependabot[bot] 0275c8a5c4 NOISSUE - Bump github.com/oklog/ulid/v2 from 2.1.0 to 2.1.1 (#2898)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-26 10:29:51 +02:00
Arvindh 0dd25d7140 NOISSUE - Remove .env file trailing whitespace (#2895)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-05-23 15:20:14 +02:00
Steve Munene 079749b3e8 NOISSUE - Fix callout tests (#2896)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-05-23 15:05:21 +02:00
Felix Gateru c0fd0f410f SMQ-2785 - Disable deleting a confirmed or rejected invitation by non invitee user (#2805)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-05-22 18:45:29 +02:00
Steve Munene 58753f60d8 SMQ-2804 - Move Callouts from Auth Service to pkg/authz (#2823)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-05-22 16:08:45 +02:00
Felix Gateru 04f6117e36 SMQ-2761 - Add route field to channels (#2772)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-05-21 18:53:40 +02:00
Dušan Borovčanin 7f4633a3d1 NOISSUE - Add Nullable type for optional values handling (#2877)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-05-20 18:45:24 +02:00
Felix Gateru d6c260b803 SMQ-2874 - Allow empty update for user profile picture, tags and metadata (#2876)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-05-20 10:29:24 +02:00
dependabot[bot] 2dba6e644f NOISSUE - Bump github.com/authzed/spicedb from 1.43.0 to 1.44.0 (#2883)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-20 09:26:47 +02:00
Felix Gateru a7d2acb591 SMQ-2863 - Fix listing child group's clients and channels with domain access type (#2872)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-05-19 17:10:54 +02:00
Felix Gateru 2b5a670bef SMQ-2842 - Fix client telemetry handling in journal service (#2864)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-05-19 16:50:43 +02:00
dependabot[bot] 16eff6bebb NOISSUE - Bump google.golang.org/grpc from 1.72.0 to 1.72.1 (#2879)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-19 14:00:38 +02:00
dependabot[bot] c7c224b5f1 NOISSUE - Bump github.com/jackc/pgx/v5 from 5.7.4 to 5.7.5 (#2878)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-19 13:59:35 +02:00
Steve Munene 86a8f49e82 SMQ-2856 - Add tags to groups (#2860)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-05-16 20:09:16 +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
Felix Gateru d7d059767b SMQ-2435 - Allow resending rejected invitation (#2868)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-05-14 15:09:13 +02:00
Steve Munene 3b38863b61 SMQ-2841 - List clients and channels with no parent group (#2857)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-05-13 12:20:35 +02:00
Felix Gateru c092e4c888 SMQ-2842 - Update journal service to handle roles events (#2858)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-05-09 15:07:54 +02:00
dependabot[bot] 17a884f7e9 NOISSUE - Bump golang.org/x/oauth2 from 0.29.0 to 0.30.0 (#2852)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-09 09:38:59 +02:00
dependabot[bot] 920d775965 NOISSUE - Bump golang.org/x/sync from 0.13.0 to 0.14.0 (#2853)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@abstractmachines.fr>
2025-05-09 09:34:56 +02:00
dependabot[bot] 7a3c598fb9 NOISSUE - Bump golang.org/x/crypto from 0.37.0 to 0.38.0 (#2854)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-09 09:34:26 +02:00
Nin Tran 8b185cf48c SMQ-2845 - fix: mark supermq-base-net as external in addons to prevent recreate conflicts (#2846)
Signed-off-by: Nin Tran <nin.tran52@gmail.com>
2025-05-05 13:43:05 +02:00
dependabot[bot] 0c7ec7c197 NOISSUE - Bump golangci/golangci-lint-action from 7 to 8 in /.github/workflows in the gh-dependency group (#2849)
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-05-05 13:42:06 +02:00
dependabot[bot] 7b13473af8 NOISSUE - Bump github.com/redis/go-redis/v9 from 9.7.3 to 9.8.0 (#2843)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-05 13:34:35 +02:00
dependabot[bot] b586d988e6 NOISSUE - Bump github.com/lestrrat-go/jwx/v2 from 2.1.5 to 2.1.6 (#2844)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-05 13:33:28 +02:00
Nin Tran 16ac66c35f SMQ-2847 - Fix vault approle script missing template reference (#2848)
Signed-off-by: Nin Tran <nin.tran52@gmail.com>
2025-05-05 13:33:01 +02:00
dependabot[bot] ecf78a36ba NOISSUE - Bump github.com/authzed/spicedb from 1.42.1 to 1.43.0 (#2850)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-05 13:16:48 +02:00
dependabot[bot] 39bb9f5240 NOISSUE - Bump github.com/nats-io/nats.go from 1.41.2 to 1.42.0 (#2851)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-05 13:11:09 +02:00
Nin Tran f76332ef71 SMQ-2838 - Mark supermq-base-net as external in addons docker-compose (#2839)
Signed-off-by: Nin Tran <nin.tran52@gmail.com>
2025-04-30 11:51:59 +02:00
Nin Tran ed367fb1e5 SMQ-2832 - Fix make sed -i compatible with both macOS and Linux (#2833)
Signed-off-by: Nin Tran <nin.tran52@gmail.com>
2025-04-27 17:20:20 +02:00
Nin Tran b04fb5cd97 SMQ-2831 - Fix Makefile '@unset' incompatibility on macOS (#2834)
Signed-off-by: Nin Tran <nin.tran52@gmail.com>
2025-04-27 17:13:51 +02:00
Arvindh 5ea3cbd014 NOISSUE - Update mGate version in http and ws adapters (#2825)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-04-25 14:06:37 +02:00
dependabot[bot] cc9fc70d6d NOISSUE - Bump github.com/authzed/authzed-go from 1.3.1-0.20250320210445-0cde0d8c71e2 to 1.4.0 (#2827)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-25 10:38:29 +02:00
dependabot[bot] 8aa5668a73 NOISSUE - Bump github.com/nats-io/nats.go from 1.41.1 to 1.41.2 (#2826)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-25 10:32:14 +02:00
dependabot[bot] bd9e0c9b5a NOISSUE - Bump github.com/rubenv/sql-migrate from 1.7.1 to 1.8.0 (#2829)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-25 10:27:07 +02:00
dependabot[bot] f79cce34fa NOISSUE - Bump github.com/lestrrat-go/jwx/v2 from 2.1.4 to 2.1.5 (#2828)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-25 10:09:55 +02:00
dependabot[bot] fc02c26a84 NOISSUE - Bump google.golang.org/grpc from 1.71.1 to 1.72.0 (#2830)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-25 10:03:53 +02:00
dependabot[bot] c14bb6e18a NOISSUE - Bump golang.org/x/net from 0.37.0 to 0.38.0 (#2824)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-21 20:43:58 +02:00
dependabot[bot] 62f4599140 NOISSUE - Bump github.com/nats-io/nats.go from 1.41.0 to 1.41.1 (#2821)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-15 10:09:28 +02:00
dependabot[bot] 56fa8aee84 NOISSUE - Bump github.com/prometheus/client_golang from 1.21.1 to 1.22.0 (#2822)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-15 10:03:47 +02:00
Steve Munene 6d7100b8ec NOISSUE - Remove name constrains (#2818)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-04-14 10:14:25 +02:00
b1ackd0t 602025b48b NOISSUE - Pass Logger For Messaging (#2819)
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2025-04-11 17:58:30 +02:00
Dušan Borovčanin 0e571d1905 NOISSUE - Fix build tags (#2817)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-04-11 15:28:29 +02:00
Arvindh 757ad31f92 NOISSUE - Update broker options (#2816)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-04-11 14:04:14 +02:00
Dušan Borovčanin 01f20a29d2 NOISSUE - Update messaging SDK and CLI (#2815)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-04-11 12:31:50 +02:00
Dušan Borovčanin 5fd1d9b431 NOISSUE - Update SDK message order (#2814)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-04-11 11:23:34 +02:00
Felix Gateru 6151be72ce SMQ-2706 - Add domain id to message topic (#2765)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-04-11 09:11:39 +02:00
Felix Gateru 299cee7771 SMQ-2609 - Enable superadmin to perform actions over entities (#2688)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-04-10 16:55:05 +02:00
Dušan Borovčanin a01d2571de NOISSUE - Enable empty Transformers (#2810)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-04-10 15:54:42 +02:00
Steve Munene 1c3ffba300 SMQ-2807 - Fix retrieve query (#2809)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-04-10 15:24:44 +02:00
Arvindh ba9d65898f NOISSUE - Fix Domains invitations SDK test (#2808)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-04-10 14:26:32 +02:00
Arvindh 814f19390d NOISSUE - Fix domain invitation request and accept (#2806)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-04-09 23:18:47 +02:00
dependabot[bot] af8caa4cc8 NOISSUE - Bump google.golang.org/grpc from 1.71.0 to 1.71.1 (#2797)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-08 10:52:22 +02:00
dependabot[bot] ff55a7625a NOISSUE - Bump golang.org/x/crypto from 0.36.0 to 0.37.0 (#2796)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-08 10:42:10 +02:00
dependabot[bot] 8e5daf735d NOISSUE - Bump golang.org/x/oauth2 from 0.28.0 to 0.29.0 (#2798)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-08 10:24:52 +02:00
dependabot[bot] f2006ae97a NOISSUE - Bump github.com/ory/dockertest/v3 from 3.11.0 to 3.12.0 (#2791)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 11:40:07 +02:00
dependabot[bot] efb392f77b NOISSUE - Bump github.com/authzed/spicedb from 1.41.0 to 1.42.1 (#2792)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 11:34:20 +02:00
dependabot[bot] 739730efe5 NOISSUE - Bump github.com/nats-io/nats.go from 1.40.1 to 1.41.0 (#2793)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 11:30:34 +02:00
dependabot[bot] 05e72a5932 NOISSUE - Bump golang.org/x/sync from 0.12.0 to 0.13.0 (#2794)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 11:26:31 +02:00
dependabot[bot] a1e4b51d55 NOISSUE - Bump github.com/absmach/senml from 1.0.6 to 1.0.7 (#2795)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 08:30:53 +02:00
Dusan Borovcanin 006a1fb0f4 NOISSUE - Fix Makefile user repo sed expression
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-04-04 19:37:26 +02:00
Dušan Borovčanin e14eee0ac5 NOISSUE - Update Protoc and plugins (#2789)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-04-04 14:36:25 +02:00
Felix Gateru 49fd8448c0 SMQ-2703 - Shorten channel and message prefix in message topics (#2787)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-04-04 09:39:33 +02:00
Felix Gateru b79fdb1534 SMQ-2760 - Rename domain alias to route (#2776)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-04-02 17:40:04 +02:00
Felix Gateru 3931ecabdb SMQ-2740 - Create events streams per service per action type (#2744)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-04-02 17:14:03 +02:00
Steve Munene 7a3a55d399 NOISSUE - Fix callback (#2788)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-04-02 15:56:32 +02:00
Sammy Kerata Oina 340098cec3 NOISSUE - Pass context on SDK to allow distributed tracing (#2783)
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
2025-04-01 23:54:41 +02:00
dependabot[bot] 12b41e3ab0 NOISSUE - Bump github.com/nats-io/nats.go from 1.40.0 to 1.40.1 (#2778)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-01 22:09:01 +02:00
dependabot[bot] ce570be40e NOISSUE - Bump github.com/jackc/pgx/v5 from 5.7.3 to 5.7.4 (#2779)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-01 22:07:32 +02:00
Dusan Borovcanin 5e77512009 NOISSUE - Fix go.mod formatting broken by Dependabot
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-04-01 22:02:08 +02:00
dependabot[bot] 321e38590c NOISSUE - Bump github.com/gofrs/uuid/v5 from 5.3.1 to 5.3.2 (#2781)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-01 21:56:03 +02:00
Dušan Borovčanin 7ae2f7de00 NOISSUE - Update GolangCI linter (#2786)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-04-01 21:47:23 +02:00
Dusan Borovcanin 056dd34f9b NOISSUE - Fix actions versions
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-04-01 21:13:36 +02:00
Dusan Borovcanin 623b9910d5 NOISSUE - Update Go version
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-04-01 21:09:14 +02:00
Felix Gateru 6011cad546 NOISSUE - Update Mockery version and config (#2784)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-04-01 20:56:07 +02:00
Dušan Borovčanin e56b86823e NOISSUE - Rename YAML files extension (#2782)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2025-03-31 10:51:43 +02:00
dependabot[bot] 878860d249 NOISSUE - Bump google.golang.org/protobuf from 1.36.5 to 1.36.6 (#2770)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-25 15:04:12 +01:00
dependabot[bot] 3ff3469455 NOISSUE - Bump github.com/nats-io/nats.go from 1.39.1 to 1.40.0 (#2771)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-25 13:55:47 +01:00
dependabot[bot] cca5e27de7 NOISSUE - Bump github.com/jackc/pgx/v5 from 5.7.2 to 5.7.3 (#2769)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-24 08:31:44 +01:00
dependabot[bot] 7e1b53bf3e NOISSUE - Bump github.com/redis/go-redis/v9 from 9.7.1 to 9.7.3 (#2768)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-21 10:21:03 +01:00
Steve Munene ddb3f9ba6d SMQ-2758 - Add option Auth to call webhook for only for certain authz (#2763)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-03-20 23:10:32 +01:00
Felix Gateru 3b675a7ab3 SMQ-2703 - Shorten channel and message prefix in message topics (#2764)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-03-20 22:29:15 +01:00
Steve Munene f6b3938f96 SMQ-2718 - Add actions on view entities response in groups (#2750)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-03-20 12:04:39 +01:00
Steve Munene b0493e03af SMQ-2718 - Add actions on view entities response in channels (#2748)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@abstractmachines.fr>
2025-03-18 13:17:24 +01:00
Steve Munene 1ad754d933 SMQ-2742 - Add entity role check for optional members when adding role (#2762)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-03-18 13:03:09 +01:00
Steve Munene 001c8255eb SMQ-2718 - Add actions on view entities response in domains (#2749)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@abstractmachines.fr>
2025-03-18 12:36:24 +01:00
Steve Munene 1e4341a6ec SMQ-2751 - Add search to PATs (#2753)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-03-14 10:06:03 +01:00
Steve Munene 2bee2efae5 SMQ-2718 - Add actions on view entities response in clients (#2746)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Arvindh <arvindh91@gmail.com>
2025-03-12 13:54:36 +01:00
Ian Ngethe Muchiri 065e764387 NOISSUE - Update changes to domains and channels (#2752)
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2025-03-12 13:31:03 +01:00
Sammy Kerata Oina e7032a6313 NOISSUE - Add default members list base query for role management (#2747)
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
2025-03-06 14:15:24 +01:00
b1ackd0t b23a8c20eb NOISSUE - Fix Websocket Adapter (#2700)
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2025-03-06 11:23:56 +01:00
dependabot[bot] 5cc3c1b4fa NOISSUE - Bump github.com/authzed/spicedb from 1.40.1 to 1.41.0 (#2745)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-04 19:51:11 +01:00
b1ackd0t 88f7172fb4 SMQ-2724 - Add Auth Callout (#2731)
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2025-03-03 19:29:31 +01:00
Steve Munene fd76a03257 SMQ-2735 - Add PATs README and API docs (#2737)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-03-03 11:51:41 +01:00
dependabot[bot] adf94adc7b NOISSUE - Bump github.com/lestrrat-go/jwx/v2 from 2.1.3 to 2.1.4 (#2741)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 11:29:27 +01:00
Steve Munene 98bc206169 SMQ-2670 - Fix Unauthorized User IDs can be added to domain entity role members (#2684)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-02-28 14:06:59 +01:00
Steve Munene 17b5224090 SMQ-2604 - Change PAT repo implementation (#2680)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Arvindh <arvindh91@gmail.com>
2025-02-27 15:38:34 +01:00
b1ackd0t 56829c15d8 NOISSUE - Use RabbitMQ as MQTT broker (#2695)
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2025-02-26 09:45:59 +01:00
dependabot[bot] df0f9068d6 NOISSUE - Bump golang.org/x/oauth2 from 0.26.0 to 0.27.0 (#2732)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-25 19:29:25 +01:00
Arvindh de05aa7f88 NOISSUE - Fix Invitations test (#2723)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-02-25 19:14:49 +01:00
dependabot[bot] 9997d0c77f NOISSUE - Bump golang.org/x/crypto from 0.34.0 to 0.35.0 (#2733)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-25 15:31:34 +01:00
dependabot[bot] d4c8383266 NOISSUE - Bump github.com/go-jose/go-jose/v4 from 4.0.4 to 4.0.5 (#2734)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-25 15:30:54 +01:00
Felix Gateru 986bc38a19 SMQ-2689 - Allow user defined ids for domains (#2696)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-02-25 14:46:15 +01:00
Felix Gateru f96876fe04 SMQ-2705 - Add list groups with no parent group (#2708)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-02-25 10:13:42 +01:00
JeffMboya a5bf63c2c6 SMQ-2678 - Rename SMQ_CLIENTS_AUTH_GRPC_ to SMQ_CLIENTS_GRPC_ (#2721)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2025-02-24 14:22:52 +01:00
dependabot[bot] a4e4527b04 NOISSUE - Bump github.com/nats-io/nats.go from 1.39.0 to 1.39.1 (#2727)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 13:57:21 +01:00
dependabot[bot] 506f67f222 NOISSUE - Bump golang.org/x/crypto from 0.33.0 to 0.34.0 (#2729)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 13:56:51 +01:00
dependabot[bot] 5c0a0237d7 NOISSUE - Bump github.com/redis/go-redis/v9 from 9.7.0 to 9.7.1 (#2728)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 12:53:21 +01:00
dependabot[bot] 2a86caeb3d NOISSUE - Bump github.com/prometheus/client_golang from 1.20.5 to 1.21.0 (#2730)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 11:32:10 +01:00
Steve Munene eaaba5beeb SMQ-2682 - Fix incorrectly referenced field name (#2725)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-02-20 22:41:39 +01: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
Arvindh 972fa0b25b NOISSUE - Add role name and domain name in list invitations response (#2720)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-02-19 13:26:55 +01:00
dependabot[bot] da6e3e17a6 NOISSUE - Bump github.com/authzed/spicedb from 1.40.0 to 1.40.1 (#2714)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-17 09:28:24 +01:00
dependabot[bot] db553d328a NOISSUE - Bump github.com/gofrs/uuid/v5 from 5.3.0 to 5.3.1 (#2715)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-17 09:18:19 +01:00
dependabot[bot] 3fc7868759 NOISSUE - Bump github.com/spf13/cobra from 1.8.1 to 1.9.1 (#2716)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-17 09:13:41 +01:00
dependabot[bot] 62a3578e0d NOISSUE - Bump golang from 1.23-alpine to 1.24-alpine in /docker in the docker-dependency group (#2711)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-17 09:09:47 +01:00
dependabot[bot] 42f48b41ba NOISSUE - Bump github.com/hashicorp/vault/api/auth/approle from 0.8.0 to 0.9.0 (#2713)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-17 09:09:19 +01:00
Felix Gateru 7667eee725 SMQ - 2435 - Merge invitations into domains service (#2676)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-02-13 16:24:39 +01:00
Felix Gateru 597ad23ba1 NOISSUE - Fix domains path in CI tests workflow (#2697)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-02-11 21:07:24 +01:00
dependabot[bot] 838cfd59a6 NOISSUE - Bump golang.org/x/oauth2 from 0.25.0 to 0.26.0 (#2698)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-11 21:01:48 +01:00
dependabot[bot] 984d67eaa1 NOISSUE - Bump golang.org/x/crypto from 0.32.0 to 0.33.0 (#2699)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-11 19:46:13 +01:00
dependabot[bot] 6121c18088 NOISSUE - Bump go.etcd.io/bbolt from 1.3.11 to 1.4.0 (#2691)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-10 10:38:02 +01:00
dependabot[bot] 392940cfa8 NOISSUE - Bump google.golang.org/protobuf from 1.36.4 to 1.36.5 (#2693)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-10 10:29:58 +01:00
dependabot[bot] 118d85f1e8 NOISSUE - Bump golang.org/x/sync from 0.10.0 to 0.11.0 (#2690)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-10 10:28:35 +01:00
dependabot[bot] 236b841182 NOISSUE - Bump github.com/nats-io/nats.go from 1.38.0 to 1.39.0 (#2694)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-10 09:54:00 +01:00
dependabot[bot] da17597121 NOISSUE - Bump github.com/go-chi/chi/v5 from 5.2.0 to 5.2.1 (#2692)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-10 09:50:04 +01:00
Steve Munene bd44d1e95a SMQ-2505 - Add Domain ID in all service logs (#2687)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-02-07 11:07:02 +01:00
Felix Gateru 67ab52db90 SMQ-2686 - Fix channel journals (#2685)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-02-06 18:10:35 +01:00
b1ackd0t cff6e7f085 NOISSUE - Use NATS as MQTT broker (#2681)
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2025-02-03 18:17:35 +01:00
Arvindh 7c6bc9cd7e SMQ 2667 - List all the users who can access the entity (#2673)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-02-03 16:37:51 +01:00
Felix Gateru 484de372ec SMQ - 2546 - Add telemetry aggregation for clients telemetry (#2661)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-02-03 11:37:25 +01:00
Felix Gateru 07dbb86203 SMQ-2546 - Add events to adapters (#2659)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-01-30 12:45:40 +01:00
dependabot[bot] 53cb10bb89 NOISSUE - Bump github.com/authzed/authzed-go from 1.2.2-0.20250107172318-7fd4159ab2b7 to 1.3.0 (#2668)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-28 12:07:10 +01:00
Felix Gateru e69730d9d6 NOISSUE - Fix failing channel repo tests (#2662)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@abstractmachines.fr>
2025-01-27 14:05:05 +01:00
Arvindh ef328369b8 NOISSUE - Fix Clients, Channels roles initialization and Channels connection Authz (#2663)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-01-27 10:46:45 +01:00
dependabot[bot] e5b2fa2ec7 NOISSUE - Bump google.golang.org/protobuf from 1.36.3 to 1.36.4 (#2665)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-26 18:04:23 +01:00
dependabot[bot] 97f8092868 NOISSUE - Bump github.com/authzed/spicedb from 1.39.1 to 1.40.0 (#2664)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-26 17:56:46 +01:00
dependabot[bot] d2dbc4c44c NOISSUE - Bump google.golang.org/grpc from 1.69.4 to 1.70.0 (#2666)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-26 17:51:47 +01:00
Arvindh d77d005659 NOISSUE - Fix Listing of connections and groups for clients and channels (#2660)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-01-23 10:12:13 +01:00
Arvindh 104c5b3da4 NOISSUE - Fix channels connections (#2658)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-01-21 17:06:22 +01:00
Arvindh 53e39a1dc6 NOISSUE - Add domain events consumer, listing of clients and channels with domains (#2656)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-01-21 14:31:29 +01:00
dependabot[bot] 3cb41fa6e7 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.33.0 to 1.34.0 (#2657)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-21 14:06:55 +01:00
Arvindh 88d583bfb1 SMQ-2605 - Groups replication with groups events consumer & listing of things and channels (#2639)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2025-01-20 12:36:50 +01:00
dependabot[bot] a8b12e4461 NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.58.0 to 0.59.0 (#2650)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 09:22:12 +01:00
dependabot[bot] bc6339bf52 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace from 1.33.0 to 1.34.0 (#2652)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 09:11:29 +01:00
dependabot[bot] 15d8e94678 NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.58.0 to 0.59.0 (#2653)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 09:08:40 +01:00
dependabot[bot] 250070dc15 NOISSUE - Bump google.golang.org/protobuf from 1.36.2 to 1.36.3 (#2655)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 09:05:59 +01:00
dependabot[bot] f7ee4f103c NOISSUE - Bump go.opentelemetry.io/otel/trace from 1.33.0 to 1.34.0 (#2654)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 09:01:12 +01:00
Felix Gateru fbbe5ff767 SMQ-2648 - Add API and Repository implementation for the Client stats (#2647)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-01-17 17:14:13 +01:00
Steve Munene 5d755990b7 SMQ-1485 - Add mutual TLS support for gRPC connections (#2646)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-01-17 08:20:41 +01:00
Steve Munene fdea1a753e MG-2358 - Add Domain to Events (#2510)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Co-authored-by: Felix Gateru <felix.gateru@gmail.com>
2025-01-16 13:13:41 +01:00
Steve Munene d02d63d1eb MG-2048 - Authorize groups and channels with PATs (#2501)
Signed-off-by: nyagamunene <stevenyaga2014@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>
2025-01-15 12:15:14 +01:00
Felix Gateru 153d230907 NOISSUE - Update CLI (#2645)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-01-14 13:07:28 +01:00
Felix Gateru 3a11b54394 NOISSUE - Revert removal of notifier interface (#2643)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-01-13 10:14:33 +01:00
dependabot[bot] 6fd7e3de63 NOISSUE - Bump google.golang.org/grpc from 1.69.2 to 1.69.4 (#2644)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 10:02:14 +01:00
Steve Munene 33407fad16 NOISSUE - Update CLI (#2642)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2025-01-10 12:49:38 +01:00
Felix Gateru a9169276e5 SMQ-2629 - Remove Readers and Consumers (#2641)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-01-10 11:26:39 +01:00
Felix Gateru df5d752c4b SMQ-2629 - Remove Boostrap and Provision services (#2640)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2025-01-10 09:56:03 +01:00
dependabot[bot] cd73d36bdf NOISSUE - Bump golang.org/x/oauth2 from 0.24.0 to 0.25.0 (#2634)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-09 09:49:44 +01:00
dependabot[bot] 2b2d8b8a5c NOISSUE - Bump github.com/authzed/authzed-go from 1.2.0 to 1.2.1 (#2638)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-08 18:03:40 +01:00
dependabot[bot] a052559983 NOISSUE - Bump google.golang.org/protobuf from 1.36.1 to 1.36.2 (#2637)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-08 17:54:32 +01:00
dependabot[bot] 8de72f88f4 NOISSUE - Bump golang.org/x/crypto from 0.31.0 to 0.32.0 (#2635)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-08 13:06:28 +01:00
Drasko DRASKOVIC d89c199f3a NOISSUE - Update MAINTAINERS (#2625) 2024-12-30 23:56:23 +01:00
Drasko DRASKOVIC 378da932b5 NOISSUE - Fix README badge and docs (#2624) 2024-12-30 23:35:20 +01:00
Drasko DRASKOVIC c89cb41c5b Fix README intro (#2623) 2024-12-30 20:09:39 +01:00
Drasko DRASKOVIC ca0f7ca3e8 NOISSUE - Update README (#2622)
Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com>
2024-12-30 19:38:45 +01:00
Steve Munene 6abc52d074 MG-2048 - Authorize clients and users with PATs (#2499)
Signed-off-by: nyagamunene <stevenyaga2014@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>
2024-12-30 17:41:00 +01:00
Arvindh f12aacd1da NOISSUE - Emit roles event during entity creation (#2620)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-12-27 19:34:13 +01:00
Dušan Borovčanin c32d40636d NOISSUE - Add token type check (#2621)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-12-25 23:44:57 +01:00
Arvindh 6b16535958 NOISSUE - Use role id instead of name (#2612)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-12-25 14:25:43 +01:00
dependabot[bot] 58ba597c62 NOISSUE - Bump google.golang.org/protobuf from 1.36.0 to 1.36.1 (#2619)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-24 10:15:01 +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
Felix Gateru 4f73a52192 SMQ-2570 - Update SDK to align with new architecture (#2585)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2024-12-23 15:09:06 +01:00
dependabot[bot] 7486317363 NOISSUE - Bump github.com/caarlos0/env/v11 from 11.3.0 to 11.3.1 (#2618)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-23 10:34:45 +01:00
dependabot[bot] 7ac7b1f9c6 NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.57.0 to 0.58.0 (#2617)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-23 10:30:27 +01:00
dependabot[bot] 10c6140e3c NOISSUE - Bump github.com/nats-io/nats.go from 1.37.0 to 1.38.0 (#2616)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-23 10:28:13 +01:00
dependabot[bot] c50bf5bebf NOISSUE - Bump github.com/go-chi/chi/v5 from 5.1.0 to 5.2.0 (#2615)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-23 10:26:10 +01:00
dependabot[bot] 0e2ae5e5e1 NOISSUE - Bump github.com/jackc/pgx/v5 from 5.7.1 to 5.7.2 (#2614)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-23 10:24:02 +01:00
dependabot[bot] 1474da8b2e NOISSUE - Bump google.golang.org/grpc from 1.68.1 to 1.69.2 (#2613)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-23 10:22:20 +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
dorcaslitunya 9e6da193c8 NOISSUE - Remove duplicate DomainID paths (#2607) 2024-12-19 12:39:41 +01:00
Steve Munene e8e17f5530 MG-2048 - Implement Personal Access Tokens (PATs) (#2492)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-12-18 10:33:07 +01:00
dependabot[bot] 0d126c3be0 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.32.0 to 1.33.0 (#2597)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-17 19:25:13 +01:00
dependabot[bot] d46c8d71a0 NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.57.0 to 0.58.0 (#2598)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-17 19:18:45 +01:00
dependabot[bot] 99b3e67918 NOISSUE - Bump github.com/caarlos0/env/v11 from 11.2.2 to 11.3.0 (#2599)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-17 19:17:10 +01:00
dependabot[bot] d6aa51bf24 NOISSUE - Bump go.opentelemetry.io/otel/sdk from 1.32.0 to 1.33.0 (#2596)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-17 19:12:49 +01:00
dependabot[bot] f288c77893 NOISSUE - Bump google.golang.org/protobuf from 1.35.2 to 1.36.0 (#2600)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-17 16:46:32 +01:00
Felix Gateru f7d0513ad5 SMQ-2587 - Fix creating group with parent and group listing with tree parameter (#2594)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2024-12-17 13:17:55 +01:00
Felix Gateru 8c93dae2ba NOISSUE - Add domains, channels and groups tests to CI (#2595)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2024-12-16 18:48:53 +01:00
dependabot[bot] 42802703d4 NOISSUE - Bump github.com/rubenv/sql-migrate from 1.7.0 to 1.7.1 (#2589)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-16 10:17:59 +01:00
dependabot[bot] e8e8a4bd8a NOISSUE - Bump go.opentelemetry.io/otel from 1.32.0 to 1.33.0 (#2591)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-16 10:15:26 +01:00
dependabot[bot] e8d77679e4 NOISSUE - Bump github.com/authzed/spicedb from 1.39.0 to 1.39.1 (#2592)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-16 10:09:16 +01:00
Felix Gateru 901ed73fc9 SMQ-2570 - Update user and groups api docs (#2581)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2024-12-11 15:22:56 +01:00
Dušan Borovčanin b444046661 NOISSUE - Remove LoRA references (#2584)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-12-11 14:34:39 +01:00
Felix Gateru cff356461d SMQ-2570 - Update auth and domains api docs (#2579)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2024-12-11 09:15:06 +01:00
Sammy Kerata Oina adfb2f4143 NOISSUE - Fix standard TLS connection (#2576)
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
2024-12-10 19:27:07 +01:00
Arvindh 4a24edc9ea NOISSUE - Add roles and actions to domain listing (#2571)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-12-10 19:25:53 +01:00
dependabot[bot] 48e4c12187 NOISSUE - Bump github.com/authzed/spicedb from 1.38.1 to 1.39.0 (#2582)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-10 14:28:50 +01:00
Dušan Borovčanin 559e05f0f4 NOISSUE - Move SDK to pkg (#2583)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-12-10 14:23:35 +01:00
Felix Gateru 1e77579b33 SMQ-2570 - Update clients and channels api docs (#2578)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2024-12-10 11:55:45 +01:00
dependabot[bot] ed7f818514 NOISSUE - Bump codecov/codecov-action from 4 to 5 in /.github/workflows in the gh-dependency group (#2574)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 12:10:42 +01:00
dependabot[bot] 8b732db931 NOISSUE - Bump google.golang.org/grpc from 1.68.0 to 1.68.1 (#2573)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 12:06:35 +01:00
dependabot[bot] 922de4abaa NOISSUE - Bump golang.org/x/crypto from 0.29.0 to 0.30.0 (#2572)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 12:06:03 +01:00
dependabot[bot] c401324667 NOISSUE - Bump golang.org/x/sync from 0.9.0 to 0.10.0 (#2575)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 11:09:50 +01:00
dependabot[bot] fed25100d4 NOISSUE - Bump github.com/authzed/authzed-go from 1.1.1 to 1.2.0 (#2580)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 11:06:38 +01:00
Arvindh 51d2c37458 NOISSUE - Add events to roles (#2562)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-12-05 11:44:35 +01:00
Felix Gateru 9630595333 NOISSUE - Remove middleware from tests coverage (#2563)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2024-12-05 10:56:13 +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
dependabot[bot] 10bc218dee NOISSUE - Bump github.com/authzed/spicedb from 1.38.0 to 1.38.1 (#2561)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-03 17:12:46 +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
dependabot[bot] e29b54c54d NOISSUE - Bump github.com/absmach/senml from 1.0.5 to 1.0.6 (#2559)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-03 17:12:46 +01:00
Dušan Borovčanin 3b937c284c MG-2553 - Rename Magistrala to SuperMQ (#2554)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-12-03 17:12:46 +01:00
Felix Gateru 5b2c1bab8e MG-2556 - Fix super admin functionality (#2558)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2024-11-29 09:19:18 +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
Felix Gateru 8d4e752274 NOISSUE - Update API documentation (#2550)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2024-11-26 09:36:27 +01:00
Felix Gateru b20b45023d NOISSUE - Update auth in journal service (#2527)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2024-11-25 13:02:27 +01:00
dependabot[bot] f42f45e305 NOISSUE - Bump github.com/lestrrat-go/jwx/v2 from 2.1.2 to 2.1.3 (#2547)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-25 10:41:07 +01:00
dependabot[bot] aa5a2bffe8 NOISSUE - Bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#2548)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-25 10:39:02 +01:00
Washington Kigani Kamadi 73138d83bd MG-2541 - Fix list domain users sdk (#2542)
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
2024-11-21 09:08:04 +01:00
Steve Munene 92e84c05ce NOISSUE - Fix status during listing things (#2528)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-11-20 11:31:41 +01:00
Felix Gateru eb49015dce MG-2530 - Fix domain assign and unassign for users (#2531)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2024-11-20 11:30:19 +01:00
JeffMboya d9f3bca478 MG-2533 - Fix Linting Issues in Proto Files (#2534)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-11-18 08:52:30 +01:00
JeffMboya c039b0a45d MG-2483 - Add Protobuf Linter (#2532)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-11-18 08:52:06 +01:00
dependabot[bot] ccf4ab934f NOISSUE - Bump golang.org/x/oauth2 from 0.23.0 to 0.24.0 (#2535)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-18 08:24:42 +01:00
dependabot[bot] 317a7e4ac4 NOISSUE - Bump codecov/codecov-action from 4 to 5 in /.github/workflows in the gh-dependency group (#2537)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-18 08:21:16 +01:00
dependabot[bot] 41ff500ccf NOISSUE - Bump github.com/authzed/authzed-go from 1.1.0 to 1.1.1 (#2536)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-18 08:15:02 +01:00
dependabot[bot] c5fb31fbe5 NOISSUE - Bump google.golang.org/protobuf from 1.35.1 to 1.35.2 (#2538)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-18 08:08:58 +01:00
Steve Munene 54a134e72f MG-2516 - Fix listing users in domain (#2526)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-11-13 08:29:32 -07:00
Steve Munene 8b9ec40abc MG-2524 - Fix domain disable and list things (#2525)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-11-13 07:44:33 -07:00
dependabot[bot] 6d305286df NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.56.0 to 0.57.0 (#2520)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-12 08:25:31 -07:00
dependabot[bot] e8d69e67be NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.31.0 to 1.32.0 (#2518)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-12 08:22:34 -07:00
dependabot[bot] 31342746a0 NOISSUE - Bump golang.org/x/crypto from 0.28.0 to 0.29.0 (#2521)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-12 08:20:43 -07:00
dependabot[bot] b11cf10622 NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.56.0 to 0.57.0 (#2523)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-12 08:20:00 -07:00
dependabot[bot] cacec3adaa NOISSUE - Bump go.opentelemetry.io/otel/sdk from 1.31.0 to 1.32.0 (#2522)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-11 08:09:24 -07:00
Felix Gateru cd945419c4 NOISSUE - Fix users update functionality (#2515)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2024-11-11 08:06:37 -07:00
Felix Gateru 3a02788e3a MG-2507 - Update auth in readers service (#2514)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2024-11-10 10:59:46 -07:00
Steve Munene a5059a7946 NOISSUE - Remove domain prefix for invitation (#2513)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-11-08 18:31:00 +01:00
Steve Munene a596afb498 NOISSUE - Fix list domain permission (#2512)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-11-08 12:02:52 +01:00
Nataly Musilah 87c390da4c MG-2426 - Replace generic Clients in Things service (#2476)
Signed-off-by: Musilah <nataleigh.nk@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Co-authored-by: Felix Gateru <felix.gateru@gmail.com>
2024-11-04 11:46:40 +01:00
Dušan Borovčanin ef8631bd1f NOISSUE - Switch from mProxy to mGate (#2500)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-11-04 11:02:55 +01:00
dependabot[bot] e271d0ff29 NOISSUE - Bump github.com/authzed/authzed-go from 1.0.0 to 1.1.0 (#2502)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-04 09:45:02 +01:00
Felix Gateru 233bbf9861 NOISSUE - Update Users tests (#2498)
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2024-11-04 09:42:09 +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 077882f672 MG-2488 - Fix get domain permission (#2491)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-10-28 11:53:59 +01:00
dependabot[bot] db7a9ce0ac NOISSUE - Bump github.com/lestrrat-go/jwx/v2 from 2.1.1 to 2.1.2 (#2490)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-28 10:52:25 +01:00
dependabot[bot] 50de747792 NOISSUE - Bump github.com/fatih/color from 1.17.0 to 1.18.0 (#2489)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-28 10:49: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
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
JeffMboya 0a1ac0183c MG-2470 - Check and update GH Action scripts (#2479)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-10-23 14:49:33 +02:00
dependabot[bot] 52c0f26c08 NOISSUE - Bump github.com/redis/go-redis/v9 from 9.6.2 to 9.7.0 (#2481)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 10:33:37 +02:00
dependabot[bot] ea42694dc8 NOISSUE - Bump github.com/prometheus/client_golang from 1.20.4 to 1.20.5 (#2480)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 10:30:00 +02:00
dependabot[bot] 225b10e866 NOISSUE - Bump github.com/jackc/pgtype from 1.14.3 to 1.14.4 (#2482)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 10:26:50 +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
dependabot[bot] eb513e19df NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.55.0 to 0.56.0 (#2465)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 11:52:30 +02:00
dependabot[bot] f305f40acb NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.55.0 to 0.56.0 (#2466)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 11:49:39 +02:00
dependabot[bot] a457601d77 NOISSUE - Bump github.com/redis/go-redis/v9 from 9.6.1 to 9.6.2 (#2467)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-15 09:47:12 +02:00
Steve Munene 61eca8a371 NOISSUE - Update certs (#2464)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-10-14 22:45:12 +02:00
Steve Munene e5765c6a9b MG-2359 - Replace Vault with Absmach certs (#2425)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
Co-authored-by: b1ackd0t <28790446+rodneyosodo@users.noreply.github.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@abstractmachines.fr>
2024-10-14 15:51:15 +02:00
dependabot[bot] 957fd786f8 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.30.0 to 1.31.0 (#2461)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-14 10:15:54 +02:00
dependabot[bot] e66eaae328 NOISSUE - Bump go.opentelemetry.io/otel/sdk from 1.30.0 to 1.31.0 (#2463)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-14 10:13:58 +02:00
dependabot[bot] f40ef0b0a3 NOISSUE - Bump go.opentelemetry.io/otel/trace from 1.30.0 to 1.31.0 (#2459)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-14 10:12:10 +02:00
dependabot[bot] 858045bb18 NOISSUE - Bump google.golang.org/protobuf from 1.34.2 to 1.35.1 (#2454)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-08 08:46:43 +02:00
Dušan Borovčanin 95c174c094 NOISSUE - Fix CI script config path (#2455)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-10-08 08:44:35 +02:00
Dušan Borovčanin 4552b7c7ab NOISSUE - Ignore tools dir in CI tests (#2452)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-10-07 17:54:29 +02:00
dependabot[bot] d454db70e8 NOISSUE - Bump github.com/authzed/authzed-go from 0.16.0 to 1.0.0 (#2450)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 10:46:29 +02:00
dependabot[bot] db0183b5b3 NOISSUE - Bump google.golang.org/grpc from 1.67.0 to 1.67.1 (#2448)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 10:45:28 +02:00
dependabot[bot] b45ee62e3d NOISSUE - Bump golang.org/x/net from 0.29.0 to 0.30.0 (#2451)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 10:44:46 +02:00
dependabot[bot] 5f0235ce67 NOISSUE - Bump github.com/authzed/authzed-go from 0.15.0 to 0.16.0 (#2445)
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-09-30 11:23:15 +02:00
dependabot[bot] 9f1aa4aef9 NOISSUE - Bump google.golang.org/grpc from 1.66.2 to 1.67.0 (#2439)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 12:29:00 +02:00
dependabot[bot] 85bcb4e70c NOISSUE - Bump github.com/plgd-dev/go-coap/v3 from 3.3.5 to 3.3.6 (#2440)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 12:25:49 +02:00
Dušan Borovčanin b9cf48d9c8 NOISSUE - Add timezone to the CI updates (#2438)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-09-23 12:17:40 +02:00
Washington Kigani Kamadi e611165fc8 NOISSUE - Fix rejected invitations query (#2433)
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
2024-09-19 21:41:32 +02:00
Dušan Borovčanin 67aee00dc4 NOISSUE - Use weekly code dependency updates (#2432)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-09-18 11:01:34 +02:00
Sammy Kerata Oina c32b802a07 NOISSUE - Add reject to SDK (#2431)
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
2024-09-17 22:51:36 +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
JMboya 2bc851c38b NOISSUE - Ignore Vault data directory containing runtime-generated data (#2417)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-09-13 13:19:57 +02:00
Sammy Kerata Oina fdaecf54e5 NOISSUE - Reject invitations (#2379)
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
2024-09-12 14:45:22 +02:00
dependabot[bot] 1ce5952d1a NOISSUE - Bump github.com/jackc/pgx/v5 from 5.6.0 to 5.7.0 (#2422)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-10 18:49:52 +02:00
dependabot[bot] 44e9c4e819 NOISSUE - Bump golang.org/x/oauth2 from 0.22.0 to 0.23.0 (#2421)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-10 14:14:24 +02:00
dependabot[bot] 16820d1da2 NOISSUE - Bump golang.org/x/net from 0.28.0 to 0.29.0 (#2419)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-10 14:10:35 +02:00
dependabot[bot] 8fb2b052e4 NOISSUE - Bump github.com/prometheus/client_golang from 1.20.2 to 1.20.3 (#2423)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-10 14:01:51 +02:00
dependabot[bot] a8e25b16ec NOISSUE - Bump github.com/opencontainers/runc from 1.1.13 to 1.1.14 (#2412)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-04 13:37:24 +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
dependabot[bot] 529d81739c NOISSUE - Bump google.golang.org/grpc from 1.65.0 to 1.66.0 (#2407)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-03 10:03:31 +02:00
dependabot[bot] 81c1ccf2ed NOISSUE - Bump github.com/authzed/authzed-go from 0.14.0 to 0.15.0 (#2406)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-03 09:57:40 +02:00
dependabot[bot] b992f45bdd NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.53.0 to 0.54.0 (#2408)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-03 09:52:17 +02:00
Nataly Musilah 092e679103 NOISSUE - Fix aggregation query (#2370)
Signed-off-by: Musilah <nataleigh.nk@gmail.com>
2024-09-02 12:07:12 +02:00
JMboya 2eccae8097 MG-2380 - Pass env files to vault script (#2387)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-09-02 11:32:55 +02:00
dependabot[bot] 6d9f08622b NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.53.0 to 0.54.0 (#2399)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-28 11:19:14 +02:00
dependabot[bot] cb186979d5 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.28.0 to 1.29.0 (#2400)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-28 10:30:19 +02:00
Dušan Borovčanin 6c95a0505a NOISSUE - Compress binaries in Docker images (#2401)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-08-27 00:03:00 +02:00
dependabot[bot] 81d56b5cb9 NOISSUE - Bump github.com/prometheus/client_golang from 1.19.1 to 1.20.2 (#2395)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 10:12:25 +02:00
dependabot[bot] fa3c084d86 NOISSUE - Bump gonum.org/v1/gonum from 0.15.0 to 0.15.1 (#2390)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 10:10:21 +02:00
dependabot[bot] c077a03d54 NOISSUE - Bump github.com/nats-io/nats.go from 1.36.0 to 1.37.0 (#2389)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 10:07:47 +02:00
dependabot[bot] f5cc255caa NOISSUE - Bump golang from 1.22-alpine to 1.23-alpine in /docker (#2391)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 09:57:07 +02:00
dependabot[bot] 871998c529 NOISSUE - Bump github.com/ory/dockertest/v3 from 3.10.0 to 3.11.0 (#2383)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-13 10:27:44 +02:00
dependabot[bot] 612f0a82a7 NOISSUE - Bump github.com/docker/docker from 26.1.4+incompatible to 26.1.5+incompatible (#2385)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-13 09:37:18 +02:00
dependabot[bot] c156aed68d NOISSUE - Bump golang.org/x/net from 0.27.0 to 0.28.0 (#2382)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-13 09:32:23 +02:00
dependabot[bot] 8015b40980 NOISSUE - Bump golang.org/x/crypto from 0.25.0 to 0.26.0 (#2384)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-13 09:27:24 +02:00
JMboya a97155d8fb NOISSUE- Fix Journal database host in Docker composition (#2378)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-08-08 10:09:13 +02:00
Arvindh d23e005618 NOISSUE - Fix Journal database path in Docker composition (#2376)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-08-06 14:25:35 +02:00
dependabot[bot] 3ae864d39e NOISSUE - Bump golang.org/x/sync from 0.7.0 to 0.8.0 (#2374)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-06 09:19:57 +02:00
dependabot[bot] 4697ad4415 NOISSUE - Bump github.com/docker/docker from 26.0.2+incompatible to 26.1.4+incompatible (#2372)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-06 09:10:14 +02:00
dependabot[bot] 7aef267fdd NOISSUE - Bump github.com/eclipse/paho.mqtt.golang from 1.4.3 to 1.5.0 (#2373)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-06 09:06:25 +02:00
dependabot[bot] e3f5f6e720 NOISSUE - Bump golang.org/x/oauth2 from 0.21.0 to 0.22.0 (#2375)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-06 09:02:00 +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 03065369a7 NOISSUE - Rename db prefix for Journal DB env (#2368)
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2024-08-01 14:26:57 +02:00
Steve Munene 38386a3d96 MG-2363 - Fix users with member relation being able to list things (#2364)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-07-30 18:47:15 +02:00
dependabot[bot] 06cb004a9b NOISSUE - Bump github.com/lestrrat-go/jwx/v2 from 2.1.0 to 2.1.1 (#2361)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-30 08:42:16 +02:00
dependabot[bot] dcc8a831f9 NOISSUE - Bump github.com/authzed/authzed-go from 0.13.0 to 0.14.0 (#2362)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-30 08:33:26 +02:00
Felix Gateru b97b1398f7 MG-2281 - Remove all user domain related policy on domain unassign (#2353)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-07-29 10:20:53 +02:00
Steve Munene c3e7159cb7 MG-2354 - Fix Bootstrap Config state change (#2356)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-07-25 16:15:55 +02:00
Steve Munene 0e3dbf6e38 MG-2241 - Fix list domains with permission as query parameter (#2355)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-07-22 19:11:54 +02:00
Steve Munene c398908d50 MG-2330 - Fix non-admin users search with identity (#2331)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-07-22 13:12:43 +02:00
Steve Munene c4c037f839 MG-887 - Create Bootstrap, Invitations, and Journal CLI tests (#2352)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-07-19 09:40:08 +02:00
Felix Gateru 66fe5f1483 NOISSUE - Format MQTT over WS target URL (#2348)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-07-18 18:11:45 +02:00
Steve Munene 8440affe5f MG-887 - Create Domains CLI tests (#2349)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-07-18 18:09:32 +02:00
Steve Munene 6c54214732 MG-887 - Create certs, messages, health, consumers CLI tests (#2350)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-07-18 17:23:20 +02:00
Steve Munene 78cd5a88bd MG-887 - Create Channels and Groups CLI tests (#2347)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-07-17 23:53:16 +02:00
Felix Gateru 5faf15723d MG-509 - Update mProxy version (#2339)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-07-16 09:47:30 +02:00
dependabot[bot] 395a97b0fc NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.27.0 to 1.28.0 (#2345)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 09:46:13 +02:00
dependabot[bot] df698e9560 NOISSUE - Bump github.com/lestrrat-go/jwx/v2 from 2.0.21 to 2.1.0 (#2342)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 09:42:01 +02:00
dependabot[bot] 862cdc8aa7 NOISSUE - Bump golang.org/x/net from 0.26.0 to 0.27.0 (#2344)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 09:37:01 +02:00
dependabot[bot] f50cc5b80d NOISSUE - Bump github.com/rubenv/sql-migrate from 1.6.1 to 1.7.0 (#2346)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 09:32:11 +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
Steve Munene ffba4ebb8e MG-887 - Create Things CLI tests (#2340)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-07-15 10:04:18 +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
JMboya 04c3594627 MG-2253 - Create Users CLI tests (#2319)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-07-09 13:37:39 +02:00
JMboya b49a2cd012 MG-1955 - Update Bootstrap service access control (#2199)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-07-09 13:03:10 +02:00
dependabot[bot] c0b9017679 NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.52.0 to 0.53.0 (#2334)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 09:36:03 +02:00
dependabot[bot] e315d05355 NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.52.0 to 0.53.0 (#2333)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 09:29:36 +02:00
Felix Gateru 573fefc86d MG-888 - Update health, message and journal SDK tests (#2332)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-07-09 09:02:01 +02:00
Steve Munene ccb4827c52 MG-2287 - Improve search for channels and groups (#2315)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-07-05 16:37:51 +02:00
Felix Gateru b8a1fe1af6 MG-888 - Update channels SDK tests (#2269)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-07-05 14:37:43 +02:00
Felix Gateru 083e655bde MG-888 - Update things SDK tests (#2328)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-07-04 22:30:22 +02:00
Felix Gateru 8596b73375 MG-888 - Update users SDK tests (#2329)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-07-04 17:43:45 +02:00
Felix Gateru c518c0bcd6 MG-888 - Add invitations sdk tests (#2327)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-07-04 16:44:46 +02:00
Steve Munene 13024417ca MG-2287 - Improve search for Things (#2305)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-07-04 16:39:19 +02:00
dependabot[bot] e86eda5f54 NOISSUE - Bump github.com/gorilla/websocket from 1.5.1 to 1.5.3 (#2322)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-04 16:00:14 +02:00
Felix Gateru 9d982c466b MG-888 - Add domians SDK tests (#2272)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-07-03 16:03:02 +02:00
dependabot[bot] a82413c32a NOISSUE - Bump github.com/go-chi/chi/v5 from 5.0.12 to 5.1.0 (#2321)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 23:11:55 +02:00
dependabot[bot] e48a52c023 NOISSUE0 - Bump github.com/authzed/authzed-go from 0.12.0 to 0.13.0 (#2320)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 22:57:36 +02:00
dependabot[bot] d9cd733c90 NOISSUE - Bump github.com/0x6flab/namegenerator from 1.3.1 to 1.4.0 (#2323)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 22:50:27 +02:00
Felix Gateru 4e2ae73fb0 MG-2280 - Unassign single user from domain (#2325)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-07-02 22:49:52 +02:00
Steve Munene 86d896dd44 MG-2287 - Improve users search (#2288)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-07-02 12:04:37 +02:00
JMboya 6d11c54874 NOISSUE: Add status field to ListMembers response (#2317)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-07-02 10:40:00 +02:00
JMboya 1a817f6684 MG-2268 - Rename SpiceDB permission viewer_only to view_only (#2318)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-07-01 13:49:03 +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 0794363a3c MG-1965 - Process Event Logs (#2057)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2024-06-27 16:38:20 +02:00
JMboya b0e37dacf4 MG-2026 - Fix JSON page response key from groups to channels (#2298)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-06-26 22:11:57 +02:00
Felix Gateru 1893107b07 MG-888 - Add bootstrap SDK tests (#2261)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-06-26 14:45:05 +02:00
Felix Gateru 50b374bd3e MG-888 - Update consumers SDK tests (#2271)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-06-26 13:40:48 +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
dependabot[bot] d19a2e4337 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.26.0 to 1.27.0 (#2309)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 13:21:49 +02:00
dependabot[bot] 288f94de35 NOISSUE - Bump github.com/nats-io/nats.go from 1.35.0 to 1.36.0 (#2308)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 13:17:46 +02:00
dependabot[bot] 709b670819 NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace from 1.26.0 to 1.27.0 (#2310)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 13:12:35 +02:00
dependabot[bot] 9cfa7134b0 NOISSUE - Bump google.golang.org/protobuf from 1.34.1 to 1.34.2 (#2311)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 13:05:53 +02:00
dependabot[bot] 4d6f523260 NOISSUE - Bump github.com/hashicorp/go-retryablehttp from 0.7.6 to 0.7.7 (#2312)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 12:55:22 +02:00
Felix Gateru be69946036 NOISSUE - Add domain events for Auth service (#2313)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-06-25 12:52:06 +02:00
Washington Kigani Kamadi fdb8aa216e NOISSUE - Remove redundant relation check (#2197)
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
2024-06-25 11:29:55 +02:00
Veddy 4ae799ec39 MF-2299 - Update influxdb2 volumes path (#2300)
Co-authored-by: Veddy <veddy@qq.com>
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-06-24 18:38:05 +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
JMboya 3c33961395 NOISSUE - add CreatedAt and UpdatedAt fields for mgclients.Client (#2306)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-06-24 17:39:58 +02:00
JMboya 94053f37ee MG-2142 - Consume Things connect/disconnect event in Bootstrap (#2192)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-06-24 11:02:09 +02:00
Steve Munene 424aa7cf80 MG-2216 - Rename delete policy function (#2218)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-06-21 10:07:52 +02:00
JMboya ef1322be57 MG-2296 - Domain creation allowed with nil alias (#2297)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-06-20 13:41:55 +02:00
JMboya 95badeee62 MG-2025 - CLI Flag to print only curl output (#2242)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-06-18 11:23:39 +02:00
dependabot[bot] d9bd5a465b NOISSUE - Bump github.com/hashicorp/vault/api/auth/approle from 0.6.0 to 0.7.0 (#2292)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 11:22:24 +02:00
dependabot[bot] 8ac4f0122b NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.51.0 to 0.52.0 (#2293)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 11:07:14 +02:00
dependabot[bot] b49a5ca04f NOISSUE - Bump golang.org/x/oauth2 from 0.20.0 to 0.21.0 (#2294)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 11:05:08 +02:00
dependabot[bot] fdc9450f8c NOISSUE - Bump github.com/spf13/cobra from 1.8.0 to 1.8.1 (#2295)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 11:04:32 +02:00
Felix Gateru 3528163175 MG-888 - Update certs sdk tests (#2267)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-06-18 10:59:18 +02:00
Felix Gateru c47bfb4fcd MG-888 - Update groups SDK tests (#2276)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-06-14 11:16:50 +02:00
Steve Munene 3355332ebd MG-2075 - Add guest relation (#2228)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-06-12 16:19:06 +02:00
Steve Munene 27f5fb8688 MG-2071 - Rename viewer relation to contributor (#2237)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-06-12 12:07:38 +02:00
JMboya 6cabc23dad MG-2201 - Fail role update if user does not exist (#2234)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-06-12 11:55:01 +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
Nataly Musilah 75a66a4f9b NOISSUE - Fix Timescale reader (#2263)
Signed-off-by: Musilah <nataleigh.nk@gmail.com>
2024-06-12 11:23:40 +02:00
b1ackd0t ce02e30587 MG-2007 - Rollback Policies if Entity Creation Fails (#2255)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2024-06-12 10:27:44 +02:00
Felix Gateru 20f8c084c1 MG-888 - Add Certs API tests (#2265)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-06-12 09:40:21 +02:00
dependabot[bot] 222c8a8252 NOISSUE - Bump github.com/authzed/authzed-go from 0.11.1 to 0.12.0 (#2284)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 13:35:39 +02:00
dependabot[bot] 052128a395 NOISSUE - Bump github.com/spf13/viper from 1.18.2 to 1.19.0 (#2285)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 12:21:27 +02:00
Dušan Borovčanin cb00f3a5db NOISSUE - Fix CI to fetch tags (#2282)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-06-11 12:12:09 +02:00
dependabot[bot] 7c7d0265d1 NOISSUE - Bump golang.org/x/net from 0.25.0 to 0.26.0 (#2286)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 12:11:33 +02:00
dependabot[bot] 2b7ec78797 NOISSUE - Bump github.com/jackc/pgx/v5 from 5.5.5 to 5.6.0 (#2283)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 12:07:26 +02:00
dependabot[bot] b795213649 NOISSUE - Bump go.opentelemetry.io/otel/sdk from 1.26.0 to 1.27.0 (#2257)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 17:41:14 +02:00
dependabot[bot] 36a7e81f1b NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.50.0 to 0.52.0 (#2259)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 17:34:33 +02:00
dependabot[bot] 931583693d NOISSUE - Bump go.opentelemetry.io/otel from 1.26.0 to 1.27.0 (#2258)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 17:27:16 +02:00
b1ackd0t 3e23807623 NOISSUE - Use only sign in state in OAuth 2.0 flows (#2270)
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2024-06-05 10:30:19 +02:00
Dušan Borovčanin 31d0e8c452 NOISSUE - Move default permission filters from Auth API to service (#2252)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-05-22 20:02:15 +02:00
Felix Gateru 42be65a3d2 MG-2186 - Migrate gocoap library from v2 to v3.3 (#2183)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-05-22 12:35:47 +02:00
dependabot[bot] e9172f7e5f NOISSUE - Bump github.com/fatih/color from 1.16.0 to 1.17.0 (#2248)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 10:12:43 +02:00
dependabot[bot] 5dada0d584 NOISSUE - Bump github.com/nats-io/nats.go from 1.34.1 to 1.35.0 (#2247)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 10:08:40 +02:00
dependabot[bot] b212d8afbb NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.50.0 to 0.51.0 (#2246)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 09:59:25 +02:00
dependabot[bot] 7ed7c66015 NOISSUE - Bump google.golang.org/protobuf from 1.33.0 to 1.34.1 (#2249)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 09:38:38 +02:00
b1ackd0t dba14f8c74 MG-2200 - Remove Unused Errors (#2243)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-05-20 14:36:02 +02:00
b1ackd0t d62982b4b6 NOISSUE - Add property based testing to HTTP Adapter (#2212)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-05-20 12:31:20 +02:00
Washington Kigani Kamadi 3e70fedb14 MG-1987 - Enable entity endpoints to return basic info for non-admins (#2168)
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
2024-05-20 12:10:12 +02:00
b1ackd0t cbb97c1d2e MG-1972 - Disable token refresh for disabled users (#2238)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-05-18 19:54:56 +02:00
dependabot[bot] 3bd5984480 NOISSUE - Bump golang.org/x/net from 0.24.0 to 0.25.0 (#2230)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-05-14 12:15:56 +02:00
dependabot[bot] 894a4ab118 NOISSUIE - Bump github.com/prometheus/client_golang from 1.19.0 to 1.19.1 (#2232)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
Co-authored-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-05-14 12:12:24 +02:00
dependabot[bot] 5b32305f43 NOISSUE - Bump golangci/golangci-lint-action from 5 to 6 in /.github/workflows (#2229)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 12:02:01 +02:00
dependabot[bot] 965dd986f2 NOISSUE - Bump golang.org/x/crypto from 0.22.0 to 0.23.0 (#2231)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 11:54:00 +02:00
dependabot[bot] 8eb8ed873c NOISSUE - Bump github.com/rabbitmq/amqp091-go from 1.9.0 to 1.10.0 (#2233)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 11:45:05 +02:00
JMboya 4d18c8b21d MG-2056 - List Domains not showing domains (#2226)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-05-13 11:52:25 +02:00
Washington Kigani Kamadi 75db28c522 MG-2117 - Remove repository errors from API layer (#2119)
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
2024-05-10 15:09:21 +02:00
Felix Gateru 551d5cf4ca MG-1977 - Check whether user is domain member before sending invitation (#2213)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-05-10 10:27:23 +02:00
guangwu 3e63dfb696 NOISSUE - Fix closing file in OPC-UA adapter (#2215)
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
2024-05-09 15:59:11 +02:00
dependabot[bot] c164253474 NOISSUE - Bump golangci/golangci-lint-action from 4 to 5 in /.github/workflows (#2207)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 15:42:38 +02:00
dependabot[bot] 7746b65f9a NOISSUE - Bump github.com/jmoiron/sqlx from 1.3.5 to 1.4.0 (#2208)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 15:34:47 +02:00
dependabot[bot] bb77ef8e4d NOISSUE - Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp from 1.25.0 to 1.26.0 (#2219)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 15:34:01 +02:00
dependabot[bot] afe0f2d449 NOISSUE - Bump golang.org/x/oauth2 from 0.19.0 to 0.20.0 (#2220)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 15:27:33 +02:00
dependabot[bot] e343b1d38c NOISSUE - Bump go.opentelemetry.io/otel/sdk from 1.25.0 to 1.26.0 (#2210)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 11:07:24 +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
dependabot[bot] 2040d2b34a NOISSUE - Bump github.com/hashicorp/vault/api from 1.12.2 to 1.13.0 (#2194)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 22:47:50 +03:00
JMboya d7d5911b93 MG-2092 - Remove unused field in token object (#2191)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-04-23 14:30:37 +03: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
Washington Kigani Kamadi 07635ad828 MG-2069 - Remove relation requirement from entity unassignment (#2130)
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
2024-04-23 11:58:00 +03:00
JMboya 3aa674fca0 MG-2137 - Generate mocks with mockery for Certs service (#2138)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-04-23 10:01:01 +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
dependabot[bot] 49028e2950 NOISSUE - Bump github.com/docker/docker from 26.0.1+incompatible to 26.0.2+incompatible (#2188)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-19 12:20:08 +02:00
Steve Munene 539be0f011 MG-2145 - Generate mocks with mockery for Lora service (#2146)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-04-19 11:01:24 +02:00
b1ackd0t 66c737a22d NOISSUE - Add property based testing to readers API (#2177)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-04-18 17:21:25 +02:00
Felix Gateru 24b5ea14b1 NOISSUE - Test pkg-sdk on change in internal package (#2184)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-04-18 09:22:52 +02:00
b1ackd0t 3cfcf14a50 NOISSUE - Fix provision test command (#2182)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-04-17 09:40:08 +02:00
JMboya 28b4087b69 MG-2166 - Generate mocks with mockery for readers (#2167)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-04-17 08:33:22 +02:00
Felix Gateru 1ca5b87db4 NOISSUE - Fix failing groups tests in sdk (#2181)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-04-16 16:15:49 +02:00
dependabot[bot] 469466d3c9 NOISSUE - Bump go.mongodb.org/mongo-driver from 1.14.0 to 1.15.0 (#2178)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 15:10:16 +02:00
dependabot[bot] 9474830136 NOISSUE - Bump github.com/docker/docker from 26.0.0+incompatible to 26.0.1+incompatible (#2179)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 15:02:34 +02:00
b1ackd0t 54e322ee3e NOISSUE - Add property based testing to provision API (#2099)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-04-16 14:54:32 +02:00
Felix Gateru 853dab3f5c MG-1981 - Fix bug on list groups wth subject returning subject group. (#2148)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-04-16 14:30:24 +02:00
b1ackd0t f334ee2606 NOISSUE - Add property based testing to twins API (#2098)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-04-16 10:39:32 +02:00
JMboya f6477ed868 MG-2161 - Generate mocks with mockery for mqtt (#2163)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-04-15 16:30:15 +02:00
Steve Munene 4935ae867d MG-2170 - Generate mocks with mockery for HTTP service (#2171)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-04-15 16:29:39 +02:00
JMboya 2246d790a4 MG-2164 - Generate mocks with mockery for users (#2165)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-04-15 09:24:43 +02:00
Emmanuel Ferdman 1f9f8f5e30 NOISSUE - Update the location of MQTT API docs (#2172)
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2024-04-13 14:42:36 +02:00
b1ackd0t c10c453eac NOISSUE - Add property based testing to certs API (#2096)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-04-12 17:40:46 +02:00
b1ackd0t 3d0678725e NOISSUE - Add property based testing to bootstrap API (#2095)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-04-12 17:05:03 +02:00
Felix Gateru cdf18dc972 MG-1963 - Remove TCP config from CoAP server (#2139)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-04-11 21:53:59 +02:00
b1ackd0t 76788d3ae2 NOISSUE - Add property based testing to auth API (#2094)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-04-11 09:58:20 +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
b1ackd0t e803f36f78 NOISSUE - Add property based testing to invitations API (#2093)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-04-10 10:18:54 +02:00
Dušan Borovčanin 9742d5bf07 NOISSUE - Update Go version to 1.22.2 (#2158)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-04-09 21:02:13 +02:00
dependabot[bot] 3fe9b5273c NOISSUE - Bump dorny/paths-filter from 2 to 3 (#2155)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 20:43:20 +02:00
dependabot[bot] 3b1b038b51 NOISSUE - Bump golang from 1.21-alpine to 1.22-alpine in /docker (#2156)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 20:34:35 +02:00
dependabot[bot] b27d924d82 NOISSUE - Bump peaceiris/actions-gh-pages from 3 to 4 (#2154)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 20:33:38 +02:00
dependabot[bot] 24b3b485b7 NOISSUE - Bump codecov/codecov-action from 3 to 4 (#2153)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 20:31:22 +02:00
dependabot[bot] 467c22fcd3 NOISSUE - Bump actions/setup-go from 4 to 5 (#2152)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 20:24:25 +02:00
Dušan Borovčanin 1571119e0f NOISSUE - Update dependencies (#2151)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-04-09 20:09:56 +02:00
Steve Munene 634e68de5a MG-2143 - Generate mocks with mockery for Invitations service (#2144)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-04-09 19:14:00 +02:00
Arvindh ab77d93950 NOISSUE - Fix: Domain Total Query (#2149)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-04-09 18:29:29 +02:00
Steve Munene ddb90a046a MG-2136 - Generate mocks with mockery for Bootstrap service (#2140)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-04-09 11:48:45 +02:00
b1ackd0t 33704abc0c NOISSUE - Add property based testing to things service (#2088)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2024-04-09 10:09:14 +02:00
b1ackd0t 5c62e339c1 NOISSUE - Update Health Information (#2089)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-04-08 19:18:20 +02:00
Felix Gateru 9b188b4520 NOISSUE - Add group tests to users and things service (#2133)
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
2024-04-05 14:40:46 +02:00
Ian Ngethe Muchiri 36944c1941 NOISSUE - Fix secret reset failing (#2135)
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2024-04-04 11:15:16 +02:00
Steve Munene 987c853448 MG-2060 - Remove int32 type in policy interface (#2131)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
2024-04-04 10:18:43 +02:00
JMboya 8b930e81e9 MG-2125 - Unable to enable thing using bootstrap (#2132)
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
2024-04-03 14:40:05 +02:00
b1ackd0t eb6b201a2a NOISSUE - Fix Failing Users Property Based Tests (#2134)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-04-03 13:01:42 +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
Washington Kigani Kamadi 65941368b8 NOISSUE - Fix OPC-UA adapter (#2114)
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
2024-04-01 12:38:12 +02:00
Ian Ngethe Muchiri ed4824d959 NOISSUE - Fix Timescale Reader query (#2120)
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2024-03-26 11:24:09 +01:00
dependabot[bot] 9e0be76911 NOISSUE - Bump github.com/docker/docker from 24.0.7+incompatible to 24.0.9+incompatible (#2123)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-26 11:22:57 +01:00
b1ackd0t 70c3d65863 NOISSUE - Add property based testing to users service (#2087)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-03-22 16:16:07 +01:00
Arvindh f733147517 NOISSUE - Add Domain URL to CLI and SDK configuration (#2118)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-03-20 17:01:07 +01:00
b1ackd0t ec7b4b45ec NOISSUE - Convert SenML Payload Time To UnixNano (#2115)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2024-03-15 21:32:29 +01:00
dependabot[bot] 7a2f71a6c1 NOISSUE - Bump github.com/jackc/pgx/v5 from 5.5.2 to 5.5.4 (#2116)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-15 10:53:05 +01:00
b1ackd0t 22a3c2962d NOISSUE - Remove OAuth2.0 tokens from Magistrala token (#2106)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2024-03-14 14:55:17 +01:00
dependabot[bot] 364749f281 NOISSUE - Bump google.golang.org/protobuf from 1.32.0 to 1.33.0 (#2112)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 12:10:20 +01: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
dependabot[bot] 3bf59689fb NOISSUE - Bump github.com/lestrrat-go/jwx/v2 from 2.0.19 to 2.0.21 (#2110)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-12 13:13:33 +01:00
Ian Ngethe Muchiri cd1c88b4d4 NOISSUE - Update Aggregation SQL query (#2111)
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2024-03-12 13:02:12 +01:00
dependabot[bot] 0affd8b619 NOISSUE - Bump github.com/go-jose/go-jose/v3 from 3.0.1 to 3.0.3 (#2108)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-08 11:26:25 +01:00
Ian Ngethe Muchiri 163ccbbe59 NOISSUE - Update UI environment variables (#2107)
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2024-03-07 11:38:00 +01:00
Nataly Musilah 42d433a92f NOISSUE - Update timescale reader (#2085)
Signed-off-by: Musilah <nataleigh.nk@gmail.com>
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Co-authored-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-03-05 12:12:55 +01:00
Ian Ngethe Muchiri 2be34c42f4 NOISSUE - Update UI service env variables (#2105)
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2024-03-04 14:09:29 +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 adb03b4ed8 NOISSUE - Add Event Subscriber Config (#2054)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-02-26 16:42:08 +01:00
Arvindh eb905267ab NOISSUE - Fix assign and unassign commands in CLI (#2102)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-02-26 12:27:47 +01:00
b1ackd0t 9ed0fe0b19 NOISSUE - Add job for checking go.mod changes (#2097)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-02-23 12:58:23 +01:00
Arvindh d716f3d02a NOISSUE - Fix panic during revocation of expired certificate (#2101)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-02-23 12:57:20 +01:00
Arvindh 7207512dca NOISSUE : Add Domain routes in Nginx x509 conf (#2100)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-02-22 13:09:06 +01:00
Arvindh 5d0cb70df8 NOIISUE - Update Vault setup scripts to support Vault CLI (#2091)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-02-22 10:09:50 +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
Arvindh ab4206cc93 NOISSUE - Vault operations with app role authentication (#2084)
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: arvindh123 <arvindh91@gmail.com>
2024-02-20 15:59:55 +01:00
Arvindh 4c206ec375 NOISSUE - Fix Bootstrap thing creation flow (#2083)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-02-19 16:03:21 +01:00
Arvindh 21c5813a96 NOISSUE - Fix provision configuration loading (#2078)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-02-19 13:20:47 +01:00
b1ackd0t a9e5897f4e NOISSUE - Add Postgres DB for UI (#2082)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2024-02-15 15:47:02 +01:00
b1ackd0t e77d4eafc5 NOISSUE - Pin the version of golangci-lint (#2077)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-02-12 12:21:33 +01:00
dependabot[bot] 3564f19158 NOISSUE - Bump github.com/opencontainers/runc from 1.1.10 to 1.1.12 (#2070)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-12 12:19:49 +01:00
Dušan Borovčanin 73362210dd NOISSUE - Remove CHANGELOG (#2067)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-01-29 18:25:34 +01:00
Sammy Kerata Oina f938a0c28a NOISSUE - Replace deprecated gRPC metrics collection with stats handler (#281)
Signed-off-by: SammyOina <sammyoina@gmail.com>
2024-01-29 16:54:47 +01:00
b1ackd0t 562c578108 NOISSUE - Simplify docker deployment (#275)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-01-29 16:53:05 +01:00
Arvindh 2c4880485d MG-104: Rename/Replace filed owner with domain (#268)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-01-27 22:47:00 +01:00
Arvindh e2616ecc4f NOISSUE - Fix messaging handler logger (#280)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-01-26 18:09:34 +01:00
Arvindh 15314a579d NOISSUE - Fix Listing of things connected to a channel (#279)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-01-26 13:54:24 +01:00
Dušan Borovčanin 2d7ccfae3f NOISSUE - Update CallHome version (#2066)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-01-26 11:16:47 +01:00
b1ackd0t 75b65afcbf NOISSUE - Make Check Interval Configurable (#277)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2024-01-25 16:02:13 +01:00
Sammy Kerata Oina 867060f6a5 NOISSUE - Replace deprecated gRPC instrumentation method (#278)
Signed-off-by: SammyOina <sammyoina@gmail.com>
2024-01-25 15:40:26 +01:00
Dusan Borovcanin 3221a05a7a NOISSUE - Replace docs link in API docs
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-01-25 15:00:20 +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 8424ef9867 NOISSUE - Use VerneMQ as the dafault MQTT broker (#2064)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-01-24 17:09:12 +01:00
Dušan Borovčanin 24d3804f89 NOISSUE - Revert Mosquitto broker version in MQTT tests (#2063)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-01-24 13:43:56 +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
Dušan Borovčanin d95283d314 NOISSUE - Update VerneMQ build scripts (#2058)
Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
2024-01-19 20:10:55 +01:00
b1ackd0t 25d43bc58c NOISSUE - Bug Fix on Listing Things (#274)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-01-19 12:10:20 +01:00
charlie-jangala 7fe60caf82 NOISSUE - Limit Max Traces kept in-memory by Jaeger all-in-one (#259)
Signed-off-by: Charlie Evans <charlie@janga.la>
2024-01-19 11:34:54 +01:00
Felix Gateru d7cd911613 NOISSUE - Improve tests in users service (#194)
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2024-01-18 17:14:46 +01:00
Felix Gateru e7129fe502 NOISSUE - Improve tests in things service (#200)
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2024-01-18 15:39:09 +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 a9c4ee6d89 NOISSUE - Fix Compose With v2.24.0 (#273)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-01-18 13:54:59 +01:00
b1ackd0t fe97de024c NOISSUE - Add tests for pkg/clients (#258)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-01-16 13:25:52 +01:00
b1ackd0t 021f15ac77 NOISSUE - Add group API tests (#243)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2024-01-12 17:41:09 +01:00
Arvindh d59bf77238 NOISSUE - Fix Domain listing and updating (#271)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-01-12 13:33:55 +01:00
Ian Ngethe Muchiri 9f573850fc NOISSUE - Add pagemetadata to ReadMessage function in sdk (#2055)
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2024-01-10 18:11:57 +01:00
Arvindh 660181539a NOISSUE - List Permissions when listing Users (#269)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-01-10 18:10:56 +01:00
Arvindh 235536128d MG-1967 - Handle errors in Things gRPC server and client (#257)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-01-10 16:52:06 +01:00
Arvindh 7378156e64 MG-1961 - Add Domains OpenAPI Spec (#261)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-01-10 16:46:32 +01:00
Nataly Musilah 2cafd60666 NOISSUE - Resolve falsely passing CI (#214)
Signed-off-by: Musilah <nataleigh.nk@gmail.co>
Co-authored-by: Musilah <nataleigh.nk@gmail.co>
2024-01-10 13:45:54 +01:00
charlie-jangala 7d3680a18b NOISSUE - Increase minimum docker-compose version in README.md (#260) 2024-01-10 13:40:48 +01:00
Arvindh 508227573c MG-1968 - List all status domains by default (#248)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-01-10 12:02:09 +01:00
b1ackd0t e8bf29d3fe NOISSUE - Add group service tests (#241)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-01-10 11:48:41 +01:00
b1ackd0t 2fb14e222f NOISSUE - Refactor Provision API tests (#192)
- Refactored the code snippets related to API requests and provisioning services
- Added test cases for error handling and functionality
- Created mock services for testing purposes
- Utilized external packages Magistrala and mockery

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-01-08 14:23:15 +01:00
b1ackd0t f7037397e5 NOISSUE - Add tests for auth config package (#251)
Improve authentication functionality, error handling, setup functions, add client and handler, new test file and test cases

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-01-08 14:19:55 +01:00
b1ackd0t 22ecbc24ee NOISSUE - Refactor error handling and SDK error testing (#263)
Improve error handling and SDK error testing. The code now includes signal handling, error wrapping, checking for contained errors, and testing HTTP error responses. Additionally, assertions have been added to ensure the expected behavior is met.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-01-08 11:33:16 +01:00
Felix Gateru b3e206321c NOISSUE - Add Things service mock (#242)
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2024-01-03 13:06:56 +01:00
Arvindh 7701f95bee NOISSUE - Add domain freeze endpoint (#247)
* add domain freeze endpoint

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

* fix: naming

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2024-01-03 12:48:09 +01:00
Ian Ngethe Muchiri b13357666a NOISSUE - Update Magistrala's mProxy and SenML dependencies (#250)
* update senml from mainflux to absmach repo

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

* update api documentation for websocket and mqtt

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

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2024-01-03 12:12:44 +01:00
b1ackd0t 03a2cbe573 NOISSUE - Add tests for internal API package (#193)
* Add test function api package

for UUID validation, encoding response data, and error handling
This commit refactors the test function responsible for validating UUIDs, encoding response data in JSON format, and handling error scenarios. The test cases have been improved for better coverage and reliability. Assertions are used to compare the actual results with the expected results.

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

* Add assertion to check if the error message is correctly encoded

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-01-03 11:01:34 +01:00
b1ackd0t 2ba2237bcc NOISSUE - Add test cases for Provision service (#191)
Add test cases for a provision service. The test cases check for valid and invalid tokens, verify the returned content and errors, and test scenarios for configuring the provision service with different authentication methods and expected outcomes.
Additionally, a test function has been added to check the behavior of the "Cert" service method by setting expectations on certain SDK method calls and asserting the expected values for the returned certificate, key, and error.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2024-01-03 10:33:48 +01:00
b1ackd0t 41d9e1bdd0 NOISSUE - Add group repository tests (#197)
* Add repository tests

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

* Add getIDs function to get ID from an array of groups

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: rodneyosodo <blackd0t@protonmail.com>
2024-01-03 10:27:25 +01:00
Felix Gateru ff12f7fca3 NOISSUE - Generate Users service mocks (#215)
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-12-29 10:36:21 +01:00
b1ackd0t e01a82e84b NOISSUE - Expand filters to check for test changes (#213)
* Expand filters to check for test changes

This is because sometimes SDK tests failed to pass on push to main
because for PR we were only testing directory changes.

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

* Fix failing SDK tests by adding authz

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

* Rename pipeline to workflow

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

* Rename push branch to main

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-12-27 12:58:28 +01:00
b1ackd0t 160b70e9dc NOISSUE - Add config tests (#190)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-26 16:12:23 +01:00
b1ackd0t e8a10862ab NOISSUE - Expose port 9091 instead of 9090 in dev env (#203)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-26 16:00:43 +01:00
Arvindh 5eccd71c12 NOISSUE - Fix channels, things, and groups domain authorization (#210)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-12-25 18:34:29 +01:00
Arvindh 8439a9f900 NOISSUE - Fix mockery version to v2.38.0 in the Makefile (#206)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-12-25 18:08:49 +01:00
Arvindh c2f125fc5a NOISSUE - Domains status check on Create & List of Things & Groups (#202)
* check domain status on create and list things and groups

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

* rename internal function name

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

* fix things test

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-12-25 16:56:54 +01:00
b1ackd0t 5590695e4b NOISSUE - Expose Timescale on 5433 (#208)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-12-25 15:27:35 +01:00
b1ackd0t 1f5a17b58a NOISSUE - Fix ListGroups failing to authorize (#205)
* Refactor "ListGroups" for imporoved access control

- Implement additional authorization based on domain ID

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

* Add subject and domain to PolicyReq in Authorize method

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-25 15:26:19 +01:00
Dušan Borovčanin 67097686e8 NOISSUE - Setup Dependbot (#207)
Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
2023-12-25 11:20:44 +01:00
b1ackd0t c57dedcc04 NOISSYE - Use auth const for checking authorization (#201)
The changes include:
- Updating the authorization functionality in a messaging service by modifying the check auth function
- Using constants from the auth package

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-22 19:21:08 +01:00
Arvindh e106349fb7 NOISSUE - Block login for non-admin users on disabled domain (#198)
* block disable domain login

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

* add: domain status custom json marshal and unmarshal

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

* fix: function naming

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

* remove: debug codes

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

* fix: golangci-lint errors

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

* fix: remove delete status

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

* fix: remove delete status

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

* rename: DStatus to Status

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-12-22 13:19:06 +01:00
b1ackd0t 2944e8881e NOISSUE - Generate event sourcing mocks (#186)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-22 11:32:49 +01:00
b1ackd0t 370b0c58a2 NOISSUE - Refactor Readers to use view permission instead of subscribe (#199)
It changes the permission from `subscribePermission` to `viewPermission` for the specified `Subject` and `Object`.
This is because group doesn't have permission subscribe.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-22 10:16:05 +01:00
b1ackd0t 9180494901 NOISSUE - Generate Auth mocks (#185)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-22 10:14:47 +01:00
Arvindh 1fe2e74a74 NOISSUE - Implement Thing Delete (#179)
* add: delete function in things interface

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

* add: remove things

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

* fix: things event streams

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

* add: things delete test

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

* add: delete thing http transport

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

* add: delete thing sdk, sdk_test, cli

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

* gofumpt -ed

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

* add: openapi

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

* fix: things change status response

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

* add: openapi

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

* rename events: from thing delete to thing remove

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

* fix wordings

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

* fix wordings in openapi

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

* add: type check

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

* update open api yaml

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

* fix things mocks

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-12-20 19:55:38 +01:00
Nataly Musilah 822515e9cf NOISSUE - Remove unused coverage.html files (#181)
* remove coverage.html generation

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

* update pkg coverage

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

---------

Signed-off-by: Musilah <nataleigh.nk@gmail.com>
2023-12-20 16:59:14 +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
Felix Gateru cb3161ce0e NOISSUE - Remove failing Auth tests for Policy removal
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-12-20 15:20:43 +01:00
b1ackd0t c3c910d9e3 NOISSUE - Generate Things repository mocks (#162)
* Generate things repository mocks

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

* Generate things cache mocks

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

* Change output dir for generated mocks

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

* rename factory methods

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

* Fix failing test

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 12:42:16 +01:00
Felix Gateru a6dd160091 MG-149 - Fix leaking database errors (#183)
* fix: handle database errors in svc

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

* fix: add descriptive error to postgres errors

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

---------

Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-12-20 10:51: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
b1ackd0t 0fa80ba186 NOISSUE - Split package tests (#133)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-19 12:40:13 +01:00
Nataly Musilah d4244dce51 NOISSUE - Fix CI badge
Signed-off-by: Musilah <nataleigh.nk@gmail.com>
2023-12-19 12:26:14 +01:00
dependabot[bot] a3f5f6f954 NOISSUE - Bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#182)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-19 12:25:00 +01:00
Ian Ngethe Muchiri 492ce14baf MG-174 - Bug: Docker Compose commands from README are incorrect
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2023-12-18 11:37:59 +01:00
b1ackd0t b3f1a91842 NOISSUE - Fix issue with MG_UI_CONTENT_TYPE in docker/.env file. (#175)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-18 09:39:04 +01:00
Felix Gateru 48e971180b MG-31 - Fix Auth tests (#129)
* Fix auth tests

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

* Fix auth tests

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

* Fix auth tests

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

* Fix service tests

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

* Fix auth tests

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

* Fix auth tests

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

* Fix auth errors

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

* rafactor set up

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

---------

Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-12-17 14:14:21 +01:00
Ian Ngethe Muchiri 188311e9ce NOISSUE - Add Docker composition for UI (#153)
* add compose file for ui

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

* fix bootstrap url

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

* update image source to use docker hub

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

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2023-12-15 17:10:55 +01:00
b1ackd0t 3112865810 NOISSUE - Generate PubSub mocks (#157)
* Refactor codegen to include pubsub

The commit includes changes to files related to messaging using the PubSub pattern.
It introduces a new step for checking PubSub updates and generating mocks.
Additionally, a new file for autogenerated mock code has been added.
Function and test case modifications have been made, including the use of mock implementations and checking for expected errors.
The commit also defines a mock implementation of a publisher-subscriber system using websockets.

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

* Add error check for authentication

modify error handling, and return 401 status code in updateClientSecret function

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

* Change output dir for generated mocks

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-15 14:56:28 +01:00
b1ackd0t da79c82208 NOISSUE - Generate Users repository mocks (#160)
* Generate users repository mocks

Add generation of users repository mocks for easier testing purposes
rather than writing the mocks

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

* Change output dir for generated mocks

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-15 14:32:16 +01:00
Ian Ngethe Muchiri 4bce9b6f2b NOISSUE - Fix API operations naming (#158)
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2023-12-15 12:00:45 +01:00
b1ackd0t de992d52a5 NOISSUE - Enforce aliases for errors packages (#147)
- repoerr "github.com/absmach/magistrala/pkg/errors/repository" instead of repoerror
- svcerr "github.com/absmach/magistrala/pkg/errors/service" instead of svcerror

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-15 11:30:03 +01:00
Nataly Musilah 69791d71c9 NOISSUE - Update badges (#152)
* fix: update badges

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

* fix: update badges files

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

---------

Signed-off-by: Musilah <nataleigh.nk@gmail.com>
2023-12-15 11:28:02 +01:00
b1ackd0t 6d2096cda9 NOISSUE - Fix e2e Testing Tool (#135)
* fix(e2e): Add admin role and permission

This commit adds a new constant and modifies the `createUser` function. The function now creates a user with an admin role and a domain with admin permissions.

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

* chore(ci): add e2e testing on CI

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

* Remove unnecessary time.Sleep calls and optimize code execution

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-15 11:20:48 +01:00
Arvindh 450a8f94a2 MG-50 - Auth: Improve gRPC response with error codes (#142)
* add: grpc error handling

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

* fix: golangci errors & remove: switch case placeholders

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

* Handle ok case error

* Handle ok case error

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-12-15 11:17:20 +01:00
Ian Ngethe Muchiri 13ab8d042f NOISSUE - Add marshalling to retrieve domain response (#154)
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2023-12-15 10:34:44 +01:00
b1ackd0t aaf0756707 NOISSUE - Generate SDK Mocks (#127)
* fix(errors): Fix nil pointer error in NewSDKError

In the NewSDKError function, a check is added to handle the case where the input error is nil. Previously, if the error was nil, the function would panic. This fix ensures that the function returns nil instead of panicking when the input error is nil.

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

* feat(sdk-mock): Add mock functions for SDK testing

This commit adds a set of mock functions for the software development kit (SDK) to facilitate testing. These functions simulate the behavior of the actual functions in the SDK and have defined input parameters and return values. The code also includes error handling logic and checks for different return types.

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

* test: use sdk mocked interface

* feat(workflow): check for generated files

The commit modifies the check-proto GitHub workflow to check-generated files. It checks for changes in specific paths and verifies the protobuf files and generated mocks. The code also includes checking if the SDK mock is up to date, installing a tool, generating mocks, and displaying an error message if the mocks are different. The tool we use is: https://github.com/vektra/mockery.

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

* feat(mocks): Add copyright notice to mocks.go

Added a copyright notice to the mocks.go file in the pkg/sdk/go directory for clarity and attribution.

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

* feat(build): Add target for generating mocks

Added a new target to the Makefile for generating mocks using the mockery tool. The target checks if the mockery tool is installed and then runs the "go generate" command to generate mocks for the codebase..

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

* Improve error messages in check-generated-files.yml

In this commit, I have made changes to the check-generated-files.yml file. Specifically, I have updated the error messages to provide more information about the issue. Instead of simply stating that the proto file and generated Go file are out of sync, the error message now includes a more detailed explanation and a suggestion for resolving the issue. Additionally, I have also added error messages for the generated mocks for the SDK. These error messages provide information about the sync issue and suggest running the necessary commands to resolve it. This commit aims to improve the clarity of error messages and help developers quickly identify and fix sync issues in the codebase.

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-15 09:25:05 +01:00
Felix Gateru a8d3e7de42 Refactor errors (#155)
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-12-14 18:09:53 +01:00
b1ackd0t 5e541f6a2c MG-144 - Refactor Invitations to list invitations by state (#148)
* Refactor invitation to list invitations by state

Add states when fetching invitations that is:
- pending
- accepted
- all
- unknown

The changes focus on refactoring the functions responsible for retrieving and updating invitation data from a PostgreSQL database. Additionally, improvements have been made to the error handling mechanism. The commit also introduces new test cases to verify the functionality of the implemented functions.

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

* Rename `todbInviation` to `toDBInvitation`

This is to align with the rest of the codebase

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

* Refactor invitation state constants and string conversions

- Refactor the constants for invitation states in the state.go file.
- Rename the "pendingState" constant to "pending" and the "acceptedState" constant to "accepted".
- Update the corresponding String() function to return the new constant names.
- Update the ToState() function to handle the new constant names.

This commit improves the clarity and consistency of the invitation state constants and their string representations.

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-14 11:42:57 +01:00
Felix Gateru 4d038c633a MG-31 - Fix pkg tests (#123)
* Fix pkg tests

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

* fix errors

* refactor groups tests

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

* Add opts to docker containers

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

* Fix pkg tests

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

* Remove unvailable publish test

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

* Remove unvailable publish test

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

* Cleaning up

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

* Cleaning up

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

---------

Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-12-12 16:09:05 +01:00
Arvindh 2281b44a26 MG-140 - Permission denied when checking entity permissions
Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-12-12 15:32:43 +01:00
b1ackd0t 5aaf1da35a NOISSUE - Add order & direction to list Users API (#88)
* feat: API layer for search

Implement the API layer for search. This includes the following:
- API endpoints for search
- Logging
- Metrics
- Tracing

* fix(api): fix default order in common.go

The default order in the common.go file was set to "updated_by" instead of "updated_at". This commit fixes the default order to "updated_at" to ensure accurate sorting.

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

* test: Add test function for search clients

The test function creates a new service with mock dependencies and tests various scenarios, including authorized and invalid tokens. It also checks the response and error values. The test function sets up mock calls and asserts expected values.

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

* refactor(users): remove search endpoint

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-12 11:04:24 +01:00
b1ackd0t a07aabe783 NOISSUE - Add Invitation service (#126)
* feat(service): Add new "invitations" service

This commit adds a new service called "invitations" to the existing file. The service includes the necessary imports and initializes components for its functionality. It also includes configuration settings and a Docker Compose file. Additionally, instructions for deploying and using the service are provided, along with a function to create an HTTP handler.

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

* docs(api): invitation api

The commit adds documentation for an API that allows users to manage invitations. It includes information about the endpoints, parameters, data types, and components used in the API. The documentation also outlines the properties and specifications of the Invitation object. This commit provides a comprehensive overview of the API's functionality and structure.

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

* fix: accept invitation to take in domain

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

* refactor(invitations): rename domain to domainID

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

* Authorize on id(domain+user) rather than user

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-11 18:24:37 +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
Arvindh a078bbe91d NOISSUE - Add view Domain permissions (#118)
* add: view domain permissions

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

* "gofumpt" -ed

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

* fix: retrieve group

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

* change in approch for retrieve domain permissions

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

* change to query fram approch

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

* add: view domain permissions sdk

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

* add: view domain permissions sdk

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

* add: view domain permissions sdk

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

* fix: golangci errors

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-12-11 09:41:31 +01:00
b1ackd0t 5d77ea5475 MG-137 - Use Magistrala errors wrap (#138)
- Updated the error assertion in the invitations_test.go file.
- Replaced the assert.ErrorIs() function with assert.True() and errors.Contains() to check if the expected error is contained in the actual error.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-10 20:06:37 +01:00
Dušan Borovčanin 1fa9fb8d72 NOISSUE - Update .gitignore (#136)
Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
2023-12-08 15:17:21 +01:00
b1ackd0t c3882675f9 NOISSUE - Add API layer for Invitation service (#125)
* feat(api): Implement endpoints for invitations

Implemented endpoints for sending, viewing, accepting, and deleting invitations in the API. Added validation, error handling, logging, and metrics functionality. Utilized various packages, routers, and frameworks to handle HTTP requests and perform invitation operations. Also included functions for decoding request payloads and implementing tracing functionality.

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

* feat(invitations): add service mocks

* feat(endpoint): test API layer

"endpoint_test.go" is introduced, which contains test cases for API endpoints. These test functions cover various features related to invitations, including different input parameters and expected outcomes. Furthermore, the code includes modifications to a function in the transport file, where a parameter is removed and a route is modified for better performance and efficiency.

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

* refactor(invitations): accept invitation to take domain

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

* refactor(invitations): rename domain to domainID

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-08 13:11:31 +01:00
b1ackd0t 75a2e8d4f3 NOISSUE - Add Invitations service layer (#124)
* feat(invitation): Add new function for sending invitations

This commit adds a new function for sending invitations in the invitation management and authorization code. The function allows users to send invitations to other users, providing necessary details such as email address and invitation message. This feature enhances the overall functionality of the application.

The code changes include the addition of the "sendInvitation" function in the invitation module, along with necessary validation checks and error handling. Additionally, test cases have been added to cover different scenarios and ensure the proper functioning of the feature.

This commit improves the invitation management and authorization functionality by enabling users to send invitations to others.

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

* test(invitations): Add test cases for invitation functions

Add new test cases to cover different scenarios and expected behavior in the invitation functions. These test cases ensure proper error handling and validate the functionality of the code related to invitations.

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

* feat: test with token

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

* feat(invitations): update ListInvitations function

This commit updates the ListInvitations function in the invitations service. The changes include updating the page parameters to use InvitedByOrUserID instead of separate InvitedBy and UserID fields. This ensures that invitations are retrieved correctly based on the user ID.

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

* feat(invitations): Add rename to checkAdmin

An existing function has been renamed to "checkAdmin".

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

* Refactor RetrieveAll method signature

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-08 10:02:20 +01:00
b1ackd0t 1f087bf42c NOISSUE - Add Invitation service repository layer (#120)
* feat(invitations): add repository layer

Add PostgreSQL migration, setup test, and
repository for invitations

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

* feat(invitations): Implement error handling and repository functions

This commit introduces modifications to the error handling and repository functions in the internal/postgres and invitations/postgres packages. The changes primarily focus on retrieving invitations from a database and handling errors appropriately. Additionally, the code diff includes updates to imports and test cases for the InvitationCreate function. The Retrieve function is thoroughly tested with different scenarios, including tests for updating invitation tokens and confirmations. Moreover, tests are added for the update and delete functions for invitations in a repository.

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

* feat: test with token

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

* feat(Page): Add new field `InvitedByOrUserID`

This code change adds a new field to the Page struct and modifies the pageQuery function to handle it. The change also includes modifications to the test file. The code snippet tests the functionality of retrieving invitations, specifically using the invited_by_or_user_id field. The test ensures that the retrieved invitations match the expected response.

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

* feat(invitations): add updated_at field to UpdateConfirmation query

This commit adds the updated_at field to the UpdateConfirmation query in the invitations package. This ensures that the updated_at field is updated when confirming an invitation.

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-07 16:11:54 +01:00
Nataly Musilah c8126d1a03 MG-117 - Update Makefile test target (#122)
* fix: remove vendor from go test

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

* fix: update make test

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

* fix: fix coverage.txt in cd.yml

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

* fix: simplify go test

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

* fix: remove cassandra

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

---------

Signed-off-by: Musilah <nataleigh.nk@gmail.co>
Co-authored-by: Musilah <nataleigh.nk@gmail.co>
2023-12-07 14:20:52 +01:00
b1ackd0t 68f551f81d NOISSUE - Implement Invitations Service Outline (#116)
* feat(invitations): Implement invitations outline

This commit adds the necessary data structures and methods for managing invitations to join a domain. It includes structs for invitations, pages of invitations, and pages of invitations with additional metadata. Additionally, error variables for missing and invalid relations are defined.
The commit also introduces methods for sending, viewing, listing, accepting, and deleting invitations. In addition, it includes functions for creating, retrieving, updating, and deleting invitations in a repository.
Furthermore, a function is added to check the validity of a relation, returning an error if it does not match specific values.

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

* docs(invitations): add godocs

* test: Add tests for MarshalJSON and CheckRelation

Add tests to ensure the MarshalJSON function of the InvitationPage struct correctly marshals the JSON representation. Also, add tests for the CheckRelation function to verify its behavior in different scenarios. The tests use a loop and the assert.Equal function to compare expected and actual errors.

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

* feat(invitations): add withToken parameter to RetrieveAll method

This commit adds a new parameter "withToken" to the RetrieveAll method in the invitations package. This parameter allows the caller to specify whether they want to include the token in the returned invitation list.

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

* docs(invitations): Add Base README

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-07 14:15:16 +01:00
b1ackd0t 71e600798d MG-132 - Remove Identity From Basic Information (#94)
* refactor(clients): deprecate RetrieveNames

Remove RetrieveNames and modify RetrieveAllBasicInfo to replace it. Remove sensitive information when retrieving basic information

* change from if statement to switch

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

---------

Co-authored-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
2023-12-07 13:56:34 +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
Nataly Musilah 7692546c1c NOISSUE - Fix WS coverage flag (#121)
Signed-off-by: Musilah <nataleigh.nk@gmail.co>
Co-authored-by: Musilah <nataleigh.nk@gmail.co>
2023-12-05 10:37:34 +01:00
Nataly Musilah ee6b47610b NOISSUE - Run Test on Merge to Main (#103)
* add e2e tests

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

* fix test run

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

* fix: modify files for running tests

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

* fix: add makefile changes

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

* fix: add certs

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

* fix: add other services test

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

* fix: remove makefile change

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

* test: test out the test run

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

* fix: add test.yml and build.yml

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

* fix: fix bootstrap test

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

* try: building test

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

* test: reduce repeating tests

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

* remove build on pr

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

* fix: add secrets to cd.yml

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

* fix: fix secrets

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

* fix: remove build.yml

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

* fix: return to build on push

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

* fix: check codecov upload

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

* test: test out coverage

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

* fix: resolve comments

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

* update: remove test.yml and update makefile

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

* resolve comments

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

* fix: change Test to tests

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

---------

Signed-off-by: Musilah <nataleigh.nk@gmail.co>
Co-authored-by: Musilah <nataleigh.nk@gmail.co>
2023-12-04 20:26:25 +01:00
b1ackd0t 8c05a17491 NOISSUE - Align Environment Variables in Docs (#114)
This commit adds various configurations and environment variables for different services in the codebase. These services include CoAP adapter, HTTP adapter, LoRa adapter, MQTT adapter, OPC-UA adapter, and WebSocket adapter.
The variables control settings such as log level, host and port, server certificates and keys, auth URLs, message broker URLs, Jaeger server URLs, telemetry settings, and instance IDs.
Additionally, instructions are provided for running the services outside of the Docker container. TLS encryption can be enabled by setting specific variables and providing PEM format files for certificates and keys. Default values are also provided for unset variables.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-04 15:13:01 +01:00
b1ackd0t 38b50cb6c0 NOISSUE - Repository Retrieve User By Name (#84)
* feat: add retrieve users by name

Retrieve users by name from the database. This is a new feature. It
enables the user to retrieve users by name.

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

* test: bump up test cases

The changes made in this commit involve modifying the RetrieveNames function in the clients.go file. The function now retrieves client names by constructing a query. Additionally, test cases have been added to ensure the correct retrieval of clients with different parameters and to assert the expected response and error values.

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

* fix: add direction only when we have order

When constructing a query, the function now checks if the order parameter is provided and if it is one of the allowed values (name, identity, created_at, updated_at). If so, the function adds an ORDER BY clause to the query. Additionally, if the direction parameter is provided and it is either "asc" or "desc", the function adds the direction to the query.

This change enables users to specify the order in which the query results should be returned and the direction of the ordering.

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

* fix: fix sorting direction check in constructQuery

The fix updates the check to use the constants from the api package for clarity and consistency.

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

* feat(users): add ID field to RetrieveNames query

Added the ID field to the SELECT query in the RetrieveNames function in clients.go. This change allows the function to retrieve the ID along with the name of the clients.

Also modified the clients_test.go file to include the ID field in the test data for the RetrieveNames test.

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

* feat(db): Test for SQL injection

This commit adds a new feature by including a username field in the client information. It also modifies the retrieval of client names and adds tests to prevent SQL injection. Additionally, it introduces functions for retrieving clients based on their identity and includes test functions for retrieving clients based on different criteria. The code also includes functions for setting parameters and finding clients based on specific queries.

* feat(users): update SQL query in RetrieveNames

This commit updates the SQL query in the RetrieveNames function in the users/postgres/clients.go file. The query now uses the '~' operator instead of 'ILIKE' for the name and identity conditions. This change improves the search functionality by allowing for more flexible matching.

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-04 15:05:52 +01:00
Felix Gateru 44b537c8fa MG-31 - Fix Users tests (#115)
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-12-04 14:18:10 +01:00
Felix Gateru e7a628e910 MG-31 - Fix Twins tests (#106)
* Fix tests in Twnins

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

* fix twins tests

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

---------

Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-12-04 14:00:42 +01:00
Felix Gateru 93357eb5dd MG-31 - Fix Things tests (#107)
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-12-04 13:27:34 +01:00
b1ackd0t c1e76e698d NOISSUE - Update Auth documentation (#110)
The commit introduces changes to the "auth/README.md" file. It updates the authentication keys, adds new key types, and introduces the concept of domains.
The documentation also includes information on the configuration settings for the authentication service, such as database and server details. It mentions that the service is distributed as a Docker container and provides instructions for running it outside of the container.
Furthermore, the commit mentions a configuration file for the "magistrala-auth" service and highlights specific changes made to environment variables in various files.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-04 13:11:28 +01:00
b1ackd0t e0cd2ceb55 NOISSUE - Update Readers Documentation (#113)
* feat(readers): remove jaeger URL

Remove JAEGER URL and align documentation

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

* docs: update description

Update the description of message readers in the `readers/README.md` file. This commit clarifies that message readers provide implementations of various `message readers` and consume normalized (in `SenML` format) Magistrala messages from data storage. Additionally, it highlights that message readers expose an HTTP API for message consumption. For more detailed information on the usage of `reader` and a comprehensive understanding of Magistrala, please refer to the [official documentation][doc].

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-04 13:01:31 +01:00
b1ackd0t 658fd373ba NOISSUE - Update Certs service configuration and docs (#112)
The commit modifies the configuration files and Docker Compose files related to the "certs" service. The changes include updating URLs, adjusting the log level, and modifying the SDK certs URL. This refactor ensures that the service operates with the correct settings and improves the overall functionality.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-04 12:26:43 +01:00
b1ackd0t 99b509d5dc NOISSUE - Update Bootstrap configuration documentation (#111)
Updated the documentation to include details about the configuration variables and environment settings for the bootstrap service. This includes information about database connections, SSL settings, authentication services, event sources, and other parameters. Also added deployment instructions and links to API documentation for further information.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-04 12:16:07 +01:00
b1ackd0t 0c68108ada NOISSUE -Make preshared Key an env var (#109)
Refactor initialization of SpiceDB client and schema to take in context
Update Docker environment variables and Docker Compose file
Update the Docker environment variables and the Docker Compose file to reflect the latest configuration requirements. This ensures that the application can run smoothly in the Docker environment.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-04 12:15:02 +01:00
b1ackd0t 4982174775 NOISSUE - Remove ISSUE_TEMPLATE.md (#108)
* chore(.github): Update files and guidelines

Deleted the "ISSUE_TEMPLATE.md" file, added a new "config.yml" file, and modified the "PULL_REQUEST_TEMPLATE.md" file in the ".github" directory.

The modifications include updating contact links, adding licensing information, and providing guidelines for pull request titles, contributing guidelines, and the use of draft pull requests. Also, advised against force-pushing additional commits after a pull request has received reviews or comments.

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

* feat(issue-template): Update labels and title format

Update the labels and title format in the bug_report.yml and feature_request.yml files of the .github/ISSUE_TEMPLATE directory.

- Change the title format in bug_report.yml from "[BUG] <title>" to "Bug: <title>"
- Change the labels in bug_report.yml from ["bug", "needs-review", "needs-reproduction"] to ["bug", "needs-review", "help wanted"]
- Change the title format in feature_request.yml from "[FEATURE] <title>" to "Feature: <title>"
- Change the labels in feature_request.yml from ["feature", "needs-review"] to ["enhancement", "needs-review"]

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

* feat(issue_template): update feature_request.yml

Updated the feature_request.yml file in the .github/ISSUE_TEMPLATE directory. Replaced the checkboxes type with a dropdown type for indicating the importance of the feature request. Updated the options to "Must-have," "Should-have," and "Nice-to-have."

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

* fix(template): remove checkboxes

Checkboxes are render incorrently according to our use case hence we are moving away from using check boxes to using text input

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-04 11:56:21 +01:00
Arvindh 3ef67f7ffd NOISSUE - Enable superadmin listing resources by domains (#105)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-12-03 17:28:44 +01:00
Felix Gateru 2dffccfb77 MG-31 - Fix Readers tests (#102)
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-12-01 14:27:30 +01:00
Nataly Musilah 6edcbee794 NOISSUE - Add failfast for CI test run (#100)
* add failsafe

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

* add missing tests

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

---------

Signed-off-by: Musilah <nataleigh.nk@gmail.co>
Co-authored-by: Musilah <nataleigh.nk@gmail.co>
2023-12-01 13:59:51 +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
b1ackd0t 94cfadc745 NOISSUE - Generate Invitation Key (#87)
* feat(auth): Add invitation key generation

This commit adds the functionality to generate an invitation key in the auth service. The `invitationKey` function is responsible for generating the key and issuing an access token. It sets the key type, expiration time, and subject based on the user's domain. The generated access token is returned as part of the response.

The `invitationKey` function is called in the `Issue` function when the key type is InvitationKey. This allows for the generation of invitation keys when needed.

This feature enhances the functionality of the auth service by enabling the generation of invitation keys for user invitations.

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

* fix(auth): fix invitation duration

The invitation duration in the auth service has been corrected to 7 days (7 * 24 * time.Hour) instead of 24 hours.

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

* feat(auth): configure invitation duration by env vars

Configure invitation duration by envionment variables. The default is `168h` which is 1 week.

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-12-01 11:46:51 +01:00
Felix Gateru f42c248313 MG-31 - Fix HTTP adapter tests (#99)
Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-12-01 11:28:03 +01:00
Nataly Musilah 29f405b4f2 NOISSUE - Add bootstrap tests to CI (#98)
* add bootstrap tests

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

* add more context

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

* add test name

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

* change timeout

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

* change timeout to 10min

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

* remove build after lint

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

---------

Signed-off-by: Musilah <nataleigh.nk@gmail.co>
Co-authored-by: Musilah <nataleigh.nk@gmail.co>
2023-12-01 11:10:51 +01:00
Felix Gateru 8ea1042531 MG-31 - Make bootstrap tests pass (#97)
* Fix errors

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

* Fix bootstrap tests

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

* remove changes to Makefile

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

* Fix tests in streams

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

---------

Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-12-01 10:27:52 +01:00
Nataly Musilah 94c5a36929 MG-90 - Fix CI (#93)
* fix ci

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

* add status badge

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

* remove badge

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

* add status badge

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

* fix gofumpt error

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

* remove badge again

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

* return badges

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

* clean cache

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

* fix lint errors

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

* fix clients.go

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

---------

Signed-off-by: Musilah <nataleigh.nk@gmail.co>
Co-authored-by: Musilah <nataleigh.nk@gmail.co>
2023-11-30 17:33:29 +01:00
Ian Ngethe Muchiri 977bbc552b NOISSUE - Add list permissions to SDK metadata (#96)
* add list permissions to sdk metadata

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

* rename list perms

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

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2023-11-30 15:11:20 +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
Felix Gateru 0197244427 NOISSUE - Fix Auth tests (#82)
* Fix users tests

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

* Fix failing tests

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

* Fix tests

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

---------

Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-11-29 16:20:28 +01:00
Arvindh 6f195f816e NOISSUE - Fix Update user roles, Listing and retrieve users with role (#76)
* remove: UpdateClientOwner from things service

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

* fix: user role update, listing and retrieve

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

* fix: add user to have dual relationship to platform, so for update role just add or remove admin relation

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

* add: users permission sdk

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

* fix: grammer

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-11-29 13:54:49 +01:00
Arvindh f7350c40cd NOISSUE - List user permissions on entities (#66)
* add: list permissions

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

* remove test files

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

* add: retrieve entites  permissions endpoint and service

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

* changed to errgroup

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

* rollback grpc encoder decoder to standard

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

* fix: list permissions grpc types

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

* fix: loop varaible captured in func literal

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-11-29 12:40:36 +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
b1ackd0t 3362f1a71a NOISSUE - Update go.mod and go.sum files (#92)
The commit updates the go.mod and go.sum files.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-11-29 11:27:10 +01:00
Arvindh 1e21f556cf NOISSUE - Fix policies error handling (#85)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-11-29 09:16:13 +01:00
Dušan Borovčanin 18b0bd9f38 NOISSUE - Update GitHub templates (#89)
Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
2023-11-28 22:11:32 +01:00
Nataly Musilah 5958880354 MG-68 - Switch to GitHub Actions (#61)
* add ci.yml file

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

* fix setup codecov

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

* fix setup Golangci

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

* fix protoc version

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

* fix protoc files

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

* remove cache lines

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

* fix lint users

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

* fix linter

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

* add golintci file location

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

* remove linter cache

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

* fix bootstrap linter

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

* fix golangci cache

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

* fix linter

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

* remove download golangci-lint

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

* add golangci-lint.yml file

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

* fix lint errors

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

* resolve comments

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

* remove ./codecov

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

* fix test certs

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

* fix http and mqtt

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

* add test matrix

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

* fix matrix paths

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

* add build matrix

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

* remove branch

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

* set environment passwords

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

* remove login step

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

* add login action

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

* fix readers login

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

* check tests

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

* use elgohr

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

* fix docker image

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

* remove interactive build

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

* restructure files

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

* fix proto version

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

* remove build.yml

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

* change name of ci workflow

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

* add back docker login

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

---------

Signed-off-by: Musilah <nataleigh.nk@gmail.co>
Co-authored-by: Musilah <nataleigh.nk@gmail.co>
2023-11-28 15:21:14 +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
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 151eaeb2b3 NOISSUE - Fix SDK Tests (#49)
* NOISSUE - Fix Users Tests (#42)

* Fix users tests

Fix tests in users service to ensure there are no failing tests

* test: update tests with domains

Added test cases to cover the authn and authz functionality of the user service with domains integration.  The tests involve mocking function calls, setting up expectations, and checking for expected results. The code includes conditional statements and different scenarios to ensure the proper behavior of the functions.
This commit also fixes updating client secret

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

* NOISSUE - Fix loading Auth config (#64)

Fix bug in loading auth config and also refactor postgres connect

---------

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

* Fix failing tests in SDK

Fix failing tests in `sdk` package.

* fix(tests): update sdk tests with domains

Add domain integration and fix failing tests on SDK package

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-11-27 15:50:03 +01:00
Ian Ngethe Muchiri 98007ad669 NOISSUE - Fix SDK page metadata from email to identity. (#77)
* fix sdk pgm from email to identity

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

* fix linter error

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

* fi linter error

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

* update identity shortform

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

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2023-11-27 15:34:08 +01:00
Arvindh ea0559da44 NOISSUE - Limit user to have single relation with things, groups, channels and domains (#48)
* add: single relation precondition for user -> things, groups

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

* manual sync with main branch

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

* fix: comment grammar

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-11-27 10:57:20 +01:00
b1ackd0t f6cf7e0d6b NOISSUE - Fix WS adapter and Nginx configs (#73)
The commit adds a new target server configuration and modifies the code to use it. The main function now creates a target server configuration and passes it to the NewPubSub function. Additionally, a new httpserver is created using the target server configuration.
The proxyWS function has been updated to take two server configurations to create the target and address variables.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-11-24 00:54:09 +01:00
Felix Gateru 705560efd6 MG-12 - Improve Error Handling (#18)
* Add service error type

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

* Wrap errors in users service

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

* Solve merge errors

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

* Wrap errors in users service

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

* Wrap errors in things service

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

* Wrap errors in twins

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

* Wrap errors in bootstrap

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

* Update provision

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

* Update error tags

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

* Remove repo errors from transport layer

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

* Add copyright headers

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

* Resolve conflicts

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

* Remove apiutil from service

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

* Update postgres errors

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

* Handle token errors

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

* Handle token errors

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

* Update auth errors

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

* Update auth errors

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

* Update errors in auth

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

* Update users service

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

* Update license header

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

* fix ci

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

* Update error definitions

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

* Update error wrapping

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

* update error type definitions

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

* update error type definitions

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

* update error type definitions

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

* Rename import aliases

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

* Rename import aliases

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

* Refactor postgres errors

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

* Update errors

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

* Update errors

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

* Fix ci

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

* Update errors in transport

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

* Update errors in transport

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

* update error definitions

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

---------

Signed-off-by: felix.gateru <felix.gateru@gmail.com>
2023-11-24 00:52:04 +01:00
b1ackd0t dd3fb241b0 NOISSUE - Make Username Unique (#75)
* feat(users): add unique constraint to clients name

This commit adds a new migration to the users. The migration adds a unique constraint to the "clients" table in the database. This constraint ensures that the "name" column of the "clients" table is unique.

* feat: add tests

This commit adds constraints to the PostgreSQL database code for saving clients. Specifically, it ensures that the name column is not null and unique.
The code includes test cases with descriptions, client objects, and expected errors to cover scenarios such as adding clients successfully. These changes enhance the functionality and reliability of the codebase.

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

* fix: no need for seperate migration

This commit fixes an issue in the clients table in the PostgreSQL database. The name column is now set to NOT NULL and UNIQUE, ensuring that every client has a name and that the name is unique. This change improves data integrity and prevents any potential data inconsistencies.
Note: This commit does not include the clients_02 migration as it has been removed.

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-11-23 13:39:04 +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
Sammy Kerata Oina af4177b7ea NOISSUE - Fix NATS documentation (#29)
Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-11-22 11:14:18 +01:00
b1ackd0t 1f9d551bd2 NOISSUE - Fix Users Tests (#42)
* Fix users tests

Fix tests in users service to ensure there are no failing tests

* test: update tests with domains

Added test cases to cover the authn and authz functionality of the user service with domains integration.  The tests involve mocking function calls, setting up expectations, and checking for expected results. The code includes conditional statements and different scenarios to ensure the proper behavior of the functions.
This commit also fixes updating client secret

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

* NOISSUE - Fix loading Auth config (#64)

Fix bug in loading auth config and also refactor postgres connect

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-11-22 11:13:40 +01:00
b1ackd0t 9ae6ca8f63 NOISSUE - Align WS Documentation (#70)
Add documentation so that The service can now be deployed as a Docker container
or run outside of the container with the necessary dependencies.
Refactor server configuration i.e removing tagretServerConf as it is
used internally to proxy WS connection hence not configurable and update README.md

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-11-22 10:30:06 +01:00
dependabot[bot] 2b8aff5fe8 NOISSUE - Bump github.com/go-jose/go-jose/v3 from 3.0.0 to 3.0.1 (#69)
Bumps [github.com/go-jose/go-jose/v3](https://github.com/go-jose/go-jose) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/go-jose/go-jose/releases)
- [Changelog](https://github.com/go-jose/go-jose/blob/v3/CHANGELOG.md)
- [Commits](https://github.com/go-jose/go-jose/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: github.com/go-jose/go-jose/v3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-22 10:28:32 +01:00
b1ackd0t 12d400544b NOISSUE - Fix Prefix magistrala to Binary Names (#67)
* fix: update Makefile to prefix magistrala

The Makefile has been updated to generate the binary with a specific name. Now, the binary will be named "magistrala-<service_name>" instead of just "<service_name>". This change will help in better identification and organization of the generated binaries.

* fix: update Dockerfile to reflect correct file names

The Dockerfile has been updated to correctly reflect the file names of the built executables. The "mv" command has been modified to move the correct file to the "/exe" directory. This ensures that the Docker container will have the correct executable file.

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

* feat(build): update Makefile

Updated the Makefile to use a generic binary name in the build process. Instead of using "magistrala-$(1)" as the binary name, now it uses "$(1)". This change allows for easier customization and avoids hard-coding specific binary names for each service.
Revert Dockerfile to use a generic binary name in the build process. Instead of using "magistrala-$SVC" as the binary name, now it uses "$SVC". This change aligns with the updated Makefile and ensures consistency between the build process and the Docker image.

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-11-21 14:15:27 +01:00
b1ackd0t 23618c172d NOISSUE - Fix Bootstrap Tests (#54)
* Fix Bootstrap Tests

Fix failing tests in bootstrap package

* fix(domains): align tests with domains
2023-11-21 13:53:00 +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 b67d1d2501 NOISSUE - Fix pkg/clients tests (#44)
Fix failing tests on `pkg/clients` tests
2023-11-21 13:49:17 +01:00
b1ackd0t 01c1c5b43d NOISSUE - Fix Certs Tests (#51)
Fix tests in certs package
2023-11-21 13:40:16 +01:00
b1ackd0t 0bc8490692 NOISSUE - Fix Linting Errors (#65)
* style: fix linting errors

Fix code formatting and remove unnecessary
comments

* chore: Exclude string occurrences

Excluded the occurrences of the strings "Usage:" and "For example:" from being marked as issues in the golangci.yml file.

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-11-21 13:39:41 +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 a5fd7b037a NOISSUE - Fix error on WS test (#41)
The test case was returning a wrapped error yet it was
supposed to return a single error. The wrapped error
was just a duplicate.
2023-11-17 12:46:48 +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
Arvindh 48dddc4bba NOISSUE - Add Domains to the SDK (#45)
* add: domains sdk

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

* fix: error

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

* fix: cli users token and refresh

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

* fix: cli provision

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

* add domains cli

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

* remove test program

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

* update cli command for list domains

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

* add list user domain cli cmd

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

* fix varaible naming

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

* fix: comments grammar & varabile; add package headers

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-11-17 11:42:53 +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
Arvindh 1c6beb23de MG-53 - Remove precondition check : User exists in Domain only for Super admin in add policies (#57)
* fix: super admin to create entites in domain

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

* remove policy agent from not required function

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-11-16 17:55:52 +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 41176e83b1 NOISSUE - Invitation Service Auth Helper (#28)
* feat(auth): Add invitationkey

Add InvitationKey to auth key types and set expiration duration

* feat(auth): Add support for InvitationKey in Identify function

This commit adds support for the InvitationKey type in the Identify function of the auth service. Now, when the key type is either RecoveryKey, AccessKey, or InvitationKey, the key's subject will be returned. This allows for identifying users with an invitation key.

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-11-14 19:41:27 +01:00
b1ackd0t 4b5f06b15f NOISSUE - Update opentelemetry dependencies (#40)
When depandabot updated one of the opentelemetry dependenices
it did not update others hence the change was breaking jaeger
trace provider. This commit updates the remaining dependecies
while removing unnecessary import alias
2023-11-14 10:15:23 +01:00
Dušan Borovčanin 974b1433ef NOISSUE - Fix branch name in Semaphore (#26)
* Fix branch name in Semaphore

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

* Update README badge

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

* Update golangci lint version

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-13 16:33:04 +01:00
dependabot[bot] ee2b2410ab NOISSUE - Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc (#38)
Bumps [go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.45.0 to 0.46.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.45.0...zpages/v0.46.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 16:32:34 +01:00
Ian Ngethe Muchiri 3f37876af9 NOISSUE - Add Permission to sdk query (#24)
* add permission to query sdk

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

* revert subject object action

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

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2023-11-10 13:50:43 +01:00
b1ackd0t dc67f0cf0e NOISSUE - Fix DOCKER_PROJECT variable assignment (#33)
The DOCKER_PROJECT variable was not being assigned correctly due to a missing closing parenthesis in the command. This has been fixed by adding the missing parenthesis.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-11-10 10:36:51 +01:00
Sammy Kerata Oina 37ed187d82 NOISSUE - Remove branch from docker project (#27)
Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-11-09 13:40:50 +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
Dušan Borovčanin 28bba6d975 Update dependencies (#19)
Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
2023-11-01 19:16:52 +01:00
Dušan Borovčanin 7922ce80ba Fix Cassandra Writer setup (#23)
Signed-off-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
Co-authored-by: dborovcanin <dusan.borovcanin@abstractmachines.fr>
2023-11-01 19:16:27 +01:00
dependabot[bot] 11824a8b8a NOISSUE - Bump github.com/nats-io/nkeys from 0.4.5 to 0.4.6 (#20)
Bumps [github.com/nats-io/nkeys](https://github.com/nats-io/nkeys) from 0.4.5 to 0.4.6.
- [Release notes](https://github.com/nats-io/nkeys/releases)
- [Changelog](https://github.com/nats-io/nkeys/blob/main/.goreleaser.yml)
- [Commits](https://github.com/nats-io/nkeys/compare/v0.4.5...v0.4.6)

---
updated-dependencies:
- dependency-name: github.com/nats-io/nkeys
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-01 17:59:52 +01:00
dependabot[bot] 5afad8c933 NOISSUE - Bump github.com/docker/docker (#21)
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 24.0.6+incompatible to 24.0.7+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v24.0.6...v24.0.7)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-01 17:59:35 +01:00
Ian Ngethe Muchiri e17abe7fee NOISSUE - Fix sdk (#16)
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2023-11-01 13:04:57 +01:00
Ian Ngethe Muchiri 0907074922 NOISSUE- Fix renaming of mainflux-server to magistrala-server (#15)
* fix renaming of mainflux-server

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

* generate certs

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

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2023-11-01 13:03:17 +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
b1ackd0t 43a263d7da NOISSUE - Introduce NATS Jetstream as Default ES (#1907)
* Refactor message broker implementation

This commit refactors the Nats message broker implementation to include pubsub options. These changes include:

- Adding `Option` func that takes in the URL and prefix
- Implement `WithStream` option which can create a different stream for nats stream
- Implement `WithExchange` option which can create a different exchaange for rabbitmq channel
- Implement `WithPrefix` option which allows to you change the publisher prefix

These changes improve the organization and readability of the codebase.

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

* Use redis URL to configure username, password and db

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

* Make event store configurable on dev deployment

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

* Fix adds options to messaging `PubSub` interface

Adding options to PubSub interface allows the use of messaging
package to do es.

The changes in this commit ensure that the code handles errors
properly and provides more informative error messages when
encountering unexpected types.

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

* Add NATS event publisher implementation

This commit adds the implementation of the NATS event publisher.

The NATS event publisher is responsible for publishing events
to a NATS messaging system. It uses the `messaging`
package to interact with the messaging system.

The implementation includes the following features:

- Publishing events to NATS using the `Publish` method.
- Marshaling events to JSON before publishing.
- Setting the message subject and headers based on the event.
- Handling errors during publishing.

This implementation is built with the `!rabbitmq` build tag,
which means it will only be compiled if the `rabbitmq` build tag
is not present.

The NATS event publisher is part of the Mainflux events package
and provides support for the Mainflux NATS events source service functionality.

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

* Add RabbitMQ event publisher implementation

This commit adds the implementation of the RabbitMQ event publisher.

The RabbitMQ event publisher is responsible for publishing events
to a RabbitMQ messaging system. It uses the `messaging`
package to interact with the messaging system.

The implementation includes the following features:

- Publishing events to RabbitMQ using the `Publish` method.
- Marshaling events to JSON before publishing.
- Setting the message subject and headers based on the event.
- Handling errors during publishing.

This implementation is built with the `rabbitmq` build tag,
which means it will only be compiled if the `rabbitmq` build tag
is present.

The RabbitMQ event publisher is part of the Mainflux events package
and provides support for the Mainflux RabbitMQ events source service functionality.

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

* Add configurable implementation for events store

This commit adds a new file `brokers_*.go` which contains the implementation for the different event store. The file includes functions for creating a new publisher and subscriber using different es store.

This commit also includes an `init` function that logs a message indicating that the binary was built using the respective package as the events store.

The purpose of this commit is to add support for alternative events store.

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

* Fix build flags

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

* Refactor Makefile and Semaphore configuration

The Makefile has been refactored to include the `MF_ES_STORE_TYPE` tag in the `go build` command. Additionally, the Semaphore configuration has been updated to include a new task for compiling with Redis as the broker type.

This commit addresses the need to compile the codebase with Redis as the event store type and includes the necessary changes in the Makefile and Semaphore configuration.

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

* Reduced due to memory on testing

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

* Fix tests for es

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

* Fix grammar

Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com>
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix linting

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

* feat(docker): update environment variables for message broker

The commit updates the environment variable `MF_ES_STORE_TYPE` in the `docker/.env` file. The variable is changed from `${MF_MQTT_BROKER_TYPE}` to `${MF_MESSAGE_BROKER_TYPE}` to accurately reflect the type of message broker being used. This change ensures that the correct message broker is configured for the Event Store.

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

* feat: Update docker environment variables

- Removed the unused MF_ES_URL variable in the .env file
- Updated the MF_ES_STORE_TYPE and MF_ES_STORE_URL variables in the .env file to match the MF_MESSAGE_BROKER_TYPE and MF_NATS_URL variables respectively

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

* Fix after rebase

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

* Add godocs for option parameters for brokers

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

* pass by value exchange and prefix names

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

* Rename option functions

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

* move variables to constants

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

* fix: option example comment

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

---------

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com>
2023-10-24 17:22:53 +02:00
b1ackd0t 059b954047 NOISSUE - Refactor Redis URI (#1898)
* Replace Nats with Nats Jestream For PubSub

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

* Refactor Redis client connection

Use a single Redis URI to connect to Redis where the URI contains
host, port, database and possibly username and password.

This is to simplify environment variable configuration.

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-23 17:25:57 +02:00
Sammy Kerata Oina 9b4c2b24c8 UV-267 - Update WS service to mproxy (#1917)
* update WS service to mproxy

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

* Fix brokerstracing initialization in main.go

The commit fixes the initialization of the brokerstracing package in the main.go file. The target server configuration is now correctly passed to the NewPubSub function, ensuring that the correct host and port are used for the PubSub service. This resolves an issue where the wrong server configuration was being used, leading to incorrect behavior.

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

* Fix goroutine issue in main.go

The commit fixes a goroutine issue in the main.go file. Previously, the `hs.Start()` function was not being executed in a goroutine, which caused the program to block. This commit wraps the `hs.Start()` function call in a goroutine to ensure it runs concurrently. This resolves the issue and allows the program to continue execution without blocking.

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

* update to current mproxy

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

* update dependencies

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

* Fix targetWSHost value in proxyWS function

The targetWSHost value in the proxyWS function was empty. This commit fixes the issue by setting the targetWSHost value to "localhost". Additionally, the target variable in the proxyWS function is updated to include the "ws://" protocol prefix.

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

* update deps

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

* remove authorize from unsubscribe

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

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-10-23 16:22:09 +02:00
b1ackd0t 6bc931eb2a NOISSUE - Fix Readers Tests (#1933)
* Add things auth and auth

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

* feat(auth): add environment variable prefix for authorization gRPC client

This commit adds the environment variable prefix `MF_THINGS_AUTH_G` for the authorization gRPC client in the `internal/clients/grpc/auth/client.go` file. The prefix is used to configure the gRPC client for authorization.

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

* feat(auth): add mock implementation

This commit adds a new file `auth.go` to the `mocks` package. The file contains a mock implementation of the `mainflux.AuthzServiceClient` interface. This mock implementation is used for testing purposes and allows for easier unit testing of code that depends on the `AuthzServiceClient` interface.

The `auth.go` file includes the necessary imports and initializes a new struct that embeds the `mock.Mock` struct from the `github.com/stretchr/testify/mock` package. This struct provides methods for setting expectations and returning predefined responses during tests.

This addition will improve the testability of the codebase and facilitate the testing of components that rely on the `AuthzServiceClient` interface.

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

* feat(readers): add user authentication to listMessagesEndpoint

This commit adds user authentication to the listMessagesEndpoint function in the readers package. The function now takes an additional parameter, uauth, which is an instance of the mainflux.AuthServiceClient. This change allows the endpoint to verify the user's authentication before returning the list of messages.

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-23 15:36:42 +02:00
b1ackd0t 4401e79a0d NOISSUE - Add Subscriber Config (#1896)
* Replace Nats with Nats Jestream For PubSub

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

* Add Stream Description

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

* Fix connection leak in NATS publisher

The publisher struct in pkg/messaging/nats/publisher.go was modified to include a new `conn` field of type `*broker.Conn`. This change was made to fix a connection leak issue in the NATS publisher.

The `NewPublisher` function was updated to assign the `conn` parameter to the new `conn` field in the publisher struct.

Additionally, the `Close` method in the publisher struct was modified to close the `conn` connection.

This commit fixes the connection leak issue in the NATS publisher and ensures that connections are properly closed.

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

* Setup subscriber config to contain handler topic and ID

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

* Add delivery policy

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

* Avoid duplicate messages

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

* Rename to DeliveryPolicy

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

* Fix tests

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

* Not check for data result set when we are returning subset of messages

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

* For unsubscribe remove config

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

* Fix comment

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-23 15:27:15 +02:00
Sammy Kerata Oina 822c1baf85 UV-267 - Update http messaging to mproxy (#1916)
* update http messaging to mproxy

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

* Fix import path for mproxy module

The import path for the mproxy module has been updated to github.com/sammyoina/mproxy v0.0.0-20231005134356-c44220b46ea0. This change ensures that the correct version of the module is used.

This commit fixes the import path for the mproxy module, updating it to github.com/sammyoina/mproxy v0.0.0-20231005134356-c44220b46ea0.

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

* Fix inconsistent variable naming in streams_test.go

The variable "defaultTimout" was misspelled and should be "defaultTimeout".
Also, the unused variable "configList" was removed.

- Fix variable name "defaultTimout" to "defaultTimeout"
- Remove unused variable "configList"

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

* update mproxy

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

* update mproxy

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

* use auth connect

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

* Fix incorrect HTTP status code in endpoint_test.go

The previous commit introduced a mistake in the HTTP status code used in the endpoint_test.go file. The status code http.StatusUnauthorized was changed to http.StatusBadGateway. This commit corrects the status code to http.StatusBadRequest.

This commit also includes a minor change in the things.go file. It adds three lines of code to the Authorize function.

These changes ensure that the test cases and authorization logic are aligned with the correct HTTP status codes.

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

* fix errors

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

* Fix import formatting in message_test.go

The import statements in message_test.go were not properly formatted. This commit fixes the formatting by organizing the imports and removing unnecessary commented code.

- Import statements were organized and grouped together.
- Unnecessary commented code was removed.

This commit resolves the import formatting issue in message_test.go, ensuring that the codebase adheres to proper formatting conventions.

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

* Fix import order and add missing import in endpoint_test.go

The import order in the `endpoint_test.go` file has been fixed, and the missing import for `mainflux/mainflux` has been added.

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

* Fix targetHTTPHost value in main.go and remove commented code in endpoint_test.go

Summary:
Fix targetHTTPHost value and remove commented code

Body:
- In main.go, fix the value of targetHTTPHost to "http://localhost"
- In endpoint_test.go, remove commented code

This commit fixes the targetHTTPHost value in main.go and removes unnecessary commented code in endpoint_test.go. The targetHTTPHost value was previously empty and has been updated to "http://localhost" to correctly specify the target HTTP host. Additionally, the commented code in endpoint_test.go has been removed for cleaner code.

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

* Fix typo in log statement

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

* Refactor HTTP server startup logic

Refactor the logic for starting the HTTP server in the `main.go` file. Instead of directly starting the server and logging the server details, the code now uses a goroutine to start the server. This change improves code readability and maintainability.

The commit message follows the best practices for writing commit messages. It starts with a succinct one-line summary of the changes, which is no longer than 50 characters. The summary is capitalized and written in the imperative mood. The summary is followed by a more detailed description, separated by a blank line. The body of the message provides context and reasoning behind the changes.

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

* Fix import and variable assignment in main.go

The import "github.com/mainflux/mainflux/pkg/messaging" was removed and the variable assignment for "h" in main() was updated to remove the unnecessary slice brackets.

This commit fixes the import and variable assignment in main.go to ensure proper functionality.

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

* Fix typo in function name

The function name "newProxyHTPPServer" was misspelled and has been corrected to "newProxyHTTPServer". This commit fixes the typo in the function name.

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

* Fix Docker clean command in Makefile

The Docker clean command in the Makefile has been fixed to include the Docker profile and project name. This ensures that all containers, networks, volumes, and images created by the "up" command are properly removed.

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

* Fix proxy address bug in main.go

The proxy address was not being set correctly in the main.go file,
resulting in incorrect routing of HTTP requests. This commit fixes
the bug by correctly setting the proxy address. Additionally, it
registers the proxy handler for all incoming requests.

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

* Refactor main.go to simplify HTTP server setup

The previous implementation of the main.go file had unnecessary complexity in setting up the HTTP server. This commit simplifies the code by removing the unnecessary switch statement and consolidating the server setup logic.

The main changes include:
- Removing the switch statement that handled HTTPS server setup
- Consolidating the server setup logic into a single goroutine
- Removing the unnecessary goroutine for starting the server

These changes make the code more readable and maintainable by reducing unnecessary complexity and improving the overall structure of the code.

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

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-10-23 14:35:15 +02:00
b1ackd0t ab832aff1b Fix MQTT Tests (#1939)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-10-21 23:50:47 +02:00
b1ackd0t 02158d4701 Fix HTTP Tests (#1940)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-10-21 23:49:26 +02:00
b1ackd0t 6da9a5da21 NOISSUE - Fix Linting (#1938)
* Fix linting

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

* Remove parentID when creating groups

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-10-21 23:26:47 +02:00
b1ackd0t fa00c82b98 feat(things): remove unused variable inValidToken (#1932)
Remove the unused variable inValidToken from the things/service_test.go file.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-21 23:25:57 +02:00
b1ackd0t 1f21541a27 NOISSUE - Fix Twins Tests (#1931)
* feat(twins/mocks): Add new service constructor with mock dependencies

This commit adds a new service constructor to the `twins/mocks/service.go` file. The new constructor, `NewService`, takes no arguments and returns an instance of `twins.Service` along with a mock instance of `authmocks.Service`. This allows for the creation of a real twins service using mock dependencies.

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

* feat(api): Add tests for endpoint states

This commit adds tests for the endpoint states API in the `endpoint_states_test.go` file. The tests cover the functionality of the `GET` and `POST` methods for retrieving and updating the states of endpoints respectively. The tests use the `mainflux` and `authmocks` packages for mocking and testing the API endpoints. Additionally, the `testsutil` package is imported for utility functions used in the tests.

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-20 23:06:03 +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
Arvindh a91a8f44d3 Fix: user and things authz (#1941)
Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-10-19 19:51:03 +02:00
Arvindh 4ae0feced4 NOISSUE: Fix: SDK ListGroupUsers function (#1936)
* fix: SDK function

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

* fix: listing of clients response

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

* fix: SDK functions

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

* fix: Listing of group parents and children

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

* fix: SDK functions

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

* fix: users and things response

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-10-19 17:56:31 +02:00
b1ackd0t 34f293220c NOISSUE - Refactor e2e Testing Tool (#1905)
* Refactor e2e testing tool.

- Enable creation of things and channels over 100 values
using batched requests.
- Change library of generating random names to a better
one.
- Fix WS sending of messages.

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

* Refactor e2e test configuration

The e2e test configuration has been refactored to improve readability and maintainability. The following changes have been made:

- Removed the defReaderURL constant as it is no longer used.
- Added usersPort and thingsPort constants for the respective URLs.
- Updated the ThingsURL and UsersURL in the Test function to use the new constants.

These changes make the code more modular and easier to understand.

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

---------

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-18 22:45:41 +02:00
b1ackd0t e6f34e1546 NOISSUE - Fix WS Tests (#1927)
* feat(testsutil): Add function to generate random UUID

This commit adds a new function to the `common.go` file in the `testsutil` package. The function `GenerateRandomUUID` generates a random UUID using the `github.com/mainflux/mainflux/pkg/uuid` package. This function will be used in tests to generate unique identifiers for testing purposes.

The function is added to the existing `common.go` file in the `testsutil` package, which is used for common utilities in tests.

This change improves the testability of the codebase by providing a convenient way to generate random UUIDs for testing purposes.

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

* feat(auth): add error constants

This commit adds two error constants, InvalidID and InvalidToken, to the auth package. These constants will be used to represent invalid ID and token values in the authentication service.

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

* feat(ws): add validation for empty message payload

This commit adds a validation check for an empty message payload in the Publish method of the adapterService struct in the ws/adapter.go file. If the payload is empty, the method will now return an ErrFailedMessagePublish error. This validation ensures that only non-empty payloads are published.

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

* feat(auth): add constant for invalid value

Added a constant named InvalidValue to the auth/mocks/service.go file. This constant is set to "invalid" and will be used to represent an invalid value in the codebase.

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-18 22:40:55 +02:00
b1ackd0t 67276c14eb NOISSUE - Update Auth ENV Vars in Docker-Compose (#1937)
* feat(docker): update auth env vars in compose

Update docker/addons/*/docker-compose.yml with appropriate auth environment variables

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

* feat(config): update remotes URLs

Updated the URLs for the remotes in the config file to reflect the correct endpoints.

- Updated bootstrap_url to "http://localhost:9013"
- Updated certs_url to "http://localhost:9019"
- Updated http_adapter_url to "http://localhost/http:9016"
- Updated reader_url to "http://localhost"

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-18 22:36:41 +02:00
b1ackd0t 824156fbf0 NOISSUE - Use Nats JetStream As Internal Message Bus (#1893)
* Replace Nats with Nats Jestream For PubSub

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

* Add Stream Description

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

* Subscribe using wildcard

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

* Add consumers description

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

* Remove unused queue variable

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

* Add extra configs to stream

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

* Use inline error handling

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

* Fix connection leak in NATS publisher

The publisher struct in pkg/messaging/nats/publisher.go was modified to include a new `conn` field of type `*broker.Conn`. This change was made to fix a connection leak issue in the NATS publisher.

The `NewPublisher` function was updated to assign the `conn` parameter to the new `conn` field in the publisher struct.

Additionally, the `Close` method in the publisher struct was modified to close the `conn` connection.

This commit fixes the connection leak issue in the NATS publisher and ensures that connections are properly closed.

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

* feat(messaging): Add support for durable consumers

This commit adds support for durable consumers to NATS JS in the messaging package.

To support this functionality, the `strings` package has been imported in the `pubsub.go` file to check the topic.

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

* feat : remove internal logic to keep subscribers

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

* feat(messaging): add function to format consumer name

This commit adds a new function to the `pubsub` package in the `messaging` module. The function is called `formatConsumerName` and is used to generate a consumer name for NATS messaging. The function takes two parameters, `topic` and `id`, and returns a formatted consumer name. The consumer name is generated by concatenating the `topic` and `id` parameters, with some restrictions on the characters that can be used. This function will be useful for creating durable subscriptions in NATS messaging.

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-18 17:00:38 +02:00
b1ackd0t 5c270abe29 NOISSUE - Uncomment Code (#1926)
* Uncomment all code

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

* feat(linters): add godox and dupword linters

This commit adds two new linters, godox and dupword, to the linter configuration file (.golangci.yml). The godox linter checks for occurrences of TODO and FIXME comments in the codebase, helping to ensure that these comments are not forgotten or left unresolved. The dupword linter detects duplicate words in comments and strings, which can be a sign of typos or errors. These new linters will enhance the code quality and maintainability of the project.

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

* uncomment tests in /pkg/sdk/go/tokens_test.go

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-18 16:45:08 +02:00
Arvindh 75b37e078f NOISSUE: Fix Response , SDK, Listing of users with Relation (#1935)
* fix: response of requests

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

* fix: sdk url

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

* fix: listing of users with relation

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-10-18 15:58:14 +02:00
b1ackd0t 89fcf1207d Fix linting (#1934)
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-18 14:05:08 +02:00
b1ackd0t 687505c833 NOISSUE - Remove Development Mode on Certs Creation (#1908)
* Fix certificate creation in development mode

This commit removes certificate creation in development mode. Previously, the `MF_CERTS_VAULT_HOST` environment variable was not being properly checked, resulting in incorrect behavior when issuing certificates. This commit ensures that the correct mode is set based on the value of `MF_CERTS_VAULT_HOST`.

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

* Fix certificate revocation in README.md

The README.md file has been updated to clarify the process of revoking certificates. The previous instructions were incorrect, and the correct method is now provided. The certificates can be revoked using the `certs` service by providing the `thing_id` of the thing for which the certificate was issued.

```
curl -s -S -X DELETE http://localhost:9019/certs/revoke -H "Authorization: Bearer $TOK" -H 'Content-Type: application/json' -d '{"thing_id":"c30b8842-507c-4bcd-973c-74008cef3be5"}'
```

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

---------

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2023-10-18 11:48:47 +02:00
b1ackd0t 46705d401f Sync events with docs (#1900)
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-18 10:31:38 +02:00
Arvindh cd82cc5a43 NOISSUE: Listing of shared things with users & Update SDK (#1923)
* 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>

* 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>

* 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>

* 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>

* add: listing of shared things and users

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

* fix: listing of shared things and users

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

* add: new SDK

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

* add: new SDK

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

* fix: comment

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

* fix: sdk function names

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

* update: api spec

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

* fix: channels connect request

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

* fix: listing of clients and groups

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

* fix: CLI

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

* fix: array len comparision

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

* fix: nginx

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

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 15:38:06 +02:00
b1ackd0t b4e7e859fb feat(api): Add JSON tags to connectChannelThingRequest struct (#1930)
The connectChannelThingRequest struct in the things/api/http/requests.go file has been updated to include JSON tags for the ThingID and ChannelID fields. This change allows for proper serialization and deserialization of the struct when working with JSON data.

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-17 12:43:48 +02:00
b1ackd0t 09236e87a7 NOISSUE - Add Auth API Documentation (#1929)
* feat(api): aligns things api documentation

This commit addresses the following changes:
- Removes bulk provision of channels endpoint `/channels/bulk` to the OpenAPI specification file `api/openapi/things.yml`.
- Adds connect and disconnect API documentation for things

Note: No implementation changes have been made in this commit.
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* Remove policies

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

* feat(api): update group members endpoint

This commit updates the group members endpoint in the users API. Instead of having a separate endpoint for /{groupID}/members, we can now use /{groupID}/users. This change simplifies the API structure and improves consistency.

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

* feat(api): add OpenAPI specification for Auth Service

This commit adds the OpenAPI 3.0 specification for the Auth Service. The `auth.yml` file contains the definition of the HTTP API for managing platform users. This specification will help in improving the API by allowing changes to be made to the definition.

Changes:
- Added `auth.yml` file with OpenAPI 3.0 specification
- Defined the title and description of the Auth Service in the `info` section

Note: This commit only includes the addition of the OpenAPI specification file and does not include any implementation changes.
Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>

* feat(auth): add new endpoint for deleting policies

- Updated the `MakeHandler` function in `auth/api/http/policies/transport.go` to add a new endpoint for deleting policies.
- Replaced the `mux.Put` method with `mux.Post` to match the HTTP verb for deleting policies.
- The new endpoint is now `/policies/delete`.

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-10-16 13:43:01 +02:00
Dušan Borovčanin ea851cf12c NOISSUE - Fix CI setup (#1928)
* Update CI script

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

* Update Protoc version on CI

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

---------

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2023-10-16 12:55:10 +02:00
b1ackd0t 6726bc7744 NOISSUE - Update Go Version on Docker and CI (#1925)
* feat(docker): update base image version to golang:1.21-alpine

The Dockerfile has been updated to use the latest version of the base image, golang:1.21-alpine, instead of golang:1.19-alpine. This update ensures that the application is built using the most recent version of the Go programming language.

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

* fix(ci): update Go version in Semaphore configuration

The Go version in the Semaphore configuration file was updated from 1.20 to 1.21.

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:46:07 +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
AHmed Khatab 59bcb72f52 Update postgres-reader's docker-compose.yml enviorment varaible (#1914)
Changes to be committed:
	modified:   docker/addons/postgres-reader/docker-compose.yml

Signed-off-by: Khatab <a@khatab.me>
2023-10-05 07:36:06 +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
b1ackd0t 65b6374235 MF-1901 - Return ThingID on Authorize (#1902)
* Combine actions and thingID to cache

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

* Change signature of things cache

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

* Fix Tests

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

* Add cached policy stuct

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

* Change contents of cached policy

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

* Set all values for cachedPolicy after missing values in cache

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

---------

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2023-09-06 15:07:47 +02:00
b1ackd0t a008440dcc NOISSUE - MQTT To Publish Payload Only (#1903)
* Publish only message payload

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

* Use concatenation instead of sprintf as documented

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

* Fix tests

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

---------

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2023-09-05 15:01:24 +02:00
b1ackd0t 7c3add6949 Fix ws adapter communication with broker and things service (#1899)
Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
2023-09-01 23:51:37 +02:00
b1ackd0t 320921a63e Add Comment to docker compose project name (#1895)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-08-25 15:51:11 +02:00
b1ackd0t 2252438956 NOISSUE - Enable JetStream on NATS (#1885)
* Enable Jestream on Nats

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

* Update verbosity

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-08-25 15:45:08 +02:00
Ian Ngethe Muchiri 5fa2bf4229 1890 - Update error encoding (#1891)
* update error encoding

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

* fix semaphore fail

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

* update encode error

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

* update bootstraptests

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

* Update notifiers endpoint_test

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

* Update tokens_test

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

* Update json.unmarshal into expected struct

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

* update .env

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

* update sdk_error to check if err is empty

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

* update message_test

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

* Update error marshaling

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

* update tests

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

* Redo makefile

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

* Add fullstop to comments

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

* Update rebase error

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

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2023-08-24 15:09:23 +02:00
Washington Kigani Kamadi 822a607e31 NOISSUE - Change error description (#1892)
* Change error description

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

* Fix typo

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

* Create specific error for login

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

* Add period to comment

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

* fix error description

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

---------

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
2023-08-23 14:48:03 +02:00
b1ackd0t 20e8593d4f Convert docker project name to lowercase (#1894)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-08-23 14:38:54 +02:00
Sammy Kerata Oina 0525a9ab75 NOISSUE - Update mProxy handlers for testability (#1889)
* update mproxy handler for testability

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

* remove import replacement

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

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-08-22 20:01:47 +02:00
Arvindh fde435060c NOISSUE - Implementation of gRPC mTLS (#1848)
Rebase with master and squash commits
add: rootCA and clientCA in grpc server
add: rootCA and client certificate in grpc client
add: docker-compose for grpc-mtls and make target for mtls cert generation
fix: typo in makefile
fix: loadCertFile function in internal/clients/grpc/connect.go
fix: env.parser test
remove: commented lines
add: make commands
update: make commands and grpc clients
fix: typo in makefile
fix: loadCertFile function in internal/clients/grpc/connect.go
remove: commented lines
update: make commands and grpc clients
update: make commands and docker-compose
add: end of line
fix: typos in makefile
add: end of line
fix: typos in makefile
revert: grafana port in .env
change: loadCertFile function
change: certficate logic
change: env name and update in compose file
fix: makefile
remove: tls env var
change: ioutil to os for ReadFile
change loadfile
remove: test which is no needed
fix: docker project name
single docker-compose file
single docker-compose file
single docker-compose file
fix space and new lines
fix makefile
add: GRPC_TLS varaible and imporved logging in gRPC Client
fix mtls and tls env vars
fix mtls and tls env vars
grpc_mtls
fix docker-compose
fix makefile
fix const name to go idomatic

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-08-16 19:11:33 +02:00
Ian Ngethe Muchiri 9dbe87f03a NOISSUE- Update bootstrapSDK endpoints (#1888)
* Update bootstrapSDK constants

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

* Remove first slash

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

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2023-08-11 15:17: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
Sammy Kerata Oina 91e3873a13 NOISSUE - Add linter config file and add duplicate import check (#1880)
* add duplicate import check

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

* add for new CI

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

* use config file

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

* remove duplicate case

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

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-08-10 14:34:29 +02:00
Aryan Godara 5e8555444a MF-1723 - Fix lack of logging for invalid query params (#1724)
* fix error package errors

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix bootstap and bootstrap api

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix certs

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix consumers

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix http

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix provision

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix readers

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix twins

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix things

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix users

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix sdk excpet channel policies users things

Signed-off-by: aryan <aryangodara03@gmail.com>

* tests passing, but logging not working for things and users

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix sdk tests, and other failing tests

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix comment

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors acc to pr review

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errror wrapping in consumers api

Signed-off-by: aryan <aryangodara03@gmail.com>

* all tests running

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix encodeError

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix minor issues

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix failing sdk policy tests

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors in things test sdk

Signed-off-by: aryan <aryangodara03@gmail.com>

* update things service

Signed-off-by: aryan <aryangodara03@gmail.com>

* update usrs service

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix things and users sdk

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix sdk for channels groups policies things users

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix remaining services and sdk

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix bootstrap twins

Signed-off-by: aryan <aryangodara03@gmail.com>

* resolve conflicts

Signed-off-by: aryan <aryangodara03@gmail.com>

* Shift errmalformedentity to pkg/errors

Signed-off-by: aryan <aryangodara03@gmail.com>

* Fix bootstrap service

Signed-off-by: aryan <aryangodara03@gmail.com>

* Add errors.Unwrap and use in encodeError

Signed-off-by: aryan <aryangodara03@gmail.com>

* Fix type in print statement for policies_test

Signed-off-by: aryan <aryangodara03@gmail.com>

* Fix ordering of errvalidation wrapping and encodeError

Signed-off-by: aryan <aryangodara03@gmail.com>

* Fix failing tests

Signed-off-by: aryan <aryangodara03@gmail.com>

---------

Signed-off-by: aryan <aryangodara03@gmail.com>
2023-08-09 23:02:44 +02:00
b1ackd0t 51998d79af NOISSUE - Fix Share Thing To Add External To Request (#1886)
* Fix Share Thing To Add External To Request

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

* Comment External on SDK policy

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-08-09 14:42:46 +02:00
b1ackd0t 896a74ad49 NOISSUE - Remove Secret on Viewing User(s) and Things (#1884)
* Remove secret when returning user

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

* Remove secret on list all users

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

* Remove Secret on list all things

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-08-09 12:26:21 +02:00
Ian Ngethe Muchiri b4b625ddb1 NOISSUE- update health method in SDK (#1881)
* update health function in sdk

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

* update bootstrap name

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

* update health_test

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

* update sdk.go comment

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

* update cli/README

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

* update health_test

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

* remove duplicate import

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

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2023-08-08 14:42:32 +02:00
Sammy Kerata Oina 06800c1038 NOISSUE - Unify group and clients implementations on things and users (#1793)
* unify groups repo implementation

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

* unify clients implementation

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

* closer client integration

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

* further unification of groups

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

* enable on update secret & owner

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

* unify retrieve all

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

* fully unify groups repository

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

* add secret to retrieve all

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

* save updated at

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

* fix test

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

* fix retrieve all tests

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

* restore files

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

* fix build

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

* remove unused files

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

* fix retrieve all tests

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

* fix linting

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

* fix linting

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

* restore broken changes

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

* restore setup tests

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

* update where condition

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

* remove extra db object

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

* unify groups test

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

* unify clients test

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

* remove unused variables

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

* update changes

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

* sync with master current updates

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

* update test

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

* fix tests

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

* fix test

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

* fix test

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

* fix tests

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

* match changes in #1877

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

* separate things and users repos

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

* remove comments
 implement retrieveBysecret in things only

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

* remove exec

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

* remove duplicate imports

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

* wrap errors

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

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-08-08 12:19:54 +02:00
Washington Kigani Kamadi 0f0d761a1b MF-1340 - Add CLI config TOML file (#1858)
* Add config

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

* Change key names

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

* Add config file path

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

* Add config file path

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

* Configure TOML parsing

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

* Add cli config command

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

* Remove debug log

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

* Use snake case

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

* Change from interactive command

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

* use map for keys

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

* Add cli logger level

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

* Use mainflux logger

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

* Fix cli

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

* Remove unnecessary comments

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

* Fix cli error handling

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

* Remove fmt

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

* Update config

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

* Fix cli

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

* Fix cli

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

* Fix cli

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

* Fix cli

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

* Modify CLI

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

* Fix errors

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

* Fix cli

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

* Fix errors

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

* Remove user token

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

* Remove unused variables

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

* Add empty line

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

* Add url parsing

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

* TEsts

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

* Make config path configurable

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

* Fix ci

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

* Remove empty toml

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

* Change url key identification

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

* Remove url parsing functions

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

* Handle parse error

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

* Handle url error

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

* Add marshal

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

* Update config

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

* Fix cli

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

* Handle file error

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

* Handle file error

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

* Modify url parsing

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

* Add usertoken

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

* Fix user token

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

* Fix errors

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

* Fix errors

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

* Remove string init

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

* Fix error

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

* Fix errors

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

* Remove config.toml from root

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

* Add empty line to config.toml

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

* Add empty line to config.toml

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

* Inline error handling

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

* Remove unnecessary type conversion

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

* Fix error handling

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

* Fix error handling

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

* Remove dynamic filters

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

---------

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
2023-08-08 12:01:59 +02:00
b1ackd0t ca52a5a38d Fix Listing With Visibility And Comments For That (#1876)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-08-04 15:25:54 +02:00
b1ackd0t d29e8b42de Fix List Group Members Not To Include Owned Things (#1877)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-08-04 14:58:07 +02:00
b1ackd0t 1d80301455 NOISSUE - Check For Subject During Policy Addition (#1826)
* Check For Subject During Adding Policies

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

* Make Object to be Group ID

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

* Fix Tests

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

* Change  from string to  bool

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

* Update Tests

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

* When it is Admin Don't Check Subject

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

* Minor Refractoring

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

* Group Constants

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

* Test if User Doesn't Have Policy

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

* Combine Share Things Cases

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

* Remove Unnecessary Case

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

* Check For Non NIL error

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

* Remove 3 Cases From Bool

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

* Add Listing Actions Incase of Sharing

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

* Capitalize comments

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

* Move AdminRelationKeys to Tests

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

* Fix Tests After Rebase

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

* Rename myKey

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

* Simplify checkSubject

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-08-03 00:50:58 +02:00
b1ackd0t 8c17841036 Return Authentication Error on Identify (#1874)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-08-02 16:52:13 +02:00
b1ackd0t b7ab4db906 NOISSUE - Check For Policy Action Before Adding Policies (#1860)
* Check For Policy Action Before Adding Policies

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

* Use Returned Policy From EvaluateGroupAccess

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

* Check For Empty Action

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

* Use slices package

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

* Use Returned Policy From EvaluateAccess

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

* Remove Unnecessary Repo Cal

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

* Return Equal Number of Items during UNION Call

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-08-02 15:03:19 +02:00
b1ackd0t 23a665b54a MF-1510 - Add Event Sourcing To Users Service (#1835)
* Add Event Sourcing on Users Service

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

* Modify Events Sourced From Things Service

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

* Rename Cache

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

* Remove SharedBy From Events

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

* Use Combined Publisher

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

* Format Docker Compose File

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

* Rename Events

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-08-02 12:09:56 +02:00
Ian Ngethe Muchiri 518d5827d0 NOISSUE-Update initialization of instanceID (#1873)
* update initialization of instanceID

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

* remove capital letter in error log

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

* rename instanceID to host.id

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

* remove previous fix

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

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-08-02 11:31:19 +02:00
b1ackd0t 20fde26bbd NOISSUE - Update OPENAPI Files (#1832)
* Reformat Policies Enpoint to Take Sub Obj

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

* Initial Commit: Sync Env Veriables With Docker Deployment

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

* Sync Env Vars With Master

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

* Reformat Policies Enpoint to Take Sub Obj

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

* Initial Commit: Update OPENAPi Spec Files

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

* Fix Issue After Rebasing

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

* Rename `/ch/:thingID/th` to `/ch/:chanID/th`

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-08-01 17:20:51 +02:00
Ian Ngethe Muchiri c8710efce0 NOISSUE-Add resetPassword to the SDK (#1872)
* Add resetPassword to the SDK

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

* add space to sdk comments

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

* add tab space to comments

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

* update .env file

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

* add referer header to sdk request

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

* update .env file

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

* update adding headers to processRequest

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

* remove code repetition

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

* add comment to content-Type

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

* update header initialization

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

* update docker-compose file

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

* add cli functionality

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

* add host as a tag

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

* update hostURL flag

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

* update comments

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

* remove hostURL duplication

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

* update inline

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

* add space in comments

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

* add space in comment

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

* update description of reset password request

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

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-08-01 17:03:18 +02:00
b1ackd0t 38992085bd NOISSUE - Enrich Existing OpenTelemetry Tags (#1840)
* Initial Commit: Sync Env Veriables With Docker Deployment

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

* Sync Env Vars With Master

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

* Initial Commit: Add Tags to Database and Message Bus

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

* Format Address Well

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

* Propagate Context

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

* Update PostgresSQL spans

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

* Update Message Bus Spans

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

* Add Tracing To MQTT Adapter

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

* Add Span Tags to HTTP

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

* Combine Tracing and PubSub

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

* Fix Error After Rebase

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

* Reorder Server Config

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

* Seperate Tracing

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

* shorten span names

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

* Fix Issue After Rebase

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-07-31 19:20:04 +02:00
b1ackd0t abc1e3d858 MF-703 - Reliably Publish Event Messages to Redis (#1836)
* Reliably Publish Event Messages to Redis

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

* Make Redis Producer Safe For Concurrent Use

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

* Combine Redis Publishing

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

* Add defer statement

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

* Use Channel Instead of Array

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

* Adding `occurred_at`

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

* Fix Check `occurred_at`

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

* Remove Unused Const

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

* Check For Non NIL Error on Publishing

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

* Add More Tests

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

* Hanndle When Channel Is Full

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

* Fix Issue After Rebase

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

* Fix Tests

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-07-31 17:03:45 +02:00
b1ackd0t 3e7bac493c NOISSUE - Sync Env Veriables With Docker Deployment (#1841)
* Initial Commit: Sync Env Veriables With Docker Deployment

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

* Sync Env Vars With Master

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

* Remove Altprefix

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

* Rename HttpPort to HTTPPort

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

* Fix envPrefixDB After Rebase

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

* Remove Server Parse

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

* Add Provision For TLS on CoAP

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

* Fix Exit After Defer

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

* Remove Unused Function

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

* Document Undocumentated Env Variables

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-07-31 14:38:35 +02:00
Sammy Kerata Oina b7b14cc8b6 NOISSUE - Return certs on bootstrap view response (#1855)
* return certs on bootstrap view response

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

* return updated certs when updated

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

* fix test

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

* fix test

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

* fix test

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

* fix test

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

* fix tests

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

* simplify tests

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

* use named query

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

* fix test

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

* use named params

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

* fix typo

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

* use inline error checks
remove unrequired conditions

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

* sort slices before comparison

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

* rename mainflux_id to thing_id
rename MFThing to ThingID
rename MFKey to ThingKey
rename mainflux_key to thing_key

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

* remove mainflux_channels

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

* simplify unmarshaller

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

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-07-31 14:17:14 +02:00
Arvindh 57d47fea66 fix: cli message send and reader topic (#1865)
Signed-off-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-07-28 15:27:02 +02:00
Arvindh e925ca7e65 CLI bug fixes (#1866)
fix: comment formt



fix: CI error



change to mf errors



change to lowercase in error first word



fix: send message test case



remove: unused const

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-07-28 15:05:43 +02:00
b1ackd0t 7cccba91c9 NOISSUE - Reformat Things and Users Policies Endpoint (#1831)
* Reformat Policies Enpoint to Take Sub Obj

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

* Add Redirect to `policies`

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

* Make Delete Endpoint not to Contain Body

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

* Remove gRPC unused functions

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

* Remove Redirect

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

* Update CLI

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

* Use Switch Statement

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

* Uncomment Commented Parts

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

* Add Empty Line

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

* Remove Unused gRPC Req and Resp

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

* Fix Listing of Policies

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

* Rename Authorize Functions For Users and Things Service

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

* Add Authorize To CLI

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-07-28 14:39:13 +02:00
Sammy Kerata Oina 7758f42f6b NOISSUE - Improve graceful shutdown and code quality (#1821)
* remove single case switch
remove duplicate cases

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

* remove single case switch \n format comments

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

* graceful exit on main func

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

* remove fatal from imported packages

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

* reuse exit function

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

* return nill for empty configs

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

* return nil for config file not found

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

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-07-28 03:01:27 +02:00
Aryan Godara 33eb8d8bd3 MF-1361 - Add StringValue and DataValue comparison filters (#1714)
* Upgrade InfluxDB from 1.x to 2.x

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* go mod tidy vendor

Signed-off-by: aryan <aryangodara03@gmail.com>

* add all changes to single commit

Signed-off-by: aryan <aryangodara03@gmail.com>

* handle unmarshal errors

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix tests

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix primary keys in cassandra writer

Signed-off-by: aryan <aryangodara03@gmail.com>

* update mongodb vs queries

Signed-off-by: aryan <aryangodara03@gmail.com>

* update mongodb queries

Signed-off-by: aryan <aryangodara03@gmail.com>

* update mongodb queries again

Signed-off-by: aryan <aryangodara03@gmail.com>

* update readmes, revert mongo and cassandra

Signed-off-by: aryan <aryangodara03@gmail.com>

* remove unwanted print statement

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors in go.sum

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix typos

Signed-off-by: aryan <aryangodara03@gmail.com>

* revert changes to cassandra init

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors acc to pr review

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors in datavalue testcases

Signed-off-by: aryan <aryangodara03@gmail.com>

---------

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>
Signed-off-by: aryan <aryangodara03@gmail.com>
Co-authored-by: fatih <fatihdurmaz@sabanciuniv.edu>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-07-28 02:44:15 +02:00
Washington Kigani Kamadi 2b78902e01 MF-1830 - Switch to Semaphore 2.0 (#1829)
* Add pipeline

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

* Add pipeline

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

* Add Docker secret

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

* Remove function

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

* Remove function

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

* Modify block code

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

* Remove coverage on test block

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

* Fixes

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

* Update badge

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

* Remove repeated tests'

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

* Fix typo

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

* Fix typo

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

* Modify docker secrets

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

* Push docker images

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

---------

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-07-26 16:27:11 +02:00
Sammy Kerata Oina 315c17628d NOISSUE - Add deployments data collection banner (#1854)
* initial banner

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

* add disabling

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

* add approximate keyword

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

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-07-26 15:56:05 +02:00
Arvindh 106b710541 add: cli errors to stderr and others to stdout (#1863)
Signed-off-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-07-24 14:28:14 +02:00
Sammy Kerata Oina 70f53c2f97 NOISSUE - Trace consume operations (#1778)
* trace consume operations

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

* add create span function

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

* add consume message op

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

* Update consumers/tracing/consumers.go

Co-authored-by: b1ackd0t <blackd0t@protonmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>

* trace messages grouped

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

* rework comments

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

* rename value

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

* check message len

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

* rename struct member

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

* move to open telemetry

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

* fix linting

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

* improve context management

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

* add span details

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

* rename operations

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

* add comment

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

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
Co-authored-by: b1ackd0t <blackd0t@protonmail.com>
2023-07-22 14:38:16 +02:00
b1ackd0t 41be96a6e7 Add List Actions (#1861)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-07-18 16:31:31 +02:00
b1ackd0t aee0081864 NOISSUE - Enable OwnerID Filtering For Admin (#1857)
* Enable OwnerID Filtering For Admin

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

* Update things/clients/service.go

Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Update things/clients/service.go

Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Update things/clients/service.go

Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Update things/clients/service.go

Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Combine the Switch Statement

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com>
2023-07-13 16:27:57 +02:00
b1ackd0t 726e358187 NOISSUE - List Members or Memberships To Include Ownership Rights (#1820)
* List Members and Membership To also include Owner

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

* Add Member Repository Tests

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

* Add Service Tests

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

* Add More Test

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-07-13 15:42:46 +02:00
Sammy Kerata Oina 52131eba66 MF-1833 - Fix spelling of bootstrap on SDK (#1834)
* fix order of parameters and add url checks

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

* fix spelling in sdk

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

* wrap jaeger url parsing error

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

* remove jaeger

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

* remove empty lines

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

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-07-13 12:52:39 +02:00
b1ackd0t f7ba1557cf NOISSUE - Fix List Users Shared With Me and Mine (#1844)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-07-13 12:14:39 +02:00
Ian Ngethe Muchiri 031e0a62f2 NOISSUE-Update invalid secret error handling (#1856)
* update invalid secret error handling

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

* update secret error naming

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

* update secretError naming

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

* fix comment

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

* add empty space in comment

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

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2023-07-12 23:02:59 +02:00
b1ackd0t 1192325a2e Initial Commit: Add Tracing To Certs Service (#1850)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-07-12 11:48:29 +02:00
b1ackd0t 979a4b74d3 MF-1183 - Add Event Sourcing To Twins Service (#1852)
* Initial Commit: Add Event Sourcing To Twins Service

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

* Add SaveStates to Have Context

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-07-12 11:22:46 +02:00
b1ackd0t cc0b90a7cb Remove Spans From Tokenizer Repository Under Users Service (#1847)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-07-11 22:31:49 +02:00
b1ackd0t ed0436f0ae Fix Length of Arguments Required (#1837)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-07-11 15:54:58 +02:00
Sammy Kerata Oina 5410a14b04 NOISSUE - Add traces to API Bootstraps and Certs endpoints (#1851)
* add traces to bootstrap endpoints

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

* add tracing to certs endpoints

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

* remove tracing provider

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

* add tracing provider

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

* add tracing provider

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

* Update cmd/certs/main.go

Co-authored-by: b1ackd0t <blackd0t@protonmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
Co-authored-by: b1ackd0t <blackd0t@protonmail.com>
2023-07-11 15:19:04 +02:00
b1ackd0t 7ffc14b279 COPY SSL Certs From Alpine (#1839)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-07-10 14:20:44 +02:00
Ian Ngethe Muchiri 892015a60f NOISSUE - Add instance ID (#1776)
* update or to sync with clients branch

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

* Add empty lines

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

* update inline constant

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

* rebase pr to sync with master branch

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

* update pr to sync with updated master #1849

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

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
2023-07-07 11:14:55 +02:00
b1ackd0t 604949e073 NOISSUE - Add Tracing To Bootstrap Service (#1849)
* Initial Commit: Remove JaegerURL from grpc Client Config

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

* Initial Commit: Add Tracing To Bootstrap Service

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-07-07 09:59:50 +02:00
Dušan Borovčanin 412593ae94 NOISSUE - Update dependencies (#1838)
* Update dependencies

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

* Update dependencies

Fix Timescale Reader bug.

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

* Revert influxdb-reader changes

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

* Update dependencies to latest supported versions

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

---------

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-07-06 20:44:12 +02:00
b1ackd0t 2f5e313c36 NOISSUE - Propagate Context (#1842)
* Initial Commit: Propagate Context

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

* Make IssueToken Inline

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-07-06 19:57:51 +02:00
b1ackd0t b9838fbeff Initial Commit: Fix Password Regex From Env Variables (#1843)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-07-06 18:53:58 +02:00
b1ackd0t 60e9d17a61 Initial Commit: Remove Auth Service (#1845)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-07-06 17:53:17 +02:00
b1ackd0t a137645143 Initial Commit: Update Versions of Protobuf (#1846)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-07-06 17:21:52 +02:00
Dušan Borovčanin 723dc52c62 Fix MQTT Forwarder topic (#1827)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2023-06-23 00:06:56 +02:00
b1ackd0t fce91bb652 NOISSUE - Change Share Client To Be AddPolicy (#1825)
* Change Share Client To Be AddPolicy

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

* Remove  from API endpoint as it is a duplicate of

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

* Fix typo

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-06-20 15:48:25 +02:00
b1ackd0t 2673b34c6a NOISSUE - Use Insert On Conflict For Policies (#1824)
* Initial Commit: Use Insert On Conflict For Policies

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

* Invalidate Cache on Adding Policy

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

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-06-20 14:59:53 +02:00
dependabot[bot] 98aa270b14 NOISSUE - Bump github.com/lestrrat-go/jwx/v2 from 2.0.8 to 2.0.11 (#1817)
Bumps [github.com/lestrrat-go/jwx/v2](https://github.com/lestrrat-go/jwx) from 2.0.8 to 2.0.11.
- [Release notes](https://github.com/lestrrat-go/jwx/releases)
- [Changelog](https://github.com/lestrrat-go/jwx/blob/develop/v2/Changes)
- [Commits](https://github.com/lestrrat-go/jwx/compare/v2.0.8...v2.0.11)

---
updated-dependencies:
- dependency-name: github.com/lestrrat-go/jwx/v2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-20 12:28:43 +02:00
b1ackd0t f5bc71c7c9 NOISSUE - Evaluate Group Access (#1818)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-06-19 14:52:01 +02:00
b1ackd0t 87ad06689a NOISSUE - Invalidate Auth Cache When Updating Thing Policy (#1822)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-06-19 14:29:56 +02:00
b1ackd0t aef5a57e1f Fix SEND_TELEMETRY env var (#1819)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-06-15 15:05:11 +02:00
Dušan Borovčanin 55e09c1921 MF-1506 - Group-based Access Control (#1716)
* Move Things and Users to Clients

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

* NOISSUE - Update Add and Delete Policies (#1792)

* Remove Policy Action Ranks

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

* Fix Rebase Issues

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

* Fix CI Test Errors

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

* Adding Check on Subject For Clients

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

* Remove Check Client Exists

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

* Check When Sharing Clients

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

* Only Add User to Group When Sharing Things

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

* Remove clientType

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

* Minor Fix on ShareClient and Fix Tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Policies Tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Clean Up Things Authorization

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Tests on RetrieveAll

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Test ShareThing

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Merge Conflicts

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Remove Adding Policies. Only Use Ownership

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Check If Subject is same as Object

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Move Back To Union As Sometimes Policy is Empty and Fails to Evaluate on Ownership

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Entity Type For Failing Tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix BUG in policy evaluation

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Add Comments Regarding checkAdmin

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Tests On Rebase

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Combine Authorize For Things and Users

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Tests On Rebase

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Error on Things SVC `unsupported protocol scheme`

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix Bug on Things Authorization Cache (#1810)

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Use Password instead of username in MQTT handler

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Simplify MQTT authorization

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix MQTT tests

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* NOISSUE - Add More Functions to SDK (#1811)

* Add More Functions to SDK

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Add Examples to GoDoc

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Update Unassign Interface

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Pass Subject as ID and Not Token on List Channels By Thing

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Bootstrap Errors For Element Check

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Add empty line Before Return

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Reorder URLS in things mux

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Listing Things Policies

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Share Thing

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Add Examples to CLI Docs

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Update Identity To Update Another User

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Identify an Update Policies on Things

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Update Things Policies

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix GoDocs on Disconnect

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Change Authorize To Use AccessRequest

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* For Evaluate Policy Use AccessRequest (#1814)

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* NOISSUE - Add SDK Tests (#1812)

* Add Things Tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Add Channel Tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Add Certs Tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Add Consumer Tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Enrich Group Tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Add Tests For Health

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Add Tests For Tokens

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Rename SDK for Tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Add Policies Tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Linter

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Make Variable Defination Inline

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* NOISSUE - Make Cache Key Duration Configurable (#1815)

* Make Cache Key Duration Configurable

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Rename ENV Var

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* NOISSUE - Update GoDocs (#1816)

* Add GoDocs

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Add Missing GoDoc Files

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Enable godot

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Add License Information

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* NOISSUE - Add Call Home Client to Mainflux services (#1751)

* Move Things and Users to Clients

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>

* collect and send data package

Signed-off-by: SammyOina <sammyoina@gmail.com>

* create telemetry migrations

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add telemetry endpoints

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add transport

Signed-off-by: SammyOina <sammyoina@gmail.com>

* create service

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove homing server

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add call home to adapters

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add last seen

Signed-off-by: SammyOina <sammyoina@gmail.com>

* rename logger

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove homing client

Signed-off-by: SammyOina <sammyoina@gmail.com>

* use unmerged repo

Signed-off-by: SammyOina <sammyoina@gmail.com>

* use renamed module

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update call home version

Signed-off-by: SammyOina <sammyoina@gmail.com>

* edit documentation

Signed-off-by: SammyOina <sammyoina@gmail.com>

* align table

Signed-off-by: SammyOina <sammyoina@gmail.com>

* use alias for call home client

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update callhome

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update call home pkg

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update call home

Signed-off-by: SammyOina <sammyoina@gmail.com>

* fix modules

Signed-off-by: SammyOina <sammyoina@gmail.com>

* use mf build version

Signed-off-by: SammyOina <sammyoina@gmail.com>

* use mf build version

Signed-off-by: SammyOina <sammyoina@gmail.com>

* restore default

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add call home for users and things

Signed-off-by: SammyOina <sammyoina@gmail.com>

* enable opting on call home

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove full stops

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update callhome client

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add call home to all services

Signed-off-by: SammyOina <sammyoina@gmail.com>

* fix build

Signed-off-by: SammyOina <sammyoina@gmail.com>

* restore sdk tests

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove unnecessary changes

Signed-off-by: SammyOina <sammyoina@gmail.com>

* restore health_test.go

Signed-off-by: SammyOina <sammyoina@gmail.com>

---------

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Co-authored-by: b1ackd0t <blackd0t@protonmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

---------

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Co-authored-by: b1ackd0t <blackd0t@protonmail.com>
Co-authored-by: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com>
2023-06-14 12:40:37 +02:00
Sammy Kerata Oina 3d0d6e2112 NOISSUE - Add tests for env pkg (#1796)
* initial test outline

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add env tests

Signed-off-by: SammyOina <sammyoina@gmail.com>

* structure tests in a loop

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove t.Run

Signed-off-by: SammyOina <sammyoina@gmail.com>

* separate test cases

Signed-off-by: SammyOina <sammyoina@gmail.com>

* use switch

Signed-off-by: SammyOina <sammyoina@gmail.com>

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-06-08 15:58:26 +02:00
Drasko DRASKOVIC 7eea06fb40 Remove codeball (#1806)
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-05-31 14:57:21 +02:00
Sammy Kerata Oina 1eaa8056a7 NOISSUE - Trace MQTT forward operations (#1775)
* trace forward operations

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add alias

Signed-off-by: SammyOina <sammyoina@gmail.com>

* replace client from handler

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add tracing to handler

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add comments

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update mproxy

Signed-off-by: SammyOina <sammyoina@gmail.com>

* pass context

Signed-off-by: SammyOina <sammyoina@gmail.com>

* simplify span context management

Signed-off-by: SammyOina <sammyoina@gmail.com>

* fix failing tests on nil clients

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add topic

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update mproxy

Signed-off-by: SammyOina <sammyoina@gmail.com>

* vendor modified handler

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update mproxy

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update mproxy

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update mproxy

Signed-off-by: SammyOina <sammyoina@gmail.com>

* use current mproxy

Signed-off-by: SammyOina <sammyoina@gmail.com>

* use mproxy new release

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update mproxy version

Signed-off-by: SammyOina <sammyoina@gmail.com>

* wrap errors

Signed-off-by: SammyOina <sammyoina@gmail.com>

* fix ci

Signed-off-by: SammyOina <sammyoina@gmail.com>

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-05-31 12:30:28 +02:00
Sammy Kerata Oina 5ac34e2057 update command example (#1802)
Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-05-30 12:40:47 +02:00
Sammy Kerata Oina da40c54141 MF-1783 - Improve HTTP / gRPC codes when attempting to publish with nonexistent thing key / channel id (#1798)
* return 404 for non existent thing key or channel

Signed-off-by: SammyOina <sammyoina@gmail.com>

* check for malformed uuid input

Signed-off-by: SammyOina <sammyoina@gmail.com>

* use replace all

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove uuid check

Signed-off-by: SammyOina <sammyoina@gmail.com>

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-05-29 16:23:39 +02:00
Sammy Kerata Oina acfa0aa7bb MF-1801 - Improve error value returned for invalid thing (#1803)
* update return error value on things

Signed-off-by: SammyOina <sammyoina@gmail.com>

* rename var

Signed-off-by: SammyOina <sammyoina@gmail.com>

* uodate var

Signed-off-by: SammyOina <sammyoina@gmail.com>

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-05-29 15:44:55 +02:00
Sammy Kerata Oina 029140a4b0 NOISSUE - Add latency metrics to dashboard (#1773)
* display latency metrics

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove instant values from display

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove averages from quantiles

Signed-off-by: SammyOina <sammyoina@gmail.com>

* rename legend

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add units to latency metrics

Signed-off-by: SammyOina <sammyoina@gmail.com>

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-05-28 23:08:40 +02:00
b1ackd0t 7cc1dd9f89 MF-969 - Add List API Keys Endpoint (#1703)
* initial commit

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* Fix CI Test Errors

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

---------

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Co-authored-by: rodneyosodo <socials@rodneyosodo.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-05-25 00:13:29 +02:00
b1ackd0t 408eabaaa6 MF-1699 - Enrich SDK and CLI (#1719)
* initial commit update api docs

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* initial commit enrich sdk

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* initial commit enrich cli

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* add consumers test

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* remove dead code

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* add certs sdk tests

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* change contact name

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* fix tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Rename Disconnect

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix subscription typo

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Fix Swagger File

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Add Tests

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Change Limit to 10

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Remove empty line

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

---------

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Co-authored-by: rodneyosodo <socials@rodneyosodo.com>
2023-05-25 00:02:46 +02:00
Dušan Borovčanin 12a3214578 Fix response code for CoAP POST messages (#1788)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2023-05-18 19:50:30 +02:00
charlie-jangala 3b84258a0c Add Objectives field to Summary metric instantiation (#1772)
Signed-off-by: Charlie Evans <charlie@janga.la>
2023-04-28 00:26:04 +02:00
Aryan Godara 54c7518316 MF-1718 - Use static code analysis in CI (#1729)
* things, twins, and logger lint fixed

Signed-off-by: aryan <aryangodara03@gmail.com>

* all services updated, auth jwt not working, ineffectual assignment issue

Signed-off-by: aryan <aryangodara03@gmail.com>

* handle error from grpc server in endpointtest

Signed-off-by: aryan <aryangodara03@gmail.com>

* temp commit, auth/jwt needs to be resolved

Signed-off-by: aryan <aryangodara03@gmail.com>

* revert back to jwt v4 temporarily

Signed-off-by: aryan <aryangodara03@gmail.com>

* updated jwt tokenizer

Signed-off-by: aryan <aryangodara03@gmail.com>

* resolve EOF error for httptest requests

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix auth jwt, update to registeredclaims

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix ineffective assignment, auth/api/grpc endpoint failing

Signed-off-by: aryan <aryangodara03@gmail.com>

* temp commit, remove later

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix grpc server setup

Signed-off-by: aryan <aryangodara03@gmail.com>

* resolve golangci tests, remove debug statements

Signed-off-by: aryan <aryangodara03@gmail.com>

* update golangci version and modify linters used

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix failing tests

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix grpc server for setup tests

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix logging and errors inlined

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix remarks, update grpc setup_test

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix setup_test

Signed-off-by: aryan <aryangodara03@gmail.com>

* update setup_test grpc

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix data race

Signed-off-by: aryan <aryangodara03@gmail.com>

* update setup_test grpc

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix grpc setup down to single simple function

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix linting issues

Signed-off-by: aryan <aryangodara03@gmail.com>

* resolve pr comments

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix tests, handle returned errors, go mod tidy vendor

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors from new linters

Signed-off-by: aryan <aryangodara03@gmail.com>

---------

Signed-off-by: aryan <aryangodara03@gmail.com>
2023-04-22 17:14:35 +02:00
Ian Ngethe Muchiri 7948aa72e8 MF-1761 - Improve path parameters naming (#1762)
* Improve path parameters naming

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Improve path parameter naming

improve path parameter naming for:
   bootstrap/api/transport.go
   twins/api/http/transport.go

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Change functions to suit updated path params

Duplicated the functions decodeView and decodeListByConnection to
form new functions decodeThingView, decodeChannelView,
decodeThingListByConnection and decodeChannelListByConnection. This
was as a result of the two functions being used for both view thing
and view channel services

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Improve path parameter naming

Improve path parameter naming for:
    auth/api/http/groups/transport.go
    bootstrap/api/transport.go
    twins/api/http/transport.go
    ws/api/endpoints.go

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* fix swagger files

Updated the following swagger files
    api/openapi/auth.yml
    api/openapi/cert.yml
    api/openapi/websocket.yml

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Move websocket.yml from openapi to asyncapi

deleted websocket.yml file in openapi and created websocket.yml file
in asyncapi

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Update websocket.yml file

Update the websocket.yml file to make subtopic optional and
added security (bearerAuth)

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Format new line correctly

format newline for api/asyncapi/websocket.yml

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* update websocket.yml file

update the websocket.yml file based on the requested review changes
    The document is now valid

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Update path parameter naming

make changes to path parameter naming in:
    api/openapi/consumers-notifiers.yml

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* update path parameters naming

Update path parameters naming to be consistent with Go

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* update the mqtt.yml file

update the mqtt.yml file to the latest AsyncAPI version and
make changes on the security of the server

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Add contact information

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Update api/asyncapi/mqtt.yml

Co-authored-by: b1ackd0t <blackd0t@protonmail.com>
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Add an empty line between functions

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
Co-authored-by: b1ackd0t <blackd0t@protonmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-04-20 21:53:02 +02:00
Sammy Kerata Oina 1a77d384bb MF-786 - Tracing over NATS using opentracing standard (#1739)
* send and receive span context

Signed-off-by: SammyOina <sammyoina@gmail.com>

* initilize tracer in cmd

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add span context to mainflux message

Signed-off-by: SammyOina <sammyoina@gmail.com>

* propagate span context from adapters

Signed-off-by: SammyOina <sammyoina@gmail.com>

* fix failing build

Signed-off-by: SammyOina <sammyoina@gmail.com>

* fix failing build

Signed-off-by: SammyOina <sammyoina@gmail.com>

* fix linting error

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add tracing middleware to coap service

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add tracing middleware to http service

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add tracing middleware to mqtt service

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add tracing middleware to broker

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add tracing middleware to ws service

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add tracing to services

Signed-off-by: SammyOina <sammyoina@gmail.com>

* fix naming convention of functions

Signed-off-by: SammyOina <sammyoina@gmail.com>

* fix failing build

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove tracer from mqtt svc

Signed-off-by: SammyOina <sammyoina@gmail.com>

* format code and removed unused code

Signed-off-by: SammyOina <sammyoina@gmail.com>

* rename tracing files

Signed-off-by: SammyOina <sammyoina@gmail.com>

* - rename nats tracer
- intialize tracing at the broker

Signed-off-by: SammyOina <sammyoina@gmail.com>

* check for nil spans

Signed-off-by: SammyOina <sammyoina@gmail.com>

* propagate spans to consumers writers

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove unused variable

Signed-off-by: SammyOina <sammyoina@gmail.com>

* propagate traces to notifiers

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove comments

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove span from message

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove span from message

Signed-off-by: SammyOina <sammyoina@gmail.com>

* trace over rabbitmq and mqtt

Signed-off-by: SammyOina <sammyoina@gmail.com>

* fix failing build

Signed-off-by: SammyOina <sammyoina@gmail.com>

* trace subscribe and unsuscribe ops

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add create span method

Signed-off-by: SammyOina <sammyoina@gmail.com>

* pass context from main

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add span tags

Signed-off-by: SammyOina <sammyoina@gmail.com>

* restore coap transport.go

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add context to ops

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add cancel to tracing

Signed-off-by: SammyOina <sammyoina@gmail.com>

* refactor handler

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add comments to exported functions
return interfaces

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove channel span tag

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add pub sub tracer

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add pub sub tracer

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove prefixes from operations

Signed-off-by: SammyOina <sammyoina@gmail.com>

* perpetuate context from root
remove protocol from span tag

Signed-off-by: SammyOina <sammyoina@gmail.com>

* reorder functions

Signed-off-by: SammyOina <sammyoina@gmail.com>

* create span function

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add suffixes
add pubsub tags

Signed-off-by: SammyOina <sammyoina@gmail.com>

* move from if to switch

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add jaeger url to docker compose

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove snake case variables
add comments to exported functions

Signed-off-by: SammyOina <sammyoina@gmail.com>

* check for empty sub topics

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove tracing on consumers

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove duplicate tracers

Signed-off-by: SammyOina <sammyoina@gmail.com>

* clean up unused variables

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove empty lines

Signed-off-by: SammyOina <sammyoina@gmail.com>

* write better comments

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update readme jaeger url

Signed-off-by: SammyOina <sammyoina@gmail.com>

* initialize tracing midlleware on main
update readme jaeger urls

Signed-off-by: SammyOina <sammyoina@gmail.com>

* reorder arguments for tracing middleware

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add context to subscribe

Signed-off-by: SammyOina <sammyoina@gmail.com>

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-04-20 21:39:33 +02:00
Aryan Godara 23bc094ec3 NOISSUE - Blocking and Async Consumer Interface (#1742)
* Add Async Consumer Support

Author: aryan <aryangodara03@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* update consumer_async, fix flush interval

Signed-off-by: aryan <aryangodara03@gmail.com>

* update influxdb from 1.4.0 to 2.12.3

Signed-off-by: aryan <aryangodara03@gmail.com>

* separate tests and update logging and metrics middlewares

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix typos and comments

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix interfaces and tests

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix interface and add docs

Signed-off-by: aryan <aryangodara03@gmail.com>

* update Consumer interface godoc

Signed-off-by: aryan <aryangodara03@gmail.com>

* update influx-writer logger

Signed-off-by: aryan <aryangodara03@gmail.com>

---------

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Co-authored-by: dusanb94 <dusan.borovcanin@mainflux.com>
2023-04-20 18:20:53 +02:00
b1ackd0t ffd67ae154 Fix Load Email Configurations (#1768)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-04-17 16:25:57 +02:00
b1ackd0t 7dddd724f6 Add UsersURL to SDK (#1767)
Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-04-17 15:46:13 +02:00
Sammy Kerata Oina 0e3e716c48 NOISSUE - Add prometheus and grafana for metrics (#1753)
* add prometheus and grafana for metrics

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add grafana tag
move prometheus metrics

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add empty lines

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add example dashboard

Signed-off-by: SammyOina <sammyoina@gmail.com>

* fix scraping path

Signed-off-by: SammyOina <sammyoina@gmail.com>

* add things metric to dashboard

Signed-off-by: SammyOina <sammyoina@gmail.com>

* change execution path

Signed-off-by: SammyOina <sammyoina@gmail.com>

* fix typo and switch from yaml to yml

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update dashboard

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update example dashboard

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update dashboard

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove thresholds from gauges

Signed-off-by: SammyOina <sammyoina@gmail.com>

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-04-14 12:58:11 +02:00
Aryan Godara b435b80d03 MF-1720 - Improve Test Reports (#1727)
* resolve merge conflicts

Signed-off-by: aryan <aryangodara03@gmail.com>

* change remaining require with assert

Signed-off-by: aryan <aryangodara03@gmail.com>

* replace assert with require, whenever required.

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix failing tests

Signed-off-by: aryan <aryangodara03@gmail.com>

* resolve assert and require

Signed-off-by: aryan <aryangodara03@gmail.com>

* revert groups_test

Signed-off-by: aryan <aryangodara03@gmail.com>

---------

Signed-off-by: aryan <aryangodara03@gmail.com>
2023-04-12 17:30:01 +02:00
dependabot[bot] eb77f3df50 Bump github.com/docker/docker (#1760)
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.21+incompatible to 20.10.24+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v20.10.21...v20.10.24)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-05 15:12:40 +02:00
dependabot[bot] ca59d92354 Bump github.com/opencontainers/runc from 1.1.4 to 1.1.5 (#1756)
Bumps [github.com/opencontainers/runc](https://github.com/opencontainers/runc) from 1.1.4 to 1.1.5.
- [Release notes](https://github.com/opencontainers/runc/releases)
- [Changelog](https://github.com/opencontainers/runc/blob/v1.1.5/CHANGELOG.md)
- [Commits](https://github.com/opencontainers/runc/compare/v1.1.4...v1.1.5)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/runc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-02 18:36:35 +02:00
Sammy Kerata Oina 03475eb0af MF-1749 - Remove duplicate case in error handling
Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-03-28 15:24:05 +02:00
Sammy Kerata Oina 83ff4e12ea MF-512 - Change service default ports (#1737)
* Change service Default ports

Updated ports:
- auth http 9000
- auth grpc 7000
- provision http 9001
- things http 9002
- things auth http 9003
- things auth grpc 7001
- twins http 9004
- users http 9005
- bootstrap http 9006
- cassandra-reader http 9007
- cassandra-writer http 9008
- influxdb-reader http 9009
- influxdb-writer http 9010
- lora http 9011
- mongodb reader http 9012
- mongodb writer http 9013
- postgres-reader http 9014
- postgrs-writer http 9015
- smpp-notifier http 9016
- smtp-notifier http 9017
- timescale-reader http 9018
- timescale-writer http 9019

Signed-off-by: SammyOina <sammyoina@gmail.com>

* change default service ports on env and sh

Signed-off-by: SammyOina <sammyoina@gmail.com>

* change things url default port

Signed-off-by: SammyOina <sammyoina@gmail.com>

* change default ports order by importance
- auth http 9000
- auth grpc 7000
- things http 9001
- things auth http 9002
- things auth grpc 7001
- users http 9003
- cassandra-reader http 9004
- cassandra-writer http 9005
- influxdb-reader http 9006
- influxdb-writer http 9007
- mongodb reader http 9008
- mongodb writer http 9009
- postgres-reader http 9010
- postgres-writer http 9011
- timescale-reader http 9012
- timescale-writer http 9013
- bootstrap http 9014
- smpp-notifier http 9015
- smtp-notifier http 9016
- provision http 9017
- lora http 9018
- twins http 9019

Signed-off-by: SammyOina <sammyoina@gmail.com>

* lower port number in auth service

Signed-off-by: SammyOina <sammyoina@gmail.com>

* change things and users port
- things 9000
- things auth 9001
- things auth grpc 7000
- users 9002

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update documentaton to new port numbers

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update test and metrics

Signed-off-by: SammyOina <sammyoina@gmail.com>

* update host on metrics

Signed-off-by: SammyOina <sammyoina@gmail.com>

* resolving conflics

Signed-off-by: SammyOina <sammyoina@gmail.com>

* set http adapter port to :80

Signed-off-by: SammyOina <sammyoina@gmail.com>

* reassign http port on metrics to :80

Signed-off-by: SammyOina <sammyoina@gmail.com>

* reassign http adapter port

Signed-off-by: SammyOina <sammyoina@gmail.com>

* set http adapter port to 8008

Signed-off-by: SammyOina <sammyoina@gmail.com>

* document http adapter default port

Signed-off-by: SammyOina <sammyoina@gmail.com>

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
2023-03-23 21:55:11 +01:00
b1ackd0t d4fc7bab07 NOISSUE - Fix Send Response for Publishing Message (#1740)
* Initial Commit: Send Response for Publishing Message

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

* Use Defer

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>

---------

Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-03-16 11:48:57 +01:00
Aryan Godara 986edacfc7 MF-1584 - Upgrade InfluxDB from 1.x to 2.x (#1709)
* Upgrade InfluxDB from 1.x to 2.x

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Influx DB configuration updated

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Connection to InfluxDBv2

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Token cannot be created

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Connected to InfluxDB2

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Connected to InfluxDB2

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* InfluxDB v2 Consumer Implementation

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* quickfix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Influxdb-Writer Unit Tests Update

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Consumer Update

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* InfluxDB Writer Tests Implemented

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* InfluxDB Connection Check

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolving Remarks

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolved consumer-test remark

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* consumer-test slow working version

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* reader changes

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Consumer tests time issue fixed

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Eof warning fixed

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolved Reviews

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Makefile Fixed

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolved Reviews

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolved Reviews

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolved Reviews

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolved Reviews

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolved Reviews

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Readers Initial Setup

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* consumer json fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* readers simple version

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* readers simple version fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* readers simple version fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* readers simple version fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* readers simple version fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* readers simple version fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* readers simple version fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Influxdb Reader Parsers

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Influxdb Reader Parsers

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Influxdb Reader Parsers

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Bugfix and resolves comments.

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* one test fails

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* solved last page read

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* writers future time problem fixed

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* weird

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* weird

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Tests Passes

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolve Semaphore Issues

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* UUID comment on consumer tests resolved

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Inclusive from and Exclusive to

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Inclusive from and Exclusive to

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* 1 second limits

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* 1 second limits

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved review

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved review

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved review

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved review

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* fixed json time

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* fixed CI error

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved request

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved request

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved requests

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* removed blank line

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved comment

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* deleted unnecessary string builder

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* initial commit

Signed-off-by: aryan <aryangodara03@gmail.com>

* change influxdb docker image version.

Signed-off-by: aryan <aryangodara03@gmail.com>

* go mod and vendor fixing

Signed-off-by: aryan <aryangodara03@gmail.com>

* Upgrade InfluxDB from 1.x to 2.x

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Influx DB configuration updated

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Connection to InfluxDBv2

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Token cannot be created

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Connected to InfluxDB2

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Connected to InfluxDB2

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* InfluxDB v2 Consumer Implementation

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* quickfix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Influxdb-Writer Unit Tests Update

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Consumer Update

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* InfluxDB Writer Tests Implemented

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* InfluxDB Connection Check

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolving Remarks

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolved consumer-test remark

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* consumer-test slow working version

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* reader changes

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Consumer tests time issue fixed

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolved Reviews

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolved Reviews

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolved Reviews

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolved Reviews

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolved Reviews

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolved Reviews

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Readers Initial Setup

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* consumer json fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* readers simple version

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* readers simple version fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* readers simple version fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* readers simple version fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* readers simple version fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* readers simple version fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* readers simple version fix

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Influxdb Reader Parsers

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Influxdb Reader Parsers

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Influxdb Reader Parsers

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Bugfix and resolves comments.

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* one test fails

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* solved last page read

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* writers future time problem fixed

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* weird

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* weird

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Tests Passes

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Resolve Semaphore Issues

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* UUID comment on consumer tests resolved

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Inclusive from and Exclusive to

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* Inclusive from and Exclusive to

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* 1 second limits

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* 1 second limits

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved review

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved review

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved review

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved review

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* fixed json time

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* fixed CI error

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved request

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved request

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved requests

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* removed blank line

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* resolved comment

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* deleted unnecessary string builder

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>

* initial commit

Signed-off-by: aryan <aryangodara03@gmail.com>

* change influxdb docker image version.

Signed-off-by: aryan <aryangodara03@gmail.com>

* go mod and vendor fixing

Signed-off-by: aryan <aryangodara03@gmail.com>

* go mod fixing

Signed-off-by: aryan <aryangodara03@gmail.com>

* make tests pass locally, fix errors

Signed-off-by: aryan <aryangodara03@gmail.com>

* rem unsused variables/consts

Signed-off-by: aryan <aryangodara03@gmail.com>

* go mod tidy vendor

Signed-off-by: aryan <aryangodara03@gmail.com>

* add env var and data types

Signed-off-by: aryan <aryangodara03@gmail.com>

* update influxdb version to latest (2.3 to 2.12)

Signed-off-by: aryan <aryangodara03@gmail.com>

* change time precision for message tests

Signed-off-by: aryan <aryangodara03@gmail.com>

* renamed influxdb2 to influxdata

Signed-off-by: aryan <aryangodara03@gmail.com>

* address remarks on PR

Signed-off-by: aryan <aryangodara03@gmail.com>

* update influxbd according to latest mf commit

Signed-off-by: aryan <aryangodara03@gmail.com>

* temp commit, rem before pushing

Signed-off-by: aryan <aryangodara03@gmail.com>

* update main files and cassandra-reader messages_tests

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix name of logger while importing

Signed-off-by: aryan <aryangodara03@gmail.com>

* remove unnecessary print lines

Signed-off-by: aryan <aryangodara03@gmail.com>

* correct env var name

Signed-off-by: aryan <aryangodara03@gmail.com>

* change to async consume

Signed-off-by: aryan <aryangodara03@gmail.com>

* add option to switch bw sync and async

Signed-off-by: aryan <aryangodara03@gmail.com>

* test for both async and sync

Signed-off-by: aryan <aryangodara03@gmail.com>

* update consumer and add writeAPIs to config

Signed-off-by: aryan <aryangodara03@gmail.com>

* revert back to sync consuming

Signed-off-by: aryan <aryangodara03@gmail.com>

* temp fix for default timeout value

Signed-off-by: aryan <aryangodara03@gmail.com>

* set default timeout in config.

Signed-off-by: aryan <aryangodara03@gmail.com>

* remove unwanted env vars, add required ones.

Signed-off-by: aryan <aryangodara03@gmail.com>

* rem unused username password from config

Signed-off-by: aryan <aryangodara03@gmail.com>

* update readme, env vars, and remove grafana

Signed-off-by: aryan <aryangodara03@gmail.com>

* update readme

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix typo

Signed-off-by: aryan <aryangodara03@gmail.com>

* update readme description.

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix more typos.

Signed-off-by: aryan <aryangodara03@gmail.com>

* add link to official docs to readme.

Signed-off-by: aryan <aryangodara03@gmail.com>

---------

Signed-off-by: fatih <fatihdurmaz@sabanciuniv.edu>
Signed-off-by: aryan <aryangodara03@gmail.com>
Co-authored-by: fatih <fatihdurmaz@sabanciuniv.edu>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-03-16 02:36:14 +01:00
Drasko DRASKOVIC cea1def6a8 Correct Codeball permissions (#1746)
Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com>
2023-03-14 23:21:17 +01:00
Drasko DRASKOVIC e6a3ce1fa2 Add Codeball code review (#1745)
Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com>
2023-03-14 23:13:20 +01:00
Drasko DRASKOVIC 442afb5dd9 Add Codeball review 2023-03-14 22:46:27 +01:00
dependabot[bot] a12698b53d Bump golang.org/x/net from 0.5.0 to 0.7.0 (#1730)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.5.0 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.5.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-22 22:36:21 +01:00
Dušan Borovčanin c0c72491ff NOISSUE - Logger Fatal method returns no value (#1728)
* Make Fatal return no value

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add Fatal test

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Rename logger imports

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Replace Fatal with Fatalf

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Refactor Logger tests

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix expected and actual order inversion

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update dependencies

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

---------

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2023-02-22 20:50:51 +01:00
Aryan Godara 108077a356 MF-1698 - Add Fatal to Mainflux logger (#1721)
* initial commit

Signed-off-by: aryan <aryangodara03@gmail.com>

* return func() from fatal function

Signed-off-by: aryan <aryangodara03@gmail.com>

* use log.fatal in cassandra setup_tests

Signed-off-by: aryan <aryangodara03@gmail.com>

* removed fatal log level

Signed-off-by: aryan <aryangodara03@gmail.com>

---------

Signed-off-by: aryan <aryangodara03@gmail.com>
2023-02-21 13:02:57 +01:00
dependabot[bot] 19dbf9fadd Bump github.com/pion/dtls/v2 from 2.1.5 to 2.2.4 (#1722)
Bumps [github.com/pion/dtls/v2](https://github.com/pion/dtls) from 2.1.5 to 2.2.4.
- [Release notes](https://github.com/pion/dtls/releases)
- [Commits](https://github.com/pion/dtls/compare/v2.1.5...v2.2.4)

---
updated-dependencies:
- dependency-name: github.com/pion/dtls/v2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-15 00:39:37 +01:00
Arvindh d00d13dabb MF-1556 - Move the most used functions in main.go to internal package (#1601)
* MF-1525 - Add graceful stop for HTTP and GRPC servers (#1548)

* Add : errgroup to cmd/auth

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Handle graceful stop for auth service
Remove : errgroups from auth service

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Wait till server shutdown

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Change : instead of waitgroup changed to errgroups

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change : KillSignalHandler return type to error

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Empty Commit

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Context to http server shutdown
Rename : varaible from proto to protocol

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change : to default log level

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Sign-off

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: graceful stop of http and grpc server

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Fix: typos and caps

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: Signed-off

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Rename: Func KillSignalHandler to SignalHandler
Add: SIGABRT

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Fix: auth service

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: timeout for grpc gracefulstop
Fix: typos

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: .vscode folder to git ignore

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change: variable name to stopWaitTime

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove: .vscode folder

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove: .vscode from .gitignore

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : logger to handlers

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : New line at end of .gitignore file

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Fix : variable naming
Add : graceful stop for timescale

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Remove : unsued NATS library from import

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Move: "https" and "https" to moved to const var

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Move: "http" and "https" to moved to const var

Signed-off-by: Arvindh <arvindh91@gmail.com>

* update:  branch with master

Signed-off-by: Arvindh <arvindh91@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: httpserver and grpcsever

Signed-off-by: Arvindh <arvindh91@gmail.com>

* MF-1588 - Update Subscriber interface (#1598)

* Initial commit

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update subscriber interface

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* check subscription map

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Check topic id after topic

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* reword description

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Setup empty queue

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change mqtt implementation

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Switch statements

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Simplify

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change mqtt subscriber

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Protect subscription map

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix subscription

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Set client id

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change delete method

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* move http and grpc server functions

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* Move Keto and Jaeger

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add metrics and auth

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* MF - 1590 - Fix fetching list of users with a zero limit (#1594)

* Add max and min limit size

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* NOISSUE - Retrieve client key on cert issuing (#1607)

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix bug (#1604)

Signed-off-by: zhangchuanfeng <654300242@qq.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* Rename service name

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* Change metrics method

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* Rename

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* Rename

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* Rename package name

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* 🚚 Rename Keto and Jaeger functions

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify grpc service

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* 🚚 rename apiutil to initutil

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

*  coap server

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* 🚚 rename

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* 🚚 Rename

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* ♻️ rename packages

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* ♻️ remove mf prefix

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* 🚚 rename server error

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove dead code

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* MF - 1416 - Queue Abstraction for Mainflux & RabbitMQ Support (#1562)

* MF-1263 - Move repeating errors to the separate package (#1540)

* MF-1263 - Mv duplicated errors to pkg/errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert test build flags

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix merge

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Fix auth members list response (#1555)

* NOISSUE - Fix auth members list response

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Move group type next to page details

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm membersRes

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1261 - Use StatusUnauthorized for authn and StatusForbidden for authz (#1538)

* MF-1261 - Use StatusUnauthorized for authn and StatusForbidden for authz

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* ErrExternalKey typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename ErrUnauthorizedAcces -> ErrAuthentication

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix bootstrap error

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix status code in openapi

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add errors cases

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix status codes

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add gRPC stutus code

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix tests description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix openapi and encodeError

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix grpc message

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test descriptions

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert sdk error

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1059 - Add TLS support for email (#1560)

* Use gomail package for sending emails

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove print err

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Add vendor

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Rename email structure
remove logger

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* typo in var name

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* rename var

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove MF_EMAIL_SECRET

Signed-off-by: Ivan Milosevic <iva@blokovi.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Refactor MQTT subscriber (#1561)

* correct suscriber interface validator + refactore token error handling

Signed-off-by: tzzed <zerouali.t@gmail.com>

* apply review suggestion

Signed-off-by: tzzed <zerouali.t@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1257 - Access messages from readers endpoint with user access token (#1470)

* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add user auth for db reader

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* add user auth for db reader

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* enable mongodb reader for user token reading

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* use uuid check for auth switch between thing key and user tok

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* enable user token reading

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* revert to correct version

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix endpoint test, add additional tests

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove logs,dead code

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix logging messages

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove auth interface, add authorization header type

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* update api doc

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove unused package

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* some refactor of cases for authorization switch

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* correct description in openapi

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix endpoint test to match auth service change

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* some rename

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* initialize auth url

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* add env variables for auth service

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix spelling

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* Things prefix and no prefix for Thing authorization, Bearer for user

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* update readme file

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix default things grpc port

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* enable user reading for timescaledb

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove not used error

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* improve errors

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* refactor authorize

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* add chanID check

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* inline some error checking

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fixing errors

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fixing errors

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* improve test case description

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove test code

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* dont inline

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* refactor a bit encodeError

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove unused error

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove unused error

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix things auth grpc url

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* rename variables for header prefix

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit of adding rabbitmq broker

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit of adding rabbitmq broker

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit for tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Bump up tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add more tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add go routines

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit of adding rabbitmq broker

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit for tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Bump up tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add more tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add go routines

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix with wait groups

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* unsubscribe to stop delivering messages

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove exclusivity

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1551 - Fix Cobra usage commands and clean unnecessary struct types (#1558)

* MF-1551 - Fix Cobra usage commands and clean unnecessary struct types

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use linux syntax for cmd usage description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix cmd.Use

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Separate Keto hosts for read and write (#1563)

* Separate keto hosts for read and write

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* update readme with new envars

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* rename read connection name

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update dependencies (#1564)

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1240 - Return to service transport layer only service errors (#1559)

* MF-1240 - Return to service transport layer only service errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove unecessary errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm duplicated errors and fix transport

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert http endpoint_test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix conflict

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Implement cancel mechanisms

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Queuename as parameter

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Queuename as parameter

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1469 - Indicate proper authentication scheme in Authorization header (#1523)

* MF-1469 - Indicate proper authentication scheme in Authorization header

Signed-off-by: Stefan Kovacevic <jen2tri@gmail.com>

* Fixing the remarks on the last push

Signed-off-by: Stefan Kovacevic <jen2tri@gmail.com>

* Remove Bearer prefix in all services and fix tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix remarks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Add nats wrapper for COAP (#1569)

* Add nats wrapper for COAP

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Pass pubsub as argument

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Defer close connection

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Defer close connection

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Rename endpoint to topic

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1348 - Add transport errors logging (#1544)

* MF-1348 - Add go-kit transport level logging

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix merge

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix remark

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix go test flags

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use httputil errors in things and http service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix SDK tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use httputil errors in certs and provision service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use httputil errors in consumers service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* General renaming and add ErrMissingToken

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename httputil -> apiutil and use errors in users servive

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use apiutil errors in auth, bootstrap, readers, things and twins

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Replace errors.Contain by comparison

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix remarks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify validateID

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify validateID

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify and rename ExtractAuthToken -> ExtractBearerToken

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix readers

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix auth key test and remarks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Improve comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify validateUUID check

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1567 - Use Bearer, Thing or Basic scheme in Authorization header (#1568)

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1565 - Document Bearer, Thing and Basic Authorization header (#1566)

* MF-1565 - Document Bearer Authorization header

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix auth, bootstrap, http and readers openapi

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix openapi

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add enc key for bootstrap

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use global security

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix bearer formats

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Polish descriptions

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix boostrap and typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1575 Add 'Name' field to ListMembers response in things svc (#1576)

Signed-off-by: Ivan Balboteo <ivan@submer.com>

Co-authored-by: Ivan Balboteo <ivan@submer.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1580 - Influxdb Writer changes format of update-time to string (#1581)

* - MF-1580
- Modified consumers/writers/influxdb/fields.go
- influxdb-writer used to update data type of update-time to string
- Commented line 12 of consumers/writers/influxdb/fields.go to resolve
  uneccessary data type conversion issue

Signed-off-by: Hasan Tariq <hasantariqashraf@gmail.com>

* - MF-1580
- Removed strconv package from consumers/writers/influxdb/fields.go since it is no longer needed
- Removed line 12 from consumers/writers/influxdb/fields.go
- Replaced retrun value of updateTime with msg.UpdateTime (line 16 in
  fields.go)

Signed-off-by: Hasan Tariq <hasantariqashraf@gmail.com>

* Fix InflxuDB readers

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

Co-authored-by: Hasan Tariq <hasant@plcgroup.com>
Co-authored-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Unify MF_INFLUX_READER_DB_HOST and MF_INFLUX_WRITER_DB_HOST envars (#1585)

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Fix CoAP adapter (#1572)

* Revert "NOISSUE - Add nats wrapper for COAP (#1569)"

This reverts commit cc5d5195ab.

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix CoAP adapter

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update CoAP observation cancel

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix observe

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix GET handling

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Revert authorization

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Use constants instead of magic numbers

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove an empty line

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Extract special observe value to constant

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1582 - Fix lora-adapter MQTT client (#1583)

* MF-1582 - Fix lora-adapter MQTT clien

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add timeout config to the mqtt subscriber

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add sub timeout

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Update changelog and readme for release 0.13.0 (#1592)

* Update release example

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update changelog and examples for 0.13.0 release

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update VerneMQ release (#1593)

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Update changelog for release 0.13.0 (#1595)

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* unexport constants

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change routingkey

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove wait groups

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* protecting map

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add publisher to pubsub

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change proto library

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix typos

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Reduce pubsub tests based on implementation

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove channel cancel

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Export constant

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Move invariant statements out of loop for cassandra-writer (#1596)

Signed-off-by: fuzhy <fuzhy1997@outlook.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Embedding publisher into pubsub

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Naming publisher

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Fix Nginx entrypoint script (#1597)

* Fix Nginx entrypoint script

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update dependencies

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix NginX entrypoint

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Revert Makefile changes

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1525 - Add graceful stop for HTTP and GRPC servers (#1548)

* Add : errgroup to cmd/auth

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Handle graceful stop for auth service
Remove : errgroups from auth service

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Wait till server shutdown

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Change : instead of waitgroup changed to errgroups

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change : KillSignalHandler return type to error

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Empty Commit

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Context to http server shutdown
Rename : varaible from proto to protocol

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change : to default log level

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Sign-off

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: graceful stop of http and grpc server

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Fix: typos and caps

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: Signed-off

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Rename: Func KillSignalHandler to SignalHandler
Add: SIGABRT

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Fix: auth service

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: timeout for grpc gracefulstop
Fix: typos

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: .vscode folder to git ignore

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change: variable name to stopWaitTime

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove: .vscode folder

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove: .vscode from .gitignore

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : logger to handlers

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : New line at end of .gitignore file

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Fix : variable naming
Add : graceful stop for timescale

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Remove : unsued NATS library from import

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Move: "https" and "https" to moved to const var

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Move: "http" and "https" to moved to const var

Signed-off-by: Arvindh <arvindh91@gmail.com>

* update:  branch with master

Signed-off-by: Arvindh <arvindh91@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1588 - Update Subscriber interface (#1598)

* Initial commit

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update subscriber interface

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* check subscription map

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Check topic id after topic

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* reword description

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Setup empty queue

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change mqtt implementation

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Switch statements

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Simplify

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change mqtt subscriber

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Protect subscription map

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix subscription

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Set client id

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change delete method

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update rabbitmq subscriber interface

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* using publisher composition

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change contenttype

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* rename topic for publish and subscribe

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change errors to lower case

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change errors to lower case

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* export errors

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF - 1590 - Fix fetching list of users with a zero limit (#1594)

* Add max and min limit size

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Retrieve client key on cert issuing (#1607)

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* fix bug (#1604)

Signed-off-by: zhangchuanfeng <654300242@qq.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* queue per subscription

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* queue per subscription

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change routing method

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Direct method with one exchange to many queues, one consumer per queue

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* ♻️ Not casting data

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* ✏️ Fix typo

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* ♻️ remove passed queue name

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* 🔥 removing echange kind

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Combine tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Refactor unsubscribe method

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix merge conflict

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

*  sub and unsub to dummy topic

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* generate client id from topic and ID

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Rename topicID to clientID

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* update tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Reuse clientID

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix typos

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Seperate testpublish and testpubsub

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Co-authored-by: Manuel Imperiale <manuel.Imperiale@gmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Co-authored-by: Ivan Milošević <iva@blokovi.com>
Co-authored-by: __touk__ <zerouali.t@gmail.com>
Co-authored-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Co-authored-by: stefankovacevic123 <jen2tri@gmail.com>
Co-authored-by: ibalboteo <ivanbalboteo@gmail.com>
Co-authored-by: Ivan Balboteo <ivan@submer.com>
Co-authored-by: Hasan98-git <67228396+Hasan98-git@users.noreply.github.com>
Co-authored-by: Hasan Tariq <hasant@plcgroup.com>
Co-authored-by: fuzhy <fuzhy1997@outlook.com>
Co-authored-by: Arvindh <30824765+arvindh123@users.noreply.github.com>
Co-authored-by: 张传峰 <59160162+zhang-chuanfeng@users.noreply.github.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* NOISSUE - Fix Groups SDK (#1609)

* Fix Groups SDK

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix CLI

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* NOISSUE - Fix CI script (#1613)

* Fix CI script

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix linter errors

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add timeout to linter

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* NOISSUE - Make application/json content-type valid in http-adapter (#1606)

* NOISSUE - Make application/json content-type valid in http-adapter

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add CBOR content-type

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix naming

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix naming

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix CI

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix CI flag

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix CI install

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Upgrade grpc version

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* rm cli

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* Specify size of channel

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* NOISSUE - fix pull request template typo (#1616)

* Fix typo

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Change link

Signed-off-by: fbugarski <filipbugarski@gmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: load configuration function

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change: load config from env with pkg caarlos0/env

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change: mfdatabase to internaldb

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: httpserver and grpcsever

Signed-off-by: Arvindh <arvindh91@gmail.com>

move http and grpc server functions

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

Move Keto and Jaeger

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

Add metrics and auth

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

Rename service name

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

Change metrics method

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

Rename

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

Rename

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

Rename package name

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

🚚 Rename Keto and Jaeger functions

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

unify grpc service

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

🚚 rename apiutil to initutil

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

 coap server

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

🚚 rename

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

🚚 Rename

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

♻️ rename packages

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

♻️ remove mf prefix

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

🚚 rename server error

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

remove dead code

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

NOISSUE - Fix CI script (#1613)

* Fix CI script

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix linter errors

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add timeout to linter

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

Specify size of channel

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Arvindh <arvindh91@gmail.com>

Add: load configuration function

Signed-off-by: Arvindh <arvindh91@gmail.com>

change: load config from env with pkg caarlos0/env

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change: mfdatabase to internaldb

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: merge resolve error

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: merge resolve error

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: merge resolve error

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove: unused variables

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: address variable in servers

Signed-off-by: Arvindh <arvindh91@gmail.com>

* move: postgres connect to internal

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: client wrapper for most used

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: client wrapper for env

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify : auth, bootstrap, cassandra reader

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify : bootstrap code

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify : cassandra writer

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: struct tag to envDefault

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: grpc prefix

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: env parser

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: alt prefix

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: env default tag

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: auth grpc config

Signed-off-by: Arvindh <arvindh91@gmail.com>

* changes: internal approch and service start

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify: http adapter service

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove: unused code in http adapter"

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: config environment variable tags

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify: timescale writer

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify: timescale reader

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify: thing main.go

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify: smtp-notifier

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify: smpp-notifier

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify: postgres reader and writer

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify: twins

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify certs main.go

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify certs main.go

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify coap main.go

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify lora main.go

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix fatalf

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify mqtt main.go

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify mqtt main.go

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify ocpua adapter main.go

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix case

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify ws_adapter

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify ws_adapter

Signed-off-by: Arvindh <arvindh91@gmail.com>

* unify ws_adapter

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add : comment and spacing

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: lint errors

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: lint errors

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: main.go config load

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: main.go config load

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: auth main.go keto config

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove: package internal/sqlxt

Signed-off-by: Arvindh <arvindh91@gmail.com>

* code format : internal/client/grpc/connect.go

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: inline code

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: code format

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: inline and code format

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: moved to single block

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: moved to single block

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: export function comments

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: export function comments

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: export function comments

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: export function comments

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: export function comments

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remane: newtracer.go to tracer.go

Signed-off-by: Arvindh <arvindh91@gmail.com>

* renamee: authClient.go and thingsClient.go to client.go

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove space

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: jaeger default value

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: cassander config default values

Signed-off-by: Arvindh <arvindh91@gmail.com>

* rename file

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: postgres client config default values

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add setup with default config

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: mongo client config default values

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: postgres default db name in services

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for auth

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for bootstrap

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for cassandra-reader

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for cassandra-writer

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for certs

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for coap

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for http-adapter

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for influx-reader

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for influx-writer

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for lora

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for mongodb-reader

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for mongodb-writer

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for mqtt

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for opcua

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for postgres-reader

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for postgres-writer

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for smpp-notifier

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for smtp-notifier

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for things

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for timescale-reader

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for timescale-writer

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for twins

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for users

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: environment variable default for ws

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: unused variables

Signed-off-by: Arvindh <arvindh91@gmail.com>

* empty commit

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add comments

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: redis env variables

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: adapter ports and postgres db name

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: adapter ports

Signed-off-by: Arvindh <arvindh91@gmail.com>

* comments aligned

Signed-off-by: Arvindh <arvindh91@gmail.com>

* rename cassandra session variable

Signed-off-by: Arvindh <arvindh91@gmail.com>

* rename influxdb and influx to influxDB

Signed-off-by: Arvindh <arvindh91@gmail.com>

* rename EsConsumername to ESConsumerName

Signed-off-by: Arvindh <arvindh91@gmail.com>

* made comments consistant

Signed-off-by: Arvindh <arvindh91@gmail.com>

* made comments consistant & remove empty lines

Signed-off-by: Arvindh <arvindh91@gmail.com>

* made comments consistant & renmae function

Signed-off-by: Arvindh <arvindh91@gmail.com>

* made comments

Signed-off-by: Arvindh <arvindh91@gmail.com>

* comments added

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix bootstrap

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix empty env var

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove : unused variable

Signed-off-by: Arvindh <arvindh91@gmail.com>

* update: env parser library

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: mongodb reader and writer

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: cassandra reader and writer

Signed-off-by: Arvindh <arvindh91@gmail.com>

* rename: directory

Signed-off-by: Arvindh <arvindh91@gmail.com>

* rename: variable

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove: unused librar

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Format code and remove unused comments

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix tests

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Move test URL construction out of the loop

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* remove end dot in single line comments

Signed-off-by: Arvindh <arvindh91@gmail.com>

* empty

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: zhangchuanfeng <654300242@qq.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: fbugarski <filipbugarski@gmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Co-authored-by: b1ackd0t <blackd0t@protonmail.com>
Co-authored-by: Manuel Imperiale <manuel.Imperiale@gmail.com>
Co-authored-by: 张传峰 <59160162+zhang-chuanfeng@users.noreply.github.com>
Co-authored-by: Ivan Milošević <iva@blokovi.com>
Co-authored-by: __touk__ <zerouali.t@gmail.com>
Co-authored-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Co-authored-by: stefankovacevic123 <jen2tri@gmail.com>
Co-authored-by: ibalboteo <ivanbalboteo@gmail.com>
Co-authored-by: Ivan Balboteo <ivan@submer.com>
Co-authored-by: Hasan98-git <67228396+Hasan98-git@users.noreply.github.com>
Co-authored-by: Hasan Tariq <hasant@plcgroup.com>
Co-authored-by: fuzhy <fuzhy1997@outlook.com>
Co-authored-by: Filip Bugarski <filipbugarski@gmail.com>
2023-02-03 17:36:18 +01:00
b1ackd0t ada5813f47 MF-1455 - Update Versions of Protobuf (#1704)
* initial commit
* add protoc-gen-gofast
* update generated files
* fix linting
* fix consumers error on message conversion
* fix copying values on transformers
* initial commit
* initial commit
* add protoc-gen-gofast
* update generated files
* fix linting
* fix consumers error on message conversion
* fix copying values on transformers
* embedded for forward compatible.
* remove gogo
* embedded for forward compatible.
* update protoc compiler
* fix linting
* remove hex comment

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>
2023-02-02 18:28:32 +01:00
b1ackd0t 2e118ce36b NOISSUE - Update Nginx Docker Image (#1706)
* initial commit

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* update tests

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* initial commit

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* update tests

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* add empty line

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* update certs

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* remove serial file

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* fix check password from certs

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* change from include to endswith

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

---------

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>
Co-authored-by: rodneyosodo <socials@rodneyosodo.com>
2023-01-29 01:58:28 +01:00
b1ackd0t 5f9b3c9905 initial commit (#1708)
Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>
Co-authored-by: rodneyosodo <socials@rodneyosodo.com>
2023-01-24 15:10:25 +01:00
b1ackd0t d008ae5d97 NOISSUE - Add cert revocation to SDK (#1693)
* initial commit

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* fix certificate revoking

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* change from mapstructure to json

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* add comments to serial modification

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* fix typo

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* update vault docker version

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* write env variables

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* change env path

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* return revocation time

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* revert to intermediate CA

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* remove deadcode

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* make revoke cert output readable

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* remove keybits and keytype

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* remove dead code

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* make inline

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* add empty line

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* remove commented code

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* remove keyBits

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* remove keyBits

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>
Co-authored-by: rodneyosodo <socials@rodneyosodo.com>
2023-01-13 14:33:00 +01:00
b1ackd0t b83a344093 NOISSUE - Update SDK and Things Service (#1694)
* add reader url

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* fix connected and not-connected

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>
Co-authored-by: rodneyosodo <socials@rodneyosodo.com>
2023-01-11 17:11:36 +01:00
b1ackd0t b502af65fe NOISSUE - Update Read Message CLI (#1696)
Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>
Co-authored-by: rodneyosodo <socials@rodneyosodo.com>
2023-01-10 12:00:12 +01:00
b1ackd0t 2cfcbfb1e2 NOISSUE - Fix Bootstrap CLI (#1695)
Reorder SDK params (external id and key) for Bootstrap service.
2023-01-10 11:13:09 +01:00
b1ackd0t 48e368b59a NOISSUE - Combining Query Parameters (#1631)
* Initial commit

Signed-off-by: b1ackd0t <blackd0t@protonmail.com>

* Initial commit

Signed-off-by: b1ackd0t <blackd0t@protonmail.com>

* Fix CI

Signed-off-by: b1ackd0t <blackd0t@protonmail.com>

* fix tests: add enabled status key

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

* start with token

Signed-off-by: rodneyosodo <socials@rodneyosodo.com>

Signed-off-by: b1ackd0t <blackd0t@protonmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: rodneyosodo <socials@rodneyosodo.com>
Co-authored-by: rodneyosodo <socials@rodneyosodo.com>
2023-01-05 17:20:05 +01:00
Aryan Godara 302d71e8cb NOISSUE - Update pubsub tests for rabbitmq (#1656)
* testPubSub failing on channel

Signed-off-by: aryan <aryangodara03@gmail.com>

* testPubSub failing, rest passing

Signed-off-by: aryan <aryangodara03@gmail.com>

* all tests passing

Signed-off-by: aryan <aryangodara03@gmail.com>

* removed unnecessary lines

Signed-off-by: aryan <aryangodara03@gmail.com>

* rename subunsub to unsubscribe

Signed-off-by: aryan <aryangodara03@gmail.com>

* nats tests working, rabbitmq left

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix TestPublisher

Signed-off-by: aryan <aryangodara03@gmail.com>

* changed clientID of pubsub

Signed-off-by: aryan <aryangodara03@gmail.com>

* testSubscribe failing, rest all passing

Signed-off-by: aryan <aryangodara03@gmail.com>

* testPubsub failing

Signed-off-by: aryan <aryangodara03@gmail.com>

* TestSubscribe(s) failing, rest tests passing.

Signed-off-by: aryan <aryangodara03@gmail.com>

* For Rabbitmq, all tests are passing.

Signed-off-by: aryan <aryangodara03@gmail.com>

* For Nats, All tests passing, but unreliable

Signed-off-by: aryan <aryangodara03@gmail.com>

* Fix typos and improve variable names.

Signed-off-by: aryan <aryangodara03@gmail.com>

* nats tests passing, rabbitmq half tests passing.

Signed-off-by: aryan <aryangodara03@gmail.com>

* all tests working.

Signed-off-by: aryan <aryangodara03@gmail.com>

* removed commented out, dead code.

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix errors, queuesubscribe tests for nats.

Signed-off-by: aryan <aryangodara03@gmail.com>

* updated broker.Connect to opts.Connect for nats.

Signed-off-by: aryan <aryangodara03@gmail.com>

* experimental soluton

Signed-off-by: aryan <aryangodara03@gmail.com>

* Revert nats back to original status.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Remove unnecessary commit

Signed-off-by: aryan <aryangodara03@gmail.com>

Signed-off-by: aryan <aryangodara03@gmail.com>
2022-12-31 02:18:31 +01:00
b1ackd0t 6f2ce82263 Don't throw an error if users status type exists
Signed-off-by: 0x6f736f646f <b1ackd0t@protonmail.com>

Signed-off-by: 0x6f736f646f <b1ackd0t@protonmail.com>
Co-authored-by: 0x6f736f646f <b1ackd0t@protonmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-12-29 12:14:46 +01:00
Arvindh 57e3c25d3d NOISSUE - Trim trailing and leading whitespaces in email at login & register (#1687)
* add: trim email in users at login & register

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: trim email in users at login & register

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: trim email in users at login & register

Signed-off-by: Arvindh <arvindh91@gmail.com>

Signed-off-by: Arvindh <arvindh91@gmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-12-21 19:03:52 +01:00
Dušan Borovčanin f438d24c41 MF-1681 - Failed to reconnect to NATS (#1686)
* Make NATS reconnect never give up

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Extract maxReconnects to a constant

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2022-12-21 14:08:02 +01:00
Aryan Godara e6e9d22133 MF-1670 - Improve error handling in SDK (#1674)
* initial commit

Signed-off-by: aryan <aryangodara03@gmail.com>

* remove unused variables.

Signed-off-by: aryan <aryangodara03@gmail.com>

* removed temporarily created file.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Fix failing CI

Signed-off-by: aryan <aryangodara03@gmail.com>

* Fix thing_test failing cases.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Remove dead code, debug statements, and add comments.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Extract errors to separate file.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Updated things/api/http tests

Signed-off-by: aryan <aryangodara03@gmail.com>

* Created custom SDK error.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Changed to using CheckError. All tests passing.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Replace error interface with errors.SDKError interface.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Fix failing CI.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Remove unused sdk errors.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Change SDKError to error in internal function of sdk package.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Remove unused error.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Remove encodeError. All tests working.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Rename sdkerr vars, convert common strings to constants.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Change checkerror to take error instead of string.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Remove unused errors, and removed errfailedwhitelist wrap.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Removed unused errors, and remove errors.go since it only had a repeated error from errors package

Signed-off-by: aryan <aryangodara03@gmail.com>

* Remove unused errors.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Update sdk_error.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Used function to reduce code for sending and receiving requests.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Added function sendrequestandgetheadersorerror.

Signed-off-by: aryan <aryangodara03@gmail.com>

* sdk_error updated.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Updated function names to processRequest.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Made errors internal, fixed typo in http.

Signed-off-by: aryan <aryangodara03@gmail.com>

* Remove empty line.

Signed-off-by: aryan <aryangodara03@gmail.com>

* merged proceessBody and processHeaders functions in sdk.

Signed-off-by: aryan <aryangodara03@gmail.com>

* remove sendThingRequest function.

Signed-off-by: aryan <aryangodara03@gmail.com>

* changed processRequest signature

Signed-off-by: aryan <aryangodara03@gmail.com>

* changed processRequest signature, changed error names.

Signed-off-by: aryan <aryangodara03@gmail.com>

Signed-off-by: aryan <aryangodara03@gmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-12-15 16:24:19 +01:00
Dušan Borovčanin a48fb944c6 MF-1667 - Postgres lib update (#1680)
* Replace SQL lib in Things and Users

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update Bootstrap DB lib

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Rename pqErr to pgErr

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update Auth db lib

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update DB lib in consumers

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update DB lib for Readers

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update Certs DB lib

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove "lib/pq" from dependencies

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update vendor

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update Go version for base image in Dockerfile

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove unused Provision Dockerfile

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Move error codes to init.go files

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add missing comment

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Use Error Codes lib

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update Go version in CI script

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update mod file

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2022-12-13 15:34:01 +01:00
Arvindh 47fd646030 MF-1678 - Fetching users returns an invalid status code response (#1679)
* fix: get /users authorize err code

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: test case for forbidden request in GET /users

Signed-off-by: Arvindh <arvindh91@gmail.com>

* update: api docs of GET /users

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: test case for forbidden request in GET /users

Signed-off-by: Arvindh <arvindh91@gmail.com>

Signed-off-by: Arvindh <arvindh91@gmail.com>
2022-12-07 12:31:01 +01:00
Zoran Rebic 933b5dedce MF-1197 - Add MQTT adapter tests (#1622)
* MF-1197 - add mqtt tests

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - add test cases

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - refactor tests

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Fix test names.Add const

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add mocks. Add publish test

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add buffer to logger

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add redis mock.Change logger error

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add new test cases

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Fix session fields

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Fix bad logs. Fix tests

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add new test case.Fix names.

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Fix test name

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Refactoring tests

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Wrap errors

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Wrap errors. Fix logs level

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Wrap errors.

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Fix var names

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-888 - Add clientID err check.Refactor tests

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Fix info and err names

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Remove redundant log and channel parts check

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Revert channel parts check

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add authorize test case

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Remove unused var

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Change var name

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 -Add missing test case.Change var name

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 -Add err case.

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 -Change var name

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Use logMsg for all logs

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Use logs instead of errors

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Use redis mock

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Return interface in constructor

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add missing test cases. Create consts

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Add global vars

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Refactor code

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Remove unused var

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Remove unnecessary var

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Use created session client

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Refactor vars

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

* MF-1197 - Separate constant

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>

Signed-off-by: zzokki81 <zoran.rebic@outlook.com>
2022-11-21 14:40:19 +01:00
Dušan Borovčanin 677f3c70b0 Update Go version and dependencies (#1663)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2022-10-26 15:56:35 +02:00
b1ackd0t 8c21181f17 NOISSUE - Update Provision service (#1658)
* Add config urls

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add docs for provision

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update provision docs on mqtt bench

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Run tools relative to root folder

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-10-21 17:01:55 +02:00
b1ackd0t 2213c5e1af MF-1654 - Fix Topic Parsing in RabbitMQ Broker (#1655)
* Initial commit

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* increase message durability

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* inline err check

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove quality of service and priority

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-10-21 12:06:39 +02:00
Aryan Godara c212254c2a MF-1640 - Create tests for mqtt pubsub (#1643)
Signed-off-by: aryan <aryangodara03@gmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2022-10-17 09:05:22 +02:00
b1ackd0t 78b025c473 Fix ws broker url (#1659)
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
2022-09-29 01:08:15 +02:00
b1ackd0t 237826e253 MF-1648 - Add Default MF_BROKER_URL in env file (#1650)
* Initial commit

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove nats and rabbitmq url

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove broker url construction in makefile

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove nats and rabbitmq url

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove broker url construction in makefile

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove if else statement in Makefile

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-09-21 15:30:06 +02:00
Aryan Godara 8a4cc12cd3 MF-1623 - Bring back WebSocket Adapter (#1625)
Signed-off-by: aryan <aryangodara03@gmail.com>
2022-09-16 14:07:12 +02:00
b1ackd0t 2e0299119d NOISSUE - Fix Update Channel CLI Typo (#1649)
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
2022-08-24 15:14:47 +02:00
b1ackd0t 4a71a08863 NOISSUE - Update CLI Documentation (#1647)
* Initial commit

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Capitalize

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
2022-08-23 16:18:52 +02:00
Aryan Godara d9c47045cd MF-1630 - Replace old subscriptions with a new one instead of throwing an error (#1633)
* updated pubsub.subscribe() to delete and renew already subscribed objects

Signed-off-by: aryan <aryangodara03@gmail.com>

* fixing sync.mutex error

Signed-off-by: aryan <aryangodara03@gmail.com>

* made changes to pubsub_test.go to fix failing CI

Signed-off-by: aryan <aryangodara03@gmail.com>

* made some changes to pubsub.go

Signed-off-by: aryan <aryangodara03@gmail.com>

* made some changes to pubsub.go added flag var

Signed-off-by: aryan <aryangodara03@gmail.com>

* little code cleanup

Signed-off-by: aryan <aryangodara03@gmail.com>

* minor change, to make code more intuitive

Signed-off-by: aryan <aryangodara03@gmail.com>

* added comment, removed the ws_client file

Signed-off-by: aryan <aryangodara03@gmail.com>

* removed ErrAlreadySubscribed

Signed-off-by: aryan <aryangodara03@gmail.com>

* fixed some failing tests, will check again after semaphore result

Signed-off-by: aryan <aryangodara03@gmail.com>

* made similar changes for MQTT and rabbitMQ

Signed-off-by: aryan <aryangodara03@gmail.com>

* removed extra comment

Signed-off-by: aryan <aryangodara03@gmail.com>

* removed extra comment

Signed-off-by: aryan <aryangodara03@gmail.com>

* removed extra comment

Signed-off-by: aryan <aryangodara03@gmail.com>

* to fix failing CI

Signed-off-by: aryan <aryangodara03@gmail.com>

* checking code after adding conditions

Signed-off-by: aryan <aryangodara03@gmail.com>

* added ps.mu.Lock(), and changed len(s)

Signed-off-by: aryan <aryangodara03@gmail.com>

* added tests for failing unsubscribe

Signed-off-by: aryan <aryangodara03@gmail.com>

* shifted defer lock

Signed-off-by: aryan <aryangodara03@gmail.com>

* fixed mqtt/pubsub

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix mqtt/pubsub typo

Signed-off-by: aryan <aryangodara03@gmail.com>

* add comment to improve readability

Signed-off-by: aryan <aryangodara03@gmail.com>

* add comment to better improve readability

Signed-off-by: aryan <aryangodara03@gmail.com>

* add comments for docs

Signed-off-by: aryan <aryangodara03@gmail.com>

* improve doc comment

Signed-off-by: aryan <aryangodara03@gmail.com>

* change to mqtt/pubsub

Signed-off-by: aryan <aryangodara03@gmail.com>

* remove unnecessary mutex lock

Signed-off-by: aryan <aryangodara03@gmail.com>

* change to pubsub

Signed-off-by: aryan <aryangodara03@gmail.com>

* add comments to improve readability

Signed-off-by: aryan <aryangodara03@gmail.com>

* fix typo in comment

Signed-off-by: aryan <aryangodara03@gmail.com>

Signed-off-by: aryan <aryangodara03@gmail.com>
2022-08-12 18:08:20 +02:00
b1ackd0t 721ee545f9 MF1621 - Logical user removal (#1620)
* Initial commit

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* change active to string

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Set default

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix query all users

Signed-off-by: GitHub <noreply@github.com>

* Set user active on service

Signed-off-by: GitHub <noreply@github.com>

* Rename active to state

Signed-off-by: GitHub <noreply@github.com>

* check user active on service

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* fix test

Signed-off-by: GitHub <noreply@github.com>

* Add deactivate user tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Rename deactivate to change user status

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Revert to sorting users

Signed-off-by: GitHub <noreply@github.com>

* change user state

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change user status to enable and disable

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* change user state to status

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* from enable to activate

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* from activate to enable

Signed-off-by: GitHub <noreply@github.com>

* not found error by retrievebyID

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Combine enable and disable user

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add api docs

Signed-off-by: b1ackd0t <blackd0t@protonmail.com>

* verify docs

Signed-off-by: b1ackd0t <blackd0t@protonmail.com>

* change to camel

Signed-off-by: b1ackd0t <blackd0t@protonmail.com>

* Reword

Signed-off-by: b1ackd0t <blackd0t@protonmail.com>

* fix default state

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* change from VARCHAR to ENUM

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* invalid user status test

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: b1ackd0t <blackd0t@protonmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-08-11 18:58:45 +02:00
Dušan Borovčanin f89ea226e5 Remove .DS_Store file (#1638)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2022-08-11 16:51:38 +02:00
Manuel Imperiale e1992a694a NOISSUE - Replace MF_SDK_BASE_URL envar by MF_THINGS_URL (#1632)
* NOISSUE - Replace MF_SDK_BASE_URL envar by MF_THINGS_URL

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* fix url

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm unused var

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-08-08 15:12:35 +02:00
Dušan Borovčanin 42c003b556 Fix setup in .env file (#1634)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2022-08-04 13:22:13 +02:00
Mariana Cavalcante 6bd745b658 Fix SDK interface function signature (#1628)
Change function ThingsByChannel param name from connected to disconnected to match with request params

Signed-off-by: Mariana Coutinho <mariana.cavalcante@encora.com>
2022-07-13 11:12:41 +02:00
b1ackd0t 931b48f3a7 NOISSUE - Add identify thing method to SDK (#1617)
* Initial commit

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* typo

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Get thing key

Signed-off-by: GitHub <noreply@github.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-06-24 16:31:12 +02:00
b1ackd0t 5c495238a6 NOISSUE - RabbitMQ build and deployment (#1570)
* Initial commit of adding rabbitmq broker

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit of adding rabbitmq broker

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit for tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Bump up tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add more tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add go routines

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit of adding rabbitmq broker

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit of adding rabbitmq broker

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit for tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Bump up tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add more tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add go routines

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix with wait groups

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* unsubscribe to stop delivering messages

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove exclusivity

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Implement cancel mechanisms

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Queuename as parameter

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Queuename as parameter

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove broker type

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Configure broker with makefile

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Check if we have changed MESSAGE_BROKER_FILE~

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Set nats automatically

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Catching null and invalid broker type

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove unused fmt

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Nats

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* unexport constants

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change routingkey

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove wait groups

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* protecting map

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add publisher to pubsub

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change proto library

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix typos

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Reduce pubsub tests based on implementation

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove channel cancel

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Export constant

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Embedding publisher into pubsub

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Naming publisher

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update rabbitmq subscriber interface

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* using publisher composition

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change contenttype

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* rename topic for publish and subscribe

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change errors to lower case

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change errors to lower case

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* export errors

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* queue per subscription

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* queue per subscription

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Merge branch 'master' into RabbitMQ-deployment

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* rename nats to broker

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change routing method

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Direct method with one exchange to many queues, one consumer per queue

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1263 - Move repeating errors to the separate package (#1540)

* MF-1263 - Mv duplicated errors to pkg/errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert test build flags

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix merge

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Fix auth members list response (#1555)

* NOISSUE - Fix auth members list response

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Move group type next to page details

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm membersRes

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1261 - Use StatusUnauthorized for authn and StatusForbidden for authz (#1538)

* MF-1261 - Use StatusUnauthorized for authn and StatusForbidden for authz

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* ErrExternalKey typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename ErrUnauthorizedAcces -> ErrAuthentication

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix bootstrap error

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix status code in openapi

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add errors cases

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix status codes

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add gRPC stutus code

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix tests description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix openapi and encodeError

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix grpc message

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test descriptions

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert sdk error

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1059 - Add TLS support for email (#1560)

* Use gomail package for sending emails

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove print err

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Add vendor

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Rename email structure
remove logger

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* typo in var name

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* rename var

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove MF_EMAIL_SECRET

Signed-off-by: Ivan Milosevic <iva@blokovi.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Refactor MQTT subscriber (#1561)

* correct suscriber interface validator + refactore token error handling

Signed-off-by: tzzed <zerouali.t@gmail.com>

* apply review suggestion

Signed-off-by: tzzed <zerouali.t@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1257 - Access messages from readers endpoint with user access token (#1470)

* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add user auth for db reader

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* add user auth for db reader

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* enable mongodb reader for user token reading

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* use uuid check for auth switch between thing key and user tok

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* enable user token reading

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* revert to correct version

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix endpoint test, add additional tests

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove logs,dead code

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix logging messages

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove auth interface, add authorization header type

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* update api doc

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove unused package

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* some refactor of cases for authorization switch

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* correct description in openapi

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix endpoint test to match auth service change

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* some rename

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* initialize auth url

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* add env variables for auth service

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix spelling

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* Things prefix and no prefix for Thing authorization, Bearer for user

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* update readme file

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix default things grpc port

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* enable user reading for timescaledb

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove not used error

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* improve errors

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* refactor authorize

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* add chanID check

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* inline some error checking

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fixing errors

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fixing errors

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* improve test case description

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove test code

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* dont inline

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* refactor a bit encodeError

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove unused error

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove unused error

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix things auth grpc url

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* rename variables for header prefix

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit of adding rabbitmq broker

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit of adding rabbitmq broker

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit for tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Bump up tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add more tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add go routines

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit of adding rabbitmq broker

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit for tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Bump up tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add more tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add go routines

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix with wait groups

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* unsubscribe to stop delivering messages

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove exclusivity

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1551 - Fix Cobra usage commands and clean unnecessary struct types (#1558)

* MF-1551 - Fix Cobra usage commands and clean unnecessary struct types

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use linux syntax for cmd usage description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix cmd.Use

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Separate Keto hosts for read and write (#1563)

* Separate keto hosts for read and write

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* update readme with new envars

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* rename read connection name

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update dependencies (#1564)

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1240 - Return to service transport layer only service errors (#1559)

* MF-1240 - Return to service transport layer only service errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove unecessary errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm duplicated errors and fix transport

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert http endpoint_test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix conflict

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Implement cancel mechanisms

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Queuename as parameter

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Queuename as parameter

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1469 - Indicate proper authentication scheme in Authorization header (#1523)

* MF-1469 - Indicate proper authentication scheme in Authorization header

Signed-off-by: Stefan Kovacevic <jen2tri@gmail.com>

* Fixing the remarks on the last push

Signed-off-by: Stefan Kovacevic <jen2tri@gmail.com>

* Remove Bearer prefix in all services and fix tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix remarks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Add nats wrapper for COAP (#1569)

* Add nats wrapper for COAP

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Pass pubsub as argument

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Defer close connection

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Defer close connection

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Rename endpoint to topic

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1348 - Add transport errors logging (#1544)

* MF-1348 - Add go-kit transport level logging

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix merge

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix remark

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix go test flags

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use httputil errors in things and http service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix SDK tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use httputil errors in certs and provision service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use httputil errors in consumers service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* General renaming and add ErrMissingToken

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename httputil -> apiutil and use errors in users servive

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use apiutil errors in auth, bootstrap, readers, things and twins

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Replace errors.Contain by comparison

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix remarks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify validateID

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify validateID

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify and rename ExtractAuthToken -> ExtractBearerToken

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix readers

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix auth key test and remarks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Improve comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify validateUUID check

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1567 - Use Bearer, Thing or Basic scheme in Authorization header (#1568)

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1565 - Document Bearer, Thing and Basic Authorization header (#1566)

* MF-1565 - Document Bearer Authorization header

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix auth, bootstrap, http and readers openapi

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix openapi

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add enc key for bootstrap

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use global security

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix bearer formats

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Polish descriptions

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix boostrap and typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1575 Add 'Name' field to ListMembers response in things svc (#1576)

Signed-off-by: Ivan Balboteo <ivan@submer.com>

Co-authored-by: Ivan Balboteo <ivan@submer.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1580 - Influxdb Writer changes format of update-time to string (#1581)

* - MF-1580
- Modified consumers/writers/influxdb/fields.go
- influxdb-writer used to update data type of update-time to string
- Commented line 12 of consumers/writers/influxdb/fields.go to resolve
  uneccessary data type conversion issue

Signed-off-by: Hasan Tariq <hasantariqashraf@gmail.com>

* - MF-1580
- Removed strconv package from consumers/writers/influxdb/fields.go since it is no longer needed
- Removed line 12 from consumers/writers/influxdb/fields.go
- Replaced retrun value of updateTime with msg.UpdateTime (line 16 in
  fields.go)

Signed-off-by: Hasan Tariq <hasantariqashraf@gmail.com>

* Fix InflxuDB readers

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

Co-authored-by: Hasan Tariq <hasant@plcgroup.com>
Co-authored-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Unify MF_INFLUX_READER_DB_HOST and MF_INFLUX_WRITER_DB_HOST envars (#1585)

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Fix CoAP adapter (#1572)

* Revert "NOISSUE - Add nats wrapper for COAP (#1569)"

This reverts commit cc5d5195ab.

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix CoAP adapter

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update CoAP observation cancel

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix observe

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix GET handling

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Revert authorization

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Use constants instead of magic numbers

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove an empty line

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Extract special observe value to constant

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1582 - Fix lora-adapter MQTT client (#1583)

* MF-1582 - Fix lora-adapter MQTT clien

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add timeout config to the mqtt subscriber

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add sub timeout

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Update changelog and readme for release 0.13.0 (#1592)

* Update release example

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update changelog and examples for 0.13.0 release

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update VerneMQ release (#1593)

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Update changelog for release 0.13.0 (#1595)

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* unexport constants

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change routingkey

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove wait groups

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* protecting map

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add publisher to pubsub

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change proto library

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix typos

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Reduce pubsub tests based on implementation

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove channel cancel

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Export constant

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Move invariant statements out of loop for cassandra-writer (#1596)

Signed-off-by: fuzhy <fuzhy1997@outlook.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Embedding publisher into pubsub

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Naming publisher

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Fix Nginx entrypoint script (#1597)

* Fix Nginx entrypoint script

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update dependencies

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix NginX entrypoint

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Revert Makefile changes

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1525 - Add graceful stop for HTTP and GRPC servers (#1548)

* Add : errgroup to cmd/auth

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Handle graceful stop for auth service
Remove : errgroups from auth service

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Wait till server shutdown

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Change : instead of waitgroup changed to errgroups

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change : KillSignalHandler return type to error

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Empty Commit

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Context to http server shutdown
Rename : varaible from proto to protocol

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change : to default log level

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Sign-off

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: graceful stop of http and grpc server

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Fix: typos and caps

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: Signed-off

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Rename: Func KillSignalHandler to SignalHandler
Add: SIGABRT

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Fix: auth service

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: timeout for grpc gracefulstop
Fix: typos

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: .vscode folder to git ignore

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change: variable name to stopWaitTime

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove: .vscode folder

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove: .vscode from .gitignore

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : logger to handlers

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : New line at end of .gitignore file

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Fix : variable naming
Add : graceful stop for timescale

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Remove : unsued NATS library from import

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Move: "https" and "https" to moved to const var

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Move: "http" and "https" to moved to const var

Signed-off-by: Arvindh <arvindh91@gmail.com>

* update:  branch with master

Signed-off-by: Arvindh <arvindh91@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1588 - Update Subscriber interface (#1598)

* Initial commit

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update subscriber interface

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* check subscription map

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Check topic id after topic

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* reword description

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Setup empty queue

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change mqtt implementation

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Switch statements

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Simplify

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change mqtt subscriber

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Protect subscription map

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix subscription

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Set client id

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change delete method

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update rabbitmq subscriber interface

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* using publisher composition

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change contenttype

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* rename topic for publish and subscribe

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change errors to lower case

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change errors to lower case

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* export errors

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF - 1590 - Fix fetching list of users with a zero limit (#1594)

* Add max and min limit size

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Retrieve client key on cert issuing (#1607)

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* fix bug (#1604)

Signed-off-by: zhangchuanfeng <654300242@qq.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* queue per subscription

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* queue per subscription

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change routing method

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Direct method with one exchange to many queues, one consumer per queue

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* ♻️ Not casting data

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* ✏️ Fix typo

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* ♻️ remove passed queue name

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* 🔥 removing echange kind

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Combine tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Refactor unsubscribe method

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix merge conflict

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

*  sub and unsub to dummy topic

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* generate client id from topic and ID

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Rename topicID to clientID

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* update tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* merge changes

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* ♻️ rename constant and variable declaration

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* rename to brokers

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* ♻️ Rename brokers

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change mqtt implementation

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Rename broker to brokers

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* include nats port

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* move to build tags

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* move to build tags

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* add nats build tag to test

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* \n at the end of file

Signed-off-by: GitHub <noreply@github.com>

* Add init function

Signed-off-by: GitHub <noreply@github.com>

* Add init function

Signed-off-by: GitHub <noreply@github.com>

* broker url automatically

Signed-off-by: GitHub <noreply@github.com>

* make nats as the default broker

Signed-off-by: GitHub <noreply@github.com>

* Updated publisher and subscriber interface

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add error to close

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change image version and let user define URI

Signed-off-by: GitHub <noreply@github.com>

* make broker url configurable

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* add compile check

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* rabbitmq check

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* default broker to nats

Signed-off-by: GitHub <noreply@github.com>

* change broker url in docker compose

Signed-off-by: GitHub <noreply@github.com>

* Fix ci

Signed-off-by: GitHub <noreply@github.com>

* fix makefile

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix env var and ci

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix ci

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix consts

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Co-authored-by: Manuel Imperiale <manuel.Imperiale@gmail.com>
Co-authored-by: Ivan Milošević <iva@blokovi.com>
Co-authored-by: __touk__ <zerouali.t@gmail.com>
Co-authored-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Co-authored-by: stefankovacevic123 <jen2tri@gmail.com>
Co-authored-by: ibalboteo <ivanbalboteo@gmail.com>
Co-authored-by: Ivan Balboteo <ivan@submer.com>
Co-authored-by: Hasan98-git <67228396+Hasan98-git@users.noreply.github.com>
Co-authored-by: Hasan Tariq <hasant@plcgroup.com>
Co-authored-by: fuzhy <fuzhy1997@outlook.com>
Co-authored-by: Arvindh <30824765+arvindh123@users.noreply.github.com>
Co-authored-by: 张传峰 <59160162+zhang-chuanfeng@users.noreply.github.com>
2022-06-21 17:40:20 +02:00
b1ackd0t 9a87e5cd1f NOISSUE - Get user by ID and get all users by SDK (#1589)
* Add get user by id and get all users

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove print statement

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add get user by id and get all users

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove print statement

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* rename userid

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* rename userid

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add pagination

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* reduce user creation

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add pagination to sdk

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add offset and limits

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove exported variables

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add filtering users value to sdk

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add filtering to things and channels

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Linting

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add struct embedding

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change filtering variable names

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change Name to Email

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Combined Paging struct

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* setting total, offset and limit even when zero

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Rename fields

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Rename pageMetadata

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Adding limit and offset size errors

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* ♻️

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* query by name, metadata or id

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove duplicate importation

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove duplicate pageMetadata

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* remove unused name

Signed-off-by: GitHub <noreply@github.com>

* Fix minor changes

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* use net/url to construct query params

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* simplify query

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* unexport method

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix mock

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* update user

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* email and metadata as flags

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* update help message

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2022-06-17 17:32:23 +02:00
Dušan Borovčanin 2a5884f4e2 MF-1614 - Invalid handling of auth errors in Things service (#1615)
* Fix Things service Auth error handling

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove unused test vars

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix SDK tests

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2022-06-17 16:24:07 +02:00
Filip Bugarski 0f0830ff61 NOISSUE - fix pull request template typo (#1616)
* Fix typo

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Change link

Signed-off-by: fbugarski <filipbugarski@gmail.com>
2022-06-14 17:53:43 +02:00
Manuel Imperiale 5b8780de4a NOISSUE - Make application/json content-type valid in http-adapter (#1606)
* NOISSUE - Make application/json content-type valid in http-adapter

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add CBOR content-type

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix naming

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix naming

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix CI

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix CI flag

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix CI install

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Upgrade grpc version

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* rm cli

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-06-13 12:04:48 +02:00
Dušan Borovčanin 6c59184d3f NOISSUE - Fix CI script (#1613)
* Fix CI script

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix linter errors

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add timeout to linter

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2022-06-09 21:57:37 +02:00
Dušan Borovčanin 758ed6fa02 NOISSUE - Fix Groups SDK (#1609)
* Fix Groups SDK

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix CLI

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2022-06-01 01:41:54 +02:00
b1ackd0t 55c4f087cd MF - 1416 - Queue Abstraction for Mainflux & RabbitMQ Support (#1562)
* MF-1263 - Move repeating errors to the separate package (#1540)

* MF-1263 - Mv duplicated errors to pkg/errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert test build flags

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix merge

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Fix auth members list response (#1555)

* NOISSUE - Fix auth members list response

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Move group type next to page details

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm membersRes

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1261 - Use StatusUnauthorized for authn and StatusForbidden for authz (#1538)

* MF-1261 - Use StatusUnauthorized for authn and StatusForbidden for authz

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* ErrExternalKey typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename ErrUnauthorizedAcces -> ErrAuthentication

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix bootstrap error

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix status code in openapi

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add errors cases

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix status codes

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add gRPC stutus code

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix tests description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix openapi and encodeError

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix grpc message

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test descriptions

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert sdk error

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1059 - Add TLS support for email (#1560)

* Use gomail package for sending emails

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove print err

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Add vendor

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Rename email structure
remove logger

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* typo in var name

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* rename var

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove MF_EMAIL_SECRET

Signed-off-by: Ivan Milosevic <iva@blokovi.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Refactor MQTT subscriber (#1561)

* correct suscriber interface validator + refactore token error handling

Signed-off-by: tzzed <zerouali.t@gmail.com>

* apply review suggestion

Signed-off-by: tzzed <zerouali.t@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1257 - Access messages from readers endpoint with user access token (#1470)

* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add user auth for db reader

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* add user auth for db reader

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* enable mongodb reader for user token reading

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* use uuid check for auth switch between thing key and user tok

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* enable user token reading

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* revert to correct version

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix endpoint test, add additional tests

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove logs,dead code

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix logging messages

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove auth interface, add authorization header type

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* update api doc

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove unused package

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* some refactor of cases for authorization switch

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* correct description in openapi

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix endpoint test to match auth service change

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* some rename

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* initialize auth url

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* add env variables for auth service

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix spelling

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* Things prefix and no prefix for Thing authorization, Bearer for user

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* update readme file

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix default things grpc port

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* enable user reading for timescaledb

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove not used error

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* improve errors

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* refactor authorize

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* add chanID check

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* inline some error checking

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fixing errors

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fixing errors

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* improve test case description

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove test code

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* dont inline

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* refactor a bit encodeError

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove unused error

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove unused error

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix things auth grpc url

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* rename variables for header prefix

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit of adding rabbitmq broker

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit of adding rabbitmq broker

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit for tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Bump up tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add more tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add go routines

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit of adding rabbitmq broker

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Initial commit for tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Bump up tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add more tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add go routines

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix with wait groups

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* unsubscribe to stop delivering messages

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove exclusivity

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1551 - Fix Cobra usage commands and clean unnecessary struct types (#1558)

* MF-1551 - Fix Cobra usage commands and clean unnecessary struct types

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use linux syntax for cmd usage description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix cmd.Use

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Separate Keto hosts for read and write (#1563)

* Separate keto hosts for read and write

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* update readme with new envars

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* rename read connection name

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update dependencies (#1564)

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1240 - Return to service transport layer only service errors (#1559)

* MF-1240 - Return to service transport layer only service errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove unecessary errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm duplicated errors and fix transport

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert http endpoint_test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix conflict

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Implement cancel mechanisms

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Queuename as parameter

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Queuename as parameter

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1469 - Indicate proper authentication scheme in Authorization header (#1523)

* MF-1469 - Indicate proper authentication scheme in Authorization header

Signed-off-by: Stefan Kovacevic <jen2tri@gmail.com>

* Fixing the remarks on the last push

Signed-off-by: Stefan Kovacevic <jen2tri@gmail.com>

* Remove Bearer prefix in all services and fix tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix remarks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Add nats wrapper for COAP (#1569)

* Add nats wrapper for COAP

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Pass pubsub as argument

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Defer close connection

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Defer close connection

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Rename endpoint to topic

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1348 - Add transport errors logging (#1544)

* MF-1348 - Add go-kit transport level logging

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix merge

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix remark

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix go test flags

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use httputil errors in things and http service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix SDK tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use httputil errors in certs and provision service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use httputil errors in consumers service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* General renaming and add ErrMissingToken

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename httputil -> apiutil and use errors in users servive

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use apiutil errors in auth, bootstrap, readers, things and twins

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Replace errors.Contain by comparison

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix remarks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify validateID

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify validateID

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify and rename ExtractAuthToken -> ExtractBearerToken

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix readers

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix auth key test and remarks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Improve comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify validateUUID check

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1567 - Use Bearer, Thing or Basic scheme in Authorization header (#1568)

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1565 - Document Bearer, Thing and Basic Authorization header (#1566)

* MF-1565 - Document Bearer Authorization header

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix auth, bootstrap, http and readers openapi

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix openapi

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add enc key for bootstrap

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use global security

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix bearer formats

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Polish descriptions

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix boostrap and typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1575 Add 'Name' field to ListMembers response in things svc (#1576)

Signed-off-by: Ivan Balboteo <ivan@submer.com>

Co-authored-by: Ivan Balboteo <ivan@submer.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1580 - Influxdb Writer changes format of update-time to string (#1581)

* - MF-1580
- Modified consumers/writers/influxdb/fields.go
- influxdb-writer used to update data type of update-time to string
- Commented line 12 of consumers/writers/influxdb/fields.go to resolve
  uneccessary data type conversion issue

Signed-off-by: Hasan Tariq <hasantariqashraf@gmail.com>

* - MF-1580
- Removed strconv package from consumers/writers/influxdb/fields.go since it is no longer needed
- Removed line 12 from consumers/writers/influxdb/fields.go
- Replaced retrun value of updateTime with msg.UpdateTime (line 16 in
  fields.go)

Signed-off-by: Hasan Tariq <hasantariqashraf@gmail.com>

* Fix InflxuDB readers

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

Co-authored-by: Hasan Tariq <hasant@plcgroup.com>
Co-authored-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Unify MF_INFLUX_READER_DB_HOST and MF_INFLUX_WRITER_DB_HOST envars (#1585)

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Fix CoAP adapter (#1572)

* Revert "NOISSUE - Add nats wrapper for COAP (#1569)"

This reverts commit cc5d5195ab.

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix CoAP adapter

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update CoAP observation cancel

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix observe

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix GET handling

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Revert authorization

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Use constants instead of magic numbers

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Remove an empty line

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Extract special observe value to constant

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1582 - Fix lora-adapter MQTT client (#1583)

* MF-1582 - Fix lora-adapter MQTT clien

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add timeout config to the mqtt subscriber

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add sub timeout

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Update changelog and readme for release 0.13.0 (#1592)

* Update release example

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update changelog and examples for 0.13.0 release

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update VerneMQ release (#1593)

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Update changelog for release 0.13.0 (#1595)

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* unexport constants

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change routingkey

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove wait groups

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* protecting map

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add publisher to pubsub

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change proto library

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix typos

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Reduce pubsub tests based on implementation

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Remove channel cancel

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Export constant

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Move invariant statements out of loop for cassandra-writer (#1596)

Signed-off-by: fuzhy <fuzhy1997@outlook.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Embedding publisher into pubsub

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Naming publisher

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Fix Nginx entrypoint script (#1597)

* Fix Nginx entrypoint script

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update dependencies

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix NginX entrypoint

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Revert Makefile changes

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1525 - Add graceful stop for HTTP and GRPC servers (#1548)

* Add : errgroup to cmd/auth

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Handle graceful stop for auth service
Remove : errgroups from auth service

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Wait till server shutdown

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Change : instead of waitgroup changed to errgroups

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change : KillSignalHandler return type to error

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Empty Commit

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Context to http server shutdown
Rename : varaible from proto to protocol

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change : to default log level

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Sign-off

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: graceful stop of http and grpc server

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Fix: typos and caps

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: Signed-off

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Rename: Func KillSignalHandler to SignalHandler
Add: SIGABRT

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Fix: auth service

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: timeout for grpc gracefulstop
Fix: typos

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: .vscode folder to git ignore

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change: variable name to stopWaitTime

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove: .vscode folder

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove: .vscode from .gitignore

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : logger to handlers

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : New line at end of .gitignore file

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Fix : variable naming
Add : graceful stop for timescale

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Remove : unsued NATS library from import

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Move: "https" and "https" to moved to const var

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Move: "http" and "https" to moved to const var

Signed-off-by: Arvindh <arvindh91@gmail.com>

* update:  branch with master

Signed-off-by: Arvindh <arvindh91@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF-1588 - Update Subscriber interface (#1598)

* Initial commit

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update subscriber interface

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* check subscription map

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Check topic id after topic

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* reword description

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Setup empty queue

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change mqtt implementation

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Switch statements

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Simplify

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change mqtt subscriber

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Protect subscription map

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix subscription

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Set client id

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change delete method

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update rabbitmq subscriber interface

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* using publisher composition

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change contenttype

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* rename topic for publish and subscribe

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change errors to lower case

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change errors to lower case

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* export errors

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* MF - 1590 - Fix fetching list of users with a zero limit (#1594)

* Add max and min limit size

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* NOISSUE - Retrieve client key on cert issuing (#1607)

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* fix bug (#1604)

Signed-off-by: zhangchuanfeng <654300242@qq.com>
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* queue per subscription

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* queue per subscription

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change routing method

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Direct method with one exchange to many queues, one consumer per queue

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* ♻️ Not casting data

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* ✏️ Fix typo

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* ♻️ remove passed queue name

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* 🔥 removing echange kind

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Combine tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Refactor unsubscribe method

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix merge conflict

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

*  sub and unsub to dummy topic

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* generate client id from topic and ID

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Rename topicID to clientID

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* update tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Reuse clientID

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix typos

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Seperate testpublish and testpubsub

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Co-authored-by: Manuel Imperiale <manuel.Imperiale@gmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Co-authored-by: Ivan Milošević <iva@blokovi.com>
Co-authored-by: __touk__ <zerouali.t@gmail.com>
Co-authored-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Co-authored-by: stefankovacevic123 <jen2tri@gmail.com>
Co-authored-by: ibalboteo <ivanbalboteo@gmail.com>
Co-authored-by: Ivan Balboteo <ivan@submer.com>
Co-authored-by: Hasan98-git <67228396+Hasan98-git@users.noreply.github.com>
Co-authored-by: Hasan Tariq <hasant@plcgroup.com>
Co-authored-by: fuzhy <fuzhy1997@outlook.com>
Co-authored-by: Arvindh <30824765+arvindh123@users.noreply.github.com>
Co-authored-by: 张传峰 <59160162+zhang-chuanfeng@users.noreply.github.com>
2022-05-26 19:49:13 +02:00
张传峰 163c1b2fb7 fix bug (#1604)
Signed-off-by: zhangchuanfeng <654300242@qq.com>
2022-05-11 09:35:29 +02:00
Manuel Imperiale 9c2298daa9 NOISSUE - Retrieve client key on cert issuing (#1607)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-05-10 18:37:55 +02:00
b1ackd0t d30e6bad3c MF - 1590 - Fix fetching list of users with a zero limit (#1594)
* Add max and min limit size

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-05-09 22:23:19 +02:00
b1ackd0t c8f841f8f3 MF-1588 - Update Subscriber interface (#1598)
* Initial commit

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update subscriber interface

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Add tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Add tests

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* check subscription map

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Check topic id after topic

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* reword description

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Setup empty queue

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change mqtt implementation

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Switch statements

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Simplify

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change mqtt subscriber

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Protect subscription map

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Fix subscription

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Set client id

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Format

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Change delete method

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-05-03 18:02:19 +02:00
Arvindh b19ba0db7d MF-1525 - Add graceful stop for HTTP and GRPC servers (#1548)
* Add : errgroup to cmd/auth

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Handle graceful stop for auth service
Remove : errgroups from auth service

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Wait till server shutdown

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Change : instead of waitgroup changed to errgroups

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change : KillSignalHandler return type to error

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Empty Commit

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Context to http server shutdown
Rename : varaible from proto to protocol

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change : to default log level

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : Sign-off

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: graceful stop of http and grpc server

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Fix: typos and caps

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: Signed-off

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Rename: Func KillSignalHandler to SignalHandler
Add: SIGABRT

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Fix: auth service

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: timeout for grpc gracefulstop
Fix: typos

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add: .vscode folder to git ignore

Signed-off-by: Arvindh <arvindh91@gmail.com>

* change: variable name to stopWaitTime

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove: .vscode folder

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove: .vscode from .gitignore

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : logger to handlers

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Add : New line at end of .gitignore file

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Fix : variable naming
Add : graceful stop for timescale

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Remove : unsued NATS library from import

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Move: "https" and "https" to moved to const var

Signed-off-by: Arvindh <arvindh91@gmail.com>

* Move: "http" and "https" to moved to const var

Signed-off-by: Arvindh <arvindh91@gmail.com>

* update:  branch with master

Signed-off-by: Arvindh <arvindh91@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2022-05-03 13:57:54 +02:00
Dušan Borovčanin 195b78303f NOISSUE - Fix Nginx entrypoint script (#1597)
* Fix Nginx entrypoint script

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Update dependencies

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Fix NginX entrypoint

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Revert Makefile changes

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2022-04-26 18:41:22 +02:00
fuzhy 188778710f NOISSUE - Move invariant statements out of loop for cassandra-writer (#1596)
Signed-off-by: fuzhy <fuzhy1997@outlook.com>
2022-04-26 08:57:02 +02:00
5220 changed files with 111554 additions and 1075663 deletions
+3
View File
@@ -1,3 +1,6 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
.git
.github
build
+15
View File
@@ -0,0 +1,15 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
# CoAP is temporarily ignored since we don't have tests for it yet.
coverage:
ignore:
- "tools/*"
- "api/grpc/**"
- "cmd/*"
- "coap/**"
- "**/mocks/*"
- "*/middleware/*"
- "pkg/sid/mock.go"
- "pkg/tracing/utils.go"
- "pkg/prometheus/*"
+1 -1
View File
@@ -1 +1 @@
* @mainflux/maintainers
* @absmach/magistrala
-40
View File
@@ -1,40 +0,0 @@
<!--
The GitHub issue tracker is for bug reports and feature requests. General support can be found at
the following locations:
- Google group - https://groups.google.com/forum/#!forum/mainflux
- Gitter - https://gitter.im/mainflux/mainflux
-->
**FEATURE REQUEST**
1. Is there an open issue addressing this request? If it does, please add a "+1" reaction to the
existing issue, otherwise proceed to step 2.
2. Describe the feature you are requesting, as well as the possible use case(s) for it.
3. Indicate the importance of this feature to you (must-have, should-have, nice-to-have).
**BUG REPORT**
1. What were you trying to achieve?
2. What are the expected results?
3. What are the received results?
4. What are the steps to reproduce the issue?
5. In what environment did you encounter the issue?
6. Additional information you deem important:
**ENHANCEMENT**
1. Describe the enhancement you are requesting. Enhancements include:
- tests
- code refactor
- documentation
- research
- tooling
2. Indicate the importance of this enhancement to you (must-have, should-have, nice-to-have).
+52
View File
@@ -0,0 +1,52 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: Bug Report
description: File a bug/issue report. Make sure to search to see if an issue already exists for the bug you encountered.
title: "Bug: <title>"
labels: ["bug", "needs-review", "help wanted"]
body:
- type: textarea
attributes:
label: What were you trying to achieve?
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: What are the expected results?
description: A concise description of what you expected to happen.
validations:
required: true
- type: textarea
attributes:
label: What are the received results?
description: A concise description of what you received.
validations:
required: true
- type: textarea
attributes:
label: Steps To Reproduce
description: What are the steps to reproduce the issue?
placeholder: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: false
- type: textarea
attributes:
label: In what environment did you encounter the issue?
description: A concise description of the environment you encountered the issue in.
validations:
required: true
- type: textarea
attributes:
label: Additional information you deem important
description: |
Links? References? Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
+11
View File
@@ -0,0 +1,11 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
blank_issues_enabled: false
contact_links:
- name: Google group
url: https://groups.google.com/forum/#!forum/mainflux
about: Join the Magistrala community on Google group.
- name: Gitter
url: https://gitter.im/mainflux/mainflux
about: Join the Magistrala community on Gitter.
@@ -0,0 +1,39 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: Feature Request
description: File a feature request. Make sure to search to see if a request already exists for the feature you are requesting.
title: "Feature: <title>"
labels: ["enchancement", "needs-review"]
body:
- type: textarea
attributes:
label: Is your feature request related to a problem? Please describe.
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: true
- type: textarea
attributes:
label: Describe the feature you are requesting, as well as the possible use case(s) for it.
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: dropdown
attributes:
label: Indicate the importance of this feature to you.
description: This will help us prioritize the feature request.
options:
- Must-have
- Should-have
- Nice-to-have
validations:
required: true
- type: textarea
attributes:
label: Anything else?
description: |
Links? References? Anything that will give us more context about the feature that you are requesting.
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
+62 -8
View File
@@ -1,15 +1,69 @@
Pull request title should be `MF-XXX - description` or `NOISSUE - description` where XXX is ID of issue that this PR relate to.
Please review the [CONTRIBUTING.md](./CONTRIBUTING.md) file for detailed contributing guidelines.
<!-- Copyright (c) Abstract Machines
SPDX-License-Identifier: Apache-2.0 -->
### What does this do?
<!--
### Which issue(s) does this PR fix/relate to?
Put here `Resolves #XXX` to auto-close the issue that your PR fixes (if such)
Pull request title should be `MG-XXX - description` or `NOISSUE - description` where XXX is ID of the issue that this PR relate to.
Please review the [CONTRIBUTING.md](https://github.com/absmach/magistrala/blob/main/CONTRIBUTING.md) file for detailed contributing guidelines.
### List any changes that modify/break current functionality
For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details.
### Have you included tests for your changes?
For a timely review/response, please avoid force-pushing additional commits if your PR already received reviews or comments.
### Did you document any new/modified functionality?
- Provide tests for your changes.
- Use descriptive commit messages.
- Comment your code where appropriate.
- Squash your commits
- Update any related documentation.
-->
# What type of PR is this?
<!--This represents the type of PR you are submitting.
For example:
This is a bug fix because it fixes the following issue: #1234
This is a feature because it adds the following functionality: ...
This is a refactor because it changes the following functionality: ...
This is a documentation update because it updates the following documentation: ...
This is a dependency update because it updates the following dependencies: ...
This is an optimization because it improves the following functionality: ...
-->
## What does this do?
<!--
Please provide a brief description of what this PR is intended to do.
Include List any changes that modify/break current functionality.
-->
## Which issue(s) does this PR fix/relate to?
<!--
For pull requests that relate or close an issue, please include them below. We like to follow [Github's guidance on linking issues to pull requests](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).
For example having the text: "Resolves #1234" would connect the current pull request to issue 1234. And when we merge the pull request, Github will automatically close the issue.
-->
- Related Issue #
- Resolves #
## Have you included tests for your changes?
<!--If you have not included tests, please explain why.
For example:
Yes, I have included tests for my changes.
No, I have not included tests because I do not know how to.
-->
## Did you document any new/modified feature?
<!--If you have not included documentation, please explain why.
For example:
Yes, I have updated the documentation for the new feature.
No, I have not updated the documentation because I do not know how to.
-->
### Notes
<!--Please provide any additional information you feel is important.-->
+43
View File
@@ -0,0 +1,43 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "./.github/workflows"
target-branch: "main"
schedule:
interval: "weekly"
day: "monday"
time: "06:00"
timezone: "Europe/Paris"
groups:
gh-dependency:
patterns:
- "*"
- package-ecosystem: "gomod"
directory: "/"
target-branch: "main"
schedule:
interval: "weekly"
day: "monday"
time: "06:15"
timezone: "Europe/Paris"
groups:
go-dependency:
patterns:
- "*"
- package-ecosystem: "docker"
directory: "/docker"
target-branch: "main"
schedule:
interval: "weekly"
day: "monday"
time: "06:30"
timezone: "Europe/Paris"
groups:
docker-dependency:
patterns:
- "*"
+181
View File
@@ -0,0 +1,181 @@
<!--
Copyright (c) Abstract Machines
SPDX-License-Identifier: Apache-2.0
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Magistrala API Documentation</title>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.30.3/swagger-ui.css">
<style>
body {
margin: 0;
padding: 0;
}
.topbar {
display: none;
}
.service-selector {
background: #1b1b1b;
padding: 20px;
text-align: center;
}
.service-selector h1 {
color: #fff;
margin: 0 0 15px 0;
font-family: sans-serif;
}
.service-dropdown-container {
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
}
.service-dropdown-container label {
color: #fff;
font-family: sans-serif;
font-size: 14px;
font-weight: 500;
}
.service-dropdown {
background: #2d2d2d;
color: white;
border: 1px solid #4990e2;
padding: 10px 40px 10px 15px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
min-width: 200px;
appearance: none;
background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23ffffff" d="M6 9L1 4h10z"/></svg>');
background-repeat: no-repeat;
background-position: right 12px center;
}
.service-dropdown:hover {
background-color: #3a3a3a;
border-color: #357abd;
}
.service-dropdown:focus {
outline: none;
border-color: #4990e2;
box-shadow: 0 0 0 2px rgba(73, 144, 226, 0.3);
}
/* Responsive styles for mobile */
@media (max-width: 768px) {
.service-selector {
padding: 15px 10px;
}
.service-selector h1 {
font-size: 1.5rem;
margin: 0 0 12px 0;
}
.service-dropdown-container {
flex-direction: column;
gap: 8px;
}
.service-dropdown-container label {
font-size: 13px;
}
.service-dropdown {
width: 100%;
max-width: 300px;
min-width: auto;
font-size: 13px;
padding: 8px 35px 8px 12px;
}
}
@media (max-width: 480px) {
.service-selector h1 {
font-size: 1.25rem;
}
.service-dropdown {
max-width: 250px;
}
}
</style>
</head>
<body>
<div class="service-selector">
<h1>Magistrala API Documentation</h1>
<div class="service-dropdown-container">
<label for="serviceDropdown">Select Service:</label>
<select id="serviceDropdown" class="service-dropdown"></select>
</div>
</div>
<div id="swagger-ui"></div>
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.30.3/swagger-ui-bundle.js"></script>
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.30.3/swagger-ui-standalone-preset.js"></script>
<script>
// Available API specifications
const APIs = APIS_PLACEHOLDER;
// Get the service from URL query parameter, default to first service
function getServiceFromURL() {
const params = new URLSearchParams(window.location.search);
const service = params.get('service');
return service && APIs.includes(service) ? service : APIs[0];
}
// Update URL with selected service
function updateURL(service) {
const url = new URL(window.location);
url.searchParams.set('service', service);
window.history.pushState({}, '', url);
}
// Create service selector dropdown
function createServiceDropdown() {
const dropdown = document.getElementById('serviceDropdown');
const currentService = getServiceFromURL();
APIs.forEach(api => {
const option = document.createElement('option');
option.value = api;
let serviceName = api.replace('.yaml', '').replace(/^\w/, c => c.toUpperCase());
if (serviceName.toLowerCase() === 'http') {
serviceName = 'HTTP';
}
option.textContent = serviceName;
if (api === currentService) {
option.selected = true;
}
dropdown.appendChild(option);
});
// Handle dropdown change
dropdown.addEventListener('change', (e) => {
const selectedApi = e.target.value;
loadSwaggerUI(selectedApi);
updateURL(selectedApi);
});
}
// Load Swagger UI with specified API spec
function loadSwaggerUI(apiSpec) {
SwaggerUIBundle({
url: apiSpec,
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
});
}
// Initialize
createServiceDropdown();
loadSwaggerUI(getServiceFromURL());
</script>
</body>
</html>
+244
View File
@@ -0,0 +1,244 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: Property Based Tests
on:
push:
branches:
- main
paths:
- ".github/workflows/api-tests.yaml"
- "api/**"
- "internal/atom/**"
- "channels/api/http/**"
- "clients/api/http/**"
- "domains/api/http/**"
- "groups/api/http/**"
- "users/api/**"
- "bootstrap/api/**"
- "certs/api/http/**"
- "readers/api/http/**"
- "apidocs/openapi/**"
pull_request:
branches:
- main
paths:
- ".github/workflows/api-tests.yaml"
- "api/**"
- "internal/atom/**"
- "channels/api/http/**"
- "clients/api/http/**"
- "domains/api/http/**"
- "groups/api/http/**"
- "users/api/**"
- "bootstrap/api/**"
- "certs/api/http/**"
- "readers/api/http/**"
- "apidocs/openapi/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ATOM_LOGIN_URL: http://localhost/auth/login
USER_IDENTITY: admin
USER_SECRET: 12345678
DOMAIN_NAME: demo-test
USERS_URL: http://localhost
DOMAIN_URL: http://localhost
CLIENTS_URL: http://localhost
CHANNELS_URL: http://localhost
GROUPS_URL: http://localhost
BOOTSTRAP_URL: http://localhost:9013
CERTS_URL: http://localhost:9019
READERS_URL: http://localhost:9011
jobs:
api-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache-dependency-path: "go.sum"
- name: Check for changes in specific paths
uses: dorny/paths-filter@v4
id: changes
with:
filters: |
workflow:
- ".github/workflows/api-tests.yaml"
domains:
- "apidocs/openapi/domains.yaml"
- "internal/atom/**"
- "domains/api/http/**"
clients:
- "apidocs/openapi/clients.yaml"
- "internal/atom/**"
- "clients/api/http/**"
channels:
- "apidocs/openapi/channels.yaml"
- "internal/atom/**"
- "channels/api/http/**"
groups:
- "apidocs/openapi/groups.yaml"
- "internal/atom/**"
- "groups/api/http/**"
users:
- "apidocs/openapi/users.yaml"
- "internal/atom/**"
- "users/api/**"
bootstrap:
- "apidocs/openapi/bootstrap.yaml"
- "bootstrap/api/**"
certs:
- "apidocs/openapi/certs.yaml"
- "certs/api/http/**"
readers:
- "apidocs/openapi/readers.yaml"
- "readers/api/http/**"
- name: Build images
run: make all -j $(nproc) && make dockers_dev -j $(nproc)
- name: Provision Atom service tokens
run: make provision_atom_tokens
- name: Start containers
run: make run_latest_ci up args="-d" && make run_addons up args="-d"
- name: Wait for services to be ready
run: |
echo "Waiting for services to start..."
sleep 15
# Check if services are responding
for i in {1..30}; do
if curl -f -s http://localhost/health > /dev/null 2>&1; then
echo "Services are ready!"
exit 0
fi
echo "Waiting for services... ($i/30)"
sleep 2
done
echo "Services failed to become ready" >&2
docker compose -f docker/docker-compose.yaml -f docker/docker-compose-ci.yaml --env-file docker/.env --env-file docker/.env.tokens -p "${USER_REPO:-absmach_magistrala}" ps || true
docker logs --tail 100 magistrala-nginx || true
docker logs --tail 100 magistrala-atom || true
docker logs --tail 100 magistrala-atom-bootstrap || true
exit 1
- name: Set access token
run: |
export USER_TOKEN=$(curl -fsS -X POST "$ATOM_LOGIN_URL" -H "Content-Type: application/json" -d "{\"identifier\":\"$USER_IDENTITY\",\"secret\":\"$USER_SECRET\",\"kind\":\"password\"}" | jq -er .token)
echo "USER_TOKEN=$USER_TOKEN" >> $GITHUB_ENV
- name: Run Users API tests
if: (steps.changes.outputs.users == 'true' || steps.changes.outputs.workflow == 'true') && hashFiles('users/api/**') != ''
uses: schemathesis/action@v3.0.0
with:
schema: apidocs/openapi/users.yaml
base-url: ${{ env.USERS_URL }}
checks: all
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --suppress-health-check=filter_too_much --exclude-checks=positive_data_acceptance --exclude-operation-id=requestPasswordReset --phases=examples'
coverage-artifact-name: schema-coverage-users
coverage-pr-comment: false
- name: Run Groups API tests
if: (steps.changes.outputs.groups == 'true' || steps.changes.outputs.workflow == 'true') && hashFiles('groups/api/http/**') != ''
uses: schemathesis/action@v3.0.0
with:
schema: apidocs/openapi/groups.yaml
base-url: ${{ env.GROUPS_URL }}
checks: all
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --suppress-health-check=filter_too_much --exclude-checks=positive_data_acceptance --phases=examples'
coverage-artifact-name: schema-coverage-groups
coverage-pr-comment: false
- name: Run Clients API tests
if: (steps.changes.outputs.clients == 'true' || steps.changes.outputs.workflow == 'true') && hashFiles('clients/api/http/**') != ''
uses: schemathesis/action@v3.0.0
with:
schema: apidocs/openapi/clients.yaml
base-url: ${{ env.CLIENTS_URL }}
checks: all
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --suppress-health-check=filter_too_much --exclude-checks=positive_data_acceptance --phases=examples'
coverage-artifact-name: schema-coverage-clients
coverage-pr-comment: false
- name: Run Channels API tests
if: (steps.changes.outputs.channels == 'true' || steps.changes.outputs.workflow == 'true') && hashFiles('channels/api/http/**') != ''
uses: schemathesis/action@v3.0.0
with:
schema: apidocs/openapi/channels.yaml
base-url: ${{ env.CHANNELS_URL }}
checks: all
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --suppress-health-check=filter_too_much --exclude-checks=positive_data_acceptance --phases=examples'
coverage-artifact-name: schema-coverage-channels
coverage-pr-comment: false
- name: Run Domains API tests
if: (steps.changes.outputs.domains == 'true' || steps.changes.outputs.workflow == 'true') && hashFiles('domains/api/http/**') != ''
uses: schemathesis/action@v3.0.0
with:
schema: apidocs/openapi/domains.yaml
base-url: ${{ env.DOMAIN_URL }}
checks: all
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --suppress-health-check=filter_too_much --exclude-checks=positive_data_acceptance --phases=examples'
coverage-artifact-name: schema-coverage-domains
coverage-pr-comment: false
- name: Run Bootstrap API tests
if: (steps.changes.outputs.bootstrap == 'true' || steps.changes.outputs.workflow == 'true') && hashFiles('bootstrap/api/**') != ''
uses: schemathesis/action@v3.0.0
with:
schema: apidocs/openapi/bootstrap.yaml
base-url: ${{ env.BOOTSTRAP_URL }}
checks: all
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --suppress-health-check=filter_too_much --exclude-checks=positive_data_acceptance --phases=examples'
coverage-artifact-name: schema-coverage-bootstrap
coverage-pr-comment: false
- name: Run Certs API tests
if: (steps.changes.outputs.certs == 'true' || steps.changes.outputs.workflow == 'true') && hashFiles('docker/addons/certs/docker-compose.yaml') != ''
uses: schemathesis/action@v3.0.0
with:
schema: apidocs/openapi/certs.yaml
base-url: ${{ env.CERTS_URL }}
checks: all
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --suppress-health-check=filter_too_much --exclude-checks=positive_data_acceptance --phases=examples'
coverage-artifact-name: schema-coverage-certs
coverage-pr-comment: false
- name: Run Readers API tests
if: steps.changes.outputs.readers == 'true' || steps.changes.outputs.workflow == 'true'
uses: schemathesis/action@v3.0.0
with:
schema: apidocs/openapi/readers.yaml
base-url: ${{ env.READERS_URL }}
checks: all
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --suppress-health-check=filter_too_much --exclude-checks=positive_data_acceptance --phases=examples'
coverage-artifact-name: schema-coverage-readers
coverage-pr-comment: false
- name: Stop containers
if: always()
run: make run_latest_ci down args="-v" && make run_addons down args="-v"
+59
View File
@@ -0,0 +1,59 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: Continuous Delivery
on:
push:
branches:
- main
paths-ignore:
- "**/*.md"
- "docs/**"
- ".github/workflows/**"
- "LICENSE"
- "MAINTAINERS"
- "CODEOWNERS"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
lint-and-build:
uses: ./.github/workflows/lint-and-build.yaml
build-and-push:
name: Build and Push Docker Images
runs-on: ubuntu-latest
needs: [lint-and-build]
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache-dependency-path: "go.sum"
- name: Set up Docker Build
uses: docker/setup-buildx-action@v4
- name: Login to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
run: |
make latest -j $(nproc)
@@ -0,0 +1,128 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: Check the consistency of generated files
on:
pull_request:
branches:
- main
jobs:
check-generated-files:
runs-on: ubuntu-latest
env:
PROTOC_VERSION: "35.1"
PROTOC_GEN_GO_VERSION: "v1.36.11"
PROTOC_GEN_GO_GRPC_VERSION: "v1.6.2"
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Install Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache-dependency-path: "go.sum"
- name: Set GOBIN
run: echo "GOBIN=$HOME/.local/bin" >> $GITHUB_ENV
- name: Add GOBIN to PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Check for changes in go.mod
run: |
go mod tidy
git diff --exit-code
- name: Check for changes in specific paths
uses: dorny/paths-filter@v4
id: changes
with:
base: main
filters: |
proto:
- ".github/workflows/check-generated-files.yaml"
- "auth.proto"
- "auth/*.pb.go"
- "pkg/messaging/message.proto"
- "pkg/messaging/*.pb.go"
mocks:
- "tools/config/.mockery.yaml"
- ".github/workflows/check-generated-files.yaml"
- "pkg/sdk/sdk.go"
- "users/postgres/clients.go"
- "users/clients.go"
- "pkg/clients/clients.go"
- "pkg/messaging/pubsub.go"
- "clients/postgres/clients.go"
- "clients/clients.go"
- "pkg/authz.go"
- "pkg/authn.go"
- "auth/domains.go"
- "auth/keys.go"
- "auth/service.go"
- "pkg/events/events.go"
- "pkg/groups/groups.go"
- "users/emailer.go"
- "users/hasher.go"
- "consumers/notifier.go"
- name: Install Protoc
if: steps.changes.outputs.proto == 'true'
uses: arduino/setup-protoc@v3
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Go Protobuf Plugins
if: steps.changes.outputs.proto == 'true'
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@$PROTOC_GEN_GO_VERSION
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@$PROTOC_GEN_GO_GRPC_VERSION
- name: Check Protobuf is up to Date
if: steps.changes.outputs.proto == 'true'
run: |
for p in $(find . -name "*.pb.go"); do
mv $p $p.tmp
done
make proto
for p in $(find . -name "*.pb.go"); do
if ! cmp -s $p $p.tmp; then
echo "Error: Proto file and generated Go file $p are out of sync!"
echo "Here is the difference:"
diff $p $p.tmp || true
echo "Please run 'make proto' with protoc version $PROTOC_VERSION, protoc-gen-go version $PROTOC_GEN_GO_VERSION and protoc-gen-go-grpc version $PROTOC_GEN_GO_GRPC_VERSION and commit the changes."
exit 1
fi
done
- name: Check Mocks are up to Date
if: steps.changes.outputs.mocks == 'true'
run: |
for f in $(find . -type f -path '*/mocks/*.go' ! -name 'doc.go'); do
mv $f $f.tmp
done
make mocks
check_mock_changes() {
local file_path=$1
local tmp_file_path=$1.tmp
local entity_name=$2
if ! cmp -s "$file_path" "$tmp_file_path"; then
echo "Error: Generated mocks for $entity_name are out of sync!"
echo "Please run 'make mocks' with mockery version $MOCKERY_VERSION and commit the changes."
exit 1
fi
}
for f in $(find . -type f -path '*/mocks/*.go' ! -name 'doc.go'); do
check_mock_changes $f "$f"
done
+37
View File
@@ -0,0 +1,37 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: Check License Header
on:
pull_request:
branches:
- main
jobs:
check-license:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Check License Header
run: |
CHECK=""
for file in $(grep -rl --exclude-dir={.git,build} \
--exclude=\*.{crt,key,pem,zed,hcl,md,json,csv,mod,sum,tmpl,args} \
--exclude={CODEOWNERS,LICENSE,MAINTAINERS,enabled_plugins,rabbitmq.conf} \
.); do
if ! head -n 5 "$file" | grep -q "Copyright (c) Abstract Machines"; then
CHECK="$CHECK $file"
fi
done
if [ "$CHECK" ]; then
echo "License header check failed. Fix the following files:"
echo "$CHECK"
exit 1
else
echo "All files have the correct license header!"
fi
+63
View File
@@ -0,0 +1,63 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: Lint and Build
on:
workflow_call:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Setup Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache-dependency-path: "go.sum"
- name: Run linters
uses: golangci/golangci-lint-action@v9.3.0
with:
version: v2.10.1
args: --config ./tools/config/.golangci.yaml
build:
name: Build All Binaries
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Setup Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache-dependency-path: "go.sum"
- name: Build all binaries
run: |
make all -j $(nproc)
compile-check:
name: Compile Check Redis Event Store
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Setup Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache-dependency-path: "go.sum"
- name: Compile check
run: |
MG_ES_TYPE=es_redis make all -j $(nproc)
-26
View File
@@ -1,26 +0,0 @@
name: Deploy GitHub Pages
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Swagger ui action
id: swagger-ui-action
uses: blokovi/swagger-ui-action@main
with:
dir: './api/openapi'
pattern: '*.yml'
debug: 'true'
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: swagger-ui
cname: api.mainflux.io
+45
View File
@@ -0,0 +1,45 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: Deploy GitHub Pages
on:
push:
branches:
- main
permissions:
contents: write
jobs:
swagger-ui:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Build Swagger UI
run: |
# Create output directory
mkdir -p swagger-ui
# Copy OpenAPI YAML files and schemas directory
cp apidocs/openapi/*.yaml swagger-ui/
cp -r apidocs/openapi/schemas swagger-ui/
# Get list of YAML files
cd apidocs/openapi
YAML_FILES=$(ls *.yaml | jq -R -s -c 'split("\n")[:-1]')
cd ../..
# Generate index.html from template
sed "s|APIS_PLACEHOLDER|$YAML_FILES|g" .github/swagger-ui-template.html > swagger-ui/index.html
echo "Generated Swagger UI with APIs: $YAML_FILES"
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./swagger-ui
cname: docs.api.magistrala.absmach.eu
+306
View File
@@ -0,0 +1,306 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: CI Pipeline
on:
push:
branches:
- main
paths-ignore:
- '**/*.md'
- 'docs/**'
- 'LICENSE'
- 'MAINTAINERS'
- 'CODEOWNERS'
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-proto:
name: Lint Proto
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v7
- name: Setup Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache-dependency-path: "go.sum"
- name: Install protolint
run: |
go install github.com/yoheimuta/protolint/cmd/protolint@latest
- name: Lint Protobuf Files
run: |
protolint .
lint-and-build:
needs: [lint-proto]
uses: ./.github/workflows/lint-and-build.yaml
detect-changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
modules: ${{ steps.set-matrix.outputs.modules }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Check for changes in specific paths
uses: dorny/paths-filter@v4
id: changes
with:
filters: |
workflow:
- ".github/workflows/tests.yaml"
channels:
- "channels/**"
- "pkg/sdk/**"
- "clients/api/grpc/**"
- "groups/api/grpc/**"
- "domains/api/grpc/**"
- "internal/grpc/**"
cli:
- "cli/**"
- "cmd/cli/**"
- "pkg/sdk/**"
clients:
- "clients/**"
- "pkg/ulid/**"
- "pkg/uuid/**"
- "pkg/events/**"
- "groups/api/grpc/**"
- "channels/api/grpc/**"
- "domains/api/grpc/**"
- "internal/grpc/**"
domains:
- "domains/**"
- "internal/grpc/**"
groups:
- "groups/**"
- "pkg/ulid/**"
- "pkg/uuid/**"
- "clients/api/grpc/**"
- "channels/api/grpc/**"
- "domains/api/grpc/**"
- "internal/grpc/**"
internal:
- "internal/**"
logger:
- "logger/**"
pkg-atom:
- "pkg/atom/**"
pkg-email:
- "pkg/email/**"
- "pkg/emailer/**"
pkg-readersclient:
- "pkg/readersclient/**"
pkg-testsutil:
- "pkg/testsutil/**"
pkg-errors:
- "pkg/errors/**"
pkg-events:
- "pkg/events/**"
- "pkg/messaging/**"
pkg-grpcclient:
- "pkg/grpcclient/**"
pkg-messaging:
- "pkg/messaging/**"
pkg-sdk:
- "pkg/sdk/**"
- "pkg/errors/**"
- "pkg/groups/**"
- "internal/*"
- "clients/**"
- "users/**"
- "channels/**"
- "domains/**"
- "groups/**"
- "api/http/**"
pkg-transformers:
- "pkg/transformers/**"
pkg-ulid:
- "pkg/ulid/**"
pkg-uuid:
- "pkg/uuid/**"
users:
- "users/**"
- "pkg/ulid/**"
- "pkg/uuid/**"
- "pkg/events/**"
api:
- "api/**"
consumers:
- "consumers/**"
- "cmd/postgres-writer/**"
- "cmd/timescale-writer/**"
- "cmd/smpp-notifier/**"
- "cmd/smtp-notifier/**"
readers:
- "readers/**"
- "cmd/postgres-reader/**"
- "cmd/timescale-reader/**"
- name: Set matrix for changed modules
id: set-matrix
run: |
modules=()
if [[ "${{ steps.changes.outputs.workflow }}" == "true" || "${{ steps.changes.outputs.pkg-errors }}" == "true" || "${{ steps.changes.outputs.pkg-testsutil }}" == "true" ]]; then
# If workflow, shared errors, or test utilities changed, test everything
modules=("auth" "channels" "cli" "clients" "domains" "groups" "internal" "logger" "pkg-atom" "pkg-email" "pkg-errors" "pkg-events" "pkg-grpcclient" "pkg-messaging" "pkg-readersclient" "pkg-sdk" "pkg-testsutil" "pkg-transformers" "pkg-ulid" "pkg-uuid" "users" "api" "consumers" "readers")
else
# Add only changed modules
[[ "${{ steps.changes.outputs.auth }}" == "true" ]] && modules+=("auth")
[[ "${{ steps.changes.outputs.channels }}" == "true" ]] && modules+=("channels")
[[ "${{ steps.changes.outputs.cli }}" == "true" ]] && modules+=("cli")
[[ "${{ steps.changes.outputs.clients }}" == "true" ]] && modules+=("clients")
[[ "${{ steps.changes.outputs.domains }}" == "true" ]] && modules+=("domains")
[[ "${{ steps.changes.outputs.groups }}" == "true" ]] && modules+=("groups")
[[ "${{ steps.changes.outputs.internal }}" == "true" ]] && modules+=("internal")
[[ "${{ steps.changes.outputs.logger }}" == "true" ]] && modules+=("logger")
[[ "${{ steps.changes.outputs.pkg-atom }}" == "true" ]] && modules+=("pkg-atom")
[[ "${{ steps.changes.outputs.pkg-email }}" == "true" ]] && modules+=("pkg-email")
[[ "${{ steps.changes.outputs.pkg-errors }}" == "true" ]] && modules+=("pkg-errors")
[[ "${{ steps.changes.outputs.pkg-events }}" == "true" ]] && modules+=("pkg-events")
[[ "${{ steps.changes.outputs.pkg-grpcclient }}" == "true" ]] && modules+=("pkg-grpcclient")
[[ "${{ steps.changes.outputs.pkg-messaging }}" == "true" ]] && modules+=("pkg-messaging")
[[ "${{ steps.changes.outputs.pkg-readersclient }}" == "true" ]] && modules+=("pkg-readersclient")
[[ "${{ steps.changes.outputs.pkg-sdk }}" == "true" ]] && modules+=("pkg-sdk")
[[ "${{ steps.changes.outputs.pkg-transformers }}" == "true" ]] && modules+=("pkg-transformers")
[[ "${{ steps.changes.outputs.pkg-ulid }}" == "true" ]] && modules+=("pkg-ulid")
[[ "${{ steps.changes.outputs.pkg-uuid }}" == "true" ]] && modules+=("pkg-uuid")
[[ "${{ steps.changes.outputs.users }}" == "true" ]] && modules+=("users")
[[ "${{ steps.changes.outputs.api }}" == "true" ]] && modules+=("api")
[[ "${{ steps.changes.outputs.consumers }}" == "true" ]] && modules+=("consumers")
[[ "${{ steps.changes.outputs.readers }}" == "true" ]] && modules+=("readers")
fi
# Convert to JSON array
json_modules=$(printf '%s\n' "${modules[@]}" | jq -R . | jq -s -c .)
echo "modules=$json_modules" >> $GITHUB_OUTPUT
echo "Testing modules: $json_modules"
run-tests:
name: Test ${{ matrix.module }}
runs-on: ubuntu-latest
needs: [lint-and-build, detect-changes]
if: needs.detect-changes.outputs.modules != '[]'
strategy:
fail-fast: true
max-parallel: 20
matrix:
module: ${{ fromJSON(needs.detect-changes.outputs.modules) }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache-dependency-path: "go.sum"
- name: Verify dependencies
run: |
go mod download
go mod verify
- name: Run ${{ matrix.module }} tests
run: |
# Map module names to directories
case "${{ matrix.module }}" in
pkg-atom) dir="pkg/atom" ;;
pkg-email) dir="pkg/email" ;;
pkg-errors) dir="pkg/errors" ;;
pkg-events) dir="pkg/events" ;;
pkg-grpcclient) dir="pkg/grpcclient" ;;
pkg-messaging) dir="pkg/messaging" ;;
pkg-readersclient) dir="pkg/readersclient" ;;
pkg-sdk) dir="pkg/sdk" ;;
pkg-testsutil) dir="pkg/testsutil" ;;
pkg-transformers) dir="pkg/transformers" ;;
pkg-ulid) dir="pkg/ulid" ;;
pkg-uuid) dir="pkg/uuid" ;;
channels) dir="pkg/channels" ;;
clients) dir="pkg/clients" ;;
domains) dir="pkg/domains" ;;
groups) dir="pkg/groups" ;;
*) dir="${{ matrix.module }}" ;;
esac
if [[ ! -d "$dir" ]]; then
echo "Skipping ${{ matrix.module }}; ./$dir is not present in this branch"
echo "mode: atomic" > coverage-${{ matrix.module }}.out
exit 0
fi
go test -mod=readonly --race -v -count=1 -failfast -coverprofile=coverage-${{ matrix.module }}.out ./$dir/...
- name: Upload coverage
uses: actions/upload-artifact@v7
with:
name: coverage-${{ matrix.module }}
path: coverage-${{ matrix.module }}.out
retention-days: 1
upload-coverage:
name: Upload Coverage
runs-on: ubuntu-latest
needs: run-tests
if: always() && needs.run-tests.result != 'cancelled'
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Download all coverage artifacts
uses: actions/download-artifact@v8
with:
pattern: coverage-*
path: coverage
merge-multiple: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV }}
directory: ./coverage
files: ./coverage/*.out
fail_ci_if_error: false
verbose: true
+25 -4
View File
@@ -1,8 +1,29 @@
# Copyright (c) Mainflux
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
# Set your private global .gitignore:
# https://digitalfortress.tech/tricks/creating-a-global-gitignore/
# build dirs
build
# tools
tools/e2e/e2e
tools/mqtt-bench/mqtt-bench
tools/provision/provision
tools/provision/mgconn.toml
# coverage files
coverage
# Schemathesis
.hypothesis
# Ignore Openbao data directory as it contains runtime-generated data
docker/addons/certs/openbao/
# Ignore generated local Atom service tokens.
docker/.env.tokens
# Ignore SeaweedFS data directory as it contains runtime-generated data
docker/data/*
demo-ui
node_modules
+6 -6
View File
@@ -1,12 +1,12 @@
# Adopters
As Mainflux Community grows, we'd like to keep track of Mainflux adopters to grow the community, contact other users, share experiences and best practices.
As Magistrala Community grows, we'd like to keep track of Magistrala adopters to grow the community, contact other users, share experiences and best practices.
To accomplish this, we created a public ledger. The list of organizations and users who consider themselves as Mainflux adopters and that **publicly/officially** shared information and/or details of their adoption journey(optional).
To accomplish this, we created a public ledger. The list of organizations and users who consider themselves as Magistrala adopters and that **publicly/officially** shared information and/or details of their adoption journey(optional).
Where users themselves directly maintain the list.
## Adding yourself as an adopter
If you are using Mainflux, please consider adding yourself as an adopter with a brief description of your use case by opening a pull request to this file and adding a section describing your adoption of Mainflux technology.
If you are using Magistrala, please consider adding yourself as an adopter with a brief description of your use case by opening a pull request to this file and adding a section describing your adoption of Magistrala technology.
**Please send PRs to add or remove organizations/users**
@@ -25,12 +25,12 @@ Pull request commit must be [signed](https://docs.github.com/en/github/authentic
* There is no minimum requirement or adaptation size, but we request to list permanent deployments only, i.e., no demo or trial deployments. Commercial or production use is not required. A well-done home lab setup can be equally impressive as a large-scale commercial deployment.
**The list of organizations/users that have publicly shared the usage of Mainflux:**
**The list of organizations/users that have publicly shared the usage of Magistrala:**
**Note**: Several other organizations/users couldn't publicly share their usage details but are active project contributors and Mainflux Community members.
**Note**: Several other organizations/users couldn't publicly share their usage details but are active project contributors and Magistrala Community members.
## Adopters list (alphabetical)
**Note:** The list is maintained by the users themselves. If you find yourself on this list, and you think it's inappropriate. Please contact [project maintainers](https://github.com/mainflux/mainflux/blob/master/MAINTAINERS) and you will be permanently removed from the list.
**Note:** The list is maintained by the users themselves. If you find yourself on this list, and you think it's inappropriate. Please contact [project maintainers](https://github.com/absmach/magistrala/blob/main/MAINTAINERS) and you will be permanently removed from the list.
-708
View File
@@ -1,708 +0,0 @@
# Mainflux Changelog
## Generation
Mainflux release notes for the latest release can be obtained via:
```
make changelog
```
Otherwise, whole log in a similar format can be observed via:
```
git log --pretty=oneline --abbrev-commit
```
## 0.13.0 - 15. APR 2022.
### Features and Bugfixes
- NOISSUE - Update changelog for release 0.13.0
- Update VerneMQ release (#1593)
- NOISSUE - Update changelog and readme for release 0.13.0
- MF-1582 - Fix lora-adapter MQTT client (#1583)
- NOISSUE - Fix CoAP adapter (#1572)
- NOISSUE - Unify MF_INFLUX_READER_DB_HOST and MF_INFLUX_WRITER_DB_HOST envars (#1585)
- MF-1580 - Influxdb Writer changes format of update-time to string (#1581)
- MF-1575 Add 'Name' field to ListMembers response in things svc (#1576)
- MF-1565 - Document Bearer, Thing and Basic Authorization header (#1566)
- MF-1567 - Use Bearer, Thing or Basic scheme in Authorization header (#1568)
- MF-1348 - Add transport errors logging (#1544)
- NOISSUE - Add nats wrapper for COAP (#1569)
- MF-1469 - Indicate proper authentication scheme in Authorization header (#1523)
- MF-1240 - Return to service transport layer only service errors (#1559)
- Update dependencies (#1564)
- NOISSUE - Separate Keto hosts for read and write (#1563)
- MF-1551 - Fix Cobra usage commands and clean unnecessary struct types (#1558)
- MF-1257 - Access messages from readers endpoint with user access token (#1470)
- NOISSUE - Refactor MQTT subscriber (#1561)
- MF-1059 - Add TLS support for email (#1560)
- MF-1261 - Use StatusUnauthorized for authn and StatusForbidden for authz (#1538)
- NOISSUE - Fix auth members list response (#1555)
- MF-1263 - Move repeating errors to the separate package (#1540)
- NOISSUE - Add API keys functions to CLI (#1537)
- Fix SDK for group members (#1553)
- NOISSUE - Fix Swagger UI (#1552)
- MF-1008 - Make token duration configurable (#1550)
- MF-1308 - Use IETF Health Check standard (#1541)
- Fix user listing access control (#1546)
- Update dependencies (#1545)
- MF-1478 - TimescaleDB writer and reader add-on (#1542)
- MF-1149 - Add AsyncAPI MQTT API doc (#1539)
- MF-1535 - Add API keys functions to SDK (#1536)
- NOISSUE - Add view and list serials endpoints in certs service (#1483)
- MF-1516 - Fix API key issuing (#1530)
- NOISSUE - Add disconnect endpoint in nginx conf (#1528)
- NOISSUE - Add timestamp transformation rules for specifc JSON fields (#1514)
- MF-1425 - Support external UUIDs for Things and Channels (#1518)
- MF-1521 - Fix email headers (#1522)
- Fix SenML lib dependency version (#1519)
- Bump vernemq to 1.12.3 (#1520)
- NOISSUE - Remove auth URL from SDK (#1511)
- NOISSUE - Apply policies to Channels (#1505)
- remove dead code (#1503)
- NOISSUE - Fix listing (#1502)
- NOISSUE - Listing Policies (#1498)
- Fix standalone mode (#1497)
- MF-1489 - Add API for deleting policies (#1491)
- NOISSUE - Update group sharing policies (#1494)
- NOISSUE - Refactor InfluxDB Reader: explicit check event + add safe conversion (#1460)
- NOISSUE - Update users create command for CLI (#1495)
- NOISSUE - Update self register environment variable name (#1493)
- Bring back the job add
- NOISSUE - Fix assigning invalid group policy (#1487)
- MF-1443 - Add policies (#1482)
- NOISSUE - Fix retrieving all users (#1477)
- MF-1468 - Fix ThingsURL in Certs Service (#1474)
- NOISSUE - Refactor single-user mode (#1471)
- Fix UpdateChannelHandler for Redis producer (#1473)
- NOISSUE - Add SMPP notifier (#1464)
- NOISSUE - Update dependencies (#1453)
- NOISSUE - Fix security warnings for dependencies (#1452)
- Bump docker-compose version in prereq (#1449)
- NOISSUE - Fix bootstraping (#1448)
- MF 1413 - Use per-service URL in SDK (#1444)
- MF-1439 - Add support for Basic Authentication in HTTP Adapter (#1441)
- MF-1421 - Make flattening of JSON transformer only available on InfluxDB (#1432)
- NOISSUE - Update the /disconnect endpoint HTTP method as PUT (#1438)
- MF-1389 - Add /disconnect endpoint in Things service (#1433)
- NOISSUE - Fix httputil implementation in users service (#1434)
- Fix fetching user members of an empty group (#1436)
- Change to user friendly docs urls (#1430)
- NOISSUE - Use github action for showing OpenAPI spec with Swagger UI (#1427)
- Fix JSON Transformer empty format handling (#1429)
- Update README
- NOISSUE - Update docker-compose images to latest release (#1419)
- MF-1378 - Update dependencies (#1379)
## 0.12.1 - 05. MAY 2021.
### Features and Bugfixes
- NOISSUE - Refactor SDK memberships and fix openapi for memberships.
- NOISSUE - Fix incorrect influxdb credentials
- MF-1408 - Fix error handling for Thing update SQL(#1408)
- MF-1288 - Add tests for JSON messages in message writers and readers
- NOISSUE - Fix Postgres Reader order
- NOISSUE - Fix nginx configuration for groups
- NOISSUE - Add tests and connection route-map to lora-adapter
- MF-1403 - Change vernemq building source revision
- NOISSUE - Rm content-type check from list endpoint
## 0.12.0 - 29. MAR 2021.
### Features and Bugfixes
- MF-1394 - SDK groups (#1396)
- NOISSUE - fix response for passwd endpoints (#1393)
- NOISSUE - dont retrieve groups (#1392)
- MF-1368 - Add internal http api package for query params reading (#1384)
- MF-1390 - Fix docker-compose env_file (#1391)
- NOISSUE - put order direction in response body (#1387)
- NOISSUE - Certs service refactor (#1369)
- MF-1357 - Add new endpoint for searching things (#1383)
- NOISSUE - Add missing auth port in nginx enrypoint.sh (#1380)
- MF-1346 - Create Groups API - add grouping of entities (#1334)
- NOISSUE - Fix certs and vault deployment, reorganize and remove unnecessary vars (#1368)
- MF-1317 - Configurable regexp rule for password (#1355)
- Fix CoAP Adapter README (#1376)
- NOISSUE - Fix default values for port and x509 provision (#1367)
- NOISSUE - Added missing endpoints for users service (#1372)
- MF-1365 - Add ADOPTERS.md file (#1371)
- Fix grpc endpoint parameter permutation (#1370)
- NOISSUE - Add IsChannelOwner grpc endpoint (#1366)
- MF-1362 - Sort Things and Channels connections by name (#1363)
- MF-1314 - Add value comparison filters for readers (#1353)
- Fix env configuration and documentation (#1360)
- NOISSUE - Support disabling Email Agent authentication (#1356)
- NOISSUE - Upgrade Mongo, Cassandra and Influx docker images (#1354)
- NOISSUE - Add READMEs to pkg packages (#1352)
- NOISSUE - Correct README (#1349)
- MF-1342 - Use environment variables in docker-compose to use tagged version of image (#1343)
- MF-1311 - Add Notifications service (#1324)
- MF-1344 - Fix links to API documentations #1345
- NOISSUE - Upgrade influxdb and postgres docker images (#1341)
- NOISSUE - Revert cli to use user token from command args (#1339)
- MF-1276 - Fix openapi IDs and Keys format (#1338)
- MF-1061 - Add PageMetadata to readers (#1333)
- NOISSUE - Fix run script and compiler warnings (#1336)
- Fix Postgres writer transaction handling (#1335)
- Make Transformer type configurable (#1331)
- MF-1061 - Implement v, vb, vs, vd and from/to mongodb-reader filters (#1326)
- NOISSUE - Rename package aliases uuidProvider into uuid (#1323)
- MF-1034 - Wrapping MQTT client (#1318)
- MF-1061 - Fix cassandra-reader count for json format (#1327)
- MF-1061 - Implement v, vb, vs, vd and from/to cassandra-reader filters (#1325)
- NOISSUE - Switch to Consumers interface (#1316)
- MF-1061 - Implement protocol, name, v, vb, vs, vd and from/to Postgres reader… (#1322)
- MF-1061 - Add name, protocol and publisher tests to influxdb-reader (#1320)
- NOISSUE - Fix Auth typo (#1319)
- NOISSUE - Add health check for MQTT broker (#1305)
- MF-1264 - Add support for JSON readers (#1295)
- NOISSUE - Merge authz and authn into new service auth (#1313)
- MF-1061 - Implement InfluxDB filters value, v, vb, vs, vd, from, to (#1312)
- NOISSUE - Correct readers openapi.yml (#1310)
- NOISSUE - Fix MQTT Forwarder client id (#1309)
- NOISSUE - Fix dates not being init properly on save, change path construction, replace UUID with ULID for group ID (#1300)
- NOISSUE - Remove authz from docker comp (#1307)
- Shorten descriptions and add formats (#1306)
- NOISSUE - remove owner id from user table and object (#1303)
- NOISSUE - Add missing fields to openapi specs and enclose http codes in single quotes (#1302)
- MF-1290 - Sort Things and Channels by name (#1293)
- MF-1248 - Add access policies for users (#1246)
- Fixes, without spaces. (#1296)
- Add different CNs for CA and certs (#1292)
- MF-397 - Introduce Thing Groups (#1259)
- Add Enhancement section to the issue template (#1284)
- Fix hardcoded env var values (#1283)
- NOISSUE - Improve AuthN service docs (#1282)
- MF-1268 - CLI improvements (#1274)
- NOISSSUE - Vault integration as an addon. (#1266)
- Fix naming in Authn API tests (#1275)
- MF-1244 - Return UserID alongside with user Email in Identify response (#1245)
- NOISSUE - Fix ViewGroup and UpdateGroup (#1269)
- NOISSUE - Add ListUsers, ViewUser and ViewProfile methods (#1262)
- NOISSUE - Rm users http package (#1256)
- NOISSUE - Remove content-type check from decodeListUserGroupsRequest (#1255)
- NOISSUE - Migrate swaggers to openapi 3 spec (#1250)
- Update MQTT Broker Docker scripts (#1253)
- update mproxy version (#1251)
- NOISSUE - Fix group retrieval when parent id is not specified (#1247)
- NOISSUE - Add new endpoint to retrieve configuration to be used as a template. (#1242)
- NOISSUE - Add user groups (#1228)
- MF-1237 - Return to transport only things service errors (#1236)
- MF-928 - Change CoAP lib (#1233)
- NOISSUE - Simplify make cleandocker (#1230)
- NOISSUE - Fix malformed Swagger API specs (#1229)
- MF-435 - Add support for env file loading (#1223)
- update certs docs (#1227)
- NOISSUE - Fix certs update in bootstrap config and make content handling in config.toml user friendly (#1221)
- NOISSUE - Fix typo in authorization.js (#1226)
- MF-983 - Add HTTP query param to connections list endpoints to fetch disconnected Things or Channels (#1217)
- MF-1179 - Add a certificate service and certs endpoint to SDK (#1188)
- NOISUE - Fix cache error when key is not in Redis (#1220)
- MF-1199 - Add NATS messaging tests (#1209)
- NOISSUE: Fix emailer (#1219)
- NOISSUE - Update dependencies (#1218)
- NOISSUE - Add subtopic wildcard for twin attribute's definition (#1214)
- fix envs for nginx (#1215)
- Remove twin mqtt related obsolete var and fix es-redis address (#1213)
- NOISSUE - Remove unused `MF_THINGS_SECRET` env var (#1211)
- NOISSUE - Fix some typos (#1212)
- NOISSUE - Remove unknown Bootstrap requests (#1210)
- NOISSUE - Use `pgcrypto` instead `uuid-ossp` for UUIDs generation (version 4) (#1208)
- MF-1198 - Add errors package tests (#1207)
- MF-1025 - timeout env in sec, use parseduration (#1206)
- MF-1201 - Fix MF_THINGS_AUTH_GRPC_URL mongo reader ENVAR (#1203)
- NOISSUE - Fix CI (#1204)
- MF-1180 - Add redis based twins and states cache (#1184)
- MF-739 - Add ID to the User entity (#1152)
- NOISSUE - Fix default db name for storage databases (#1194)
- NOISSUE - Add `MF_DOCKER_IMAGE_NAME_PREFIX` to Makefile (#1173)
- MF-1154 - Move UUID provider to project root (#1172)
- Fix typo in error messages (#1193)
- MF-1190 - Add pkg for library packages (#1191)
- MF-1177 - Implement caching in MQTT adapter (#1187)
- NOISSUE - Refactor provision tool (#1189)
## 0.11.0 - 29. MAY 2020.
### Features and Bugfixes
- Add VerneMQ docker image build from source (#1178)
- MF-994 - Add tracing middleware for twins and states repos (#1181)
- MF-995 - Add Twins tests for endpoint list twins and list states (#1174)
- NOISSUE - Update dependencies (#1176)
- MF-1163 - Fix influxdb-reader to use nanoseconds precision (#1171)
- Rename environment variable MF_MQTT_ADAPTER_PORT to MF_MQTT_ADAPTER_MQTT_PORT in docker environment (#1170)
- Remove thing related code from twins service (#1169)
- MF-997 - Add twins service swagger file (#1167)
- MF-1079 - Add MQTT forwarder (#1164)
- MF-1159 - add gateway metadata update in provision method (#1160)
- MF-1055 - rollback/release transaction on error (#1166)
- NOISSUE - Use log level error for VermeMQ docker (#1162)
- NOISSUE - Fix default nats pubsub subject (#1153)
- MF-1125 - Document Provision service (#1143)
- NOISSUE - Fix bootstrap SDK args naming (#1151)
- Use VerneMQ default log level (#1150)
- NOISSUE - Update provision service (#1133)
- NOISSUE - Refactor messaging (#1141)
- Add JSON tags to SDK entities (#1146)
- NOISSUE - Update CLI README.md (#1139)
- NOISSUE - Update mProxy version (#1137)
- fix nginx, channel connect (#1136)
- Remove concurrency flag for golangci-lint (#1134)
- MF-1088 - Remove message payload content type (#1121)
- MF-1129 - Use snake_case for Lora and OPC-UA metadata fields (#1130)
- MF-1128 - Add golangci-linter to a CI script (#1131)
- MF-1123 - Move Provision service to monorepo (#1132)
- MF-845 - Add FOSSA badge for licensing (#1127)
- MF-1087 - Remove WebSocket adapter (#1120)
- NOISSUE - Use HTTP Status in SDK error messages (#1119)
- NOISSUE - Fix bootstrap token naming and interfaces named args (#1117)
- MF-1115 - Improve the SDK error encoding (#1118)
- MF-862 - Add boostrap CRUD to SDK and CLI (#1114)
- NOISSUE - Update coding style in Things service (#1116)
- NOISSUE - Remove defers from TestMain (#1111)
- NOISSUE - Create func to encode SDK errors (#1110)
- MF-1078 - Add timestamp to published messages and use it in Transformer (#1106)
- Fix prometheus namespace in postgres reader & writer (#1109)
- NOISSUE - Implement errors package in senml transformer, readers and writers (#1108)
- NOISSUE - Implement errors package in Authentication service (#1105)
- MF-1103 - API key should ignore empty expiration time (#1104)
- MF-1096 - Fix AuthN and Things Auth ENVARS (#1066)
- fix Contains function for nil arguments (#1102)
- MF-1099 - Add email subdomain validator (#1101)
- MF-1091 - Use channels. as broker prefix (#1098)
- MF-1090 - Use named Interfaces args (#1097)
- NOISSUE - Create broker package for NATS (#1080)
- NOISSUE - Implement errors package in bootstrap service (#1093)
- NOISSUE - Fix writers loadSubjectsConfig if file is missing (#1094)
- NOISSUE - Adding subtopics filtering in writer services (#1072)
- NOISSUE - Improve errors package (#1086)
- NOISSUE - Enable MQTT over WS in docker composition (#1085)
- NOISSUE - Rm unused opc-ua envars (#1083)
- MF-798 - Add utf8 support for email validation (#1082)
- Remove unused Tokenizer interface (#1084)
- Update mqtt adapter imports (#1081)
- NOISSUE - Update state based on SenML time value (#1075)
- NOISSUE - Fix StatusBadDecodingError for opc-ua browse (#1074)
- Save senml array msg to multiple states (#1073)
- NOISSUE - Fix opc-ua message type handling (#1071)
- NOISSUE - Add Publisher field to MQTT adapter (#1067)
- NOISSUE - Fix users CLI (#1062)
- NOISSUE - Fix SDK Messages response (#1064)
- Merged MQTT docker compose in core composition file (#1060)
- MF-1016 - Add UserUpdate and UpdatePassword to sdk and CLI (#1057)
- Update mProxy (#1058)
- MF-1053 - Add disconnect event to MQTT adapter (#1056)
- Fix data type for data_value in databases (#1054)
- NOISSUE - Fix opc-ua subscriptions store (#1052)
- NOISSUE - Fix connect CLI command and remove ConnectThing func from SDK (#1051)
- NOISSUE - Update Vernemq image repository (#1050)
- Removed VerneMQ auth plugin, Aedes impl. Added mproxy support in docker (#1049)
- NOISSUE - Add default subscription nodeID and Interval ENVAR (#1046)
- MF-415 - Merge mProxy support (#1045)
- NOISSUE - Remove twins-service mqtt dependency and publish notifs to nats (#1042)
- Add arbitrary SenML value type saving to twin state (#1039)
- Fixed Aedes dependencies (#1036)
- MF-998 - Add Twins service to Makefile and docker-compose.yml (#1035)
- MF-1032 - Fix redis docker volume of opcua-adapter (#1033)
- NOISSUE - add nats conf (#1031)
- MF-442 - Add SSL encryption to the MongoDB, InfluxDB and Cassanda readers (#1024)
- NOISSUE - Add opc-ua type handling and unsubscription (#1029)
- NOISSUE - Add aggregate attribute-based search for twin retrieval (#1027)
- NOISSUE - Fix metadata in add Things endpoint (#1028)
- NOISSUE - Fix minimal password length (#1023)
- MF-1020 - Change default password for CLI provision test (#1021)
- NOISSUE - Add subtopic to opcua messages (#1022)
- NOISSUE - Add details to browsed OPC-UA nodes (#1019)
- NOISSUE Fix obsolete attribute persistance (#1018)
- Fix twins update revision counter (#1011)
- Fixed docs instructions in README (#1010)
- Fix copyright year (#1009)
- Fix issuing recovery key (#1007)
- Removed gatling load-test (#1005)
- Removed old k8s manifests (#1004)
- NOISSUE - Remove UI from docker-compose (#1001)
- NOISSUE - Store successfull OPC-UA subscriptions (#999)
- MF-730 - Add digital twin service for things (#855)
- Fix Redis event naming (#996)
- NOISSUE - Add a Browse endpoint in opcua-adapter (#988)
- NOISSUE - Add Redis ES Username/Pass for VerneMQ (#991)
- MF-982 - Add error when connecting empty channels or things (#985)
## 0.10.0 - 17. DEC 2019.
### Features
- MF-932 - User API keys (#941)
- NOISSUE - Use opcua server timestamp in opcua-adapter messages (#980)
- Simplify CI script (#979)
- NOISSUE - Add opcua-adapter conn route-map, use ServerURI and NodeID (#975)
- Move docs to a separate repo (#976)
- NOISSUE - Support multiple types values in opcua-adapter (#973)
- Migrate from dep to go modules (#971)
- NOISSUE - Add Node IdentifierType config in opcua-adapter (#967)
- NOISSUE - Remove messages limit in influxdb-reader (#968)
- MF-898 - Add bulk connect to CLI and SDK (#956)
- MF-538 - Improve logging and API errors (#866)
- NOISSUE - Remove Elm UI (#953)
- MF-898 - Add bulk connections endpoint (#948)
- MF-898 - Change thing's service to use bulk connect (#946)
- MF-898 - Add transactions to postgres connect (#940)
- Add missing user service tests (#945)
- Remove Normalizer service from compose (#937)
- MF-919 - Mainflux message updates (#924)
- NOISSUE - Remove ARM multi-arch images (#929)
- MF-906 - Change single creation endpoints to use bulk service calls (#927)
- MF-922 - Add UpdateUser endpoint (#923)
- MF-780 - Use Normalizer as a lib (#915)
- NOISSUE - Switch to grpcbox for VerneMQ (#914)
- Change channels to chs (#918)
- MF-484 - Add bulk provisioning for things and channels (#889)
- MF-899 - Update README and official docs (#910)
- NOISSUE - Fix Redis envars (#903)
- Add disconnect on gen_server terminate() (#913)
- MF-890 - Add OPC-UA docs (#904)
- NOISSUE - Update Protobuf version (#902)
- MF-886 - Add OPC-UA adapter (#878)
- MF-532 - Password reset (#873)
- MF-785 - Change CanAccess to CanAccessByKey (#894)
- NOISSUE - Add MQTT UserName check on register and InstanceId in Redis (#884)
- Add MQTT troubleshooting section (#882)
- MF-875 - Add tracing to official documentation (#877)
- MF-788 - Remove date and minimize copyright comments (#876)
- MF-787 - Add tags to user, thing, and channel spans (#869)
- Update docker-compose version for addons (#874)
- MF-859 - Channels metadata search (#867)
- MF-858 Users metadata (#861)
- NOISSUE - Simplify MQTT benchmarking tool (#852)
- NOISSUE - Upgrade Go version to 1.13 in container images (#868)
- MF-820 - Fetch messages for a particular device (#843)
- Update gorilla websocket version (#865)
- NOISSUE - Update aedes version and fix Dockerfile (#863)
- NOISSUE - Search by metadata (#849)
- MF-846 - Install python in docker build for aedes mqtt image (#860)
- NOISSUE - Clean NginX files, move .gitignores to dirs (#853)
- NOISSUE - Add docker-compose for MQTT cluster (#841)
- Add debug logs to the WS adapter (#848)
- NOISSUE - Add measuring time from pub to sub (#839)
- NOISSUE - update mqtt prov tool and some refactor (#831)
- NOISSUE - Use Thing ID to update certs data (#827)
- NOISSUE - Improve VerneMQ plugin code, add configurable gRPC pool size (#836)
- NOISSUE - Use gRPC for VerneMQ (#835)
- Switch secure of WS connection according to secure of http connection of UI (#829)
- NOISSUE - Use current hostname instead of localhost for a WebSocket connection in the UI (#826)
- NOISSUE - Improve MQTT benchmarking tools (#828)
- NOISSUE - update mqtt benchmark (#824)
- Add encryption key to env vars table (#823)
- NOISSUE - Add version endpoint to MQTT adapter (#816)
- MF-295 add mqtt benchmark tool (#817)
- update mqtts commands (#815)
- NOISSUE - Support encrypted bootstrap (#796)
- Add config to writers docs (#812)
- NOISSUE - Add VerneMQ support (#809)
- NOISSUE - Add content type as part of MQTT subscription topic (#810)
### Bugfixes
- Fix MQTT protobuf filename(#981)
- MF-950 - Runtime error in normalizer - CBOR SenML (#974)
- NOISSUE - Fix opcua-adapter events warnings (#965)
- NOISSUE - Fix opcua-adapter events decode (#951)
- Fix subtopic handling in VerneMQ (#962)
- NOISSUE - Fix Update User (#959)
- NOISSUE - Fix make dockers (#957)
- Add dev_ back to make dockers_dev (#955)
- NOISSUE - Fix docs (#952)
- MF-916 - Fix Things and Channels counters (#947)
- MF-942 - Fix email template logic (#944)
- NOISSUE - Fix HTTP header for Things and Channels creation (#939)
- NOISSUE - Fix docker ui image name (#938)
- NOISSUE - Fix lora-adapter (#936)
- NOISSUE - Fix lora creation events (#933)
- Fix doc for ENV vars in README (#920)
- Fix compilation (#911)
- Revert "NOISSUE - Make event sourcing optional (#907)" (#909)
- NOISSUE - Make event sourcing optional (#907)
- NOISSUE - Fix InfluxDB env vars (#908)
- Fix Elm version for ARM Docker images (#905)
- Fix Elm version in Dockerfile (#901)
- NOISSUE - fix security doc (#897)
- NOISSUE - Fix typo in docs and README (#891)
- Fix Nginx mTLS configuration (#885)
- Fix provision tool connect error handling (#879)
- Fix: Correct 404 and Content-Type Issues in MQTT Version Endpoint (#837)
- NOISSUE - Fix proto files in VerneMQ (#834)
- NOISSUE - Fix hackney HTTP request (#833)
- Add socket pool and fix pattern matching (#830)
- Fix typo (#814)
## 0.9.0 - 19. JUL 2019.
### Features
- Create and push docker manifest for new release from Makefile (#794)
- MF-399 - Add open tracing support (#782)
- MF-783 - Allow access checking by a thing ID (#784)
- NOISSUE - Add authorization HTTP API to things service (#772)
- Remove cli executable from repo (#776)
- NOISSUE - Use .env vars in docker-compose (#770)
- MF-663 - enable nginx port conf from docker env (#769)
- Update docs (#766)
- NOISSUE - Remove installing non-existent package in ci (#758)
- NOISSUE - Add searchable Channels name (#754)
- MF-466 - ARM docker deployment (#756)
- Add missing Websocket.js into docker ui image (#755)
- NOISSUE - Add searchable Things name (#750)
- NOISSUE - Add certificate fields to the Bootstrap service (#752)
- Update grpc and protobuf deps in mqtt adapter (#751)
- MF-742 - Things to support single user scenario (#749)
- MF-732 - Add Postgres reader (#740)
- MF-722 - Change UUID lib (#746)
- Add performance improvement to writer filtering (#744)
- NOISSUE - Update nginx version (#748)
- MF-574 - Add missing environment variables to Cassandra writer (#745)
- NOISSUE - Add compile test to CI (#743)
- MF-708 - Assign Writer(s) to a channel (#737)
- MF-732 - Add PostgreSQL writer (#733)
- NOISSUE - Add readers pagination in SDK (#736)
- Add UI websocket open/close and send/receive (#728)
- MF-707 - Allow custom Thing key (#726)
- MF-525 - Add pagination response to the readers (#729)
- NOISSUE - Rm Things type from lora-adapter (#727)
- skip deleting of persistent volumes by default (#723)
- MF-488 - Remove Thing type (app or device) (#718)
- Remove empty channels check (#720)
- MF-655 Proper usage of docker volumes (#657)
- NOISSUE - Improve UI styling (#719)
- MF-715 - Conflict on updating connection with a valid list of channels (#716)
- MF-711 - Create separate Redis instance for ES (#717)
- NOISSUE - Update event fields naming (#713)
- MF-698 - Add missing info and docs about sys event sourcing (#712)
- MF-549 - Change metadata format from JSON string to JSON object (#706)
- NOISSUE - Replace repeating code by card gen func (#697)
- Update Bootstrap service docker-compose.yml (#700)
- Remove Debug function (#699)
- MF-687 - Add event sourcing to Bootstrap service (#695)
- NOISSUE - Remove debugging message from response of handle error function (#696)
- Add event stream to MQTT adapter for conn status (#692)
- NOISSUE - Improve UI style (#691)
- Update docs structure (#686)
- Use images instead of carousel (#685)
- NOISSUE - Update docs (#683)
- MF-662 - Change menu style (#678)
- MF-651 - X509 Mutual TLS authentication (#676)
- Update Aedes version for MQTT adapter (#677)
- MF-661 - Bootstrap pagination in UI (#672)
- Update subtopics section in documentation (#670)
- Remove default base URL value (#671)
### Bugfixes
- NOISSUE - Fix Readers logs (#735)
- NOISSUE - Fix Docker for ARM (#760)
- NOISSUE - Fix count when search by name is performed (#767)
- NOISSUE - Typo fix (#777)
- NOISSUE - Fix Postgres logs in Things service (#734)
- Fix CI with fixed plugin versions (#747)
- fix building problems (#741)
- fix docker-compose env (#775)
- Fix MF_THINGS_AUTH_GRPC_PORT in addons' docker-compose files (#781)
- Fix MQTT raw message deserialization (#753)
- fix variant option for manifest annotate (#765)
- fix to makefile for OSX/Darwin (#724)
- Fix .dockerignore file by removing index.html (#725)
- Fix things and channels metadata create and edit & remove thing type (#721)
- Fix Bootstrap service event map keys (#705)
- Fix logging in publish event callback (#694)
- Fix InfluxDB time bug (#689)
- Fix users service to work in offline mode (#795)
- fix mainflux_id parameter in bootstrap swagger (#789)
- Fix offset calculation after deleting thing/channel, not to go to negative offset after deleting last thing/channel (#679)
- Use errors and null packets in authorized pub/sub (#773)
- NOISSUE - Fix CoAP adapter (#779)
### Summary
https://github.com/mainflux/mainflux/milestone/10?closed=1
## 0.8.0 - 20. MAR 2019.
### Features
- MF-571 - Add Env.elm to set custom base URL (#654)
- NOISSUE Added docs about docker-compose config overriding (#653)
- MF-539 - Improve Bootstrap Service documentation (#646)
- MF-596 - Add subtopic to RawMessage (#642)
- NOISSUE - Prevent infinite loop in lora-adapter if Redis init fail (#647)
- Corrected grammar and rephrased a few sentences to read nicely (#641)
- MF-571 - Elm UI (#632)
- MF-552 - Use event sourcing to keep Bootstrap service in sync with Things service (#603)
- MF-540 - Add pagination in API responses for Bootstrap service (#575)
- MF-600 - Handle custom LoRa Server application decoder (#608)
- update docker-compose (#590)
- Update generated code (#602)
- Add generated files check (#601)
- MF-597 - Removed legacy code as not needed anymore (#598)
- NOISSUE - Added normalizer service to run script (#594)
- Changed RawMessage (#587)
- NOISSUE - fix CLI log (#581)
- MF-519 - Refine Message (#567)
- NOISSUE - Add name field for Bootstrap Config (#564)
- Fix non-SenML message routing in normalizer (#573)
- NOISSUE - Update authors list (#569)
- Update lora.md (#568)
- NOISSUE- Improve LoRa doc (#562)
- MF-551 - Add metadata fields to Bootstrap Channels (#563)
- Fix MQTT adapter by setting subscription queue (#561)
- MF-558 - Add MQTT subtopics documentation (#559)
- Fix regexp for SUB (#557)
- Simplify MQTT topipc regexp (#555)
- MF-429 -Enabled MQTT subtopic's (#554)
- Add env var for number of concurrent messages (#545)
- NOISSUE - Update doc and fix empty key bug (#544)
- MF-370 - Simplify and refine CI (#541)
- NOISSUE - Add connection commands to CLI (#542)
- NOISSUE - Refine docs (#537)
- Update licnese year (#533)
- MF-513 - Add Bootstrapping service (#524)
- Add dedicated env vars for event sourcing (#536)
- NOISSUE - Fix docs (#535)
- Add lora doc to getting-started.md (#529)
- MF-483 - Enable channels and devices corresponding lists in backend (#520)
- Add missing components doc to architecture.md (#531)
### Bugfixes
- MF-639 Split Content-Type header field on semicolon and evaluate all substrings (#644)
- MF-656 - Change bootstrap service port to 8200 (#658)
- Replace crossOrigin with relative path and fix messaging bug (#645)
- MF-579 Things & Channels returns 404 when not found or ID is malformed, not 500 (#633)
- Fix run command in dev guide (#605)
- MF-583 - Correct cmd/mongodb-reader HTTPServer log Info (#584)
- Fix Dusan Maldenovic GitHub (#570)
- Fix CLI docs (#566)
- Fix pagination response for empty page (#547)
- Fix swagger and provisioning docs (#546)
- NOISSUE - Fix event sourcing client on LoRa adapter (#527)
- Fix MQTT adapter scaling issue (#526)
- NOISSUE - Fix subtopic regex and restrict empty subtopic parts (#659)
- Fix missing css in container ui (#638)
- NOISSUE - Fix lora-adapter Object decode (#610)
- NOISSUE - Fix users logs in main.go (#577)
- NOISSUE - Fix normalizer exposed port in docker-compose (#548)
### Summary
https://github.com/mainflux/mainflux/milestone/9?closed=1
## 0.7.0 - 08. DEC 2018.
### Features
- MF-486 - Add provisioning command to CLI (#487)
- Fix lora-adapter event store handlers (#492)
- NOISSUE - Add LoRa route map validation and fix LoRa messages URL (#491)
- MF-475 - Replace increment ID with UUID (#490)
- MF-166 - Add lora-adapter service (#481)
- NOISSUE - Add Makefile target to clean old imgs (#485)
- MF-473 - Add metadata field to channel (#476)
- Make CoAP ping period configurable (#469)
- Add nginx ingress config to k8s services (#472)
- Add CoAP section in getting-started (#468)
- NOISSUE - Move CLI documentation from getting started guide to separate page (#470)
- NOISSUE - Update Getting Started doc with CLI usage (#465)
- Update CoAP docs with URL example (#463)
- MF-447 - Add event sourcing to things service (#460)
- Add TLS support to CoAP adapter and all readers (#459)
- MF-417 - Implement SDK tests (#438)
- MF-454 - Use message Time field as a time for InfluxDB points (#455)
- NOISSUE - Add .dockerignore to project root (#457)
- Update docker-compose so that every service has debug log level (#453)
- NOISSUE - Add TLS flag for Mainflux services (#452)
- MF-448 - Option for Postgres SSL Mode (#449)
- MF-443 Update project dependencies (#444)
- MF-426 - Add optional MF_CA_CERTS env variable to allow GRPC client to use TLS certs (#430)
- Expose the InfluxDB and Cassandra ports to host (#441)
- MF-374 - Bring back CoAP adapter (#413)
### Bugfixes
- gRPC Load Balancing between http-adapter and things (#387)
- MF-407 - Values of zero are being omitted (#434)
### Summary
https://github.com/mainflux/mainflux/milestone/8?closed=1
## 0.6.0 - 26. OCT 2018.
### Features
- Added Go SDK (#357)
- Updated NATS version (#412)
- Added debbug level to MFX logger (#379)
- Added Documentation for readers (#389)
- Added Redis cache to improve performance (#382)
## 0.5.1 - 05. SEP 2018.
### Features
- Improve performance by adding Redis cache (#382)
### Bugfixes
- Mixed up name and type of the things (#375)
- Fix MQTT topic (#380)
## 0.5.0 - 28. AUG 2018
### Features
- InfluxDB Reader (#311)
- Cassandra Reader (#313)
- MongoDB Reader (#344)
- MQTT Persistance via Redis (#328)
- CLI integrated into monorepo (#216)
- Normalizer logging (#333)
- WS swagger doc (#337)
- Payload renamed to Metadata (#343)
- Protobuf files added (#363)
- SPDX headers added (#325)
### Bugfixes
- Docker network for InfluxDB (#346)
- Vendor correct gRPC version (#340)
### Summary
https://github.com/mainflux/mainflux/milestone/6?closed=1
## 0.4.0 - 01. JUN 2018.
* Integrated MQTT adapter (#165 )
* Support for storing messages in MongoDB (#237)
* Support for storing messages in InfluxDB (#236)
* Use UUID PKs with auto-incremented values (#269 )
* Replaced JWT with plain string tokens in things service (#268 )
* Emit non-SenML messages (#239 )
* Support for Grafana (#296)
* Added WS Load test (#299 )
## 0.3.0 - 14. MAY 2018.
- CoAP API for message exchange (#186)
- Split `manager` service into `clients` and `users` (#266)
- Replaced ORM with raw SQL (#265)
- Setup Kubernetes (#226, #273)
- Fix docker compose (#274)
- Integrated `dashflux` into monorepo (#258)
- Integrated (*non-compatible*) `mqtt` into monorepo (#260)
## 0.2.3 - 24. APR 2018.
- Fix examples in the documentation (#243)
- Add service name in info response (#241)
- Improve code coverage in WS adapter (#242)
## 0.2.2 - 23. APR 2018.
- Setup load testing scenarios (#225)
## 0.2.1 - 22. APR 2018.
- Fixed `Content-Type` header checking (#238)
## 0.2.0 - 18. APR 2018
- Protobuf message serialization (#192)
- Websocket API for exchanging messages (#188)
- Channel & client retrieval paging (#227)
- Service instrumentation (#213)
- `go-kit` based JSON logger (#212)
- Project documentation (#218, #220)
- API tests (#211, #224)
## 0.1.2 - 18. MAR 2018.
### Bug fixes
- Fixed go lint warnings (#189)
- Compose failing startup (#185)
- Added missing service startup messages (#190)
+14 -14
View File
@@ -1,11 +1,11 @@
# Contributing to Mainflux
# Contributing to Magistrala
The following is a set of guidelines to contribute to Mainflux and its libraries, which are
hosted on the [Mainflux Organization](https://github.com/mainflux) on GitHub.
The following is a set of guidelines to contribute to Magistrala and its libraries, which are
hosted on the [Abstract Machines Organization](https://github.com/absmach) on GitHub.
This project adheres to the [Contributor Covenant 1.2](http://contributor-covenant.org/version/1/2/0).
By participating, you are expected to uphold this code. Please report unacceptable behavior to
[abuse@mainflux.com](mailto:abuse@mainflux.com).
[abuse@absmach.eu](mailto:abuse@absmach.eu).
## Reporting issues
@@ -13,7 +13,7 @@ Reporting issues are a great way to contribute to the project. We are perpetuall
thorough bug report.
Before raising a new issue, check [our issue
list](https://github.com/mainflux/mainflux/issues) to determine if it already contains the
list](https://github.com/absmach/magistrala/issues) to determine if it already contains the
problem that you are facing.
A good bug report shouldn't leave others needing to chase you for more information. Please be as detailed as possible. The following questions might serve as a template for writing a detailed
@@ -41,23 +41,23 @@ To contribute to the project, [fork](https://help.github.com/articles/fork-a-rep
clone your fork repository, and configure the remotes:
```
git clone https://github.com/<your-username>/mainflux.git
cd mainflux
git remote add upstream https://github.com/mainflux/mainflux.git
git clone https://github.com/<your-username>/magistrala.git
cd magistrala
git remote add upstream https://github.com/absmach/magistrala.git
```
If your cloned repository is behind the upstream commits, then get the latest changes from upstream:
```
git checkout master
git pull --rebase upstream master
git checkout main
git pull --rebase upstream main
```
Create a new topic branch from `master` using the naming convention `MF-[issue-number]`
Create a new topic branch from `main` using the naming convention `MG-[issue-number]`
to help us keep track of your contribution scope:
```
git checkout -b MF-[issue-number]
git checkout -b MG-[issue-number]
```
Commit your changes in logical chunks. When you are ready to commit, make sure
@@ -74,13 +74,13 @@ and `user.email` git configs, you can sign your commit automatically with `git c
Locally merge (or rebase) the upstream development branch into your topic branch:
```
git pull --rebase upstream master
git pull --rebase upstream main
```
Push your topic branch up to your fork:
```
git push origin MF-[issue-number]
git push origin MG-[issue-number]
```
[Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title
+1 -1
View File
@@ -176,7 +176,7 @@
END OF TERMS AND CONDITIONS
Copyright 2015-2020 Mainflux
Copyright 2015-2026 Magistrala
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
+9 -40
View File
@@ -1,46 +1,15 @@
# Mainflux follows the timeless, highly efficient and totally unfair system
# known as [Benevolent dictator for
# life](https://en.wikipedia.org/wiki/Benevolent_Dictator_for_Life), with
# Drasko DRASKOVIC in the role of BDFL.
# Magistrala Maintainers
[bdfl]
[[drasko]]
Name = "Drasko DRASKOVIC"
Email = "drasko@mainflux.com"
GitHub = "drasko"
Magistrala follows a BDFL model for dead-lock situations; day-to-day decisions happen through discussion and pull requests.
# However, this role serves only in dead-lock events, or in a special and very rare cases
# when BDFL completely disagrees with the decisions made.
# In the normal flow of events, decisions on the project design are made through discussions,
# most often on the Pull Requests.
#
# Maintainers have the special role in the project in managing and accepting PRs,
# overall leading the project and making design decisions on the maintained subsystems.
#
# A reference list of all maintainers of the Mainflux project.
## BDFL
# ADD YOURSELF HERE IN ALPHABETICAL ORDER
- **Drasko Draskovic** — [drasko@absmach.eu](mailto:drasko@absmach.eu) — [GitHub: drasko](https://github.com/drasko)
[maintainers]
## Maintainers
[[aleksandar]]
Name = "Aleksandar NOVAKOVIC"
Email = "aleksandar@mainflux.com"
GitHub = "anovakovic01"
[[dusan]]
Name = "Dusan BOROVCANIN"
Email = "dusan@mainflux.com"
GitHub = "dusanb94"
[[manuel]]
Name = "Manuel IMPERIALE"
Email = "manuel@mainflux.com"
GitHub = "manuIO"
[[nikola]]
Name = "Nikola MARCETIC"
Email = "nikola@mainflux.com"
GitHub = "nmarcetic"
Add yourself below in alphabetical order.
| Name | Email | GitHub |
| --- | --- | --- |
| Dusan Borovcanin | [dusan.borovcanin@absmach.eu](mailto:dusan.borovcanin@absmach.eu) | [dborovcanin](https://github.com/dborovcanin) |
+353 -27
View File
@@ -1,26 +1,65 @@
# Copyright (c) Mainflux
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
MF_DOCKER_IMAGE_NAME_PREFIX ?= mainflux
BUILD_DIR = build
SERVICES = users things http coap lora influxdb-writer influxdb-reader mongodb-writer \
mongodb-reader cassandra-writer cassandra-reader postgres-writer postgres-reader timescale-writer timescale-reader cli \
bootstrap opcua auth twins mqtt provision certs smtp-notifier smpp-notifier
override MG_DOCKER_IMAGE_NAME_PREFIX := ghcr.io/absmach/magistrala
MG_DOCKER_VOLUME_NAME_PREFIX ?= magistrala
BUILD_DIR ?= build
SERVICES = atom-bootstrap certs postgres-writer postgres-reader timescale-writer timescale-reader fluxmq
TEST_API_SERVICES = certs clients users channels groups domains
TEST_API = $(addprefix test_api_,$(TEST_API_SERVICES))
DOCKERS = $(addprefix docker_,$(SERVICES))
DOCKERS_DEV = $(addprefix docker_dev_,$(SERVICES))
CGO_ENABLED ?= 0
GOARCH ?= amd64
VERSION ?= $(shell git describe --abbrev=0 --tags)
GOOS ?= linux
DETECTED_ARCH := $(shell uname -m)
VERSION ?= $(shell git describe --abbrev=0 --tags 2>/dev/null || echo 'unknown')
COMMIT ?= $(shell git rev-parse HEAD)
TIME ?= $(shell date +%F_%T)
USER_REPO ?= $(shell git remote get-url origin | sed -E 's@.*/([^/]+)/([^/.]+)(\.git)?@\1_\2@')
empty:=
space:= $(empty) $(empty)
# Docker compose project name should follow this guidelines: https://docs.docker.com/compose/reference/#use--p-to-specify-a-project-name
DOCKER_PROJECT ?= $(shell echo $(subst $(space),,$(USER_REPO)) | sed -E 's/[^a-zA-Z0-9]/_/g' | tr '[:upper:]' '[:lower:]')
DOCKER_COMPOSE_COMMANDS_SUPPORTED := up down config restart
DEFAULT_DOCKER_COMPOSE_COMMAND := up
ATOM_TOKENS_ENV ?= docker/.env.tokens
REQUIRED_ATOM_TOKEN_ENVS := MG_ATOM_TOKEN_FLUXMQ_AUTH MG_ATOM_TOKEN_FLUXMQ_NODE1 MG_ATOM_TOKEN_FLUXMQ_NODE2 MG_ATOM_TOKEN_FLUXMQ_NODE3 MG_ATOM_TOKEN_TIMESCALE_READER MG_ATOM_TOKEN_RE MG_ATOM_TOKEN_ALARMS MG_ATOM_TOKEN_REPORTS MG_ATOM_TOKEN_POSTGRES_READER
PROVISION_ATOM_TOKENS ?= false
PROVISION_ATOM_TOKEN_GOALS := provision-atom-tokens
DOCKER_BASE_ENV_FILES := --env-file docker/.env
DOCKER_ENV_FILES = $(if $(filter down,$(DOCKER_COMPOSE_COMMAND)),$(DOCKER_BASE_ENV_FILES),$(DOCKER_BASE_ENV_FILES) --env-file $(ATOM_TOKENS_ENV))
DOCKER_PROVISION_ENV_FILES = $(DOCKER_BASE_ENV_FILES) $(if $(wildcard $(ATOM_TOKENS_ENV)),--env-file $(ATOM_TOKENS_ENV))
HOST_UID := $(shell id -u)
HOST_GID := $(shell id -g)
GRPC_MTLS_CERT_FILES_EXISTS = 0
MOCKERY = $(GOBIN)/mockery
MOCKERY_VERSION=3.6.4
PKG_PROTO_GEN_OUT_DIR=api/grpc
INTERNAL_PROTO_DIR=internal/proto
INTERNAL_PROTO_FILES := $(shell find $(INTERNAL_PROTO_DIR) -name "*.proto" | sed 's|$(INTERNAL_PROTO_DIR)/||')
ifneq ($(MG_MESSAGE_BROKER_TYPE),)
MG_MESSAGE_BROKER_TYPE := $(MG_MESSAGE_BROKER_TYPE)
else
MG_MESSAGE_BROKER_TYPE=msg_fluxmq
endif
ifneq ($(MG_ES_TYPE),)
MG_ES_TYPE := $(MG_ES_TYPE)
else
MG_ES_TYPE=es_fluxmq
endif
BUILD_TAGS := $(strip $(MG_MESSAGE_BROKER_TYPE) $(MG_ES_TYPE))
define compile_service
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) \
go build -mod=vendor -ldflags "-s -w \
-X 'github.com/mainflux/mainflux.BuildTime=$(TIME)' \
-X 'github.com/mainflux/mainflux.Version=$(VERSION)' \
-X 'github.com/mainflux/mainflux.Commit=$(COMMIT)'" \
-o ${BUILD_DIR}/mainflux-$(1) cmd/$(1)/main.go
go build -tags "$(BUILD_TAGS)" -ldflags "-s -w \
-X 'github.com/absmach/magistrala.BuildTime=$(TIME)' \
-X 'github.com/absmach/magistrala.Version=$(VERSION)' \
-X 'github.com/absmach/magistrala.Commit=$(COMMIT)'" \
-o ${BUILD_DIR}/$(1) cmd/$(1)/main.go
endef
define make_docker
@@ -34,7 +73,8 @@ define make_docker
--build-arg VERSION=$(VERSION) \
--build-arg COMMIT=$(COMMIT) \
--build-arg TIME=$(TIME) \
--tag=$(MF_DOCKER_IMAGE_NAME_PREFIX)/$(svc) \
--build-arg BUILD_TAGS="$(BUILD_TAGS)" \
--tag=$(MG_DOCKER_IMAGE_NAME_PREFIX)/$(svc) \
-f docker/Dockerfile .
endef
@@ -44,37 +84,197 @@ define make_docker_dev
docker build \
--no-cache \
--build-arg SVC=$(svc) \
--tag=$(MF_DOCKER_IMAGE_NAME_PREFIX)/$(svc) \
--tag=$(MG_DOCKER_IMAGE_NAME_PREFIX)/$(svc) \
-f docker/Dockerfile.dev ./build
endef
define require_atom_tokens_env
@if [ -z "$(filter down,$(DOCKER_COMPOSE_COMMAND))" ]; then \
if [ ! -f "$(ATOM_TOKENS_ENV)" ]; then \
echo "Missing $(ATOM_TOKENS_ENV). Run 'make provision_atom_tokens' before starting the Docker Compose stack."; \
exit 2; \
fi; \
missing=""; \
for env_name in $(REQUIRED_ATOM_TOKEN_ENVS); do \
if ! grep -q "^$${env_name}=" "$(ATOM_TOKENS_ENV)"; then \
missing="$${missing} $${env_name}"; \
fi; \
done; \
if [ -n "$${missing}" ]; then \
echo "Missing Atom service token(s) in $(ATOM_TOKENS_ENV):$${missing}. Run 'make provision_atom_tokens' before starting the Docker Compose stack."; \
exit 2; \
fi; \
fi
endef
define ensure_atom_tokens_env
@if [ "$(PROVISION_ATOM_TOKENS)" = "true" ] && [ -z "$(filter down,$(DOCKER_COMPOSE_COMMAND))" ]; then \
$(MAKE) provision_atom_tokens; \
elif [ -z "$(filter down,$(DOCKER_COMPOSE_COMMAND))" ]; then \
if [ ! -f "$(ATOM_TOKENS_ENV)" ]; then \
echo "Missing $(ATOM_TOKENS_ENV). Run 'make provision_atom_tokens' before starting the Docker Compose stack."; \
exit 2; \
fi; \
missing=""; \
for env_name in $(REQUIRED_ATOM_TOKEN_ENVS); do \
if ! grep -q "^$${env_name}=" "$(ATOM_TOKENS_ENV)"; then \
missing="$${missing} $${env_name}"; \
fi; \
done; \
if [ -n "$${missing}" ]; then \
echo "Missing Atom service token(s) in $(ATOM_TOKENS_ENV):$${missing}. Run 'make provision_atom_tokens' before starting the Docker Compose stack."; \
exit 2; \
fi; \
fi
endef
define run_with_arch_detection
$(call require_atom_tokens_env)
@echo "Detecting architecture..."
@if [ "$(DETECTED_ARCH)" = "arm64" ] || [ "$(DETECTED_ARCH)" = "aarch64" ]; then \
echo "ARM64 architecture detected."; \
git checkout $(1); \
GOARCH=arm64 $(MAKE) dockers; \
for svc in $(SERVICES); do \
docker tag $(MG_DOCKER_IMAGE_NAME_PREFIX)/$$svc $(MG_DOCKER_IMAGE_NAME_PREFIX)/$$svc:latest; \
done; \
sed -i.bak 's/^MG_RELEASE_TAG=.*/MG_RELEASE_TAG=latest/' docker/.env && rm -f docker/.env.bak; \
docker compose -f docker/docker-compose.yaml $(DOCKER_ENV_FILES) -p $(DOCKER_PROJECT) $(DOCKER_COMPOSE_COMMAND) $(args); \
else \
echo "x86_64 architecture detected."; \
git checkout $(1); \
sed -i.bak 's/^MG_RELEASE_TAG=.*/MG_RELEASE_TAG=$(2)/' docker/.env && rm -f docker/.env.bak; \
docker compose -f docker/docker-compose.yaml $(DOCKER_ENV_FILES) -p $(DOCKER_PROJECT) $(DOCKER_COMPOSE_COMMAND) $(args); \
fi
endef
ADDON_SERVICES = bootstrap provision postgres-writer postgres-reader
EXTERNAL_SERVICES = prometheus
# Detect OS and architecture for cross-platform compatibility
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
# macOS BSD sed vs GNU sed compatibility
ifeq ($(UNAME_S),Darwin)
SED_INPLACE := sed -i ''
else
SED_INPLACE := sed -i
endif
# Apple Silicon (arm64) Docker platform compatibility
# Pre-built images are amd64 only, so we need to use emulation on Apple Silicon
ifeq ($(UNAME_S),Darwin)
ifeq ($(UNAME_M),arm64)
DOCKER_PLATFORM := DOCKER_DEFAULT_PLATFORM=linux/amd64
endif
endif
DOCKER_PLATFORM ?=
ifneq ($(filter run%,$(firstword $(MAKECMDGOALS))),)
temp_args := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
DOCKER_COMPOSE_COMMAND := $(if $(filter $(DOCKER_COMPOSE_COMMANDS_SUPPORTED),$(temp_args)), $(filter $(DOCKER_COMPOSE_COMMANDS_SUPPORTED),$(temp_args)), $(DEFAULT_DOCKER_COMPOSE_COMMAND))
ifneq ($(filter $(PROVISION_ATOM_TOKEN_GOALS),$(temp_args)),)
override PROVISION_ATOM_TOKENS := true
endif
$(eval $(DOCKER_COMPOSE_COMMAND):;@)
endif
ifneq ($(filter run_addons%,$(firstword $(MAKECMDGOALS))),)
temp_args := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
RUN_ADDON_ARGS := $(if $(filter-out $(DOCKER_COMPOSE_COMMANDS_SUPPORTED),$(temp_args)), $(filter-out $(DOCKER_COMPOSE_COMMANDS_SUPPORTED),$(temp_args)),$(ADDON_SERVICES) $(EXTERNAL_SERVICES))
$(eval $(RUN_ADDON_ARGS):;@)
endif
ifneq ("$(wildcard docker/ssl/certs/*-grpc-*)","")
GRPC_MTLS_CERT_FILES_EXISTS = 1
else
GRPC_MTLS_CERT_FILES_EXISTS = 0
endif
FILTERED_SERVICES = $(filter-out $(RUN_ADDON_ARGS), $(SERVICES))
all: $(SERVICES)
.PHONY: all $(SERVICES) dockers dockers_dev latest release
.PHONY: all help $(SERVICES) dockers dockers_dev latest release provision_atom_tokens provision-atom-tokens migrate_atom run_latest run_latest_ci run_tls run_stable run_addons grpc_mtls_certs check_mtls check_certs check_fluxmq_service_certs check_re_trace_key test_api mocks
help:
@printf 'Usage:\n make <target> [VARIABLE=value ...]\n\nAvailable targets:\n'
@$(MAKE) -qpRr : 2>/dev/null | \
awk -F: '/^[[:alnum:]_][^$$#\/\t=]*:([^=]|$$)/ { split($$1, targets, /[[:space:]]+/); for (i in targets) if (targets[i] != "") print targets[i] }' | \
LC_ALL=C sort -u | \
awk '$$0 != "Makefile" { printf " make %s\n", $$0 }'
clean:
rm -rf ${BUILD_DIR}
cleandocker:
# Stops containers and removes containers, networks, volumes, and images created by up
docker-compose -f docker/docker-compose.yml down --rmi all -v --remove-orphans
docker compose -f docker/docker-compose.yaml -p $(DOCKER_PROJECT) down --rmi all -v --remove-orphans
ifdef pv
# Remove unused volumes
docker volume ls -f name=$(MF_DOCKER_IMAGE_NAME_PREFIX) -f dangling=true -q | xargs -r docker volume rm
docker volume ls -f name=$(MG_DOCKER_VOLUME_NAME_PREFIX) -f dangling=true -q | xargs -r docker volume rm
endif
install:
cp ${BUILD_DIR}/* $(GOBIN)
for file in $(BUILD_DIR)/*; do \
cp $$file $(GOBIN)/magistrala-`basename $$file`; \
done
test:
go test -mod=vendor -v -race -count 1 -tags test $(shell go list ./... | grep -v 'vendor\|cmd')
mocks: $(MOCKERY)
@$(MOCKERY) --config ./tools/config/.mockery.yaml
$(MOCKERY):
@mkdir -p $(GOBIN)
@echo ">> installing mockery $(MOCKERY_VERSION)..."
@go install github.com/vektra/mockery/v3@v$(MOCKERY_VERSION)
DIRS = consumers readers postgres internal
test: mocks
mkdir -p coverage
@for dir in $(DIRS); do \
go test -v --race -failfast -count 1 -tags test -coverprofile=coverage/$$dir.out $$(go list ./... | grep $$dir | grep -v 'cmd'); \
done
go test -v --race -failfast -count 1 -tags test -coverprofile=coverage/coverage.out $$(go list ./... | grep -v 'consumers\|readers\|postgres\|internal\|cmd\|middleware')
define test_api_service
$(eval svc=$(subst test_api_,,$(1)))
@which uv > /dev/null || (echo "uv not found, please install it from https://github.com/astral-sh/uv" && exit 1)
@if [ -z "$(USER_TOKEN)" ]; then \
echo "USER_TOKEN is not set"; \
echo "Please set it to a valid token"; \
exit 1; \
fi
@uvx schemathesis run apidocs/openapi/$(svc).yaml \
--checks all \
--url $(2) \
--header "Authorization: Bearer $(USER_TOKEN)" \
--suppress-health-check=filter_too_much \
--exclude-checks=positive_data_acceptance \
--exclude-operation-id=requestPasswordReset \
--phases=examples,stateful
endef
test_api_users: TEST_API_URL := http://localhost:9000
test_api_clients: TEST_API_URL := http://localhost:9000
test_api_domains: TEST_API_URL := http://localhost:9000
test_api_channels: TEST_API_URL := http://localhost:9000
test_api_groups: TEST_API_URL := http://localhost:9000
test_api_certs: TEST_API_URL := http://localhost:9019
$(TEST_API):
$(call test_api_service,$(@),$(TEST_API_URL))
proto:
protoc --gofast_out=plugins=grpc:. *.proto
protoc --gofast_out=plugins=grpc:. pkg/messaging/*.proto
protoc -I. --go_out=. --go_opt=paths=source_relative pkg/messaging/*.proto
mkdir -p $(PKG_PROTO_GEN_OUT_DIR)
protoc -I $(INTERNAL_PROTO_DIR) --go_out=$(PKG_PROTO_GEN_OUT_DIR) --go_opt=paths=source_relative --go-grpc_out=$(PKG_PROTO_GEN_OUT_DIR) --go-grpc_opt=paths=source_relative $(INTERNAL_PROTO_FILES)
$(SERVICES):
$(FILTERED_SERVICES):
$(call compile_service,$(@))
$(DOCKERS):
@@ -88,7 +288,7 @@ dockers_dev: $(DOCKERS_DEV)
define docker_push
for svc in $(SERVICES); do \
docker push $(MF_DOCKER_IMAGE_NAME_PREFIX)/$$svc:$(1); \
docker push $(MG_DOCKER_IMAGE_NAME_PREFIX)/$$svc:$(1); \
done
endef
@@ -98,17 +298,143 @@ changelog:
latest: dockers
$(call docker_push,latest)
publish_arch:
$(MAKE) dockers GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM)
for svc in $(SERVICES); do \
docker tag $(MG_DOCKER_IMAGE_NAME_PREFIX)/$$svc $(MG_DOCKER_IMAGE_NAME_PREFIX)/$$svc:$(VERSION)-$(GOARCH); \
docker tag $(MG_DOCKER_IMAGE_NAME_PREFIX)/$$svc $(MG_DOCKER_IMAGE_NAME_PREFIX)/$$svc:latest-$(GOARCH); \
docker push $(MG_DOCKER_IMAGE_NAME_PREFIX)/$$svc:$(VERSION)-$(GOARCH); \
docker push $(MG_DOCKER_IMAGE_NAME_PREFIX)/$$svc:latest-$(GOARCH); \
done
release:
$(eval version = $(shell git describe --abbrev=0 --tags))
git checkout $(version)
$(MAKE) dockers
for svc in $(SERVICES); do \
docker tag $(MF_DOCKER_IMAGE_NAME_PREFIX)/$$svc $(MF_DOCKER_IMAGE_NAME_PREFIX)/$$svc:$(version); \
docker tag $(MG_DOCKER_IMAGE_NAME_PREFIX)/$$svc $(MG_DOCKER_IMAGE_NAME_PREFIX)/$$svc:$(version); \
done
$(call docker_push,$(version))
rundev:
cd scripts && ./run.sh
run:
docker-compose -f docker/docker-compose.yml up
grpc_mtls_certs:
$(MAKE) -C docker/ssl clients_grpc_certs
provision_atom_tokens:
$(DOCKER_PLATFORM) docker compose -f docker/docker-compose.yaml $(DOCKER_PROVISION_ENV_FILES) -p $(DOCKER_PROJECT) up -d --wait --wait-timeout 120 atom
$(MAKE) docker_atom-bootstrap
$(DOCKER_PLATFORM) docker compose -f docker/docker-compose.yaml $(DOCKER_PROVISION_ENV_FILES) -p $(DOCKER_PROJECT) run --rm --no-deps --user "$(HOST_UID):$(HOST_GID)" -v "$(PWD)/docker:/host/docker" atom-bootstrap provision-tokens --output /host/docker/.env.tokens
provision-atom-tokens:
@:
# Migrate an old Magistrala (v0.30.0 / pre-Atom) deployment into Atom. Runs an
# isolated, collision-free stack, seeds the Atom schema into the run_latest Atom
# volume and loads the data. Default is a dry-run; pass args="--apply" to load,
# args="--verify" to reconcile afterwards.
# make migrate_atom # dry-run
# make migrate_atom args="--apply" # perform the migration
# make migrate_atom args="--apply --fresh-atom" # rebuild Atom schema first
migrate_atom:
DOCKER_PROJECT="$(DOCKER_PROJECT)" tools/atom-migration/migrate.sh $(args)
check_tls:
ifeq ($(GRPC_TLS),true)
@echo "gRPC TLS is enabled"
$(eval GRPC_MTLS :=)
else
$(eval GRPC_TLS :=)
endif
check_mtls:
ifeq ($(GRPC_MTLS),true)
@echo "gRPC MTLS is enabled"
$(eval GRPC_TLS :=)
else
$(eval GRPC_MTLS :=)
endif
# Internal services reach FluxMQ on the mTLS local listener, and Compose mounts
# both sides of those connections. Certificates and principal secrets are
# generated rather than committed, so make them before anything binds them.
check_fluxmq_service_certs:
ifeq ("$(wildcard docker/ssl/certs/re-fluxmq-client.crt)","")
$(MAKE) -C docker/ssl fluxmq_service_certs
endif
ifeq ("$(wildcard docker/ssl/certs/timescale-writer-fluxmq-client.crt)","")
$(MAKE) -C docker/ssl timescale_writer_fluxmq_client_cert
endif
ifeq ("$(wildcard docker/ssl/certs/postgres-writer-fluxmq-client.crt)","")
$(MAKE) -C docker/ssl postgres_writer_fluxmq_client_cert
endif
ifeq ("$(wildcard docker/ssl/certs/fluxmq-auth-fluxmq-client.crt)","")
$(MAKE) -C docker/ssl fluxmq_auth_fluxmq_client_cert
endif
ifeq ("$(wildcard docker/fluxmq/secrets/re-current)","")
$(MAKE) -C docker/ssl fluxmq_service_secret
endif
ifeq ("$(wildcard docker/fluxmq/secrets/timescale-writer-current)","")
$(MAKE) -C docker/ssl timescale_writer_fluxmq_service_secret
endif
ifeq ("$(wildcard docker/fluxmq/secrets/postgres-writer-current)","")
$(MAKE) -C docker/ssl postgres_writer_fluxmq_service_secret
endif
ifeq ("$(wildcard docker/fluxmq/secrets/fluxmq-auth-current)","")
$(MAKE) -C docker/ssl fluxmq_auth_fluxmq_service_secret
endif
check_re_trace_key:
ifeq ("$(wildcard docker/re/secrets/trace.key)","")
$(MAKE) -C docker/ssl re_trace_key
endif
check_certs: check_mtls check_tls check_fluxmq_service_certs check_re_trace_key
ifeq ($(GRPC_MTLS_CERT_FILES_EXISTS),0)
ifeq ($(filter true,$(GRPC_MTLS) $(GRPC_TLS)),true)
ifeq ($(filter $(DEFAULT_DOCKER_COMPOSE_COMMAND),$(DOCKER_COMPOSE_COMMAND)),$(DEFAULT_DOCKER_COMPOSE_COMMAND))
$(MAKE) -C docker/ssl clients_grpc_certs
endif
endif
endif
run_latest: check_certs
$(SED_INPLACE) 's/^MG_RELEASE_TAG=.*/MG_RELEASE_TAG=latest/' docker/.env
$(call ensure_atom_tokens_env)
$(DOCKER_PLATFORM) docker compose -f docker/docker-compose.yaml $(DOCKER_ENV_FILES) -p $(DOCKER_PROJECT) $(DOCKER_COMPOSE_COMMAND) $(args)
run_latest_ci: check_certs
$(call require_atom_tokens_env)
$(SED_INPLACE) 's/^MG_RELEASE_TAG=.*/MG_RELEASE_TAG=latest/' docker/.env
$(DOCKER_PLATFORM) docker compose -f docker/docker-compose.yaml -f docker/docker-compose-ci.yaml $(DOCKER_ENV_FILES) -p $(DOCKER_PROJECT) $(DOCKER_COMPOSE_COMMAND) $(args)
run_tls: check_certs
@test -n "$(host)" || (echo "Usage: make run_tls host=example.com [email=admin@example.com] [letsencrypt=false] [staging=true] [force=true]" && exit 2)
@if [ "$(or $(letsencrypt),true)" != "false" ] && [ -z "$(email)" ]; then echo "Usage: make run_tls host=example.com email=admin@example.com [letsencrypt=false] [staging=true] [force=true]"; exit 2; fi
MG_PUBLIC_HOST="$(host)" \
MG_LETSENCRYPT_ENABLED="$(or $(letsencrypt),true)" \
MG_LETSENCRYPT_EMAIL="$(email)" \
MG_LETSENCRYPT_STAGING="$(or $(staging),false)" \
MG_LETSENCRYPT_FORCE_RENEWAL="$(or $(force),false)" \
DOCKER_PROJECT="$(DOCKER_PROJECT)" \
./docker/setup-tls.sh
run_stable: check_certs
$(call require_atom_tokens_env)
$(eval version = $(shell git describe --abbrev=0 --tags))
git checkout $(version)
$(SED_INPLACE) 's/^MG_RELEASE_TAG=.*/MG_RELEASE_TAG=$(version)/' docker/.env
$(DOCKER_PLATFORM) docker compose -f docker/docker-compose.yaml $(DOCKER_ENV_FILES) -p $(DOCKER_PROJECT) $(DOCKER_COMPOSE_COMMAND) $(args)
run_addons: check_certs
$(call require_atom_tokens_env)
$(foreach SVC,$(RUN_ADDON_ARGS),$(if $(filter $(SVC),$(ADDON_SERVICES) $(EXTERNAL_SERVICES)),,$(error Invalid Service $(SVC))))
@$(DOCKER_PLATFORM) docker compose -f docker/docker-compose.yaml $(DOCKER_ENV_FILES) -p $(DOCKER_PROJECT) up -d atom jaeger
@for SVC in $(RUN_ADDON_ARGS); do \
MG_ADDONS_CERTS_PATH_PREFIX="../" $(DOCKER_PLATFORM) docker compose -f docker/addons/$$SVC/docker-compose.yaml -p $(DOCKER_PROJECT) $(DOCKER_ENV_FILES) $(DOCKER_COMPOSE_COMMAND) $(args) & \
done
run_live: check_certs
$(call require_atom_tokens_env)
GOPATH=$(go env GOPATH) $(DOCKER_PLATFORM) docker compose -f docker/docker-compose.yaml -f docker/docker-compose-live.yaml $(DOCKER_ENV_FILES) -p $(DOCKER_PROJECT) $(DOCKER_COMPOSE_COMMAND) $(args)
+376 -150
View File
@@ -1,186 +1,412 @@
# Mainflux
<div align="center">
[![build][ci-badge]][ci-url]
[![go report card][grc-badge]][grc-url]
[![coverage][cov-badge]][cov-url]
[![license][license]](LICENSE)
[![chat][gitter-badge]][gitter]
# Magistrala
![banner][banner]
### A Modern IoT Platform Framework for Scalable IoT
Mainflux is modern, scalable, secure, open-source, and patent-free IoT cloud platform written in Go.
**Made with ❤ by [Abstract Machines](https://absmach.eu/)**
It accepts user and thing (sensor, actuator, application) connections over various network protocols (i.e. HTTP,
MQTT, WebSocket, CoAP), thus making a seamless bridge between them. It is used as the IoT middleware
for building complex IoT solutions.
[![Build Status](https://github.com/absmach/magistrala/actions/workflows/build.yaml/badge.svg?branch=main)](https://github.com/absmach/magistrala/actions/workflows/build.yaml)
[![Go Report Card](https://goreportcard.com/badge/github.com/absmach/magistrala)](https://goreportcard.com/report/github.com/absmach/magistrala)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/absmach/magistrala)
[![Check License Header](https://github.com/absmach/magistrala/actions/workflows/check-license.yaml/badge.svg?branch=main)](https://github.com/absmach/magistrala/actions/workflows/check-license.yaml)
[![Check Generated Files](https://github.com/absmach/magistrala/actions/workflows/check-generated-files.yaml/badge.svg?branch=main)](https://github.com/absmach/magistrala/actions/workflows/check-generated-files.yaml)
[![Coverage](https://codecov.io/gh/absmach/magistrala/graph/badge.svg?token=nPCEr5nW8S)](https://codecov.io/gh/absmach/magistrala)
[![License](https://img.shields.io/badge/license-Apache%20v2.0-blue.svg)](LICENSE)
[![Matrix](https://img.shields.io/matrix/supermq%3Amatrix.org?label=Chat&style=flat&logo=matrix&logoColor=white)](https://matrix.to/#/#supermq:matrix.org)
For more details, check out the [official documentation][docs].
[Guide](https://magistrala.absmach.eu/docs/) | [Contributing](CONTRIBUTING.md) | [Website](https://absmach.eu/) | [Chat](https://matrix.to/#/#supermq:matrix.org)
</div>
## Features
## Introduction 🌍
- Multi-protocol connectivity and bridging (HTTP, MQTT, WebSocket and CoAP)
- Device management and provisioning (Zero Touch provisioning)
- Mutual TLS Authentication (mTLS) using X.509 Certificates
- Fine-grained access control (policies, ABAC/RBAC)
- Message persistence (Cassandra, InfluxDB, MongoDB and PostgresSQL)
- Platform logging and instrumentation support (Grafana, Prometheus and OpenTracing)
- Event sourcing
- Container-based deployment using [Docker][docker] and [Kubernetes][kubernetes]
- [LoRaWAN][lora] network integration
- [OPC UA](opcua) integration
- Edge [Agent](agent) and [Export](export) services for remote IoT gateway management and edge computing
- SDK
- CLI
- Small memory footprint and fast execution
- Domain-driven design architecture, high-quality code and test coverage
Magistrala is an open-source IoT platform built for engineers who need full control over their messaging, device management, and data pipelines.
## Prerequisites
It is built on top of [FluxMQ](https://github.com/absmach/fluxmq), a modern message broker designed for both messaging and event streams. Magistrala provides everything around it: identity, access control, device provisioning, data processing, and observability.
The following are needed to run Mainflux:
IoT systems usually involve brokers, databases, rule engines, and custom services. Magistrala does not pretend those pieces disappear. It provides a coherent framework for integrating them into a single system with a consistent model for identity, access control, messaging, and observability.
- [Docker](https://docs.docker.com/install/) (version 20.10)
- [Docker compose](https://docs.docker.com/compose/install/) (version 1.29)
**What it is:**
- An event-driven IoT middleware platform
- A unified control plane for devices, users, and data
- A foundation for building scalable IoT systems
Developing Mainflux will also require:
**What it is not:**
- Not just an MQTT broker
- Not a black-box SaaS
- Not tied to a single cloud or vendor
- [Go](https://golang.org/doc/install) (version 1.13.3)
- [Protobuf](https://github.com/protocolbuffers/protobuf#protocol-compiler-installation) (version 3.6.1)
---
## Install
## 🧩 IoT Platform Framework
Once the prerequisites are installed, execute the following commands from the project's root:
We call Magistrala a **framework**, not just a platform.
```bash
docker-compose -f docker/docker-compose.yml up
It is extremely flexible and lets you build systems the way you want — from simple prototypes to complex, large-scale deployments — without forcing you into rigid patterns.
At the same time, it avoids the typical complexity of many IoT platforms, where you need to learn an entirely new set of concepts before you can even get started.
Magistrala is built around a small number of main concepts:
- users
- clients (devices)
- channels
- messages
- policies
Most engineers are already familiar with these ideas, so you can start building immediately.
You can keep things simple:
- connect devices
- send messages
- store data
Or you can go deeper:
- define complex access control policies
- build event-driven pipelines
- integrate custom processing and automation
Magistrala scales with your needs — simple when you want it, powerful when you need it.
---
## 🚀 Key Benefits
- **A Coherent System, Not a Mess of Integrations**
Build IoT systems from multiple components without ending up with fragmented security, messaging, and operations.
- **Event-Driven at the Core**
Everything is built around events — enabling real-time processing, streaming, and scalable data flows.
- **Protocol-Native, Not Forced Abstractions**
MQTT, HTTP, WebSocket, and CoAP are treated as first-class citizens, each with their own semantics.
- **Security Built Into the Model**
Identity, authentication, and authorization are part of the system design — not bolted on later.
- **Flexible by Design**
Start simple or build complex systems — without changing platforms or rewriting your architecture.
- **Runs Where You Need It**
Cloud, edge, or hybrid — no vendor lock-in, no hidden dependencies.
---
## ✨ Features
Magistrala provides a complete set of building blocks for IoT systems — from device connectivity to data processing and observability — without forcing a rigid architecture.
### 🔐 Identity & Access
- Multi-tenant domains for isolating environments
- Users, roles, and organizational hierarchies
- Fine-grained access control (ABAC + RBAC)
- Mutual TLS (X.509) and JWT-based authentication
- Personal Access Tokens (PATs) with scoping and revocation
### 🔌 Connectivity
- Native support for MQTT, HTTP, WebSocket, and CoAP
- Consistent authentication and authorization across protocols
- Designed for both cloud services and constrained devices
### 📦 Device & Application Model
- Device (client) provisioning and lifecycle management
- Channels for grouping and controlling message flow
- Application-level grouping and sharing of clients
- Simple but flexible communication model
### ⚙️ Processing & Automation
- Rules engine for message processing and routing (Enterprise Edition)
- Alarms and triggers for reacting to events (Enterprise Edition)
- Scheduled actions for time-based workflows
- Event-driven architecture as the foundation
### 📊 Observability
- Audit logs for tracking system activity (Enterprise Edition)
- Metrics and tracing via Prometheus and OpenTelemetry
- Built-in visibility into system behavior and data flows
### 🚀 Deployment & Operations
- Container-native (Docker, Kubernetes)
- Designed for cloud, edge, and hybrid deployments
- Works with external storage and processing systems
- Scales from small setups to production environments
### 🧑‍💻 Developer Experience
- CLI and SDKs for fast integration
- Straightforward APIs and concepts
- Documentation focused on getting you running quickly
---
## Atom Integration Model
Magistrala uses **Atom** as the backend for identity, authorization, and the catalog.
Atom is the source of truth for:
- domains
- users
- clients
- channels
- groups
- roles
- access policies
Magistrala services such as rules, alarms, and reports remain Magistrala services, but they use Atom for identity and authorization.
Current Docker deployments use the Atom image configured by `ATOM_IMAGE` in `docker/.env`. For compatibility with the current Magistrala integration, the generated `MG_ATOM_TOKEN_*` service credentials are unscoped Atom access tokens. Scoped Atom access tokens should not be used for these service env vars until Magistrala stops using owner-wide Atom listing APIs such as `authorizedObjectIds` in service policy paths.
### Core Entity Mapping
| Magistrala concept | Atom concept | Meaning |
| ------------------ | ---------------------------- | ------------------------------------------------------------------ |
| Domain | Tenant | Isolation boundary for one organization, project, or environment |
| User | Entity with kind `human` | A person who logs in and uses the UI/API |
| Client | Entity with kind `device` | A device or application that sends/receives data |
| Channel | Resource with kind `channel` | A messaging/data path that clients can publish or subscribe to |
| Group | Group | A collection of users, clients, channels, or other grouped objects |
In simple terms:
```text
MG Domain = Atom Tenant
MG User = Atom Human Entity
MG Client = Atom Device Entity
MG Channel = Atom Channel Resource
MG Group = Atom Group
```
This will bring up the Mainflux docker services and interconnect them. This command can also be executed using the project's included Makefile:
### Actions, Permission Blocks, Roles, and Assignments
```bash
make run
Atom access control has these basic parts:
| Atom word | Simple meaning | Example |
| ---------------- | ----------------------------- | --------------------------------------------------------- |
| Action | One permission verb | `read`, `write`, `delete`, `role.manage`, `policy.manage` |
| Permission Block | Where actions apply | all channels in domain `d1` can `read`, `publish` |
| Role | A bundle of permission blocks | `tenant-admin` bundles domain, role, and member access |
| Role Assignment | Who gets a role | give `user1` the `tenant-admin` role |
Read an assignment like this:
```text
Give <who> this <role>.
The role contains permission blocks that say where and what.
```
If you want to run services from specific release checkout code from github and make sure that
`MF_RELEASE_TAG` in [.env](.env) is being set to match the release version
Example:
```bash
git checkout tags/<release_number> -b <release_number>
# e.g. `git checkout tags/0.13.0 -b 0.13.0`
```text
Give user1 the tenant-admin role on domain d1.
```
Check that `.env` file contains:
That means:
```bash
MF_RELEASE_TAG=<release_number>
```text
user1 can use the tenant-admin permissions inside domain d1.
```
>`docker-compose` should be used for development and testing deployments. For production we suggest using [Kubernetes](https://docs.mainflux.io/kubernetes).
### How MG Roles Work With Atom
MG UI shows actions such as:
- read
- update
- delete
- manage roles
- add/remove members
- publish
- subscribe
These are mapped to Atom actions:
| MG action | Atom action |
| ---------------------------- | --------------- |
| view/read | `read` |
| create/update/edit/connect | `write` |
| delete/remove | `delete` |
| manage roles | `role.manage` |
| add/remove members or access | `policy.manage` |
| channel publish | `publish` |
| channel subscribe | `subscribe` |
So when MG UI checks:
```text
Can user1 manage roles for client1?
```
Atom checks:
```text
Does user1 have role.manage on client1, or on the domain that contains client1?
```
When MG UI checks:
```text
Can user1 add a member to channel1?
```
Atom checks:
```text
Does user1 have policy.manage on channel1, or on the domain that contains channel1?
```
### Practical Rule
If a user is domain admin, they usually receive a tenant-scoped role in Atom.
That tenant-scoped role can allow them to manage objects inside the domain:
- clients
- channels
- groups
- rules
- alarms
- reports
For narrower access, create object-scoped roles. For example:
```text
Give user2 a reader role only on channel1.
```
Then user2 can read only that channel, not the whole domain.
## Installation
```bash
git clone https://github.com/absmach/magistrala.git
cd magistrala
make provision_atom_tokens
make run_latest
```
A fresh clone carries no generated secrets. Two sets have to exist before the
stack can start — certificates and keys the internal services authenticate
with, and the Atom service tokens each service presents to Atom. `make
run_latest` produces the first set itself but expects the second to be there
already, which is why the token step comes first above.
### Certificates, broker secret and trace key
Generated by `make run_latest`, or on demand:
```bash
make check_certs
```
This creates whatever is missing and leaves anything already present alone:
| Path | What it is |
| ----------------------------------------------------------- | ------------------------------------------------------------------------- |
| `docker/ssl/certs/fluxmq-service-server.{crt,key}` | Server certificate for FluxMQ's mTLS service listener |
| `docker/ssl/certs/re-fluxmq-client.{crt,key}` | Client certificate whose URI SAN identifies the Rules Engine |
| `docker/ssl/certs/timescale-writer-fluxmq-client.{crt,key}` | Client certificate whose URI SAN identifies the Timescale writer |
| `docker/ssl/certs/postgres-writer-fluxmq-client.{crt,key}` | Client certificate whose URI SAN identifies the Postgres writer |
| `docker/ssl/certs/fluxmq-auth-fluxmq-client.{crt,key}` | Client certificate whose URI SAN identifies the publish proxy |
| `docker/fluxmq/secrets/re-current` | Rules Engine principal secret, from `MG_RE_BROKER_SECRET` |
| `docker/fluxmq/secrets/timescale-writer-current` | Timescale writer secret, from `MG_TIMESCALE_WRITER_BROKER_SECRET` |
| `docker/fluxmq/secrets/postgres-writer-current` | Postgres writer secret, from `MG_POSTGRES_WRITER_BROKER_SECRET` |
| `docker/fluxmq/secrets/fluxmq-auth-current` | Publish proxy secret, from `MG_FLUXMQ_BROKER_SECRET` |
| `docker/re/secrets/trace.key` | HMAC key the Rules Engine signs its loop-detection traces with |
Internal services reach the broker as *local principals* rather than as ordinary
clients: each presents a client certificate whose URI SAN names it, plus a SASL
secret, and the broker grants it only what it needs — the Rules Engine consumes
`m`, republishes under it, and feeds the `writers` and `alarms` streams; the
writers only subscribe to `writers`; the publish proxy that serves the UI's
HTTP publish endpoint only publishes under `m.`. The principals are declared in
`docker/fluxmq/node{1,2,3}.yaml`, and adding a service means adding an entry
there alongside its certificate and secret.
Being a local principal is also what preserves a message's origin. The broker
stamps its own transport protocol and identity on anything published over a
connection it does not trust, so a message relayed to the writers over the plain
AMQP listener would be stored as `protocol: amqp` with the relaying service as
its publisher. A `service`-role principal on the mTLS listener may state the
origin instead, and the protocol the device actually published with survives to
the database.
The certificates are issued by the development CA committed at
`docker/ssl/certs/ca.crt`, so no extra setup is needed for a local run. The
generated material is gitignored.
The server certificate is issued for `fluxmq` and `fluxmq-node{1,2,3}`, which
covers both this Compose stack and a single-node deployment. Point any
`MG_*_BROKER_URL` at a host outside that set and the service fails its TLS
verification with `certificate is valid for ...`; add the name to
`FLUXMQ_SERVICE_SERVER_CERT_CONFIG` in `docker/ssl/Makefile` and reissue:
```bash
rm -f docker/ssl/certs/fluxmq-service-server.* \
docker/ssl/certs/re-fluxmq-client.* \
docker/ssl/certs/timescale-writer-fluxmq-client.* \
docker/ssl/certs/postgres-writer-fluxmq-client.*
make -C docker/ssl fluxmq_service_certs
```
`make check_certs` skips certificates that already exist, so stale certificates
have to be removed rather than merely re-running the target.
Each local-principal secret must stay equal to the corresponding value in
`docker/.env`; a mismatch fails that service's broker authentication. After
changing one, re-run its target:
| Variable | Target |
| ----------------------------------- | ----------------------------------------- |
| `MG_RE_BROKER_SECRET` | `fluxmq_service_secret` |
| `MG_TIMESCALE_WRITER_BROKER_SECRET` | `timescale_writer_fluxmq_service_secret` |
| `MG_POSTGRES_WRITER_BROKER_SECRET` | `postgres_writer_fluxmq_service_secret` |
| `MG_FLUXMQ_BROKER_SECRET` | `fluxmq_auth_fluxmq_service_secret` |
`trace.key` is created once and preserved on later runs — replacing it while
messages are in flight would invalidate the rule traces they already carry, so
delete it only deliberately. Every Rules Engine replica must read the same key.
Start the stack through `make run_latest` rather than calling `docker compose
up` directly. Compose creates a missing bind-mount source as an empty
*directory*, so bringing up `re` or `fluxmq` before these files exist leaves the
containers failing against a directory where they expect a key.
### Atom service tokens
Not generated automatically, because provisioning them starts Atom and runs a
bootstrap job against it:
```bash
make provision_atom_tokens
```
This brings up Atom, runs `atom-bootstrap`, and writes the gitignored
`docker/.env.tokens` with one service token per consumer —
`MG_ATOM_TOKEN_FLUXMQ_AUTH`, `MG_ATOM_TOKEN_FLUXMQ_NODE{1,2,3}`,
`MG_ATOM_TOKEN_RE`, `MG_ATOM_TOKEN_ALARMS`, `MG_ATOM_TOKEN_REPORTS`,
`MG_ATOM_TOKEN_TIMESCALE_READER`, and `MG_ATOM_TOKEN_POSTGRES_READER`.
`make run_latest` refuses to start when that file is absent or short of any of
those variables, and names what is missing. To fold the step into the run:
```bash
make run_latest PROVISION_ATOM_TOKENS=true
```
Re-run `provision_atom_tokens` after anything that resets Atom's database; the
old tokens do not survive it.
---
## Usage
The quickest way to start using Mainflux is via the CLI. The latest version can be downloaded from the [official releases page][rel].
It can also be built and used from the project's root directory:
```bash
make cli
./build/mainflux-cli version
./build/cli health <service>
```
Additional details on using the CLI can be found in the [CLI documentation](https://docs.mainflux.io/cli).
## Documentation
Official documentation is hosted at [Mainflux official docs page][docs]. Documentation is auto-generated, checkout the instructions on [official docs repository](https://github.com/mainflux/docs):
If you spot an error or a need for corrections, please let us know - or even better: send us a PR.
## Authors
Main architect and BDFL of Mainflux project is [@drasko][drasko].
Additionally, [@nmarcetic][nikola] and [@janko-isidorovic][janko] assured
overall architecture and design, while [@manuio][manu] and [@darkodraskovic][darko]
helped with crafting initial implementation and continuously worked on the project evolutions.
Besides them, Mainflux is constantly improved and actively
developed by [@anovakovic01][alex], [@dusanb94][dusan], [@srados][sava],
[@gsaleh][george], [@blokovi][iva], [@chombium][kole], [@mteodor][mirko] and a large set of contributors.
Maintainers are listed in [MAINTAINERS](MAINTAINERS) file.
The Mainflux team would like to give special thanks to [@mijicd][dejan] for his monumental work
on designing and implementing a highly improved and optimized version of the platform,
and [@malidukica][dusanm] for his effort on implementing the initial user interface.
## Professional Support
There are many companies offering professional support for the Mainflux system.
If you need this kind of support, best is to reach out to [@drasko][drasko] directly, and he will point you out to the best-matching support team.
## Contributing
Thank you for your interest in Mainflux and the desire to contribute!
1. Take a look at our [open issues](https://github.com/mainflux/mainflux/issues). The [good-first-issue](https://github.com/mainflux/mainflux/labels/good-first-issue) label is specifically for issues that are great for getting started.
2. Checkout the [contribution guide](CONTRIBUTING.md) to learn more about our style and conventions.
3. Make your changes compatible to our workflow.
### We're Hiring
You like Mainflux and you would like to make it your day job? We're always looking for talented engineers interested in open-source, IoT and distributed systems. If you recognize yourself, reach out to [@drasko][drasko] - he will contact you back.
>The best way to grab our attention is, of course, by sending PRs :sunglasses:.
## Community
- [Google group][forum]
- [Gitter][gitter]
- [Twitter][twitter]
---
## License
[Apache-2.0](LICENSE)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmainflux%2Fmainflux.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fmainflux%2Fmainflux?ref=badge_large)
[banner]: https://github.com/mainflux/docs/blob/master/docs/img/gopherBanner.jpg
[ci-badge]: https://semaphoreci.com/api/v1/mainflux/mainflux/branches/master/badge.svg
[ci-url]: https://semaphoreci.com/mainflux/mainflux
[docs]: https://docs.mainflux.io
[docker]: https://www.docker.com
[forum]: https://groups.google.com/forum/#!forum/mainflux
[gitter]: https://gitter.im/mainflux/mainflux?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[gitter-badge]: https://badges.gitter.im/Join%20Chat.svg
[grc-badge]: https://goreportcard.com/badge/github.com/mainflux/mainflux
[grc-url]: https://goreportcard.com/report/github.com/mainflux/mainflux
[cov-badge]: https://codecov.io/gh/mainflux/mainflux/branch/master/graph/badge.svg
[cov-url]: https://codecov.io/gh/mainflux/mainflux
[license]: https://img.shields.io/badge/license-Apache%20v2.0-blue.svg
[twitter]: https://twitter.com/mainflux
[lora]: https://lora-alliance.org/
[opcua]: https://opcfoundation.org/about/opc-technologies/opc-ua/
[agent]: https://github.com/mainflux/agent
[export]: https://github.com/mainflux/export
[kubernetes]: https://kubernetes.io/
[rel]: https://github.com/mainflux/mainflux/releases
[careers]: https://www.mainflux.com/careers.html
[lf]: https://www.linuxfoundation.org/
[edgex]: https://www.edgexfoundry.org/
[company]: https://www.mainflux.com/
[blog]: https://medium.com/mainflux-iot-platform
[drasko]: https://github.com/drasko
[nikola]: https://github.com/nmarcetic
[dejan]: https://github.com/mijicd
[manu]: https://github.com/manuIO
[darko]: https://github.com/darkodraskovic
[janko]: https://github.com/janko-isidorovic
[alex]: https://github.com/anovakovic01
[dusan]: https://github.com/dusanb94
[sava]: https://github.com/srados
[george]: https://github.com/gesaleh
[iva]: https://github.com/blokovi
[kole]: https://github.com/chombium
[dusanm]: https://github.com/malidukica
[mirko]: https://github.com/mteodor
Apache-2.0
+2 -2
View File
@@ -1,7 +1,7 @@
// Copyright (c) Mainflux
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package mainflux
package magistrala
// Response contains HTTP response specific methods.
type Response interface {
-92
View File
@@ -1,92 +0,0 @@
asyncapi: '2.2.0'
info:
title: MQTT Adapter
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
version: '1.0.0'
description: |
MQTT adapter provides an MQTT API for sending messages through the platform. MQTT adapter uses [mProxy](https://github.com/mainflux/mproxy) for proxying traffic between client and MQTT broker.
Additionally, the MQTT adapter and the NATS message broker are replicating the traffic between brokers.
defaultContentType: application/json
servers:
dev:
url: localhost:{port}
protocol: mqtt
description: Test broker
variables:
port:
description: Secure connection (TLS) is available through port 8883.
default: '1883'
enum:
- '1883'
- '8883'
username:
description: Thing ID connected to the channel defined in the MQTT topic.
password:
description: Thing Key corresponding to the Thing ID.
channels:
channels/{channelId}/messages/{subtopic}:
parameters:
channelId:
$ref: '#/components/parameters/channelId'
subtopic:
$ref: '#/components/parameters/subtopic'
publish:
traits:
- $ref: '#/components/operationTraits/mqtt'
message:
$ref: '#/components/messages/jsonMsg'
subscribe:
traits:
- $ref: '#/components/operationTraits/mqtt'
message:
$ref: '#/components/messages/jsonMsg'
components:
messages:
jsonMsg:
title: JSON Message
summary: Arbitrary JSON array or object.
contentType: application/json
payload:
$ref: "#/components/schemas/jsonMsg"
schemas:
jsonMsg:
type: object
description: Arbitrary JSON object or array. SenML format is recommended.
example: |
### SenML
```json
[{"bn":"some-base-name:","bt":1641646520, "bu":"A","bver":5, "n":"voltage","u":"V","v":120.1}, {"n":"current","t":-5,"v":1.2}, {"n":"current","t":-4,"v":1.3}]
```
### JSON
```json
{"field_1":"val_1", "t": 1641646525}
```
### JSON Array
```json
[{"field_1":"val_1", "t": 1641646520},{"field_2":"val_2", "t": 1641646522}]
```
parameters:
channelId:
description: Channel ID connected to the Thing ID defined in the username.
schema:
type: string
format: uuid
subtopic:
description: Arbitrary message subtopic.
schema:
type: string
default: ''
operationTraits:
mqtt:
bindings:
mqtt:
qos: 2
+6
View File
@@ -0,0 +1,6 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Package api contains commonly used constants and functions
// for the HTTP and gRPC API.
package api
+551
View File
@@ -0,0 +1,551 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v7.35.1
// source: auth/v1/auth.proto
package v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type AuthNReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AuthNReq) Reset() {
*x = AuthNReq{}
mi := &file_auth_v1_auth_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AuthNReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthNReq) ProtoMessage() {}
func (x *AuthNReq) ProtoReflect() protoreflect.Message {
mi := &file_auth_v1_auth_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AuthNReq.ProtoReflect.Descriptor instead.
func (*AuthNReq) Descriptor() ([]byte, []int) {
return file_auth_v1_auth_proto_rawDescGZIP(), []int{0}
}
func (x *AuthNReq) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
type AuthNRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
UserRole uint32 `protobuf:"varint,3,opt,name=user_role,json=userRole,proto3" json:"user_role,omitempty"`
Verified bool `protobuf:"varint,4,opt,name=verified,proto3" json:"verified,omitempty"`
TokenType uint32 `protobuf:"varint,5,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AuthNRes) Reset() {
*x = AuthNRes{}
mi := &file_auth_v1_auth_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AuthNRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthNRes) ProtoMessage() {}
func (x *AuthNRes) ProtoReflect() protoreflect.Message {
mi := &file_auth_v1_auth_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AuthNRes.ProtoReflect.Descriptor instead.
func (*AuthNRes) Descriptor() ([]byte, []int) {
return file_auth_v1_auth_proto_rawDescGZIP(), []int{1}
}
func (x *AuthNRes) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *AuthNRes) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
func (x *AuthNRes) GetUserRole() uint32 {
if x != nil {
return x.UserRole
}
return 0
}
func (x *AuthNRes) GetVerified() bool {
if x != nil {
return x.Verified
}
return false
}
func (x *AuthNRes) GetTokenType() uint32 {
if x != nil {
return x.TokenType
}
return 0
}
type PolicyReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`
SubjectType string `protobuf:"bytes,2,opt,name=subject_type,json=subjectType,proto3" json:"subject_type,omitempty"`
SubjectKind string `protobuf:"bytes,3,opt,name=subject_kind,json=subjectKind,proto3" json:"subject_kind,omitempty"`
SubjectRelation string `protobuf:"bytes,4,opt,name=subject_relation,json=subjectRelation,proto3" json:"subject_relation,omitempty"`
Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"`
Relation string `protobuf:"bytes,6,opt,name=relation,proto3" json:"relation,omitempty"`
Permission string `protobuf:"bytes,7,opt,name=permission,proto3" json:"permission,omitempty"`
Object string `protobuf:"bytes,8,opt,name=object,proto3" json:"object,omitempty"`
ObjectType string `protobuf:"bytes,9,opt,name=object_type,json=objectType,proto3" json:"object_type,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PolicyReq) Reset() {
*x = PolicyReq{}
mi := &file_auth_v1_auth_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PolicyReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PolicyReq) ProtoMessage() {}
func (x *PolicyReq) ProtoReflect() protoreflect.Message {
mi := &file_auth_v1_auth_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PolicyReq.ProtoReflect.Descriptor instead.
func (*PolicyReq) Descriptor() ([]byte, []int) {
return file_auth_v1_auth_proto_rawDescGZIP(), []int{2}
}
func (x *PolicyReq) GetDomain() string {
if x != nil {
return x.Domain
}
return ""
}
func (x *PolicyReq) GetSubjectType() string {
if x != nil {
return x.SubjectType
}
return ""
}
func (x *PolicyReq) GetSubjectKind() string {
if x != nil {
return x.SubjectKind
}
return ""
}
func (x *PolicyReq) GetSubjectRelation() string {
if x != nil {
return x.SubjectRelation
}
return ""
}
func (x *PolicyReq) GetSubject() string {
if x != nil {
return x.Subject
}
return ""
}
func (x *PolicyReq) GetRelation() string {
if x != nil {
return x.Relation
}
return ""
}
func (x *PolicyReq) GetPermission() string {
if x != nil {
return x.Permission
}
return ""
}
func (x *PolicyReq) GetObject() string {
if x != nil {
return x.Object
}
return ""
}
func (x *PolicyReq) GetObjectType() string {
if x != nil {
return x.ObjectType
}
return ""
}
type PATReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
PatId string `protobuf:"bytes,1,opt,name=pat_id,json=patId,proto3" json:"pat_id,omitempty"`
Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"`
Operation string `protobuf:"bytes,3,opt,name=operation,proto3" json:"operation,omitempty"`
UserId string `protobuf:"bytes,4,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
EntityId string `protobuf:"bytes,5,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"`
EntityType string `protobuf:"bytes,6,opt,name=entity_type,json=entityType,proto3" json:"entity_type,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PATReq) Reset() {
*x = PATReq{}
mi := &file_auth_v1_auth_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PATReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PATReq) ProtoMessage() {}
func (x *PATReq) ProtoReflect() protoreflect.Message {
mi := &file_auth_v1_auth_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PATReq.ProtoReflect.Descriptor instead.
func (*PATReq) Descriptor() ([]byte, []int) {
return file_auth_v1_auth_proto_rawDescGZIP(), []int{3}
}
func (x *PATReq) GetPatId() string {
if x != nil {
return x.PatId
}
return ""
}
func (x *PATReq) GetDomain() string {
if x != nil {
return x.Domain
}
return ""
}
func (x *PATReq) GetOperation() string {
if x != nil {
return x.Operation
}
return ""
}
func (x *PATReq) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
func (x *PATReq) GetEntityId() string {
if x != nil {
return x.EntityId
}
return ""
}
func (x *PATReq) GetEntityType() string {
if x != nil {
return x.EntityType
}
return ""
}
type AuthZReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
PolicyReq *PolicyReq `protobuf:"bytes,1,opt,name=policy_req,json=policyReq,proto3" json:"policy_req,omitempty"`
PatReq *PATReq `protobuf:"bytes,2,opt,name=pat_req,json=patReq,proto3,oneof" json:"pat_req,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AuthZReq) Reset() {
*x = AuthZReq{}
mi := &file_auth_v1_auth_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AuthZReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthZReq) ProtoMessage() {}
func (x *AuthZReq) ProtoReflect() protoreflect.Message {
mi := &file_auth_v1_auth_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AuthZReq.ProtoReflect.Descriptor instead.
func (*AuthZReq) Descriptor() ([]byte, []int) {
return file_auth_v1_auth_proto_rawDescGZIP(), []int{4}
}
func (x *AuthZReq) GetPolicyReq() *PolicyReq {
if x != nil {
return x.PolicyReq
}
return nil
}
func (x *AuthZReq) GetPatReq() *PATReq {
if x != nil {
return x.PatReq
}
return nil
}
type AuthZRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AuthZRes) Reset() {
*x = AuthZRes{}
mi := &file_auth_v1_auth_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AuthZRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthZRes) ProtoMessage() {}
func (x *AuthZRes) ProtoReflect() protoreflect.Message {
mi := &file_auth_v1_auth_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AuthZRes.ProtoReflect.Descriptor instead.
func (*AuthZRes) Descriptor() ([]byte, []int) {
return file_auth_v1_auth_proto_rawDescGZIP(), []int{5}
}
func (x *AuthZRes) GetAuthorized() bool {
if x != nil {
return x.Authorized
}
return false
}
func (x *AuthZRes) GetId() string {
if x != nil {
return x.Id
}
return ""
}
var File_auth_v1_auth_proto protoreflect.FileDescriptor
const file_auth_v1_auth_proto_rawDesc = "" +
"\n" +
"\x12auth/v1/auth.proto\x12\aauth.v1\" \n" +
"\bAuthNReq\x12\x14\n" +
"\x05token\x18\x01 \x01(\tR\x05token\"\x8b\x01\n" +
"\bAuthNRes\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\x12\x17\n" +
"\auser_id\x18\x02 \x01(\tR\x06userId\x12\x1b\n" +
"\tuser_role\x18\x03 \x01(\rR\buserRole\x12\x1a\n" +
"\bverified\x18\x04 \x01(\bR\bverified\x12\x1d\n" +
"\n" +
"token_type\x18\x05 \x01(\rR\ttokenType\"\xa3\x02\n" +
"\tPolicyReq\x12\x16\n" +
"\x06domain\x18\x01 \x01(\tR\x06domain\x12!\n" +
"\fsubject_type\x18\x02 \x01(\tR\vsubjectType\x12!\n" +
"\fsubject_kind\x18\x03 \x01(\tR\vsubjectKind\x12)\n" +
"\x10subject_relation\x18\x04 \x01(\tR\x0fsubjectRelation\x12\x18\n" +
"\asubject\x18\x05 \x01(\tR\asubject\x12\x1a\n" +
"\brelation\x18\x06 \x01(\tR\brelation\x12\x1e\n" +
"\n" +
"permission\x18\a \x01(\tR\n" +
"permission\x12\x16\n" +
"\x06object\x18\b \x01(\tR\x06object\x12\x1f\n" +
"\vobject_type\x18\t \x01(\tR\n" +
"objectType\"\xac\x01\n" +
"\x06PATReq\x12\x15\n" +
"\x06pat_id\x18\x01 \x01(\tR\x05patId\x12\x16\n" +
"\x06domain\x18\x02 \x01(\tR\x06domain\x12\x1c\n" +
"\toperation\x18\x03 \x01(\tR\toperation\x12\x17\n" +
"\auser_id\x18\x04 \x01(\tR\x06userId\x12\x1b\n" +
"\tentity_id\x18\x05 \x01(\tR\bentityId\x12\x1f\n" +
"\ventity_type\x18\x06 \x01(\tR\n" +
"entityType\"x\n" +
"\bAuthZReq\x121\n" +
"\n" +
"policy_req\x18\x01 \x01(\v2\x12.auth.v1.PolicyReqR\tpolicyReq\x12-\n" +
"\apat_req\x18\x02 \x01(\v2\x0f.auth.v1.PATReqH\x00R\x06patReq\x88\x01\x01B\n" +
"\n" +
"\b_pat_req\":\n" +
"\bAuthZRes\x12\x1e\n" +
"\n" +
"authorized\x18\x01 \x01(\bR\n" +
"authorized\x12\x0e\n" +
"\x02id\x18\x02 \x01(\tR\x02id2z\n" +
"\vAuthService\x123\n" +
"\tAuthorize\x12\x11.auth.v1.AuthZReq\x1a\x11.auth.v1.AuthZRes\"\x00\x126\n" +
"\fAuthenticate\x12\x11.auth.v1.AuthNReq\x1a\x11.auth.v1.AuthNRes\"\x00B0Z.github.com/absmach/magistrala/api/grpc/auth/v1b\x06proto3"
var (
file_auth_v1_auth_proto_rawDescOnce sync.Once
file_auth_v1_auth_proto_rawDescData []byte
)
func file_auth_v1_auth_proto_rawDescGZIP() []byte {
file_auth_v1_auth_proto_rawDescOnce.Do(func() {
file_auth_v1_auth_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_auth_v1_auth_proto_rawDesc), len(file_auth_v1_auth_proto_rawDesc)))
})
return file_auth_v1_auth_proto_rawDescData
}
var file_auth_v1_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_auth_v1_auth_proto_goTypes = []any{
(*AuthNReq)(nil), // 0: auth.v1.AuthNReq
(*AuthNRes)(nil), // 1: auth.v1.AuthNRes
(*PolicyReq)(nil), // 2: auth.v1.PolicyReq
(*PATReq)(nil), // 3: auth.v1.PATReq
(*AuthZReq)(nil), // 4: auth.v1.AuthZReq
(*AuthZRes)(nil), // 5: auth.v1.AuthZRes
}
var file_auth_v1_auth_proto_depIdxs = []int32{
2, // 0: auth.v1.AuthZReq.policy_req:type_name -> auth.v1.PolicyReq
3, // 1: auth.v1.AuthZReq.pat_req:type_name -> auth.v1.PATReq
4, // 2: auth.v1.AuthService.Authorize:input_type -> auth.v1.AuthZReq
0, // 3: auth.v1.AuthService.Authenticate:input_type -> auth.v1.AuthNReq
5, // 4: auth.v1.AuthService.Authorize:output_type -> auth.v1.AuthZRes
1, // 5: auth.v1.AuthService.Authenticate:output_type -> auth.v1.AuthNRes
4, // [4:6] is the sub-list for method output_type
2, // [2:4] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_auth_v1_auth_proto_init() }
func file_auth_v1_auth_proto_init() {
if File_auth_v1_auth_proto != nil {
return
}
file_auth_v1_auth_proto_msgTypes[4].OneofWrappers = []any{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_auth_v1_auth_proto_rawDesc), len(file_auth_v1_auth_proto_rawDesc)),
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_auth_v1_auth_proto_goTypes,
DependencyIndexes: file_auth_v1_auth_proto_depIdxs,
MessageInfos: file_auth_v1_auth_proto_msgTypes,
}.Build()
File_auth_v1_auth_proto = out.File
file_auth_v1_auth_proto_goTypes = nil
file_auth_v1_auth_proto_depIdxs = nil
}
+168
View File
@@ -0,0 +1,168 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.1
// source: auth/v1/auth.proto
package v1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
AuthService_Authorize_FullMethodName = "/auth.v1.AuthService/Authorize"
AuthService_Authenticate_FullMethodName = "/auth.v1.AuthService/Authenticate"
)
// AuthServiceClient is the client API for AuthService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// AuthService is a service that provides authentication
// and authorization functionalities for Magistrala services.
type AuthServiceClient interface {
Authorize(ctx context.Context, in *AuthZReq, opts ...grpc.CallOption) (*AuthZRes, error)
Authenticate(ctx context.Context, in *AuthNReq, opts ...grpc.CallOption) (*AuthNRes, error)
}
type authServiceClient struct {
cc grpc.ClientConnInterface
}
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
return &authServiceClient{cc}
}
func (c *authServiceClient) Authorize(ctx context.Context, in *AuthZReq, opts ...grpc.CallOption) (*AuthZRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AuthZRes)
err := c.cc.Invoke(ctx, AuthService_Authorize_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) Authenticate(ctx context.Context, in *AuthNReq, opts ...grpc.CallOption) (*AuthNRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AuthNRes)
err := c.cc.Invoke(ctx, AuthService_Authenticate_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// AuthServiceServer is the server API for AuthService service.
// All implementations must embed UnimplementedAuthServiceServer
// for forward compatibility.
//
// AuthService is a service that provides authentication
// and authorization functionalities for Magistrala services.
type AuthServiceServer interface {
Authorize(context.Context, *AuthZReq) (*AuthZRes, error)
Authenticate(context.Context, *AuthNReq) (*AuthNRes, error)
mustEmbedUnimplementedAuthServiceServer()
}
// UnimplementedAuthServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAuthServiceServer struct{}
func (UnimplementedAuthServiceServer) Authorize(context.Context, *AuthZReq) (*AuthZRes, error) {
return nil, status.Error(codes.Unimplemented, "method Authorize not implemented")
}
func (UnimplementedAuthServiceServer) Authenticate(context.Context, *AuthNReq) (*AuthNRes, error) {
return nil, status.Error(codes.Unimplemented, "method Authenticate not implemented")
}
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
func (UnimplementedAuthServiceServer) testEmbeddedByValue() {}
// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AuthServiceServer will
// result in compilation errors.
type UnsafeAuthServiceServer interface {
mustEmbedUnimplementedAuthServiceServer()
}
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
// If the following call panics, it indicates UnimplementedAuthServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&AuthService_ServiceDesc, srv)
}
func _AuthService_Authorize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthZReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).Authorize(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_Authorize_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).Authorize(ctx, req.(*AuthZReq))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthNReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).Authenticate(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_Authenticate_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).Authenticate(ctx, req.(*AuthNReq))
}
return interceptor(ctx, in, info, handler)
}
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AuthService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "auth.v1.AuthService",
HandlerType: (*AuthServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Authorize",
Handler: _AuthService_Authorize_Handler,
},
{
MethodName: "Authenticate",
Handler: _AuthService_Authenticate_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "auth/v1/auth.proto",
}
+228
View File
@@ -0,0 +1,228 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v7.35.1
// source: certs/v1/certs.proto
package v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
emptypb "google.golang.org/protobuf/types/known/emptypb"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type EntityReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
SerialNumber string `protobuf:"bytes,1,opt,name=serial_number,json=serialNumber,proto3" json:"serial_number,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *EntityReq) Reset() {
*x = EntityReq{}
mi := &file_certs_v1_certs_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *EntityReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EntityReq) ProtoMessage() {}
func (x *EntityReq) ProtoReflect() protoreflect.Message {
mi := &file_certs_v1_certs_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EntityReq.ProtoReflect.Descriptor instead.
func (*EntityReq) Descriptor() ([]byte, []int) {
return file_certs_v1_certs_proto_rawDescGZIP(), []int{0}
}
func (x *EntityReq) GetSerialNumber() string {
if x != nil {
return x.SerialNumber
}
return ""
}
type EntityRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *EntityRes) Reset() {
*x = EntityRes{}
mi := &file_certs_v1_certs_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *EntityRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EntityRes) ProtoMessage() {}
func (x *EntityRes) ProtoReflect() protoreflect.Message {
mi := &file_certs_v1_certs_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EntityRes.ProtoReflect.Descriptor instead.
func (*EntityRes) Descriptor() ([]byte, []int) {
return file_certs_v1_certs_proto_rawDescGZIP(), []int{1}
}
func (x *EntityRes) GetEntityId() string {
if x != nil {
return x.EntityId
}
return ""
}
type RevokeReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RevokeReq) Reset() {
*x = RevokeReq{}
mi := &file_certs_v1_certs_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RevokeReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RevokeReq) ProtoMessage() {}
func (x *RevokeReq) ProtoReflect() protoreflect.Message {
mi := &file_certs_v1_certs_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RevokeReq.ProtoReflect.Descriptor instead.
func (*RevokeReq) Descriptor() ([]byte, []int) {
return file_certs_v1_certs_proto_rawDescGZIP(), []int{2}
}
func (x *RevokeReq) GetEntityId() string {
if x != nil {
return x.EntityId
}
return ""
}
var File_certs_v1_certs_proto protoreflect.FileDescriptor
const file_certs_v1_certs_proto_rawDesc = "" +
"\n" +
"\x14certs/v1/certs.proto\x12\rabsmach.certs\x1a\x1bgoogle/protobuf/empty.proto\"0\n" +
"\tEntityReq\x12#\n" +
"\rserial_number\x18\x01 \x01(\tR\fserialNumber\"(\n" +
"\tEntityRes\x12\x1b\n" +
"\tentity_id\x18\x01 \x01(\tR\bentityId\"(\n" +
"\tRevokeReq\x12\x1b\n" +
"\tentity_id\x18\x01 \x01(\tR\bentityId2\x96\x01\n" +
"\fCertsService\x12C\n" +
"\vGetEntityID\x12\x18.absmach.certs.EntityReq\x1a\x18.absmach.certs.EntityRes\"\x00\x12A\n" +
"\vRevokeCerts\x12\x18.absmach.certs.RevokeReq\x1a\x16.google.protobuf.Empty\"\x00B1Z/github.com/absmach/magistrala/api/grpc/certs/v1b\x06proto3"
var (
file_certs_v1_certs_proto_rawDescOnce sync.Once
file_certs_v1_certs_proto_rawDescData []byte
)
func file_certs_v1_certs_proto_rawDescGZIP() []byte {
file_certs_v1_certs_proto_rawDescOnce.Do(func() {
file_certs_v1_certs_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_certs_v1_certs_proto_rawDesc), len(file_certs_v1_certs_proto_rawDesc)))
})
return file_certs_v1_certs_proto_rawDescData
}
var file_certs_v1_certs_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_certs_v1_certs_proto_goTypes = []any{
(*EntityReq)(nil), // 0: absmach.certs.EntityReq
(*EntityRes)(nil), // 1: absmach.certs.EntityRes
(*RevokeReq)(nil), // 2: absmach.certs.RevokeReq
(*emptypb.Empty)(nil), // 3: google.protobuf.Empty
}
var file_certs_v1_certs_proto_depIdxs = []int32{
0, // 0: absmach.certs.CertsService.GetEntityID:input_type -> absmach.certs.EntityReq
2, // 1: absmach.certs.CertsService.RevokeCerts:input_type -> absmach.certs.RevokeReq
1, // 2: absmach.certs.CertsService.GetEntityID:output_type -> absmach.certs.EntityRes
3, // 3: absmach.certs.CertsService.RevokeCerts:output_type -> google.protobuf.Empty
2, // [2:4] is the sub-list for method output_type
0, // [0:2] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_certs_v1_certs_proto_init() }
func file_certs_v1_certs_proto_init() {
if File_certs_v1_certs_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_certs_v1_certs_proto_rawDesc), len(file_certs_v1_certs_proto_rawDesc)),
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_certs_v1_certs_proto_goTypes,
DependencyIndexes: file_certs_v1_certs_proto_depIdxs,
MessageInfos: file_certs_v1_certs_proto_msgTypes,
}.Build()
File_certs_v1_certs_proto = out.File
file_certs_v1_certs_proto_goTypes = nil
file_certs_v1_certs_proto_depIdxs = nil
}
+163
View File
@@ -0,0 +1,163 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.1
// source: certs/v1/certs.proto
package v1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
CertsService_GetEntityID_FullMethodName = "/absmach.certs.CertsService/GetEntityID"
CertsService_RevokeCerts_FullMethodName = "/absmach.certs.CertsService/RevokeCerts"
)
// CertsServiceClient is the client API for CertsService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type CertsServiceClient interface {
GetEntityID(ctx context.Context, in *EntityReq, opts ...grpc.CallOption) (*EntityRes, error)
RevokeCerts(ctx context.Context, in *RevokeReq, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type certsServiceClient struct {
cc grpc.ClientConnInterface
}
func NewCertsServiceClient(cc grpc.ClientConnInterface) CertsServiceClient {
return &certsServiceClient{cc}
}
func (c *certsServiceClient) GetEntityID(ctx context.Context, in *EntityReq, opts ...grpc.CallOption) (*EntityRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(EntityRes)
err := c.cc.Invoke(ctx, CertsService_GetEntityID_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *certsServiceClient) RevokeCerts(ctx context.Context, in *RevokeReq, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, CertsService_RevokeCerts_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// CertsServiceServer is the server API for CertsService service.
// All implementations must embed UnimplementedCertsServiceServer
// for forward compatibility.
type CertsServiceServer interface {
GetEntityID(context.Context, *EntityReq) (*EntityRes, error)
RevokeCerts(context.Context, *RevokeReq) (*emptypb.Empty, error)
mustEmbedUnimplementedCertsServiceServer()
}
// UnimplementedCertsServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedCertsServiceServer struct{}
func (UnimplementedCertsServiceServer) GetEntityID(context.Context, *EntityReq) (*EntityRes, error) {
return nil, status.Error(codes.Unimplemented, "method GetEntityID not implemented")
}
func (UnimplementedCertsServiceServer) RevokeCerts(context.Context, *RevokeReq) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method RevokeCerts not implemented")
}
func (UnimplementedCertsServiceServer) mustEmbedUnimplementedCertsServiceServer() {}
func (UnimplementedCertsServiceServer) testEmbeddedByValue() {}
// UnsafeCertsServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CertsServiceServer will
// result in compilation errors.
type UnsafeCertsServiceServer interface {
mustEmbedUnimplementedCertsServiceServer()
}
func RegisterCertsServiceServer(s grpc.ServiceRegistrar, srv CertsServiceServer) {
// If the following call panics, it indicates UnimplementedCertsServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&CertsService_ServiceDesc, srv)
}
func _CertsService_GetEntityID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EntityReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CertsServiceServer).GetEntityID(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: CertsService_GetEntityID_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CertsServiceServer).GetEntityID(ctx, req.(*EntityReq))
}
return interceptor(ctx, in, info, handler)
}
func _CertsService_RevokeCerts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RevokeReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CertsServiceServer).RevokeCerts(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: CertsService_RevokeCerts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CertsServiceServer).RevokeCerts(ctx, req.(*RevokeReq))
}
return interceptor(ctx, in, info, handler)
}
// CertsService_ServiceDesc is the grpc.ServiceDesc for CertsService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var CertsService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "absmach.certs.CertsService",
HandlerType: (*CertsServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetEntityID",
Handler: _CertsService_GetEntityID_Handler,
},
{
MethodName: "RevokeCerts",
Handler: _CertsService_RevokeCerts_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "certs/v1/certs.proto",
}
+402
View File
@@ -0,0 +1,402 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v7.35.1
// source: channels/v1/channels.proto
package v1
import (
v1 "github.com/absmach/magistrala/api/grpc/common/v1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type RemoveClientConnectionsReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RemoveClientConnectionsReq) Reset() {
*x = RemoveClientConnectionsReq{}
mi := &file_channels_v1_channels_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RemoveClientConnectionsReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RemoveClientConnectionsReq) ProtoMessage() {}
func (x *RemoveClientConnectionsReq) ProtoReflect() protoreflect.Message {
mi := &file_channels_v1_channels_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RemoveClientConnectionsReq.ProtoReflect.Descriptor instead.
func (*RemoveClientConnectionsReq) Descriptor() ([]byte, []int) {
return file_channels_v1_channels_proto_rawDescGZIP(), []int{0}
}
func (x *RemoveClientConnectionsReq) GetClientId() string {
if x != nil {
return x.ClientId
}
return ""
}
type RemoveClientConnectionsRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RemoveClientConnectionsRes) Reset() {
*x = RemoveClientConnectionsRes{}
mi := &file_channels_v1_channels_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RemoveClientConnectionsRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RemoveClientConnectionsRes) ProtoMessage() {}
func (x *RemoveClientConnectionsRes) ProtoReflect() protoreflect.Message {
mi := &file_channels_v1_channels_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RemoveClientConnectionsRes.ProtoReflect.Descriptor instead.
func (*RemoveClientConnectionsRes) Descriptor() ([]byte, []int) {
return file_channels_v1_channels_proto_rawDescGZIP(), []int{1}
}
type UnsetParentGroupFromChannelsReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
ParentGroupId string `protobuf:"bytes,1,opt,name=parent_group_id,json=parentGroupId,proto3" json:"parent_group_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UnsetParentGroupFromChannelsReq) Reset() {
*x = UnsetParentGroupFromChannelsReq{}
mi := &file_channels_v1_channels_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UnsetParentGroupFromChannelsReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UnsetParentGroupFromChannelsReq) ProtoMessage() {}
func (x *UnsetParentGroupFromChannelsReq) ProtoReflect() protoreflect.Message {
mi := &file_channels_v1_channels_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UnsetParentGroupFromChannelsReq.ProtoReflect.Descriptor instead.
func (*UnsetParentGroupFromChannelsReq) Descriptor() ([]byte, []int) {
return file_channels_v1_channels_proto_rawDescGZIP(), []int{2}
}
func (x *UnsetParentGroupFromChannelsReq) GetParentGroupId() string {
if x != nil {
return x.ParentGroupId
}
return ""
}
type UnsetParentGroupFromChannelsRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UnsetParentGroupFromChannelsRes) Reset() {
*x = UnsetParentGroupFromChannelsRes{}
mi := &file_channels_v1_channels_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UnsetParentGroupFromChannelsRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UnsetParentGroupFromChannelsRes) ProtoMessage() {}
func (x *UnsetParentGroupFromChannelsRes) ProtoReflect() protoreflect.Message {
mi := &file_channels_v1_channels_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UnsetParentGroupFromChannelsRes.ProtoReflect.Descriptor instead.
func (*UnsetParentGroupFromChannelsRes) Descriptor() ([]byte, []int) {
return file_channels_v1_channels_proto_rawDescGZIP(), []int{3}
}
type AuthzReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
DomainId string `protobuf:"bytes,1,opt,name=domain_id,json=domainId,proto3" json:"domain_id,omitempty"`
ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
ClientType string `protobuf:"bytes,3,opt,name=client_type,json=clientType,proto3" json:"client_type,omitempty"`
ChannelId string `protobuf:"bytes,4,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
Type uint32 `protobuf:"varint,5,opt,name=type,proto3" json:"type,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AuthzReq) Reset() {
*x = AuthzReq{}
mi := &file_channels_v1_channels_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AuthzReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthzReq) ProtoMessage() {}
func (x *AuthzReq) ProtoReflect() protoreflect.Message {
mi := &file_channels_v1_channels_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AuthzReq.ProtoReflect.Descriptor instead.
func (*AuthzReq) Descriptor() ([]byte, []int) {
return file_channels_v1_channels_proto_rawDescGZIP(), []int{4}
}
func (x *AuthzReq) GetDomainId() string {
if x != nil {
return x.DomainId
}
return ""
}
func (x *AuthzReq) GetClientId() string {
if x != nil {
return x.ClientId
}
return ""
}
func (x *AuthzReq) GetClientType() string {
if x != nil {
return x.ClientType
}
return ""
}
func (x *AuthzReq) GetChannelId() string {
if x != nil {
return x.ChannelId
}
return ""
}
func (x *AuthzReq) GetType() uint32 {
if x != nil {
return x.Type
}
return 0
}
type AuthzRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AuthzRes) Reset() {
*x = AuthzRes{}
mi := &file_channels_v1_channels_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AuthzRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthzRes) ProtoMessage() {}
func (x *AuthzRes) ProtoReflect() protoreflect.Message {
mi := &file_channels_v1_channels_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AuthzRes.ProtoReflect.Descriptor instead.
func (*AuthzRes) Descriptor() ([]byte, []int) {
return file_channels_v1_channels_proto_rawDescGZIP(), []int{5}
}
func (x *AuthzRes) GetAuthorized() bool {
if x != nil {
return x.Authorized
}
return false
}
var File_channels_v1_channels_proto protoreflect.FileDescriptor
const file_channels_v1_channels_proto_rawDesc = "" +
"\n" +
"\x1achannels/v1/channels.proto\x12\vchannels.v1\x1a\x16common/v1/common.proto\"9\n" +
"\x1aRemoveClientConnectionsReq\x12\x1b\n" +
"\tclient_id\x18\x01 \x01(\tR\bclientId\"\x1c\n" +
"\x1aRemoveClientConnectionsRes\"I\n" +
"\x1fUnsetParentGroupFromChannelsReq\x12&\n" +
"\x0fparent_group_id\x18\x01 \x01(\tR\rparentGroupId\"!\n" +
"\x1fUnsetParentGroupFromChannelsRes\"\x98\x01\n" +
"\bAuthzReq\x12\x1b\n" +
"\tdomain_id\x18\x01 \x01(\tR\bdomainId\x12\x1b\n" +
"\tclient_id\x18\x02 \x01(\tR\bclientId\x12\x1f\n" +
"\vclient_type\x18\x03 \x01(\tR\n" +
"clientType\x12\x1d\n" +
"\n" +
"channel_id\x18\x04 \x01(\tR\tchannelId\x12\x12\n" +
"\x04type\x18\x05 \x01(\rR\x04type\"*\n" +
"\bAuthzRes\x12\x1e\n" +
"\n" +
"authorized\x18\x01 \x01(\bR\n" +
"authorized2\xe1\x03\n" +
"\x0fChannelsService\x12;\n" +
"\tAuthorize\x12\x15.channels.v1.AuthzReq\x1a\x15.channels.v1.AuthzRes\"\x00\x12m\n" +
"\x17RemoveClientConnections\x12'.channels.v1.RemoveClientConnectionsReq\x1a'.channels.v1.RemoveClientConnectionsRes\"\x00\x12|\n" +
"\x1cUnsetParentGroupFromChannels\x12,.channels.v1.UnsetParentGroupFromChannelsReq\x1a,.channels.v1.UnsetParentGroupFromChannelsRes\"\x00\x12N\n" +
"\x0eRetrieveEntity\x12\x1c.common.v1.RetrieveEntityReq\x1a\x1c.common.v1.RetrieveEntityRes\"\x00\x12T\n" +
"\x11RetrieveIDByRoute\x12\x1f.common.v1.RetrieveIDByRouteReq\x1a\x1c.common.v1.RetrieveEntityRes\"\x00B4Z2github.com/absmach/magistrala/api/grpc/channels/v1b\x06proto3"
var (
file_channels_v1_channels_proto_rawDescOnce sync.Once
file_channels_v1_channels_proto_rawDescData []byte
)
func file_channels_v1_channels_proto_rawDescGZIP() []byte {
file_channels_v1_channels_proto_rawDescOnce.Do(func() {
file_channels_v1_channels_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_channels_v1_channels_proto_rawDesc), len(file_channels_v1_channels_proto_rawDesc)))
})
return file_channels_v1_channels_proto_rawDescData
}
var file_channels_v1_channels_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_channels_v1_channels_proto_goTypes = []any{
(*RemoveClientConnectionsReq)(nil), // 0: channels.v1.RemoveClientConnectionsReq
(*RemoveClientConnectionsRes)(nil), // 1: channels.v1.RemoveClientConnectionsRes
(*UnsetParentGroupFromChannelsReq)(nil), // 2: channels.v1.UnsetParentGroupFromChannelsReq
(*UnsetParentGroupFromChannelsRes)(nil), // 3: channels.v1.UnsetParentGroupFromChannelsRes
(*AuthzReq)(nil), // 4: channels.v1.AuthzReq
(*AuthzRes)(nil), // 5: channels.v1.AuthzRes
(*v1.RetrieveEntityReq)(nil), // 6: common.v1.RetrieveEntityReq
(*v1.RetrieveIDByRouteReq)(nil), // 7: common.v1.RetrieveIDByRouteReq
(*v1.RetrieveEntityRes)(nil), // 8: common.v1.RetrieveEntityRes
}
var file_channels_v1_channels_proto_depIdxs = []int32{
4, // 0: channels.v1.ChannelsService.Authorize:input_type -> channels.v1.AuthzReq
0, // 1: channels.v1.ChannelsService.RemoveClientConnections:input_type -> channels.v1.RemoveClientConnectionsReq
2, // 2: channels.v1.ChannelsService.UnsetParentGroupFromChannels:input_type -> channels.v1.UnsetParentGroupFromChannelsReq
6, // 3: channels.v1.ChannelsService.RetrieveEntity:input_type -> common.v1.RetrieveEntityReq
7, // 4: channels.v1.ChannelsService.RetrieveIDByRoute:input_type -> common.v1.RetrieveIDByRouteReq
5, // 5: channels.v1.ChannelsService.Authorize:output_type -> channels.v1.AuthzRes
1, // 6: channels.v1.ChannelsService.RemoveClientConnections:output_type -> channels.v1.RemoveClientConnectionsRes
3, // 7: channels.v1.ChannelsService.UnsetParentGroupFromChannels:output_type -> channels.v1.UnsetParentGroupFromChannelsRes
8, // 8: channels.v1.ChannelsService.RetrieveEntity:output_type -> common.v1.RetrieveEntityRes
8, // 9: channels.v1.ChannelsService.RetrieveIDByRoute:output_type -> common.v1.RetrieveEntityRes
5, // [5:10] is the sub-list for method output_type
0, // [0:5] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_channels_v1_channels_proto_init() }
func file_channels_v1_channels_proto_init() {
if File_channels_v1_channels_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_channels_v1_channels_proto_rawDesc), len(file_channels_v1_channels_proto_rawDesc)),
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_channels_v1_channels_proto_goTypes,
DependencyIndexes: file_channels_v1_channels_proto_depIdxs,
MessageInfos: file_channels_v1_channels_proto_msgTypes,
}.Build()
File_channels_v1_channels_proto = out.File
file_channels_v1_channels_proto_goTypes = nil
file_channels_v1_channels_proto_depIdxs = nil
}
+277
View File
@@ -0,0 +1,277 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.1
// source: channels/v1/channels.proto
package v1
import (
context "context"
v1 "github.com/absmach/magistrala/api/grpc/common/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
ChannelsService_Authorize_FullMethodName = "/channels.v1.ChannelsService/Authorize"
ChannelsService_RemoveClientConnections_FullMethodName = "/channels.v1.ChannelsService/RemoveClientConnections"
ChannelsService_UnsetParentGroupFromChannels_FullMethodName = "/channels.v1.ChannelsService/UnsetParentGroupFromChannels"
ChannelsService_RetrieveEntity_FullMethodName = "/channels.v1.ChannelsService/RetrieveEntity"
ChannelsService_RetrieveIDByRoute_FullMethodName = "/channels.v1.ChannelsService/RetrieveIDByRoute"
)
// ChannelsServiceClient is the client API for ChannelsService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ChannelsServiceClient interface {
Authorize(ctx context.Context, in *AuthzReq, opts ...grpc.CallOption) (*AuthzRes, error)
RemoveClientConnections(ctx context.Context, in *RemoveClientConnectionsReq, opts ...grpc.CallOption) (*RemoveClientConnectionsRes, error)
UnsetParentGroupFromChannels(ctx context.Context, in *UnsetParentGroupFromChannelsReq, opts ...grpc.CallOption) (*UnsetParentGroupFromChannelsRes, error)
RetrieveEntity(ctx context.Context, in *v1.RetrieveEntityReq, opts ...grpc.CallOption) (*v1.RetrieveEntityRes, error)
RetrieveIDByRoute(ctx context.Context, in *v1.RetrieveIDByRouteReq, opts ...grpc.CallOption) (*v1.RetrieveEntityRes, error)
}
type channelsServiceClient struct {
cc grpc.ClientConnInterface
}
func NewChannelsServiceClient(cc grpc.ClientConnInterface) ChannelsServiceClient {
return &channelsServiceClient{cc}
}
func (c *channelsServiceClient) Authorize(ctx context.Context, in *AuthzReq, opts ...grpc.CallOption) (*AuthzRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AuthzRes)
err := c.cc.Invoke(ctx, ChannelsService_Authorize_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *channelsServiceClient) RemoveClientConnections(ctx context.Context, in *RemoveClientConnectionsReq, opts ...grpc.CallOption) (*RemoveClientConnectionsRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RemoveClientConnectionsRes)
err := c.cc.Invoke(ctx, ChannelsService_RemoveClientConnections_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *channelsServiceClient) UnsetParentGroupFromChannels(ctx context.Context, in *UnsetParentGroupFromChannelsReq, opts ...grpc.CallOption) (*UnsetParentGroupFromChannelsRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UnsetParentGroupFromChannelsRes)
err := c.cc.Invoke(ctx, ChannelsService_UnsetParentGroupFromChannels_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *channelsServiceClient) RetrieveEntity(ctx context.Context, in *v1.RetrieveEntityReq, opts ...grpc.CallOption) (*v1.RetrieveEntityRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.RetrieveEntityRes)
err := c.cc.Invoke(ctx, ChannelsService_RetrieveEntity_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *channelsServiceClient) RetrieveIDByRoute(ctx context.Context, in *v1.RetrieveIDByRouteReq, opts ...grpc.CallOption) (*v1.RetrieveEntityRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.RetrieveEntityRes)
err := c.cc.Invoke(ctx, ChannelsService_RetrieveIDByRoute_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ChannelsServiceServer is the server API for ChannelsService service.
// All implementations must embed UnimplementedChannelsServiceServer
// for forward compatibility.
type ChannelsServiceServer interface {
Authorize(context.Context, *AuthzReq) (*AuthzRes, error)
RemoveClientConnections(context.Context, *RemoveClientConnectionsReq) (*RemoveClientConnectionsRes, error)
UnsetParentGroupFromChannels(context.Context, *UnsetParentGroupFromChannelsReq) (*UnsetParentGroupFromChannelsRes, error)
RetrieveEntity(context.Context, *v1.RetrieveEntityReq) (*v1.RetrieveEntityRes, error)
RetrieveIDByRoute(context.Context, *v1.RetrieveIDByRouteReq) (*v1.RetrieveEntityRes, error)
mustEmbedUnimplementedChannelsServiceServer()
}
// UnimplementedChannelsServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedChannelsServiceServer struct{}
func (UnimplementedChannelsServiceServer) Authorize(context.Context, *AuthzReq) (*AuthzRes, error) {
return nil, status.Error(codes.Unimplemented, "method Authorize not implemented")
}
func (UnimplementedChannelsServiceServer) RemoveClientConnections(context.Context, *RemoveClientConnectionsReq) (*RemoveClientConnectionsRes, error) {
return nil, status.Error(codes.Unimplemented, "method RemoveClientConnections not implemented")
}
func (UnimplementedChannelsServiceServer) UnsetParentGroupFromChannels(context.Context, *UnsetParentGroupFromChannelsReq) (*UnsetParentGroupFromChannelsRes, error) {
return nil, status.Error(codes.Unimplemented, "method UnsetParentGroupFromChannels not implemented")
}
func (UnimplementedChannelsServiceServer) RetrieveEntity(context.Context, *v1.RetrieveEntityReq) (*v1.RetrieveEntityRes, error) {
return nil, status.Error(codes.Unimplemented, "method RetrieveEntity not implemented")
}
func (UnimplementedChannelsServiceServer) RetrieveIDByRoute(context.Context, *v1.RetrieveIDByRouteReq) (*v1.RetrieveEntityRes, error) {
return nil, status.Error(codes.Unimplemented, "method RetrieveIDByRoute not implemented")
}
func (UnimplementedChannelsServiceServer) mustEmbedUnimplementedChannelsServiceServer() {}
func (UnimplementedChannelsServiceServer) testEmbeddedByValue() {}
// UnsafeChannelsServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ChannelsServiceServer will
// result in compilation errors.
type UnsafeChannelsServiceServer interface {
mustEmbedUnimplementedChannelsServiceServer()
}
func RegisterChannelsServiceServer(s grpc.ServiceRegistrar, srv ChannelsServiceServer) {
// If the following call panics, it indicates UnimplementedChannelsServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&ChannelsService_ServiceDesc, srv)
}
func _ChannelsService_Authorize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthzReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ChannelsServiceServer).Authorize(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ChannelsService_Authorize_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChannelsServiceServer).Authorize(ctx, req.(*AuthzReq))
}
return interceptor(ctx, in, info, handler)
}
func _ChannelsService_RemoveClientConnections_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RemoveClientConnectionsReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ChannelsServiceServer).RemoveClientConnections(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ChannelsService_RemoveClientConnections_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChannelsServiceServer).RemoveClientConnections(ctx, req.(*RemoveClientConnectionsReq))
}
return interceptor(ctx, in, info, handler)
}
func _ChannelsService_UnsetParentGroupFromChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UnsetParentGroupFromChannelsReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ChannelsServiceServer).UnsetParentGroupFromChannels(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ChannelsService_UnsetParentGroupFromChannels_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChannelsServiceServer).UnsetParentGroupFromChannels(ctx, req.(*UnsetParentGroupFromChannelsReq))
}
return interceptor(ctx, in, info, handler)
}
func _ChannelsService_RetrieveEntity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.RetrieveEntityReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ChannelsServiceServer).RetrieveEntity(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ChannelsService_RetrieveEntity_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChannelsServiceServer).RetrieveEntity(ctx, req.(*v1.RetrieveEntityReq))
}
return interceptor(ctx, in, info, handler)
}
func _ChannelsService_RetrieveIDByRoute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.RetrieveIDByRouteReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ChannelsServiceServer).RetrieveIDByRoute(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ChannelsService_RetrieveIDByRoute_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChannelsServiceServer).RetrieveIDByRoute(ctx, req.(*v1.RetrieveIDByRouteReq))
}
return interceptor(ctx, in, info, handler)
}
// ChannelsService_ServiceDesc is the grpc.ServiceDesc for ChannelsService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ChannelsService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "channels.v1.ChannelsService",
HandlerType: (*ChannelsServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Authorize",
Handler: _ChannelsService_Authorize_Handler,
},
{
MethodName: "RemoveClientConnections",
Handler: _ChannelsService_RemoveClientConnections_Handler,
},
{
MethodName: "UnsetParentGroupFromChannels",
Handler: _ChannelsService_UnsetParentGroupFromChannels_Handler,
},
{
MethodName: "RetrieveEntity",
Handler: _ChannelsService_RetrieveEntity_Handler,
},
{
MethodName: "RetrieveIDByRoute",
Handler: _ChannelsService_RetrieveIDByRoute_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "channels/v1/channels.proto",
}
+384
View File
@@ -0,0 +1,384 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v7.35.1
// source: clients/v1/clients.proto
package v1
import (
v1 "github.com/absmach/magistrala/api/grpc/common/v1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type AuthnReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AuthnReq) Reset() {
*x = AuthnReq{}
mi := &file_clients_v1_clients_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AuthnReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthnReq) ProtoMessage() {}
func (x *AuthnReq) ProtoReflect() protoreflect.Message {
mi := &file_clients_v1_clients_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AuthnReq.ProtoReflect.Descriptor instead.
func (*AuthnReq) Descriptor() ([]byte, []int) {
return file_clients_v1_clients_proto_rawDescGZIP(), []int{0}
}
func (x *AuthnReq) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
type AuthnRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
Authenticated bool `protobuf:"varint,1,opt,name=authenticated,proto3" json:"authenticated,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AuthnRes) Reset() {
*x = AuthnRes{}
mi := &file_clients_v1_clients_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AuthnRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthnRes) ProtoMessage() {}
func (x *AuthnRes) ProtoReflect() protoreflect.Message {
mi := &file_clients_v1_clients_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AuthnRes.ProtoReflect.Descriptor instead.
func (*AuthnRes) Descriptor() ([]byte, []int) {
return file_clients_v1_clients_proto_rawDescGZIP(), []int{1}
}
func (x *AuthnRes) GetAuthenticated() bool {
if x != nil {
return x.Authenticated
}
return false
}
func (x *AuthnRes) GetId() string {
if x != nil {
return x.Id
}
return ""
}
type RemoveChannelConnectionsReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RemoveChannelConnectionsReq) Reset() {
*x = RemoveChannelConnectionsReq{}
mi := &file_clients_v1_clients_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RemoveChannelConnectionsReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RemoveChannelConnectionsReq) ProtoMessage() {}
func (x *RemoveChannelConnectionsReq) ProtoReflect() protoreflect.Message {
mi := &file_clients_v1_clients_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RemoveChannelConnectionsReq.ProtoReflect.Descriptor instead.
func (*RemoveChannelConnectionsReq) Descriptor() ([]byte, []int) {
return file_clients_v1_clients_proto_rawDescGZIP(), []int{2}
}
func (x *RemoveChannelConnectionsReq) GetChannelId() string {
if x != nil {
return x.ChannelId
}
return ""
}
type RemoveChannelConnectionsRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RemoveChannelConnectionsRes) Reset() {
*x = RemoveChannelConnectionsRes{}
mi := &file_clients_v1_clients_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RemoveChannelConnectionsRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RemoveChannelConnectionsRes) ProtoMessage() {}
func (x *RemoveChannelConnectionsRes) ProtoReflect() protoreflect.Message {
mi := &file_clients_v1_clients_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RemoveChannelConnectionsRes.ProtoReflect.Descriptor instead.
func (*RemoveChannelConnectionsRes) Descriptor() ([]byte, []int) {
return file_clients_v1_clients_proto_rawDescGZIP(), []int{3}
}
type UnsetParentGroupFromClientReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
ParentGroupId string `protobuf:"bytes,1,opt,name=parent_group_id,json=parentGroupId,proto3" json:"parent_group_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UnsetParentGroupFromClientReq) Reset() {
*x = UnsetParentGroupFromClientReq{}
mi := &file_clients_v1_clients_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UnsetParentGroupFromClientReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UnsetParentGroupFromClientReq) ProtoMessage() {}
func (x *UnsetParentGroupFromClientReq) ProtoReflect() protoreflect.Message {
mi := &file_clients_v1_clients_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UnsetParentGroupFromClientReq.ProtoReflect.Descriptor instead.
func (*UnsetParentGroupFromClientReq) Descriptor() ([]byte, []int) {
return file_clients_v1_clients_proto_rawDescGZIP(), []int{4}
}
func (x *UnsetParentGroupFromClientReq) GetParentGroupId() string {
if x != nil {
return x.ParentGroupId
}
return ""
}
type UnsetParentGroupFromClientRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UnsetParentGroupFromClientRes) Reset() {
*x = UnsetParentGroupFromClientRes{}
mi := &file_clients_v1_clients_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UnsetParentGroupFromClientRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UnsetParentGroupFromClientRes) ProtoMessage() {}
func (x *UnsetParentGroupFromClientRes) ProtoReflect() protoreflect.Message {
mi := &file_clients_v1_clients_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UnsetParentGroupFromClientRes.ProtoReflect.Descriptor instead.
func (*UnsetParentGroupFromClientRes) Descriptor() ([]byte, []int) {
return file_clients_v1_clients_proto_rawDescGZIP(), []int{5}
}
var File_clients_v1_clients_proto protoreflect.FileDescriptor
const file_clients_v1_clients_proto_rawDesc = "" +
"\n" +
"\x18clients/v1/clients.proto\x12\n" +
"clients.v1\x1a\x16common/v1/common.proto\" \n" +
"\bAuthnReq\x12\x14\n" +
"\x05token\x18\x01 \x01(\tR\x05token\"@\n" +
"\bAuthnRes\x12$\n" +
"\rauthenticated\x18\x01 \x01(\bR\rauthenticated\x12\x0e\n" +
"\x02id\x18\x02 \x01(\tR\x02id\"<\n" +
"\x1bRemoveChannelConnectionsReq\x12\x1d\n" +
"\n" +
"channel_id\x18\x01 \x01(\tR\tchannelId\"\x1d\n" +
"\x1bRemoveChannelConnectionsRes\"G\n" +
"\x1dUnsetParentGroupFromClientReq\x12&\n" +
"\x0fparent_group_id\x18\x01 \x01(\tR\rparentGroupId\"\x1f\n" +
"\x1dUnsetParentGroupFromClientRes2\x83\x05\n" +
"\x0eClientsService\x12<\n" +
"\fAuthenticate\x12\x14.clients.v1.AuthnReq\x1a\x14.clients.v1.AuthnRes\"\x00\x12N\n" +
"\x0eRetrieveEntity\x12\x1c.common.v1.RetrieveEntityReq\x1a\x1c.common.v1.RetrieveEntityRes\"\x00\x12T\n" +
"\x10RetrieveEntities\x12\x1e.common.v1.RetrieveEntitiesReq\x1a\x1e.common.v1.RetrieveEntitiesRes\"\x00\x12N\n" +
"\x0eAddConnections\x12\x1c.common.v1.AddConnectionsReq\x1a\x1c.common.v1.AddConnectionsRes\"\x00\x12W\n" +
"\x11RemoveConnections\x12\x1f.common.v1.RemoveConnectionsReq\x1a\x1f.common.v1.RemoveConnectionsRes\"\x00\x12n\n" +
"\x18RemoveChannelConnections\x12'.clients.v1.RemoveChannelConnectionsReq\x1a'.clients.v1.RemoveChannelConnectionsRes\"\x00\x12t\n" +
"\x1aUnsetParentGroupFromClient\x12).clients.v1.UnsetParentGroupFromClientReq\x1a).clients.v1.UnsetParentGroupFromClientRes\"\x00B3Z1github.com/absmach/magistrala/api/grpc/clients/v1b\x06proto3"
var (
file_clients_v1_clients_proto_rawDescOnce sync.Once
file_clients_v1_clients_proto_rawDescData []byte
)
func file_clients_v1_clients_proto_rawDescGZIP() []byte {
file_clients_v1_clients_proto_rawDescOnce.Do(func() {
file_clients_v1_clients_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_clients_v1_clients_proto_rawDesc), len(file_clients_v1_clients_proto_rawDesc)))
})
return file_clients_v1_clients_proto_rawDescData
}
var file_clients_v1_clients_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_clients_v1_clients_proto_goTypes = []any{
(*AuthnReq)(nil), // 0: clients.v1.AuthnReq
(*AuthnRes)(nil), // 1: clients.v1.AuthnRes
(*RemoveChannelConnectionsReq)(nil), // 2: clients.v1.RemoveChannelConnectionsReq
(*RemoveChannelConnectionsRes)(nil), // 3: clients.v1.RemoveChannelConnectionsRes
(*UnsetParentGroupFromClientReq)(nil), // 4: clients.v1.UnsetParentGroupFromClientReq
(*UnsetParentGroupFromClientRes)(nil), // 5: clients.v1.UnsetParentGroupFromClientRes
(*v1.RetrieveEntityReq)(nil), // 6: common.v1.RetrieveEntityReq
(*v1.RetrieveEntitiesReq)(nil), // 7: common.v1.RetrieveEntitiesReq
(*v1.AddConnectionsReq)(nil), // 8: common.v1.AddConnectionsReq
(*v1.RemoveConnectionsReq)(nil), // 9: common.v1.RemoveConnectionsReq
(*v1.RetrieveEntityRes)(nil), // 10: common.v1.RetrieveEntityRes
(*v1.RetrieveEntitiesRes)(nil), // 11: common.v1.RetrieveEntitiesRes
(*v1.AddConnectionsRes)(nil), // 12: common.v1.AddConnectionsRes
(*v1.RemoveConnectionsRes)(nil), // 13: common.v1.RemoveConnectionsRes
}
var file_clients_v1_clients_proto_depIdxs = []int32{
0, // 0: clients.v1.ClientsService.Authenticate:input_type -> clients.v1.AuthnReq
6, // 1: clients.v1.ClientsService.RetrieveEntity:input_type -> common.v1.RetrieveEntityReq
7, // 2: clients.v1.ClientsService.RetrieveEntities:input_type -> common.v1.RetrieveEntitiesReq
8, // 3: clients.v1.ClientsService.AddConnections:input_type -> common.v1.AddConnectionsReq
9, // 4: clients.v1.ClientsService.RemoveConnections:input_type -> common.v1.RemoveConnectionsReq
2, // 5: clients.v1.ClientsService.RemoveChannelConnections:input_type -> clients.v1.RemoveChannelConnectionsReq
4, // 6: clients.v1.ClientsService.UnsetParentGroupFromClient:input_type -> clients.v1.UnsetParentGroupFromClientReq
1, // 7: clients.v1.ClientsService.Authenticate:output_type -> clients.v1.AuthnRes
10, // 8: clients.v1.ClientsService.RetrieveEntity:output_type -> common.v1.RetrieveEntityRes
11, // 9: clients.v1.ClientsService.RetrieveEntities:output_type -> common.v1.RetrieveEntitiesRes
12, // 10: clients.v1.ClientsService.AddConnections:output_type -> common.v1.AddConnectionsRes
13, // 11: clients.v1.ClientsService.RemoveConnections:output_type -> common.v1.RemoveConnectionsRes
3, // 12: clients.v1.ClientsService.RemoveChannelConnections:output_type -> clients.v1.RemoveChannelConnectionsRes
5, // 13: clients.v1.ClientsService.UnsetParentGroupFromClient:output_type -> clients.v1.UnsetParentGroupFromClientRes
7, // [7:14] is the sub-list for method output_type
0, // [0:7] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_clients_v1_clients_proto_init() }
func file_clients_v1_clients_proto_init() {
if File_clients_v1_clients_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_clients_v1_clients_proto_rawDesc), len(file_clients_v1_clients_proto_rawDesc)),
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_clients_v1_clients_proto_goTypes,
DependencyIndexes: file_clients_v1_clients_proto_depIdxs,
MessageInfos: file_clients_v1_clients_proto_msgTypes,
}.Build()
File_clients_v1_clients_proto = out.File
file_clients_v1_clients_proto_goTypes = nil
file_clients_v1_clients_proto_depIdxs = nil
}
+361
View File
@@ -0,0 +1,361 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.1
// source: clients/v1/clients.proto
package v1
import (
context "context"
v1 "github.com/absmach/magistrala/api/grpc/common/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
ClientsService_Authenticate_FullMethodName = "/clients.v1.ClientsService/Authenticate"
ClientsService_RetrieveEntity_FullMethodName = "/clients.v1.ClientsService/RetrieveEntity"
ClientsService_RetrieveEntities_FullMethodName = "/clients.v1.ClientsService/RetrieveEntities"
ClientsService_AddConnections_FullMethodName = "/clients.v1.ClientsService/AddConnections"
ClientsService_RemoveConnections_FullMethodName = "/clients.v1.ClientsService/RemoveConnections"
ClientsService_RemoveChannelConnections_FullMethodName = "/clients.v1.ClientsService/RemoveChannelConnections"
ClientsService_UnsetParentGroupFromClient_FullMethodName = "/clients.v1.ClientsService/UnsetParentGroupFromClient"
)
// ClientsServiceClient is the client API for ClientsService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// ClientsService is a service that provides clients
// authorization functionalities for Magistrala services.
type ClientsServiceClient interface {
// Authorize checks if the client is authorized to perform
Authenticate(ctx context.Context, in *AuthnReq, opts ...grpc.CallOption) (*AuthnRes, error)
RetrieveEntity(ctx context.Context, in *v1.RetrieveEntityReq, opts ...grpc.CallOption) (*v1.RetrieveEntityRes, error)
RetrieveEntities(ctx context.Context, in *v1.RetrieveEntitiesReq, opts ...grpc.CallOption) (*v1.RetrieveEntitiesRes, error)
AddConnections(ctx context.Context, in *v1.AddConnectionsReq, opts ...grpc.CallOption) (*v1.AddConnectionsRes, error)
RemoveConnections(ctx context.Context, in *v1.RemoveConnectionsReq, opts ...grpc.CallOption) (*v1.RemoveConnectionsRes, error)
RemoveChannelConnections(ctx context.Context, in *RemoveChannelConnectionsReq, opts ...grpc.CallOption) (*RemoveChannelConnectionsRes, error)
UnsetParentGroupFromClient(ctx context.Context, in *UnsetParentGroupFromClientReq, opts ...grpc.CallOption) (*UnsetParentGroupFromClientRes, error)
}
type clientsServiceClient struct {
cc grpc.ClientConnInterface
}
func NewClientsServiceClient(cc grpc.ClientConnInterface) ClientsServiceClient {
return &clientsServiceClient{cc}
}
func (c *clientsServiceClient) Authenticate(ctx context.Context, in *AuthnReq, opts ...grpc.CallOption) (*AuthnRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AuthnRes)
err := c.cc.Invoke(ctx, ClientsService_Authenticate_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *clientsServiceClient) RetrieveEntity(ctx context.Context, in *v1.RetrieveEntityReq, opts ...grpc.CallOption) (*v1.RetrieveEntityRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.RetrieveEntityRes)
err := c.cc.Invoke(ctx, ClientsService_RetrieveEntity_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *clientsServiceClient) RetrieveEntities(ctx context.Context, in *v1.RetrieveEntitiesReq, opts ...grpc.CallOption) (*v1.RetrieveEntitiesRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.RetrieveEntitiesRes)
err := c.cc.Invoke(ctx, ClientsService_RetrieveEntities_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *clientsServiceClient) AddConnections(ctx context.Context, in *v1.AddConnectionsReq, opts ...grpc.CallOption) (*v1.AddConnectionsRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.AddConnectionsRes)
err := c.cc.Invoke(ctx, ClientsService_AddConnections_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *clientsServiceClient) RemoveConnections(ctx context.Context, in *v1.RemoveConnectionsReq, opts ...grpc.CallOption) (*v1.RemoveConnectionsRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.RemoveConnectionsRes)
err := c.cc.Invoke(ctx, ClientsService_RemoveConnections_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *clientsServiceClient) RemoveChannelConnections(ctx context.Context, in *RemoveChannelConnectionsReq, opts ...grpc.CallOption) (*RemoveChannelConnectionsRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RemoveChannelConnectionsRes)
err := c.cc.Invoke(ctx, ClientsService_RemoveChannelConnections_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *clientsServiceClient) UnsetParentGroupFromClient(ctx context.Context, in *UnsetParentGroupFromClientReq, opts ...grpc.CallOption) (*UnsetParentGroupFromClientRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UnsetParentGroupFromClientRes)
err := c.cc.Invoke(ctx, ClientsService_UnsetParentGroupFromClient_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ClientsServiceServer is the server API for ClientsService service.
// All implementations must embed UnimplementedClientsServiceServer
// for forward compatibility.
//
// ClientsService is a service that provides clients
// authorization functionalities for Magistrala services.
type ClientsServiceServer interface {
// Authorize checks if the client is authorized to perform
Authenticate(context.Context, *AuthnReq) (*AuthnRes, error)
RetrieveEntity(context.Context, *v1.RetrieveEntityReq) (*v1.RetrieveEntityRes, error)
RetrieveEntities(context.Context, *v1.RetrieveEntitiesReq) (*v1.RetrieveEntitiesRes, error)
AddConnections(context.Context, *v1.AddConnectionsReq) (*v1.AddConnectionsRes, error)
RemoveConnections(context.Context, *v1.RemoveConnectionsReq) (*v1.RemoveConnectionsRes, error)
RemoveChannelConnections(context.Context, *RemoveChannelConnectionsReq) (*RemoveChannelConnectionsRes, error)
UnsetParentGroupFromClient(context.Context, *UnsetParentGroupFromClientReq) (*UnsetParentGroupFromClientRes, error)
mustEmbedUnimplementedClientsServiceServer()
}
// UnimplementedClientsServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedClientsServiceServer struct{}
func (UnimplementedClientsServiceServer) Authenticate(context.Context, *AuthnReq) (*AuthnRes, error) {
return nil, status.Error(codes.Unimplemented, "method Authenticate not implemented")
}
func (UnimplementedClientsServiceServer) RetrieveEntity(context.Context, *v1.RetrieveEntityReq) (*v1.RetrieveEntityRes, error) {
return nil, status.Error(codes.Unimplemented, "method RetrieveEntity not implemented")
}
func (UnimplementedClientsServiceServer) RetrieveEntities(context.Context, *v1.RetrieveEntitiesReq) (*v1.RetrieveEntitiesRes, error) {
return nil, status.Error(codes.Unimplemented, "method RetrieveEntities not implemented")
}
func (UnimplementedClientsServiceServer) AddConnections(context.Context, *v1.AddConnectionsReq) (*v1.AddConnectionsRes, error) {
return nil, status.Error(codes.Unimplemented, "method AddConnections not implemented")
}
func (UnimplementedClientsServiceServer) RemoveConnections(context.Context, *v1.RemoveConnectionsReq) (*v1.RemoveConnectionsRes, error) {
return nil, status.Error(codes.Unimplemented, "method RemoveConnections not implemented")
}
func (UnimplementedClientsServiceServer) RemoveChannelConnections(context.Context, *RemoveChannelConnectionsReq) (*RemoveChannelConnectionsRes, error) {
return nil, status.Error(codes.Unimplemented, "method RemoveChannelConnections not implemented")
}
func (UnimplementedClientsServiceServer) UnsetParentGroupFromClient(context.Context, *UnsetParentGroupFromClientReq) (*UnsetParentGroupFromClientRes, error) {
return nil, status.Error(codes.Unimplemented, "method UnsetParentGroupFromClient not implemented")
}
func (UnimplementedClientsServiceServer) mustEmbedUnimplementedClientsServiceServer() {}
func (UnimplementedClientsServiceServer) testEmbeddedByValue() {}
// UnsafeClientsServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ClientsServiceServer will
// result in compilation errors.
type UnsafeClientsServiceServer interface {
mustEmbedUnimplementedClientsServiceServer()
}
func RegisterClientsServiceServer(s grpc.ServiceRegistrar, srv ClientsServiceServer) {
// If the following call panics, it indicates UnimplementedClientsServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&ClientsService_ServiceDesc, srv)
}
func _ClientsService_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthnReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ClientsServiceServer).Authenticate(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ClientsService_Authenticate_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ClientsServiceServer).Authenticate(ctx, req.(*AuthnReq))
}
return interceptor(ctx, in, info, handler)
}
func _ClientsService_RetrieveEntity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.RetrieveEntityReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ClientsServiceServer).RetrieveEntity(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ClientsService_RetrieveEntity_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ClientsServiceServer).RetrieveEntity(ctx, req.(*v1.RetrieveEntityReq))
}
return interceptor(ctx, in, info, handler)
}
func _ClientsService_RetrieveEntities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.RetrieveEntitiesReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ClientsServiceServer).RetrieveEntities(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ClientsService_RetrieveEntities_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ClientsServiceServer).RetrieveEntities(ctx, req.(*v1.RetrieveEntitiesReq))
}
return interceptor(ctx, in, info, handler)
}
func _ClientsService_AddConnections_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.AddConnectionsReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ClientsServiceServer).AddConnections(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ClientsService_AddConnections_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ClientsServiceServer).AddConnections(ctx, req.(*v1.AddConnectionsReq))
}
return interceptor(ctx, in, info, handler)
}
func _ClientsService_RemoveConnections_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.RemoveConnectionsReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ClientsServiceServer).RemoveConnections(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ClientsService_RemoveConnections_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ClientsServiceServer).RemoveConnections(ctx, req.(*v1.RemoveConnectionsReq))
}
return interceptor(ctx, in, info, handler)
}
func _ClientsService_RemoveChannelConnections_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RemoveChannelConnectionsReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ClientsServiceServer).RemoveChannelConnections(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ClientsService_RemoveChannelConnections_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ClientsServiceServer).RemoveChannelConnections(ctx, req.(*RemoveChannelConnectionsReq))
}
return interceptor(ctx, in, info, handler)
}
func _ClientsService_UnsetParentGroupFromClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UnsetParentGroupFromClientReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ClientsServiceServer).UnsetParentGroupFromClient(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ClientsService_UnsetParentGroupFromClient_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ClientsServiceServer).UnsetParentGroupFromClient(ctx, req.(*UnsetParentGroupFromClientReq))
}
return interceptor(ctx, in, info, handler)
}
// ClientsService_ServiceDesc is the grpc.ServiceDesc for ClientsService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ClientsService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "clients.v1.ClientsService",
HandlerType: (*ClientsServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Authenticate",
Handler: _ClientsService_Authenticate_Handler,
},
{
MethodName: "RetrieveEntity",
Handler: _ClientsService_RetrieveEntity_Handler,
},
{
MethodName: "RetrieveEntities",
Handler: _ClientsService_RetrieveEntities_Handler,
},
{
MethodName: "AddConnections",
Handler: _ClientsService_AddConnections_Handler,
},
{
MethodName: "RemoveConnections",
Handler: _ClientsService_RemoveConnections_Handler,
},
{
MethodName: "RemoveChannelConnections",
Handler: _ClientsService_RemoveChannelConnections_Handler,
},
{
MethodName: "UnsetParentGroupFromClient",
Handler: _ClientsService_UnsetParentGroupFromClient_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "clients/v1/clients.proto",
}
+691
View File
@@ -0,0 +1,691 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v7.35.1
// source: common/v1/common.proto
package v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type RetrieveEntitiesReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RetrieveEntitiesReq) Reset() {
*x = RetrieveEntitiesReq{}
mi := &file_common_v1_common_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RetrieveEntitiesReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RetrieveEntitiesReq) ProtoMessage() {}
func (x *RetrieveEntitiesReq) ProtoReflect() protoreflect.Message {
mi := &file_common_v1_common_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RetrieveEntitiesReq.ProtoReflect.Descriptor instead.
func (*RetrieveEntitiesReq) Descriptor() ([]byte, []int) {
return file_common_v1_common_proto_rawDescGZIP(), []int{0}
}
func (x *RetrieveEntitiesReq) GetIds() []string {
if x != nil {
return x.Ids
}
return nil
}
type RetrieveEntitiesRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Limit uint64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
Offset uint64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
Entities []*EntityBasic `protobuf:"bytes,4,rep,name=entities,proto3" json:"entities,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RetrieveEntitiesRes) Reset() {
*x = RetrieveEntitiesRes{}
mi := &file_common_v1_common_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RetrieveEntitiesRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RetrieveEntitiesRes) ProtoMessage() {}
func (x *RetrieveEntitiesRes) ProtoReflect() protoreflect.Message {
mi := &file_common_v1_common_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RetrieveEntitiesRes.ProtoReflect.Descriptor instead.
func (*RetrieveEntitiesRes) Descriptor() ([]byte, []int) {
return file_common_v1_common_proto_rawDescGZIP(), []int{1}
}
func (x *RetrieveEntitiesRes) GetTotal() uint64 {
if x != nil {
return x.Total
}
return 0
}
func (x *RetrieveEntitiesRes) GetLimit() uint64 {
if x != nil {
return x.Limit
}
return 0
}
func (x *RetrieveEntitiesRes) GetOffset() uint64 {
if x != nil {
return x.Offset
}
return 0
}
func (x *RetrieveEntitiesRes) GetEntities() []*EntityBasic {
if x != nil {
return x.Entities
}
return nil
}
type RetrieveEntityReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RetrieveEntityReq) Reset() {
*x = RetrieveEntityReq{}
mi := &file_common_v1_common_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RetrieveEntityReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RetrieveEntityReq) ProtoMessage() {}
func (x *RetrieveEntityReq) ProtoReflect() protoreflect.Message {
mi := &file_common_v1_common_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RetrieveEntityReq.ProtoReflect.Descriptor instead.
func (*RetrieveEntityReq) Descriptor() ([]byte, []int) {
return file_common_v1_common_proto_rawDescGZIP(), []int{2}
}
func (x *RetrieveEntityReq) GetId() string {
if x != nil {
return x.Id
}
return ""
}
type RetrieveEntityRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
Entity *EntityBasic `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RetrieveEntityRes) Reset() {
*x = RetrieveEntityRes{}
mi := &file_common_v1_common_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RetrieveEntityRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RetrieveEntityRes) ProtoMessage() {}
func (x *RetrieveEntityRes) ProtoReflect() protoreflect.Message {
mi := &file_common_v1_common_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RetrieveEntityRes.ProtoReflect.Descriptor instead.
func (*RetrieveEntityRes) Descriptor() ([]byte, []int) {
return file_common_v1_common_proto_rawDescGZIP(), []int{3}
}
func (x *RetrieveEntityRes) GetEntity() *EntityBasic {
if x != nil {
return x.Entity
}
return nil
}
type EntityBasic struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
DomainId string `protobuf:"bytes,2,opt,name=domain_id,json=domainId,proto3" json:"domain_id,omitempty"`
ParentGroupId string `protobuf:"bytes,3,opt,name=parent_group_id,json=parentGroupId,proto3" json:"parent_group_id,omitempty"`
Status uint32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *EntityBasic) Reset() {
*x = EntityBasic{}
mi := &file_common_v1_common_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *EntityBasic) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EntityBasic) ProtoMessage() {}
func (x *EntityBasic) ProtoReflect() protoreflect.Message {
mi := &file_common_v1_common_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EntityBasic.ProtoReflect.Descriptor instead.
func (*EntityBasic) Descriptor() ([]byte, []int) {
return file_common_v1_common_proto_rawDescGZIP(), []int{4}
}
func (x *EntityBasic) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *EntityBasic) GetDomainId() string {
if x != nil {
return x.DomainId
}
return ""
}
func (x *EntityBasic) GetParentGroupId() string {
if x != nil {
return x.ParentGroupId
}
return ""
}
func (x *EntityBasic) GetStatus() uint32 {
if x != nil {
return x.Status
}
return 0
}
type AddConnectionsReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Connections []*Connection `protobuf:"bytes,1,rep,name=connections,proto3" json:"connections,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AddConnectionsReq) Reset() {
*x = AddConnectionsReq{}
mi := &file_common_v1_common_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AddConnectionsReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AddConnectionsReq) ProtoMessage() {}
func (x *AddConnectionsReq) ProtoReflect() protoreflect.Message {
mi := &file_common_v1_common_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AddConnectionsReq.ProtoReflect.Descriptor instead.
func (*AddConnectionsReq) Descriptor() ([]byte, []int) {
return file_common_v1_common_proto_rawDescGZIP(), []int{5}
}
func (x *AddConnectionsReq) GetConnections() []*Connection {
if x != nil {
return x.Connections
}
return nil
}
type AddConnectionsRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AddConnectionsRes) Reset() {
*x = AddConnectionsRes{}
mi := &file_common_v1_common_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AddConnectionsRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AddConnectionsRes) ProtoMessage() {}
func (x *AddConnectionsRes) ProtoReflect() protoreflect.Message {
mi := &file_common_v1_common_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AddConnectionsRes.ProtoReflect.Descriptor instead.
func (*AddConnectionsRes) Descriptor() ([]byte, []int) {
return file_common_v1_common_proto_rawDescGZIP(), []int{6}
}
func (x *AddConnectionsRes) GetOk() bool {
if x != nil {
return x.Ok
}
return false
}
type RemoveConnectionsReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Connections []*Connection `protobuf:"bytes,1,rep,name=connections,proto3" json:"connections,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RemoveConnectionsReq) Reset() {
*x = RemoveConnectionsReq{}
mi := &file_common_v1_common_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RemoveConnectionsReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RemoveConnectionsReq) ProtoMessage() {}
func (x *RemoveConnectionsReq) ProtoReflect() protoreflect.Message {
mi := &file_common_v1_common_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RemoveConnectionsReq.ProtoReflect.Descriptor instead.
func (*RemoveConnectionsReq) Descriptor() ([]byte, []int) {
return file_common_v1_common_proto_rawDescGZIP(), []int{7}
}
func (x *RemoveConnectionsReq) GetConnections() []*Connection {
if x != nil {
return x.Connections
}
return nil
}
type RemoveConnectionsRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RemoveConnectionsRes) Reset() {
*x = RemoveConnectionsRes{}
mi := &file_common_v1_common_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RemoveConnectionsRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RemoveConnectionsRes) ProtoMessage() {}
func (x *RemoveConnectionsRes) ProtoReflect() protoreflect.Message {
mi := &file_common_v1_common_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RemoveConnectionsRes.ProtoReflect.Descriptor instead.
func (*RemoveConnectionsRes) Descriptor() ([]byte, []int) {
return file_common_v1_common_proto_rawDescGZIP(), []int{8}
}
func (x *RemoveConnectionsRes) GetOk() bool {
if x != nil {
return x.Ok
}
return false
}
type Connection struct {
state protoimpl.MessageState `protogen:"open.v1"`
ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
DomainId string `protobuf:"bytes,3,opt,name=domain_id,json=domainId,proto3" json:"domain_id,omitempty"`
Type uint32 `protobuf:"varint,4,opt,name=type,proto3" json:"type,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Connection) Reset() {
*x = Connection{}
mi := &file_common_v1_common_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Connection) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Connection) ProtoMessage() {}
func (x *Connection) ProtoReflect() protoreflect.Message {
mi := &file_common_v1_common_proto_msgTypes[9]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Connection.ProtoReflect.Descriptor instead.
func (*Connection) Descriptor() ([]byte, []int) {
return file_common_v1_common_proto_rawDescGZIP(), []int{9}
}
func (x *Connection) GetClientId() string {
if x != nil {
return x.ClientId
}
return ""
}
func (x *Connection) GetChannelId() string {
if x != nil {
return x.ChannelId
}
return ""
}
func (x *Connection) GetDomainId() string {
if x != nil {
return x.DomainId
}
return ""
}
func (x *Connection) GetType() uint32 {
if x != nil {
return x.Type
}
return 0
}
type RetrieveIDByRouteReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Route string `protobuf:"bytes,1,opt,name=route,proto3" json:"route,omitempty"`
DomainId string `protobuf:"bytes,2,opt,name=domain_id,json=domainId,proto3" json:"domain_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RetrieveIDByRouteReq) Reset() {
*x = RetrieveIDByRouteReq{}
mi := &file_common_v1_common_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RetrieveIDByRouteReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RetrieveIDByRouteReq) ProtoMessage() {}
func (x *RetrieveIDByRouteReq) ProtoReflect() protoreflect.Message {
mi := &file_common_v1_common_proto_msgTypes[10]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RetrieveIDByRouteReq.ProtoReflect.Descriptor instead.
func (*RetrieveIDByRouteReq) Descriptor() ([]byte, []int) {
return file_common_v1_common_proto_rawDescGZIP(), []int{10}
}
func (x *RetrieveIDByRouteReq) GetRoute() string {
if x != nil {
return x.Route
}
return ""
}
func (x *RetrieveIDByRouteReq) GetDomainId() string {
if x != nil {
return x.DomainId
}
return ""
}
var File_common_v1_common_proto protoreflect.FileDescriptor
const file_common_v1_common_proto_rawDesc = "" +
"\n" +
"\x16common/v1/common.proto\x12\tcommon.v1\"'\n" +
"\x13RetrieveEntitiesReq\x12\x10\n" +
"\x03ids\x18\x01 \x03(\tR\x03ids\"\x8d\x01\n" +
"\x13RetrieveEntitiesRes\x12\x14\n" +
"\x05total\x18\x01 \x01(\x04R\x05total\x12\x14\n" +
"\x05limit\x18\x02 \x01(\x04R\x05limit\x12\x16\n" +
"\x06offset\x18\x03 \x01(\x04R\x06offset\x122\n" +
"\bentities\x18\x04 \x03(\v2\x16.common.v1.EntityBasicR\bentities\"#\n" +
"\x11RetrieveEntityReq\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\"C\n" +
"\x11RetrieveEntityRes\x12.\n" +
"\x06entity\x18\x01 \x01(\v2\x16.common.v1.EntityBasicR\x06entity\"z\n" +
"\vEntityBasic\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\x12\x1b\n" +
"\tdomain_id\x18\x02 \x01(\tR\bdomainId\x12&\n" +
"\x0fparent_group_id\x18\x03 \x01(\tR\rparentGroupId\x12\x16\n" +
"\x06status\x18\x04 \x01(\rR\x06status\"L\n" +
"\x11AddConnectionsReq\x127\n" +
"\vconnections\x18\x01 \x03(\v2\x15.common.v1.ConnectionR\vconnections\"#\n" +
"\x11AddConnectionsRes\x12\x0e\n" +
"\x02ok\x18\x01 \x01(\bR\x02ok\"O\n" +
"\x14RemoveConnectionsReq\x127\n" +
"\vconnections\x18\x01 \x03(\v2\x15.common.v1.ConnectionR\vconnections\"&\n" +
"\x14RemoveConnectionsRes\x12\x0e\n" +
"\x02ok\x18\x01 \x01(\bR\x02ok\"y\n" +
"\n" +
"Connection\x12\x1b\n" +
"\tclient_id\x18\x01 \x01(\tR\bclientId\x12\x1d\n" +
"\n" +
"channel_id\x18\x02 \x01(\tR\tchannelId\x12\x1b\n" +
"\tdomain_id\x18\x03 \x01(\tR\bdomainId\x12\x12\n" +
"\x04type\x18\x04 \x01(\rR\x04type\"I\n" +
"\x14RetrieveIDByRouteReq\x12\x14\n" +
"\x05route\x18\x01 \x01(\tR\x05route\x12\x1b\n" +
"\tdomain_id\x18\x02 \x01(\tR\bdomainIdB2Z0github.com/absmach/magistrala/api/grpc/common/v1b\x06proto3"
var (
file_common_v1_common_proto_rawDescOnce sync.Once
file_common_v1_common_proto_rawDescData []byte
)
func file_common_v1_common_proto_rawDescGZIP() []byte {
file_common_v1_common_proto_rawDescOnce.Do(func() {
file_common_v1_common_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_common_v1_common_proto_rawDesc), len(file_common_v1_common_proto_rawDesc)))
})
return file_common_v1_common_proto_rawDescData
}
var file_common_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_common_v1_common_proto_goTypes = []any{
(*RetrieveEntitiesReq)(nil), // 0: common.v1.RetrieveEntitiesReq
(*RetrieveEntitiesRes)(nil), // 1: common.v1.RetrieveEntitiesRes
(*RetrieveEntityReq)(nil), // 2: common.v1.RetrieveEntityReq
(*RetrieveEntityRes)(nil), // 3: common.v1.RetrieveEntityRes
(*EntityBasic)(nil), // 4: common.v1.EntityBasic
(*AddConnectionsReq)(nil), // 5: common.v1.AddConnectionsReq
(*AddConnectionsRes)(nil), // 6: common.v1.AddConnectionsRes
(*RemoveConnectionsReq)(nil), // 7: common.v1.RemoveConnectionsReq
(*RemoveConnectionsRes)(nil), // 8: common.v1.RemoveConnectionsRes
(*Connection)(nil), // 9: common.v1.Connection
(*RetrieveIDByRouteReq)(nil), // 10: common.v1.RetrieveIDByRouteReq
}
var file_common_v1_common_proto_depIdxs = []int32{
4, // 0: common.v1.RetrieveEntitiesRes.entities:type_name -> common.v1.EntityBasic
4, // 1: common.v1.RetrieveEntityRes.entity:type_name -> common.v1.EntityBasic
9, // 2: common.v1.AddConnectionsReq.connections:type_name -> common.v1.Connection
9, // 3: common.v1.RemoveConnectionsReq.connections:type_name -> common.v1.Connection
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_common_v1_common_proto_init() }
func file_common_v1_common_proto_init() {
if File_common_v1_common_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_common_v1_common_proto_rawDesc), len(file_common_v1_common_proto_rawDesc)),
NumEnums: 0,
NumMessages: 11,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_common_v1_common_proto_goTypes,
DependencyIndexes: file_common_v1_common_proto_depIdxs,
MessageInfos: file_common_v1_common_proto_msgTypes,
}.Build()
File_common_v1_common_proto = out.File
file_common_v1_common_proto_goTypes = nil
file_common_v1_common_proto_depIdxs = nil
}
+187
View File
@@ -0,0 +1,187 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v7.35.1
// source: domains/v1/domains.proto
package v1
import (
v1 "github.com/absmach/magistrala/api/grpc/common/v1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type DeleteUserRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
Deleted bool `protobuf:"varint,1,opt,name=deleted,proto3" json:"deleted,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeleteUserRes) Reset() {
*x = DeleteUserRes{}
mi := &file_domains_v1_domains_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeleteUserRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteUserRes) ProtoMessage() {}
func (x *DeleteUserRes) ProtoReflect() protoreflect.Message {
mi := &file_domains_v1_domains_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteUserRes.ProtoReflect.Descriptor instead.
func (*DeleteUserRes) Descriptor() ([]byte, []int) {
return file_domains_v1_domains_proto_rawDescGZIP(), []int{0}
}
func (x *DeleteUserRes) GetDeleted() bool {
if x != nil {
return x.Deleted
}
return false
}
type DeleteUserReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeleteUserReq) Reset() {
*x = DeleteUserReq{}
mi := &file_domains_v1_domains_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeleteUserReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteUserReq) ProtoMessage() {}
func (x *DeleteUserReq) ProtoReflect() protoreflect.Message {
mi := &file_domains_v1_domains_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteUserReq.ProtoReflect.Descriptor instead.
func (*DeleteUserReq) Descriptor() ([]byte, []int) {
return file_domains_v1_domains_proto_rawDescGZIP(), []int{1}
}
func (x *DeleteUserReq) GetId() string {
if x != nil {
return x.Id
}
return ""
}
var File_domains_v1_domains_proto protoreflect.FileDescriptor
const file_domains_v1_domains_proto_rawDesc = "" +
"\n" +
"\x18domains/v1/domains.proto\x12\n" +
"domains.v1\x1a\x16common/v1/common.proto\")\n" +
"\rDeleteUserRes\x12\x18\n" +
"\adeleted\x18\x01 \x01(\bR\adeleted\"\x1f\n" +
"\rDeleteUserReq\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id2\x87\x02\n" +
"\x0eDomainsService\x12O\n" +
"\x15DeleteUserFromDomains\x12\x19.domains.v1.DeleteUserReq\x1a\x19.domains.v1.DeleteUserRes\"\x00\x12N\n" +
"\x0eRetrieveStatus\x12\x1c.common.v1.RetrieveEntityReq\x1a\x1c.common.v1.RetrieveEntityRes\"\x00\x12T\n" +
"\x11RetrieveIDByRoute\x12\x1f.common.v1.RetrieveIDByRouteReq\x1a\x1c.common.v1.RetrieveEntityRes\"\x00B8Z6github.com/absmach/magistrala/internal/grpc/domains/v1b\x06proto3"
var (
file_domains_v1_domains_proto_rawDescOnce sync.Once
file_domains_v1_domains_proto_rawDescData []byte
)
func file_domains_v1_domains_proto_rawDescGZIP() []byte {
file_domains_v1_domains_proto_rawDescOnce.Do(func() {
file_domains_v1_domains_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_domains_v1_domains_proto_rawDesc), len(file_domains_v1_domains_proto_rawDesc)))
})
return file_domains_v1_domains_proto_rawDescData
}
var file_domains_v1_domains_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_domains_v1_domains_proto_goTypes = []any{
(*DeleteUserRes)(nil), // 0: domains.v1.DeleteUserRes
(*DeleteUserReq)(nil), // 1: domains.v1.DeleteUserReq
(*v1.RetrieveEntityReq)(nil), // 2: common.v1.RetrieveEntityReq
(*v1.RetrieveIDByRouteReq)(nil), // 3: common.v1.RetrieveIDByRouteReq
(*v1.RetrieveEntityRes)(nil), // 4: common.v1.RetrieveEntityRes
}
var file_domains_v1_domains_proto_depIdxs = []int32{
1, // 0: domains.v1.DomainsService.DeleteUserFromDomains:input_type -> domains.v1.DeleteUserReq
2, // 1: domains.v1.DomainsService.RetrieveStatus:input_type -> common.v1.RetrieveEntityReq
3, // 2: domains.v1.DomainsService.RetrieveIDByRoute:input_type -> common.v1.RetrieveIDByRouteReq
0, // 3: domains.v1.DomainsService.DeleteUserFromDomains:output_type -> domains.v1.DeleteUserRes
4, // 4: domains.v1.DomainsService.RetrieveStatus:output_type -> common.v1.RetrieveEntityRes
4, // 5: domains.v1.DomainsService.RetrieveIDByRoute:output_type -> common.v1.RetrieveEntityRes
3, // [3:6] is the sub-list for method output_type
0, // [0:3] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_domains_v1_domains_proto_init() }
func file_domains_v1_domains_proto_init() {
if File_domains_v1_domains_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_domains_v1_domains_proto_rawDesc), len(file_domains_v1_domains_proto_rawDesc)),
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_domains_v1_domains_proto_goTypes,
DependencyIndexes: file_domains_v1_domains_proto_depIdxs,
MessageInfos: file_domains_v1_domains_proto_msgTypes,
}.Build()
File_domains_v1_domains_proto = out.File
file_domains_v1_domains_proto_goTypes = nil
file_domains_v1_domains_proto_depIdxs = nil
}
+207
View File
@@ -0,0 +1,207 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.1
// source: domains/v1/domains.proto
package v1
import (
context "context"
v1 "github.com/absmach/magistrala/api/grpc/common/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
DomainsService_DeleteUserFromDomains_FullMethodName = "/domains.v1.DomainsService/DeleteUserFromDomains"
DomainsService_RetrieveStatus_FullMethodName = "/domains.v1.DomainsService/RetrieveStatus"
DomainsService_RetrieveIDByRoute_FullMethodName = "/domains.v1.DomainsService/RetrieveIDByRoute"
)
// DomainsServiceClient is the client API for DomainsService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// DomainsService is a service that provides access to
// domains functionalities for Magistrala services.
type DomainsServiceClient interface {
DeleteUserFromDomains(ctx context.Context, in *DeleteUserReq, opts ...grpc.CallOption) (*DeleteUserRes, error)
RetrieveStatus(ctx context.Context, in *v1.RetrieveEntityReq, opts ...grpc.CallOption) (*v1.RetrieveEntityRes, error)
RetrieveIDByRoute(ctx context.Context, in *v1.RetrieveIDByRouteReq, opts ...grpc.CallOption) (*v1.RetrieveEntityRes, error)
}
type domainsServiceClient struct {
cc grpc.ClientConnInterface
}
func NewDomainsServiceClient(cc grpc.ClientConnInterface) DomainsServiceClient {
return &domainsServiceClient{cc}
}
func (c *domainsServiceClient) DeleteUserFromDomains(ctx context.Context, in *DeleteUserReq, opts ...grpc.CallOption) (*DeleteUserRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DeleteUserRes)
err := c.cc.Invoke(ctx, DomainsService_DeleteUserFromDomains_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *domainsServiceClient) RetrieveStatus(ctx context.Context, in *v1.RetrieveEntityReq, opts ...grpc.CallOption) (*v1.RetrieveEntityRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.RetrieveEntityRes)
err := c.cc.Invoke(ctx, DomainsService_RetrieveStatus_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *domainsServiceClient) RetrieveIDByRoute(ctx context.Context, in *v1.RetrieveIDByRouteReq, opts ...grpc.CallOption) (*v1.RetrieveEntityRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.RetrieveEntityRes)
err := c.cc.Invoke(ctx, DomainsService_RetrieveIDByRoute_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// DomainsServiceServer is the server API for DomainsService service.
// All implementations must embed UnimplementedDomainsServiceServer
// for forward compatibility.
//
// DomainsService is a service that provides access to
// domains functionalities for Magistrala services.
type DomainsServiceServer interface {
DeleteUserFromDomains(context.Context, *DeleteUserReq) (*DeleteUserRes, error)
RetrieveStatus(context.Context, *v1.RetrieveEntityReq) (*v1.RetrieveEntityRes, error)
RetrieveIDByRoute(context.Context, *v1.RetrieveIDByRouteReq) (*v1.RetrieveEntityRes, error)
mustEmbedUnimplementedDomainsServiceServer()
}
// UnimplementedDomainsServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedDomainsServiceServer struct{}
func (UnimplementedDomainsServiceServer) DeleteUserFromDomains(context.Context, *DeleteUserReq) (*DeleteUserRes, error) {
return nil, status.Error(codes.Unimplemented, "method DeleteUserFromDomains not implemented")
}
func (UnimplementedDomainsServiceServer) RetrieveStatus(context.Context, *v1.RetrieveEntityReq) (*v1.RetrieveEntityRes, error) {
return nil, status.Error(codes.Unimplemented, "method RetrieveStatus not implemented")
}
func (UnimplementedDomainsServiceServer) RetrieveIDByRoute(context.Context, *v1.RetrieveIDByRouteReq) (*v1.RetrieveEntityRes, error) {
return nil, status.Error(codes.Unimplemented, "method RetrieveIDByRoute not implemented")
}
func (UnimplementedDomainsServiceServer) mustEmbedUnimplementedDomainsServiceServer() {}
func (UnimplementedDomainsServiceServer) testEmbeddedByValue() {}
// UnsafeDomainsServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DomainsServiceServer will
// result in compilation errors.
type UnsafeDomainsServiceServer interface {
mustEmbedUnimplementedDomainsServiceServer()
}
func RegisterDomainsServiceServer(s grpc.ServiceRegistrar, srv DomainsServiceServer) {
// If the following call panics, it indicates UnimplementedDomainsServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&DomainsService_ServiceDesc, srv)
}
func _DomainsService_DeleteUserFromDomains_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteUserReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DomainsServiceServer).DeleteUserFromDomains(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DomainsService_DeleteUserFromDomains_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DomainsServiceServer).DeleteUserFromDomains(ctx, req.(*DeleteUserReq))
}
return interceptor(ctx, in, info, handler)
}
func _DomainsService_RetrieveStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.RetrieveEntityReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DomainsServiceServer).RetrieveStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DomainsService_RetrieveStatus_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DomainsServiceServer).RetrieveStatus(ctx, req.(*v1.RetrieveEntityReq))
}
return interceptor(ctx, in, info, handler)
}
func _DomainsService_RetrieveIDByRoute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.RetrieveIDByRouteReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DomainsServiceServer).RetrieveIDByRoute(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DomainsService_RetrieveIDByRoute_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DomainsServiceServer).RetrieveIDByRoute(ctx, req.(*v1.RetrieveIDByRouteReq))
}
return interceptor(ctx, in, info, handler)
}
// DomainsService_ServiceDesc is the grpc.ServiceDesc for DomainsService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var DomainsService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "domains.v1.DomainsService",
HandlerType: (*DomainsServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "DeleteUserFromDomains",
Handler: _DomainsService_DeleteUserFromDomains_Handler,
},
{
MethodName: "RetrieveStatus",
Handler: _DomainsService_RetrieveStatus_Handler,
},
{
MethodName: "RetrieveIDByRoute",
Handler: _DomainsService_RetrieveIDByRoute_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "domains/v1/domains.proto",
}
+70
View File
@@ -0,0 +1,70 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v7.35.1
// source: groups/v1/groups.proto
package v1
import (
v1 "github.com/absmach/magistrala/api/grpc/common/v1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
var File_groups_v1_groups_proto protoreflect.FileDescriptor
const file_groups_v1_groups_proto_rawDesc = "" +
"\n" +
"\x16groups/v1/groups.proto\x12\tgroups.v1\x1a\x16common/v1/common.proto2_\n" +
"\rGroupsService\x12N\n" +
"\x0eRetrieveEntity\x12\x1c.common.v1.RetrieveEntityReq\x1a\x1c.common.v1.RetrieveEntityRes\"\x00B2Z0github.com/absmach/magistrala/api/grpc/groups/v1b\x06proto3"
var file_groups_v1_groups_proto_goTypes = []any{
(*v1.RetrieveEntityReq)(nil), // 0: common.v1.RetrieveEntityReq
(*v1.RetrieveEntityRes)(nil), // 1: common.v1.RetrieveEntityRes
}
var file_groups_v1_groups_proto_depIdxs = []int32{
0, // 0: groups.v1.GroupsService.RetrieveEntity:input_type -> common.v1.RetrieveEntityReq
1, // 1: groups.v1.GroupsService.RetrieveEntity:output_type -> common.v1.RetrieveEntityRes
1, // [1:2] is the sub-list for method output_type
0, // [0:1] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_groups_v1_groups_proto_init() }
func file_groups_v1_groups_proto_init() {
if File_groups_v1_groups_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_groups_v1_groups_proto_rawDesc), len(file_groups_v1_groups_proto_rawDesc)),
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_groups_v1_groups_proto_goTypes,
DependencyIndexes: file_groups_v1_groups_proto_depIdxs,
}.Build()
File_groups_v1_groups_proto = out.File
file_groups_v1_groups_proto_goTypes = nil
file_groups_v1_groups_proto_depIdxs = nil
}
+131
View File
@@ -0,0 +1,131 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.1
// source: groups/v1/groups.proto
package v1
import (
context "context"
v1 "github.com/absmach/magistrala/api/grpc/common/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
GroupsService_RetrieveEntity_FullMethodName = "/groups.v1.GroupsService/RetrieveEntity"
)
// GroupsServiceClient is the client API for GroupsService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// GroupssService is a service that provides groups
// functionalities for Magistrala services.
type GroupsServiceClient interface {
RetrieveEntity(ctx context.Context, in *v1.RetrieveEntityReq, opts ...grpc.CallOption) (*v1.RetrieveEntityRes, error)
}
type groupsServiceClient struct {
cc grpc.ClientConnInterface
}
func NewGroupsServiceClient(cc grpc.ClientConnInterface) GroupsServiceClient {
return &groupsServiceClient{cc}
}
func (c *groupsServiceClient) RetrieveEntity(ctx context.Context, in *v1.RetrieveEntityReq, opts ...grpc.CallOption) (*v1.RetrieveEntityRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(v1.RetrieveEntityRes)
err := c.cc.Invoke(ctx, GroupsService_RetrieveEntity_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// GroupsServiceServer is the server API for GroupsService service.
// All implementations must embed UnimplementedGroupsServiceServer
// for forward compatibility.
//
// GroupssService is a service that provides groups
// functionalities for Magistrala services.
type GroupsServiceServer interface {
RetrieveEntity(context.Context, *v1.RetrieveEntityReq) (*v1.RetrieveEntityRes, error)
mustEmbedUnimplementedGroupsServiceServer()
}
// UnimplementedGroupsServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedGroupsServiceServer struct{}
func (UnimplementedGroupsServiceServer) RetrieveEntity(context.Context, *v1.RetrieveEntityReq) (*v1.RetrieveEntityRes, error) {
return nil, status.Error(codes.Unimplemented, "method RetrieveEntity not implemented")
}
func (UnimplementedGroupsServiceServer) mustEmbedUnimplementedGroupsServiceServer() {}
func (UnimplementedGroupsServiceServer) testEmbeddedByValue() {}
// UnsafeGroupsServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to GroupsServiceServer will
// result in compilation errors.
type UnsafeGroupsServiceServer interface {
mustEmbedUnimplementedGroupsServiceServer()
}
func RegisterGroupsServiceServer(s grpc.ServiceRegistrar, srv GroupsServiceServer) {
// If the following call panics, it indicates UnimplementedGroupsServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&GroupsService_ServiceDesc, srv)
}
func _GroupsService_RetrieveEntity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.RetrieveEntityReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GroupsServiceServer).RetrieveEntity(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: GroupsService_RetrieveEntity_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GroupsServiceServer).RetrieveEntity(ctx, req.(*v1.RetrieveEntityReq))
}
return interceptor(ctx, in, info, handler)
}
// GroupsService_ServiceDesc is the grpc.ServiceDesc for GroupsService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var GroupsService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "groups.v1.GroupsService",
HandlerType: (*GroupsServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "RetrieveEntity",
Handler: _GroupsService_RetrieveEntity_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "groups/v1/groups.proto",
}
+884
View File
@@ -0,0 +1,884 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v7.35.1
// source: readers/v1/readers.proto
package v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Aggregation defines supported data aggregations.
type Aggregation int32
const (
Aggregation_AGGREGATION_UNSPECIFIED Aggregation = 0
Aggregation_AGGREGATION_MAX Aggregation = 1
Aggregation_AGGREGATION_MIN Aggregation = 2
Aggregation_AGGREGATION_SUM Aggregation = 3
Aggregation_AGGREGATION_COUNT Aggregation = 4
Aggregation_AGGREGATION_AVG Aggregation = 5
)
// Enum value maps for Aggregation.
var (
Aggregation_name = map[int32]string{
0: "AGGREGATION_UNSPECIFIED",
1: "AGGREGATION_MAX",
2: "AGGREGATION_MIN",
3: "AGGREGATION_SUM",
4: "AGGREGATION_COUNT",
5: "AGGREGATION_AVG",
}
Aggregation_value = map[string]int32{
"AGGREGATION_UNSPECIFIED": 0,
"AGGREGATION_MAX": 1,
"AGGREGATION_MIN": 2,
"AGGREGATION_SUM": 3,
"AGGREGATION_COUNT": 4,
"AGGREGATION_AVG": 5,
}
)
func (x Aggregation) Enum() *Aggregation {
p := new(Aggregation)
*p = x
return p
}
func (x Aggregation) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Aggregation) Descriptor() protoreflect.EnumDescriptor {
return file_readers_v1_readers_proto_enumTypes[0].Descriptor()
}
func (Aggregation) Type() protoreflect.EnumType {
return &file_readers_v1_readers_proto_enumTypes[0]
}
func (x Aggregation) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Aggregation.Descriptor instead.
func (Aggregation) EnumDescriptor() ([]byte, []int) {
return file_readers_v1_readers_proto_rawDescGZIP(), []int{0}
}
type PageMetadata struct {
state protoimpl.MessageState `protogen:"open.v1"`
Limit uint64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
Protocol string `protobuf:"bytes,3,opt,name=protocol,proto3" json:"protocol,omitempty"`
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
Value float64 `protobuf:"fixed64,5,opt,name=value,proto3" json:"value,omitempty"`
Publisher string `protobuf:"bytes,6,opt,name=publisher,proto3" json:"publisher,omitempty"`
BoolValue bool `protobuf:"varint,7,opt,name=bool_value,json=boolValue,proto3" json:"bool_value,omitempty"`
StringValue string `protobuf:"bytes,8,opt,name=string_value,json=stringValue,proto3" json:"string_value,omitempty"`
DataValue string `protobuf:"bytes,9,opt,name=data_value,json=dataValue,proto3" json:"data_value,omitempty"`
From float64 `protobuf:"fixed64,10,opt,name=from,proto3" json:"from,omitempty"`
To float64 `protobuf:"fixed64,11,opt,name=to,proto3" json:"to,omitempty"`
Subtopic string `protobuf:"bytes,12,opt,name=subtopic,proto3" json:"subtopic,omitempty"`
Interval string `protobuf:"bytes,13,opt,name=interval,proto3" json:"interval,omitempty"`
Read bool `protobuf:"varint,14,opt,name=read,proto3" json:"read,omitempty"`
Aggregation Aggregation `protobuf:"varint,15,opt,name=aggregation,proto3,enum=readers.v1.Aggregation" json:"aggregation,omitempty"`
Comparator string `protobuf:"bytes,16,opt,name=comparator,proto3" json:"comparator,omitempty"`
Format string `protobuf:"bytes,17,opt,name=format,proto3" json:"format,omitempty"`
Order string `protobuf:"bytes,18,opt,name=order,proto3" json:"order,omitempty"`
Dir string `protobuf:"bytes,19,opt,name=dir,proto3" json:"dir,omitempty"`
Publishers []string `protobuf:"bytes,20,rep,name=publishers,proto3" json:"publishers,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PageMetadata) Reset() {
*x = PageMetadata{}
mi := &file_readers_v1_readers_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PageMetadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PageMetadata) ProtoMessage() {}
func (x *PageMetadata) ProtoReflect() protoreflect.Message {
mi := &file_readers_v1_readers_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PageMetadata.ProtoReflect.Descriptor instead.
func (*PageMetadata) Descriptor() ([]byte, []int) {
return file_readers_v1_readers_proto_rawDescGZIP(), []int{0}
}
func (x *PageMetadata) GetLimit() uint64 {
if x != nil {
return x.Limit
}
return 0
}
func (x *PageMetadata) GetOffset() uint64 {
if x != nil {
return x.Offset
}
return 0
}
func (x *PageMetadata) GetProtocol() string {
if x != nil {
return x.Protocol
}
return ""
}
func (x *PageMetadata) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *PageMetadata) GetValue() float64 {
if x != nil {
return x.Value
}
return 0
}
func (x *PageMetadata) GetPublisher() string {
if x != nil {
return x.Publisher
}
return ""
}
func (x *PageMetadata) GetBoolValue() bool {
if x != nil {
return x.BoolValue
}
return false
}
func (x *PageMetadata) GetStringValue() string {
if x != nil {
return x.StringValue
}
return ""
}
func (x *PageMetadata) GetDataValue() string {
if x != nil {
return x.DataValue
}
return ""
}
func (x *PageMetadata) GetFrom() float64 {
if x != nil {
return x.From
}
return 0
}
func (x *PageMetadata) GetTo() float64 {
if x != nil {
return x.To
}
return 0
}
func (x *PageMetadata) GetSubtopic() string {
if x != nil {
return x.Subtopic
}
return ""
}
func (x *PageMetadata) GetInterval() string {
if x != nil {
return x.Interval
}
return ""
}
func (x *PageMetadata) GetRead() bool {
if x != nil {
return x.Read
}
return false
}
func (x *PageMetadata) GetAggregation() Aggregation {
if x != nil {
return x.Aggregation
}
return Aggregation_AGGREGATION_UNSPECIFIED
}
func (x *PageMetadata) GetComparator() string {
if x != nil {
return x.Comparator
}
return ""
}
func (x *PageMetadata) GetFormat() string {
if x != nil {
return x.Format
}
return ""
}
func (x *PageMetadata) GetOrder() string {
if x != nil {
return x.Order
}
return ""
}
func (x *PageMetadata) GetDir() string {
if x != nil {
return x.Dir
}
return ""
}
func (x *PageMetadata) GetPublishers() []string {
if x != nil {
return x.Publishers
}
return nil
}
type ReadMessagesRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
PageMetadata *PageMetadata `protobuf:"bytes,2,opt,name=page_metadata,json=pageMetadata,proto3" json:"page_metadata,omitempty"`
Messages []*Message `protobuf:"bytes,3,rep,name=messages,proto3" json:"messages,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ReadMessagesRes) Reset() {
*x = ReadMessagesRes{}
mi := &file_readers_v1_readers_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ReadMessagesRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ReadMessagesRes) ProtoMessage() {}
func (x *ReadMessagesRes) ProtoReflect() protoreflect.Message {
mi := &file_readers_v1_readers_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ReadMessagesRes.ProtoReflect.Descriptor instead.
func (*ReadMessagesRes) Descriptor() ([]byte, []int) {
return file_readers_v1_readers_proto_rawDescGZIP(), []int{1}
}
func (x *ReadMessagesRes) GetTotal() uint64 {
if x != nil {
return x.Total
}
return 0
}
func (x *ReadMessagesRes) GetPageMetadata() *PageMetadata {
if x != nil {
return x.PageMetadata
}
return nil
}
func (x *ReadMessagesRes) GetMessages() []*Message {
if x != nil {
return x.Messages
}
return nil
}
type Message struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Types that are valid to be assigned to Payload:
//
// *Message_Senml
// *Message_Json
Payload isMessage_Payload `protobuf_oneof:"payload"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Message) Reset() {
*x = Message{}
mi := &file_readers_v1_readers_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Message) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Message) ProtoMessage() {}
func (x *Message) ProtoReflect() protoreflect.Message {
mi := &file_readers_v1_readers_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Message.ProtoReflect.Descriptor instead.
func (*Message) Descriptor() ([]byte, []int) {
return file_readers_v1_readers_proto_rawDescGZIP(), []int{2}
}
func (x *Message) GetPayload() isMessage_Payload {
if x != nil {
return x.Payload
}
return nil
}
func (x *Message) GetSenml() *SenMLMessage {
if x != nil {
if x, ok := x.Payload.(*Message_Senml); ok {
return x.Senml
}
}
return nil
}
func (x *Message) GetJson() *JsonMessage {
if x != nil {
if x, ok := x.Payload.(*Message_Json); ok {
return x.Json
}
}
return nil
}
type isMessage_Payload interface {
isMessage_Payload()
}
type Message_Senml struct {
Senml *SenMLMessage `protobuf:"bytes,1,opt,name=senml,proto3,oneof"`
}
type Message_Json struct {
Json *JsonMessage `protobuf:"bytes,2,opt,name=json,proto3,oneof"`
}
func (*Message_Senml) isMessage_Payload() {}
func (*Message_Json) isMessage_Payload() {}
type BaseMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"`
Subtopic string `protobuf:"bytes,2,opt,name=subtopic,proto3" json:"subtopic,omitempty"`
Publisher string `protobuf:"bytes,3,opt,name=publisher,proto3" json:"publisher,omitempty"`
Protocol string `protobuf:"bytes,4,opt,name=protocol,proto3" json:"protocol,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *BaseMessage) Reset() {
*x = BaseMessage{}
mi := &file_readers_v1_readers_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *BaseMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BaseMessage) ProtoMessage() {}
func (x *BaseMessage) ProtoReflect() protoreflect.Message {
mi := &file_readers_v1_readers_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BaseMessage.ProtoReflect.Descriptor instead.
func (*BaseMessage) Descriptor() ([]byte, []int) {
return file_readers_v1_readers_proto_rawDescGZIP(), []int{3}
}
func (x *BaseMessage) GetChannel() string {
if x != nil {
return x.Channel
}
return ""
}
func (x *BaseMessage) GetSubtopic() string {
if x != nil {
return x.Subtopic
}
return ""
}
func (x *BaseMessage) GetPublisher() string {
if x != nil {
return x.Publisher
}
return ""
}
func (x *BaseMessage) GetProtocol() string {
if x != nil {
return x.Protocol
}
return ""
}
type SenMLMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
Base *BaseMessage `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Unit string `protobuf:"bytes,3,opt,name=unit,proto3" json:"unit,omitempty"`
Time float64 `protobuf:"fixed64,4,opt,name=time,proto3" json:"time,omitempty"`
UpdateTime float64 `protobuf:"fixed64,5,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
Value *float64 `protobuf:"fixed64,6,opt,name=value,proto3,oneof" json:"value,omitempty"`
StringValue *string `protobuf:"bytes,7,opt,name=string_value,json=stringValue,proto3,oneof" json:"string_value,omitempty"`
DataValue *string `protobuf:"bytes,8,opt,name=data_value,json=dataValue,proto3,oneof" json:"data_value,omitempty"`
BoolValue *bool `protobuf:"varint,9,opt,name=bool_value,json=boolValue,proto3,oneof" json:"bool_value,omitempty"`
Sum *float64 `protobuf:"fixed64,10,opt,name=sum,proto3,oneof" json:"sum,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SenMLMessage) Reset() {
*x = SenMLMessage{}
mi := &file_readers_v1_readers_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SenMLMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SenMLMessage) ProtoMessage() {}
func (x *SenMLMessage) ProtoReflect() protoreflect.Message {
mi := &file_readers_v1_readers_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SenMLMessage.ProtoReflect.Descriptor instead.
func (*SenMLMessage) Descriptor() ([]byte, []int) {
return file_readers_v1_readers_proto_rawDescGZIP(), []int{4}
}
func (x *SenMLMessage) GetBase() *BaseMessage {
if x != nil {
return x.Base
}
return nil
}
func (x *SenMLMessage) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *SenMLMessage) GetUnit() string {
if x != nil {
return x.Unit
}
return ""
}
func (x *SenMLMessage) GetTime() float64 {
if x != nil {
return x.Time
}
return 0
}
func (x *SenMLMessage) GetUpdateTime() float64 {
if x != nil {
return x.UpdateTime
}
return 0
}
func (x *SenMLMessage) GetValue() float64 {
if x != nil && x.Value != nil {
return *x.Value
}
return 0
}
func (x *SenMLMessage) GetStringValue() string {
if x != nil && x.StringValue != nil {
return *x.StringValue
}
return ""
}
func (x *SenMLMessage) GetDataValue() string {
if x != nil && x.DataValue != nil {
return *x.DataValue
}
return ""
}
func (x *SenMLMessage) GetBoolValue() bool {
if x != nil && x.BoolValue != nil {
return *x.BoolValue
}
return false
}
func (x *SenMLMessage) GetSum() float64 {
if x != nil && x.Sum != nil {
return *x.Sum
}
return 0
}
type JsonMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
Base *BaseMessage `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
Created int64 `protobuf:"varint,2,opt,name=created,proto3" json:"created,omitempty"`
Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *JsonMessage) Reset() {
*x = JsonMessage{}
mi := &file_readers_v1_readers_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *JsonMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*JsonMessage) ProtoMessage() {}
func (x *JsonMessage) ProtoReflect() protoreflect.Message {
mi := &file_readers_v1_readers_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use JsonMessage.ProtoReflect.Descriptor instead.
func (*JsonMessage) Descriptor() ([]byte, []int) {
return file_readers_v1_readers_proto_rawDescGZIP(), []int{5}
}
func (x *JsonMessage) GetBase() *BaseMessage {
if x != nil {
return x.Base
}
return nil
}
func (x *JsonMessage) GetCreated() int64 {
if x != nil {
return x.Created
}
return 0
}
func (x *JsonMessage) GetPayload() []byte {
if x != nil {
return x.Payload
}
return nil
}
type ReadMessagesReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
DomainId string `protobuf:"bytes,2,opt,name=domain_id,json=domainId,proto3" json:"domain_id,omitempty"`
PageMetadata *PageMetadata `protobuf:"bytes,3,opt,name=page_metadata,json=pageMetadata,proto3" json:"page_metadata,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ReadMessagesReq) Reset() {
*x = ReadMessagesReq{}
mi := &file_readers_v1_readers_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ReadMessagesReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ReadMessagesReq) ProtoMessage() {}
func (x *ReadMessagesReq) ProtoReflect() protoreflect.Message {
mi := &file_readers_v1_readers_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ReadMessagesReq.ProtoReflect.Descriptor instead.
func (*ReadMessagesReq) Descriptor() ([]byte, []int) {
return file_readers_v1_readers_proto_rawDescGZIP(), []int{6}
}
func (x *ReadMessagesReq) GetChannelId() string {
if x != nil {
return x.ChannelId
}
return ""
}
func (x *ReadMessagesReq) GetDomainId() string {
if x != nil {
return x.DomainId
}
return ""
}
func (x *ReadMessagesReq) GetPageMetadata() *PageMetadata {
if x != nil {
return x.PageMetadata
}
return nil
}
var File_readers_v1_readers_proto protoreflect.FileDescriptor
const file_readers_v1_readers_proto_rawDesc = "" +
"\n" +
"\x18readers/v1/readers.proto\x12\n" +
"readers.v1\"\xac\x04\n" +
"\fPageMetadata\x12\x14\n" +
"\x05limit\x18\x01 \x01(\x04R\x05limit\x12\x16\n" +
"\x06offset\x18\x02 \x01(\x04R\x06offset\x12\x1a\n" +
"\bprotocol\x18\x03 \x01(\tR\bprotocol\x12\x12\n" +
"\x04name\x18\x04 \x01(\tR\x04name\x12\x14\n" +
"\x05value\x18\x05 \x01(\x01R\x05value\x12\x1c\n" +
"\tpublisher\x18\x06 \x01(\tR\tpublisher\x12\x1d\n" +
"\n" +
"bool_value\x18\a \x01(\bR\tboolValue\x12!\n" +
"\fstring_value\x18\b \x01(\tR\vstringValue\x12\x1d\n" +
"\n" +
"data_value\x18\t \x01(\tR\tdataValue\x12\x12\n" +
"\x04from\x18\n" +
" \x01(\x01R\x04from\x12\x0e\n" +
"\x02to\x18\v \x01(\x01R\x02to\x12\x1a\n" +
"\bsubtopic\x18\f \x01(\tR\bsubtopic\x12\x1a\n" +
"\binterval\x18\r \x01(\tR\binterval\x12\x12\n" +
"\x04read\x18\x0e \x01(\bR\x04read\x129\n" +
"\vaggregation\x18\x0f \x01(\x0e2\x17.readers.v1.AggregationR\vaggregation\x12\x1e\n" +
"\n" +
"comparator\x18\x10 \x01(\tR\n" +
"comparator\x12\x16\n" +
"\x06format\x18\x11 \x01(\tR\x06format\x12\x14\n" +
"\x05order\x18\x12 \x01(\tR\x05order\x12\x10\n" +
"\x03dir\x18\x13 \x01(\tR\x03dir\x12\x1e\n" +
"\n" +
"publishers\x18\x14 \x03(\tR\n" +
"publishers\"\x97\x01\n" +
"\x0fReadMessagesRes\x12\x14\n" +
"\x05total\x18\x01 \x01(\x04R\x05total\x12=\n" +
"\rpage_metadata\x18\x02 \x01(\v2\x18.readers.v1.PageMetadataR\fpageMetadata\x12/\n" +
"\bmessages\x18\x03 \x03(\v2\x13.readers.v1.MessageR\bmessages\"u\n" +
"\aMessage\x120\n" +
"\x05senml\x18\x01 \x01(\v2\x18.readers.v1.SenMLMessageH\x00R\x05senml\x12-\n" +
"\x04json\x18\x02 \x01(\v2\x17.readers.v1.JsonMessageH\x00R\x04jsonB\t\n" +
"\apayload\"}\n" +
"\vBaseMessage\x12\x18\n" +
"\achannel\x18\x01 \x01(\tR\achannel\x12\x1a\n" +
"\bsubtopic\x18\x02 \x01(\tR\bsubtopic\x12\x1c\n" +
"\tpublisher\x18\x03 \x01(\tR\tpublisher\x12\x1a\n" +
"\bprotocol\x18\x04 \x01(\tR\bprotocol\"\xfb\x02\n" +
"\fSenMLMessage\x12+\n" +
"\x04base\x18\x01 \x01(\v2\x17.readers.v1.BaseMessageR\x04base\x12\x12\n" +
"\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" +
"\x04unit\x18\x03 \x01(\tR\x04unit\x12\x12\n" +
"\x04time\x18\x04 \x01(\x01R\x04time\x12\x1f\n" +
"\vupdate_time\x18\x05 \x01(\x01R\n" +
"updateTime\x12\x19\n" +
"\x05value\x18\x06 \x01(\x01H\x00R\x05value\x88\x01\x01\x12&\n" +
"\fstring_value\x18\a \x01(\tH\x01R\vstringValue\x88\x01\x01\x12\"\n" +
"\n" +
"data_value\x18\b \x01(\tH\x02R\tdataValue\x88\x01\x01\x12\"\n" +
"\n" +
"bool_value\x18\t \x01(\bH\x03R\tboolValue\x88\x01\x01\x12\x15\n" +
"\x03sum\x18\n" +
" \x01(\x01H\x04R\x03sum\x88\x01\x01B\b\n" +
"\x06_valueB\x0f\n" +
"\r_string_valueB\r\n" +
"\v_data_valueB\r\n" +
"\v_bool_valueB\x06\n" +
"\x04_sum\"n\n" +
"\vJsonMessage\x12+\n" +
"\x04base\x18\x01 \x01(\v2\x17.readers.v1.BaseMessageR\x04base\x12\x18\n" +
"\acreated\x18\x02 \x01(\x03R\acreated\x12\x18\n" +
"\apayload\x18\x03 \x01(\fR\apayload\"\x8c\x01\n" +
"\x0fReadMessagesReq\x12\x1d\n" +
"\n" +
"channel_id\x18\x01 \x01(\tR\tchannelId\x12\x1b\n" +
"\tdomain_id\x18\x02 \x01(\tR\bdomainId\x12=\n" +
"\rpage_metadata\x18\x03 \x01(\v2\x18.readers.v1.PageMetadataR\fpageMetadata*\x95\x01\n" +
"\vAggregation\x12\x1b\n" +
"\x17AGGREGATION_UNSPECIFIED\x10\x00\x12\x13\n" +
"\x0fAGGREGATION_MAX\x10\x01\x12\x13\n" +
"\x0fAGGREGATION_MIN\x10\x02\x12\x13\n" +
"\x0fAGGREGATION_SUM\x10\x03\x12\x15\n" +
"\x11AGGREGATION_COUNT\x10\x04\x12\x13\n" +
"\x0fAGGREGATION_AVG\x10\x052\\\n" +
"\x0eReadersService\x12J\n" +
"\fReadMessages\x12\x1b.readers.v1.ReadMessagesReq\x1a\x1b.readers.v1.ReadMessagesRes\"\x00B3Z1github.com/absmach/magistrala/api/grpc/readers/v1b\x06proto3"
var (
file_readers_v1_readers_proto_rawDescOnce sync.Once
file_readers_v1_readers_proto_rawDescData []byte
)
func file_readers_v1_readers_proto_rawDescGZIP() []byte {
file_readers_v1_readers_proto_rawDescOnce.Do(func() {
file_readers_v1_readers_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_readers_v1_readers_proto_rawDesc), len(file_readers_v1_readers_proto_rawDesc)))
})
return file_readers_v1_readers_proto_rawDescData
}
var file_readers_v1_readers_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_readers_v1_readers_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_readers_v1_readers_proto_goTypes = []any{
(Aggregation)(0), // 0: readers.v1.Aggregation
(*PageMetadata)(nil), // 1: readers.v1.PageMetadata
(*ReadMessagesRes)(nil), // 2: readers.v1.ReadMessagesRes
(*Message)(nil), // 3: readers.v1.Message
(*BaseMessage)(nil), // 4: readers.v1.BaseMessage
(*SenMLMessage)(nil), // 5: readers.v1.SenMLMessage
(*JsonMessage)(nil), // 6: readers.v1.JsonMessage
(*ReadMessagesReq)(nil), // 7: readers.v1.ReadMessagesReq
}
var file_readers_v1_readers_proto_depIdxs = []int32{
0, // 0: readers.v1.PageMetadata.aggregation:type_name -> readers.v1.Aggregation
1, // 1: readers.v1.ReadMessagesRes.page_metadata:type_name -> readers.v1.PageMetadata
3, // 2: readers.v1.ReadMessagesRes.messages:type_name -> readers.v1.Message
5, // 3: readers.v1.Message.senml:type_name -> readers.v1.SenMLMessage
6, // 4: readers.v1.Message.json:type_name -> readers.v1.JsonMessage
4, // 5: readers.v1.SenMLMessage.base:type_name -> readers.v1.BaseMessage
4, // 6: readers.v1.JsonMessage.base:type_name -> readers.v1.BaseMessage
1, // 7: readers.v1.ReadMessagesReq.page_metadata:type_name -> readers.v1.PageMetadata
7, // 8: readers.v1.ReadersService.ReadMessages:input_type -> readers.v1.ReadMessagesReq
2, // 9: readers.v1.ReadersService.ReadMessages:output_type -> readers.v1.ReadMessagesRes
9, // [9:10] is the sub-list for method output_type
8, // [8:9] is the sub-list for method input_type
8, // [8:8] is the sub-list for extension type_name
8, // [8:8] is the sub-list for extension extendee
0, // [0:8] is the sub-list for field type_name
}
func init() { file_readers_v1_readers_proto_init() }
func file_readers_v1_readers_proto_init() {
if File_readers_v1_readers_proto != nil {
return
}
file_readers_v1_readers_proto_msgTypes[2].OneofWrappers = []any{
(*Message_Senml)(nil),
(*Message_Json)(nil),
}
file_readers_v1_readers_proto_msgTypes[4].OneofWrappers = []any{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_readers_v1_readers_proto_rawDesc), len(file_readers_v1_readers_proto_rawDesc)),
NumEnums: 1,
NumMessages: 7,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_readers_v1_readers_proto_goTypes,
DependencyIndexes: file_readers_v1_readers_proto_depIdxs,
EnumInfos: file_readers_v1_readers_proto_enumTypes,
MessageInfos: file_readers_v1_readers_proto_msgTypes,
}.Build()
File_readers_v1_readers_proto = out.File
file_readers_v1_readers_proto_goTypes = nil
file_readers_v1_readers_proto_depIdxs = nil
}
+130
View File
@@ -0,0 +1,130 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.1
// source: readers/v1/readers.proto
package v1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
ReadersService_ReadMessages_FullMethodName = "/readers.v1.ReadersService/ReadMessages"
)
// ReadersServiceClient is the client API for ReadersService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// ReadersService is a service that provides access to
// readers functionalities for Magistrala services.
type ReadersServiceClient interface {
ReadMessages(ctx context.Context, in *ReadMessagesReq, opts ...grpc.CallOption) (*ReadMessagesRes, error)
}
type readersServiceClient struct {
cc grpc.ClientConnInterface
}
func NewReadersServiceClient(cc grpc.ClientConnInterface) ReadersServiceClient {
return &readersServiceClient{cc}
}
func (c *readersServiceClient) ReadMessages(ctx context.Context, in *ReadMessagesReq, opts ...grpc.CallOption) (*ReadMessagesRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ReadMessagesRes)
err := c.cc.Invoke(ctx, ReadersService_ReadMessages_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ReadersServiceServer is the server API for ReadersService service.
// All implementations must embed UnimplementedReadersServiceServer
// for forward compatibility.
//
// ReadersService is a service that provides access to
// readers functionalities for Magistrala services.
type ReadersServiceServer interface {
ReadMessages(context.Context, *ReadMessagesReq) (*ReadMessagesRes, error)
mustEmbedUnimplementedReadersServiceServer()
}
// UnimplementedReadersServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedReadersServiceServer struct{}
func (UnimplementedReadersServiceServer) ReadMessages(context.Context, *ReadMessagesReq) (*ReadMessagesRes, error) {
return nil, status.Error(codes.Unimplemented, "method ReadMessages not implemented")
}
func (UnimplementedReadersServiceServer) mustEmbedUnimplementedReadersServiceServer() {}
func (UnimplementedReadersServiceServer) testEmbeddedByValue() {}
// UnsafeReadersServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ReadersServiceServer will
// result in compilation errors.
type UnsafeReadersServiceServer interface {
mustEmbedUnimplementedReadersServiceServer()
}
func RegisterReadersServiceServer(s grpc.ServiceRegistrar, srv ReadersServiceServer) {
// If the following call panics, it indicates UnimplementedReadersServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&ReadersService_ServiceDesc, srv)
}
func _ReadersService_ReadMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReadMessagesReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ReadersServiceServer).ReadMessages(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ReadersService_ReadMessages_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ReadersServiceServer).ReadMessages(ctx, req.(*ReadMessagesReq))
}
return interceptor(ctx, in, info, handler)
}
// ReadersService_ServiceDesc is the grpc.ServiceDesc for ReadersService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ReadersService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "readers.v1.ReadersService",
HandlerType: (*ReadersServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ReadMessages",
Handler: _ReadersService_ReadMessages_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "readers/v1/readers.proto",
}
+547
View File
@@ -0,0 +1,547 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v7.35.1
// source: token/v1/token.proto
package v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type IssueReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
UserRole uint32 `protobuf:"varint,2,opt,name=user_role,json=userRole,proto3" json:"user_role,omitempty"`
Type uint32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"`
Verified bool `protobuf:"varint,4,opt,name=verified,proto3" json:"verified,omitempty"`
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *IssueReq) Reset() {
*x = IssueReq{}
mi := &file_token_v1_token_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *IssueReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IssueReq) ProtoMessage() {}
func (x *IssueReq) ProtoReflect() protoreflect.Message {
mi := &file_token_v1_token_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IssueReq.ProtoReflect.Descriptor instead.
func (*IssueReq) Descriptor() ([]byte, []int) {
return file_token_v1_token_proto_rawDescGZIP(), []int{0}
}
func (x *IssueReq) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
func (x *IssueReq) GetUserRole() uint32 {
if x != nil {
return x.UserRole
}
return 0
}
func (x *IssueReq) GetType() uint32 {
if x != nil {
return x.Type
}
return 0
}
func (x *IssueReq) GetVerified() bool {
if x != nil {
return x.Verified
}
return false
}
func (x *IssueReq) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
type RefreshReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
Verified bool `protobuf:"varint,2,opt,name=verified,proto3" json:"verified,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RefreshReq) Reset() {
*x = RefreshReq{}
mi := &file_token_v1_token_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RefreshReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RefreshReq) ProtoMessage() {}
func (x *RefreshReq) ProtoReflect() protoreflect.Message {
mi := &file_token_v1_token_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RefreshReq.ProtoReflect.Descriptor instead.
func (*RefreshReq) Descriptor() ([]byte, []int) {
return file_token_v1_token_proto_rawDescGZIP(), []int{1}
}
func (x *RefreshReq) GetRefreshToken() string {
if x != nil {
return x.RefreshToken
}
return ""
}
func (x *RefreshReq) GetVerified() bool {
if x != nil {
return x.Verified
}
return false
}
type RevokeReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
TokenId string `protobuf:"bytes,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"`
UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RevokeReq) Reset() {
*x = RevokeReq{}
mi := &file_token_v1_token_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RevokeReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RevokeReq) ProtoMessage() {}
func (x *RevokeReq) ProtoReflect() protoreflect.Message {
mi := &file_token_v1_token_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RevokeReq.ProtoReflect.Descriptor instead.
func (*RevokeReq) Descriptor() ([]byte, []int) {
return file_token_v1_token_proto_rawDescGZIP(), []int{2}
}
func (x *RevokeReq) GetTokenId() string {
if x != nil {
return x.TokenId
}
return ""
}
func (x *RevokeReq) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
// If a token is not carrying any information itself, the type
// field can be used to determine how to validate the token.
// Also, different tokens can be encoded in different ways.
type Token struct {
state protoimpl.MessageState `protogen:"open.v1"`
AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
RefreshToken *string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3,oneof" json:"refresh_token,omitempty"`
AccessType string `protobuf:"bytes,3,opt,name=access_type,json=accessType,proto3" json:"access_type,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Token) Reset() {
*x = Token{}
mi := &file_token_v1_token_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Token) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Token) ProtoMessage() {}
func (x *Token) ProtoReflect() protoreflect.Message {
mi := &file_token_v1_token_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Token.ProtoReflect.Descriptor instead.
func (*Token) Descriptor() ([]byte, []int) {
return file_token_v1_token_proto_rawDescGZIP(), []int{3}
}
func (x *Token) GetAccessToken() string {
if x != nil {
return x.AccessToken
}
return ""
}
func (x *Token) GetRefreshToken() string {
if x != nil && x.RefreshToken != nil {
return *x.RefreshToken
}
return ""
}
func (x *Token) GetAccessType() string {
if x != nil {
return x.AccessType
}
return ""
}
type RevokeRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RevokeRes) Reset() {
*x = RevokeRes{}
mi := &file_token_v1_token_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RevokeRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RevokeRes) ProtoMessage() {}
func (x *RevokeRes) ProtoReflect() protoreflect.Message {
mi := &file_token_v1_token_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RevokeRes.ProtoReflect.Descriptor instead.
func (*RevokeRes) Descriptor() ([]byte, []int) {
return file_token_v1_token_proto_rawDescGZIP(), []int{4}
}
type ListUserRefreshTokensReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListUserRefreshTokensReq) Reset() {
*x = ListUserRefreshTokensReq{}
mi := &file_token_v1_token_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListUserRefreshTokensReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListUserRefreshTokensReq) ProtoMessage() {}
func (x *ListUserRefreshTokensReq) ProtoReflect() protoreflect.Message {
mi := &file_token_v1_token_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListUserRefreshTokensReq.ProtoReflect.Descriptor instead.
func (*ListUserRefreshTokensReq) Descriptor() ([]byte, []int) {
return file_token_v1_token_proto_rawDescGZIP(), []int{5}
}
func (x *ListUserRefreshTokensReq) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
type ListUserRefreshTokensRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
RefreshTokens []*RefreshToken `protobuf:"bytes,1,rep,name=refresh_tokens,json=refreshTokens,proto3" json:"refresh_tokens,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListUserRefreshTokensRes) Reset() {
*x = ListUserRefreshTokensRes{}
mi := &file_token_v1_token_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListUserRefreshTokensRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListUserRefreshTokensRes) ProtoMessage() {}
func (x *ListUserRefreshTokensRes) ProtoReflect() protoreflect.Message {
mi := &file_token_v1_token_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListUserRefreshTokensRes.ProtoReflect.Descriptor instead.
func (*ListUserRefreshTokensRes) Descriptor() ([]byte, []int) {
return file_token_v1_token_proto_rawDescGZIP(), []int{6}
}
func (x *ListUserRefreshTokensRes) GetRefreshTokens() []*RefreshToken {
if x != nil {
return x.RefreshTokens
}
return nil
}
type RefreshToken struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RefreshToken) Reset() {
*x = RefreshToken{}
mi := &file_token_v1_token_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RefreshToken) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RefreshToken) ProtoMessage() {}
func (x *RefreshToken) ProtoReflect() protoreflect.Message {
mi := &file_token_v1_token_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RefreshToken.ProtoReflect.Descriptor instead.
func (*RefreshToken) Descriptor() ([]byte, []int) {
return file_token_v1_token_proto_rawDescGZIP(), []int{7}
}
func (x *RefreshToken) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *RefreshToken) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
var File_token_v1_token_proto protoreflect.FileDescriptor
const file_token_v1_token_proto_rawDesc = "" +
"\n" +
"\x14token/v1/token.proto\x12\btoken.v1\"\x92\x01\n" +
"\bIssueReq\x12\x17\n" +
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1b\n" +
"\tuser_role\x18\x02 \x01(\rR\buserRole\x12\x12\n" +
"\x04type\x18\x03 \x01(\rR\x04type\x12\x1a\n" +
"\bverified\x18\x04 \x01(\bR\bverified\x12 \n" +
"\vdescription\x18\x05 \x01(\tR\vdescription\"M\n" +
"\n" +
"RefreshReq\x12#\n" +
"\rrefresh_token\x18\x01 \x01(\tR\frefreshToken\x12\x1a\n" +
"\bverified\x18\x02 \x01(\bR\bverified\"?\n" +
"\tRevokeReq\x12\x19\n" +
"\btoken_id\x18\x01 \x01(\tR\atokenId\x12\x17\n" +
"\auser_id\x18\x02 \x01(\tR\x06userId\"\x87\x01\n" +
"\x05Token\x12!\n" +
"\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12(\n" +
"\rrefresh_token\x18\x02 \x01(\tH\x00R\frefreshToken\x88\x01\x01\x12\x1f\n" +
"\vaccess_type\x18\x03 \x01(\tR\n" +
"accessTypeB\x10\n" +
"\x0e_refresh_token\"\v\n" +
"\tRevokeRes\"3\n" +
"\x18ListUserRefreshTokensReq\x12\x17\n" +
"\auser_id\x18\x01 \x01(\tR\x06userId\"Y\n" +
"\x18ListUserRefreshTokensRes\x12=\n" +
"\x0erefresh_tokens\x18\x01 \x03(\v2\x16.token.v1.RefreshTokenR\rrefreshTokens\"@\n" +
"\fRefreshToken\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\x12 \n" +
"\vdescription\x18\x02 \x01(\tR\vdescription2\x8b\x02\n" +
"\fTokenService\x12.\n" +
"\x05Issue\x12\x12.token.v1.IssueReq\x1a\x0f.token.v1.Token\"\x00\x122\n" +
"\aRefresh\x12\x14.token.v1.RefreshReq\x1a\x0f.token.v1.Token\"\x00\x124\n" +
"\x06Revoke\x12\x13.token.v1.RevokeReq\x1a\x13.token.v1.RevokeRes\"\x00\x12a\n" +
"\x15ListUserRefreshTokens\x12\".token.v1.ListUserRefreshTokensReq\x1a\".token.v1.ListUserRefreshTokensRes\"\x00B1Z/github.com/absmach/magistrala/api/grpc/token/v1b\x06proto3"
var (
file_token_v1_token_proto_rawDescOnce sync.Once
file_token_v1_token_proto_rawDescData []byte
)
func file_token_v1_token_proto_rawDescGZIP() []byte {
file_token_v1_token_proto_rawDescOnce.Do(func() {
file_token_v1_token_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_token_v1_token_proto_rawDesc), len(file_token_v1_token_proto_rawDesc)))
})
return file_token_v1_token_proto_rawDescData
}
var file_token_v1_token_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_token_v1_token_proto_goTypes = []any{
(*IssueReq)(nil), // 0: token.v1.IssueReq
(*RefreshReq)(nil), // 1: token.v1.RefreshReq
(*RevokeReq)(nil), // 2: token.v1.RevokeReq
(*Token)(nil), // 3: token.v1.Token
(*RevokeRes)(nil), // 4: token.v1.RevokeRes
(*ListUserRefreshTokensReq)(nil), // 5: token.v1.ListUserRefreshTokensReq
(*ListUserRefreshTokensRes)(nil), // 6: token.v1.ListUserRefreshTokensRes
(*RefreshToken)(nil), // 7: token.v1.RefreshToken
}
var file_token_v1_token_proto_depIdxs = []int32{
7, // 0: token.v1.ListUserRefreshTokensRes.refresh_tokens:type_name -> token.v1.RefreshToken
0, // 1: token.v1.TokenService.Issue:input_type -> token.v1.IssueReq
1, // 2: token.v1.TokenService.Refresh:input_type -> token.v1.RefreshReq
2, // 3: token.v1.TokenService.Revoke:input_type -> token.v1.RevokeReq
5, // 4: token.v1.TokenService.ListUserRefreshTokens:input_type -> token.v1.ListUserRefreshTokensReq
3, // 5: token.v1.TokenService.Issue:output_type -> token.v1.Token
3, // 6: token.v1.TokenService.Refresh:output_type -> token.v1.Token
4, // 7: token.v1.TokenService.Revoke:output_type -> token.v1.RevokeRes
6, // 8: token.v1.TokenService.ListUserRefreshTokens:output_type -> token.v1.ListUserRefreshTokensRes
5, // [5:9] is the sub-list for method output_type
1, // [1:5] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_token_v1_token_proto_init() }
func file_token_v1_token_proto_init() {
if File_token_v1_token_proto != nil {
return
}
file_token_v1_token_proto_msgTypes[3].OneofWrappers = []any{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_token_v1_token_proto_rawDesc), len(file_token_v1_token_proto_rawDesc)),
NumEnums: 0,
NumMessages: 8,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_token_v1_token_proto_goTypes,
DependencyIndexes: file_token_v1_token_proto_depIdxs,
MessageInfos: file_token_v1_token_proto_msgTypes,
}.Build()
File_token_v1_token_proto = out.File
file_token_v1_token_proto_goTypes = nil
file_token_v1_token_proto_depIdxs = nil
}
+238
View File
@@ -0,0 +1,238 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.1
// source: token/v1/token.proto
package v1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
TokenService_Issue_FullMethodName = "/token.v1.TokenService/Issue"
TokenService_Refresh_FullMethodName = "/token.v1.TokenService/Refresh"
TokenService_Revoke_FullMethodName = "/token.v1.TokenService/Revoke"
TokenService_ListUserRefreshTokens_FullMethodName = "/token.v1.TokenService/ListUserRefreshTokens"
)
// TokenServiceClient is the client API for TokenService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type TokenServiceClient interface {
Issue(ctx context.Context, in *IssueReq, opts ...grpc.CallOption) (*Token, error)
Refresh(ctx context.Context, in *RefreshReq, opts ...grpc.CallOption) (*Token, error)
Revoke(ctx context.Context, in *RevokeReq, opts ...grpc.CallOption) (*RevokeRes, error)
ListUserRefreshTokens(ctx context.Context, in *ListUserRefreshTokensReq, opts ...grpc.CallOption) (*ListUserRefreshTokensRes, error)
}
type tokenServiceClient struct {
cc grpc.ClientConnInterface
}
func NewTokenServiceClient(cc grpc.ClientConnInterface) TokenServiceClient {
return &tokenServiceClient{cc}
}
func (c *tokenServiceClient) Issue(ctx context.Context, in *IssueReq, opts ...grpc.CallOption) (*Token, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Token)
err := c.cc.Invoke(ctx, TokenService_Issue_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *tokenServiceClient) Refresh(ctx context.Context, in *RefreshReq, opts ...grpc.CallOption) (*Token, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Token)
err := c.cc.Invoke(ctx, TokenService_Refresh_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *tokenServiceClient) Revoke(ctx context.Context, in *RevokeReq, opts ...grpc.CallOption) (*RevokeRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RevokeRes)
err := c.cc.Invoke(ctx, TokenService_Revoke_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *tokenServiceClient) ListUserRefreshTokens(ctx context.Context, in *ListUserRefreshTokensReq, opts ...grpc.CallOption) (*ListUserRefreshTokensRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListUserRefreshTokensRes)
err := c.cc.Invoke(ctx, TokenService_ListUserRefreshTokens_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// TokenServiceServer is the server API for TokenService service.
// All implementations must embed UnimplementedTokenServiceServer
// for forward compatibility.
type TokenServiceServer interface {
Issue(context.Context, *IssueReq) (*Token, error)
Refresh(context.Context, *RefreshReq) (*Token, error)
Revoke(context.Context, *RevokeReq) (*RevokeRes, error)
ListUserRefreshTokens(context.Context, *ListUserRefreshTokensReq) (*ListUserRefreshTokensRes, error)
mustEmbedUnimplementedTokenServiceServer()
}
// UnimplementedTokenServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedTokenServiceServer struct{}
func (UnimplementedTokenServiceServer) Issue(context.Context, *IssueReq) (*Token, error) {
return nil, status.Error(codes.Unimplemented, "method Issue not implemented")
}
func (UnimplementedTokenServiceServer) Refresh(context.Context, *RefreshReq) (*Token, error) {
return nil, status.Error(codes.Unimplemented, "method Refresh not implemented")
}
func (UnimplementedTokenServiceServer) Revoke(context.Context, *RevokeReq) (*RevokeRes, error) {
return nil, status.Error(codes.Unimplemented, "method Revoke not implemented")
}
func (UnimplementedTokenServiceServer) ListUserRefreshTokens(context.Context, *ListUserRefreshTokensReq) (*ListUserRefreshTokensRes, error) {
return nil, status.Error(codes.Unimplemented, "method ListUserRefreshTokens not implemented")
}
func (UnimplementedTokenServiceServer) mustEmbedUnimplementedTokenServiceServer() {}
func (UnimplementedTokenServiceServer) testEmbeddedByValue() {}
// UnsafeTokenServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to TokenServiceServer will
// result in compilation errors.
type UnsafeTokenServiceServer interface {
mustEmbedUnimplementedTokenServiceServer()
}
func RegisterTokenServiceServer(s grpc.ServiceRegistrar, srv TokenServiceServer) {
// If the following call panics, it indicates UnimplementedTokenServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&TokenService_ServiceDesc, srv)
}
func _TokenService_Issue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IssueReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TokenServiceServer).Issue(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: TokenService_Issue_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TokenServiceServer).Issue(ctx, req.(*IssueReq))
}
return interceptor(ctx, in, info, handler)
}
func _TokenService_Refresh_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RefreshReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TokenServiceServer).Refresh(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: TokenService_Refresh_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TokenServiceServer).Refresh(ctx, req.(*RefreshReq))
}
return interceptor(ctx, in, info, handler)
}
func _TokenService_Revoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RevokeReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TokenServiceServer).Revoke(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: TokenService_Revoke_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TokenServiceServer).Revoke(ctx, req.(*RevokeReq))
}
return interceptor(ctx, in, info, handler)
}
func _TokenService_ListUserRefreshTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListUserRefreshTokensReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TokenServiceServer).ListUserRefreshTokens(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: TokenService_ListUserRefreshTokens_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TokenServiceServer).ListUserRefreshTokens(ctx, req.(*ListUserRefreshTokensReq))
}
return interceptor(ctx, in, info, handler)
}
// TokenService_ServiceDesc is the grpc.ServiceDesc for TokenService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var TokenService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "token.v1.TokenService",
HandlerType: (*TokenServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Issue",
Handler: _TokenService_Issue_Handler,
},
{
MethodName: "Refresh",
Handler: _TokenService_Refresh_Handler,
},
{
MethodName: "Revoke",
Handler: _TokenService_Revoke_Handler,
},
{
MethodName: "ListUserRefreshTokens",
Handler: _TokenService_ListUserRefreshTokens_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "token/v1/token.proto",
}
+428
View File
@@ -0,0 +1,428 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v7.35.1
// source: users/v1/users.proto
package v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
structpb "google.golang.org/protobuf/types/known/structpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type RetrieveUsersReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
Limit uint64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RetrieveUsersReq) Reset() {
*x = RetrieveUsersReq{}
mi := &file_users_v1_users_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RetrieveUsersReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RetrieveUsersReq) ProtoMessage() {}
func (x *RetrieveUsersReq) ProtoReflect() protoreflect.Message {
mi := &file_users_v1_users_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RetrieveUsersReq.ProtoReflect.Descriptor instead.
func (*RetrieveUsersReq) Descriptor() ([]byte, []int) {
return file_users_v1_users_proto_rawDescGZIP(), []int{0}
}
func (x *RetrieveUsersReq) GetIds() []string {
if x != nil {
return x.Ids
}
return nil
}
func (x *RetrieveUsersReq) GetOffset() uint64 {
if x != nil {
return x.Offset
}
return 0
}
func (x *RetrieveUsersReq) GetLimit() uint64 {
if x != nil {
return x.Limit
}
return 0
}
type RetrieveUsersRes struct {
state protoimpl.MessageState `protogen:"open.v1"`
Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Limit uint64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
Offset uint64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
Users []*User `protobuf:"bytes,4,rep,name=users,proto3" json:"users,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RetrieveUsersRes) Reset() {
*x = RetrieveUsersRes{}
mi := &file_users_v1_users_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RetrieveUsersRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RetrieveUsersRes) ProtoMessage() {}
func (x *RetrieveUsersRes) ProtoReflect() protoreflect.Message {
mi := &file_users_v1_users_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RetrieveUsersRes.ProtoReflect.Descriptor instead.
func (*RetrieveUsersRes) Descriptor() ([]byte, []int) {
return file_users_v1_users_proto_rawDescGZIP(), []int{1}
}
func (x *RetrieveUsersRes) GetTotal() uint64 {
if x != nil {
return x.Total
}
return 0
}
func (x *RetrieveUsersRes) GetLimit() uint64 {
if x != nil {
return x.Limit
}
return 0
}
func (x *RetrieveUsersRes) GetOffset() uint64 {
if x != nil {
return x.Offset
}
return 0
}
func (x *RetrieveUsersRes) GetUsers() []*User {
if x != nil {
return x.Users
}
return nil
}
type User struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
FirstName string `protobuf:"bytes,2,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
LastName string `protobuf:"bytes,3,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
Tags []string `protobuf:"bytes,4,rep,name=tags,proto3" json:"tags,omitempty"`
Metadata *structpb.Struct `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"`
PrivateMetadata *structpb.Struct `protobuf:"bytes,6,opt,name=private_metadata,json=privateMetadata,proto3" json:"private_metadata,omitempty"`
Status uint32 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"`
Role uint32 `protobuf:"varint,8,opt,name=role,proto3" json:"role,omitempty"`
ProfilePicture string `protobuf:"bytes,9,opt,name=profile_picture,json=profilePicture,proto3" json:"profile_picture,omitempty"`
Username string `protobuf:"bytes,10,opt,name=username,proto3" json:"username,omitempty"`
Email string `protobuf:"bytes,11,opt,name=email,proto3" json:"email,omitempty"`
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
UpdatedBy string `protobuf:"bytes,14,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"`
VerifiedAt *timestamppb.Timestamp `protobuf:"bytes,15,opt,name=verified_at,json=verifiedAt,proto3" json:"verified_at,omitempty"`
AuthProvider string `protobuf:"bytes,16,opt,name=auth_provider,json=authProvider,proto3" json:"auth_provider,omitempty"`
Permissions []string `protobuf:"bytes,17,rep,name=permissions,proto3" json:"permissions,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *User) Reset() {
*x = User{}
mi := &file_users_v1_users_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *User) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*User) ProtoMessage() {}
func (x *User) ProtoReflect() protoreflect.Message {
mi := &file_users_v1_users_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use User.ProtoReflect.Descriptor instead.
func (*User) Descriptor() ([]byte, []int) {
return file_users_v1_users_proto_rawDescGZIP(), []int{2}
}
func (x *User) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *User) GetFirstName() string {
if x != nil {
return x.FirstName
}
return ""
}
func (x *User) GetLastName() string {
if x != nil {
return x.LastName
}
return ""
}
func (x *User) GetTags() []string {
if x != nil {
return x.Tags
}
return nil
}
func (x *User) GetMetadata() *structpb.Struct {
if x != nil {
return x.Metadata
}
return nil
}
func (x *User) GetPrivateMetadata() *structpb.Struct {
if x != nil {
return x.PrivateMetadata
}
return nil
}
func (x *User) GetStatus() uint32 {
if x != nil {
return x.Status
}
return 0
}
func (x *User) GetRole() uint32 {
if x != nil {
return x.Role
}
return 0
}
func (x *User) GetProfilePicture() string {
if x != nil {
return x.ProfilePicture
}
return ""
}
func (x *User) GetUsername() string {
if x != nil {
return x.Username
}
return ""
}
func (x *User) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *User) GetCreatedAt() *timestamppb.Timestamp {
if x != nil {
return x.CreatedAt
}
return nil
}
func (x *User) GetUpdatedAt() *timestamppb.Timestamp {
if x != nil {
return x.UpdatedAt
}
return nil
}
func (x *User) GetUpdatedBy() string {
if x != nil {
return x.UpdatedBy
}
return ""
}
func (x *User) GetVerifiedAt() *timestamppb.Timestamp {
if x != nil {
return x.VerifiedAt
}
return nil
}
func (x *User) GetAuthProvider() string {
if x != nil {
return x.AuthProvider
}
return ""
}
func (x *User) GetPermissions() []string {
if x != nil {
return x.Permissions
}
return nil
}
var File_users_v1_users_proto protoreflect.FileDescriptor
const file_users_v1_users_proto_rawDesc = "" +
"\n" +
"\x14users/v1/users.proto\x12\busers.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"R\n" +
"\x10RetrieveUsersReq\x12\x10\n" +
"\x03ids\x18\x01 \x03(\tR\x03ids\x12\x16\n" +
"\x06offset\x18\x02 \x01(\x04R\x06offset\x12\x14\n" +
"\x05limit\x18\x03 \x01(\x04R\x05limit\"|\n" +
"\x10RetrieveUsersRes\x12\x14\n" +
"\x05total\x18\x01 \x01(\x04R\x05total\x12\x14\n" +
"\x05limit\x18\x02 \x01(\x04R\x05limit\x12\x16\n" +
"\x06offset\x18\x03 \x01(\x04R\x06offset\x12$\n" +
"\x05users\x18\x04 \x03(\v2\x0e.users.v1.UserR\x05users\"\xff\x04\n" +
"\x04User\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\x12\x1d\n" +
"\n" +
"first_name\x18\x02 \x01(\tR\tfirstName\x12\x1b\n" +
"\tlast_name\x18\x03 \x01(\tR\blastName\x12\x12\n" +
"\x04tags\x18\x04 \x03(\tR\x04tags\x123\n" +
"\bmetadata\x18\x05 \x01(\v2\x17.google.protobuf.StructR\bmetadata\x12B\n" +
"\x10private_metadata\x18\x06 \x01(\v2\x17.google.protobuf.StructR\x0fprivateMetadata\x12\x16\n" +
"\x06status\x18\a \x01(\rR\x06status\x12\x12\n" +
"\x04role\x18\b \x01(\rR\x04role\x12'\n" +
"\x0fprofile_picture\x18\t \x01(\tR\x0eprofilePicture\x12\x1a\n" +
"\busername\x18\n" +
" \x01(\tR\busername\x12\x14\n" +
"\x05email\x18\v \x01(\tR\x05email\x129\n" +
"\n" +
"created_at\x18\f \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
"\n" +
"updated_at\x18\r \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x1d\n" +
"\n" +
"updated_by\x18\x0e \x01(\tR\tupdatedBy\x12;\n" +
"\vverified_at\x18\x0f \x01(\v2\x1a.google.protobuf.TimestampR\n" +
"verifiedAt\x12#\n" +
"\rauth_provider\x18\x10 \x01(\tR\fauthProvider\x12 \n" +
"\vpermissions\x18\x11 \x03(\tR\vpermissions2Y\n" +
"\fUsersService\x12I\n" +
"\rRetrieveUsers\x12\x1a.users.v1.RetrieveUsersReq\x1a\x1a.users.v1.RetrieveUsersRes\"\x00B1Z/github.com/absmach/magistrala/api/grpc/users/v1b\x06proto3"
var (
file_users_v1_users_proto_rawDescOnce sync.Once
file_users_v1_users_proto_rawDescData []byte
)
func file_users_v1_users_proto_rawDescGZIP() []byte {
file_users_v1_users_proto_rawDescOnce.Do(func() {
file_users_v1_users_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_users_v1_users_proto_rawDesc), len(file_users_v1_users_proto_rawDesc)))
})
return file_users_v1_users_proto_rawDescData
}
var file_users_v1_users_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_users_v1_users_proto_goTypes = []any{
(*RetrieveUsersReq)(nil), // 0: users.v1.RetrieveUsersReq
(*RetrieveUsersRes)(nil), // 1: users.v1.RetrieveUsersRes
(*User)(nil), // 2: users.v1.User
(*structpb.Struct)(nil), // 3: google.protobuf.Struct
(*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp
}
var file_users_v1_users_proto_depIdxs = []int32{
2, // 0: users.v1.RetrieveUsersRes.users:type_name -> users.v1.User
3, // 1: users.v1.User.metadata:type_name -> google.protobuf.Struct
3, // 2: users.v1.User.private_metadata:type_name -> google.protobuf.Struct
4, // 3: users.v1.User.created_at:type_name -> google.protobuf.Timestamp
4, // 4: users.v1.User.updated_at:type_name -> google.protobuf.Timestamp
4, // 5: users.v1.User.verified_at:type_name -> google.protobuf.Timestamp
0, // 6: users.v1.UsersService.RetrieveUsers:input_type -> users.v1.RetrieveUsersReq
1, // 7: users.v1.UsersService.RetrieveUsers:output_type -> users.v1.RetrieveUsersRes
7, // [7:8] is the sub-list for method output_type
6, // [6:7] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
}
func init() { file_users_v1_users_proto_init() }
func file_users_v1_users_proto_init() {
if File_users_v1_users_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_users_v1_users_proto_rawDesc), len(file_users_v1_users_proto_rawDesc)),
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_users_v1_users_proto_goTypes,
DependencyIndexes: file_users_v1_users_proto_depIdxs,
MessageInfos: file_users_v1_users_proto_msgTypes,
}.Build()
File_users_v1_users_proto = out.File
file_users_v1_users_proto_goTypes = nil
file_users_v1_users_proto_depIdxs = nil
}
+130
View File
@@ -0,0 +1,130 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc v7.35.1
// source: users/v1/users.proto
package v1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
UsersService_RetrieveUsers_FullMethodName = "/users.v1.UsersService/RetrieveUsers"
)
// UsersServiceClient is the client API for UsersService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// UsersService exposes user-related functionality over gRPC.
type UsersServiceClient interface {
// RetrieveUsers fetches users for the provided IDs.
RetrieveUsers(ctx context.Context, in *RetrieveUsersReq, opts ...grpc.CallOption) (*RetrieveUsersRes, error)
}
type usersServiceClient struct {
cc grpc.ClientConnInterface
}
func NewUsersServiceClient(cc grpc.ClientConnInterface) UsersServiceClient {
return &usersServiceClient{cc}
}
func (c *usersServiceClient) RetrieveUsers(ctx context.Context, in *RetrieveUsersReq, opts ...grpc.CallOption) (*RetrieveUsersRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RetrieveUsersRes)
err := c.cc.Invoke(ctx, UsersService_RetrieveUsers_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// UsersServiceServer is the server API for UsersService service.
// All implementations must embed UnimplementedUsersServiceServer
// for forward compatibility.
//
// UsersService exposes user-related functionality over gRPC.
type UsersServiceServer interface {
// RetrieveUsers fetches users for the provided IDs.
RetrieveUsers(context.Context, *RetrieveUsersReq) (*RetrieveUsersRes, error)
mustEmbedUnimplementedUsersServiceServer()
}
// UnimplementedUsersServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedUsersServiceServer struct{}
func (UnimplementedUsersServiceServer) RetrieveUsers(context.Context, *RetrieveUsersReq) (*RetrieveUsersRes, error) {
return nil, status.Error(codes.Unimplemented, "method RetrieveUsers not implemented")
}
func (UnimplementedUsersServiceServer) mustEmbedUnimplementedUsersServiceServer() {}
func (UnimplementedUsersServiceServer) testEmbeddedByValue() {}
// UnsafeUsersServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to UsersServiceServer will
// result in compilation errors.
type UnsafeUsersServiceServer interface {
mustEmbedUnimplementedUsersServiceServer()
}
func RegisterUsersServiceServer(s grpc.ServiceRegistrar, srv UsersServiceServer) {
// If the following call panics, it indicates UnimplementedUsersServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&UsersService_ServiceDesc, srv)
}
func _UsersService_RetrieveUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RetrieveUsersReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UsersServiceServer).RetrieveUsers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UsersService_RetrieveUsers_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UsersServiceServer).RetrieveUsers(ctx, req.(*RetrieveUsersReq))
}
return interceptor(ctx, in, info, handler)
}
// UsersService_ServiceDesc is the grpc.ServiceDesc for UsersService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UsersService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "users.v1.UsersService",
HandlerType: (*UsersServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "RetrieveUsers",
Handler: _UsersService_RetrieveUsers_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "users/v1/users.proto",
}
+242
View File
@@ -0,0 +1,242 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package http
import (
"context"
"encoding/json"
"net/http"
"net/mail"
"regexp"
"strings"
"github.com/absmach/magistrala"
apiutil "github.com/absmach/magistrala/api/http/util"
"github.com/absmach/magistrala/pkg/errors"
"github.com/gofrs/uuid/v5"
)
const (
OffsetKey = "offset"
DirKey = "dir"
OrderKey = "order"
LimitKey = "limit"
OnlyTotal = "only_total"
NameOrder = "name"
IDOrder = "id"
AscDir = "asc"
DescDir = "desc"
UpdatedAtOrder = "updated_at"
CreatedAtOrder = "created_at"
MetadataKey = "metadata"
NameKey = "name"
TagKey = "tag"
TagsKey = "tags"
StatusKey = "status"
ClientKey = "client"
ChannelKey = "channel"
ConnTypeKey = "connection_type"
GroupKey = "group"
DomainKey = "domain"
StartLevelKey = "start_level"
EndLevelKey = "end_level"
TreeKey = "tree"
ParentKey = "parent_id"
LevelKey = "level"
RootGroupKey = "root_group"
TokenKey = "token"
SubjectKey = "subject"
ObjectKey = "object"
RolesKey = "roles"
ActionKey = "action"
ActionsKey = "actions"
RoleIDKey = "role_id"
RoleNameKey = "role_name"
AccessProviderIDKey = "access_provider_id"
AccessTypeKey = "access_type"
UsernameKey = "username"
UserKey = "user"
EmailKey = "email"
FirstNameKey = "first_name"
LastNameKey = "last_name"
DefTotal = uint64(100)
DefOffset = 0
DefOrder = "updated_at"
DefDir = "desc"
DefLimit = 10
DefLevel = 0
DefStartLevel = 1
DefEndLevel = 0
DefStatus = "enabled"
DefClientStatus = "enabled"
DefUserStatus = "enabled"
DefGroupStatus = "enabled"
// ContentType represents JSON content type.
ContentType = "application/json"
// MaxNameSize limits name size to prevent making them too complex.
MaxLimitSize = 100
MaxNameSize = 1024
MaxIDSize = 36
)
var (
nameRegExp = regexp.MustCompile(`^[a-z0-9][a-z0-9_-]{34}[a-z0-9]$`)
routeRegExp = regexp.MustCompile(`^[a-zA-Z][a-zA-Z0-9_-]{0,35}$`)
userNameRegExp = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_-]{0,31}$`)
errUnreadableName = errors.New("name containing double underscores or double dashes not allowed")
)
// ValidateUUID validates UUID format.
func ValidateUUID(extID string) (err error) {
id, err := uuid.FromString(extID)
if id.String() != extID || err != nil {
return apiutil.ErrInvalidIDFormat
}
return nil
}
func ValidateEmail(email string) (err error) {
if _, err := mail.ParseAddress(email); err != nil {
return apiutil.ErrInvalidEmail
}
return nil
}
// ValidateName validates name format.
func ValidateName(id string) error {
if !nameRegExp.MatchString(id) {
return apiutil.ErrInvalidNameFormat
}
// Names containing double underscores or double dashes are invalid due to similarity concerns.
if strings.Contains(id, "__") || strings.Contains(id, "--") {
return errors.Wrap(apiutil.ErrInvalidNameFormat, errUnreadableName)
}
return nil
}
// ValidateRoute validates route format.
func ValidateRoute(route string) error {
if !routeRegExp.MatchString(route) {
return apiutil.ErrInvalidRouteFormat
}
if strings.Contains(route, "__") || strings.Contains(route, "--") {
return errors.Wrap(apiutil.ErrInvalidRouteFormat, errUnreadableName)
}
return nil
}
// ValidateUserName validates user name format.
func ValidateUserName(name string) error {
if !userNameRegExp.MatchString(name) {
return apiutil.ErrInvalidUsername
}
if strings.Contains(name, "__") || strings.Contains(name, "--") {
return errors.Wrap(apiutil.ErrInvalidUsername, errUnreadableName)
}
return nil
}
// EncodeResponse encodes successful response.
func EncodeResponse(_ context.Context, w http.ResponseWriter, response any) error {
if ar, ok := response.(magistrala.Response); ok {
for k, v := range ar.Headers() {
w.Header().Set(k, v)
}
w.Header().Set("Content-Type", ContentType)
w.WriteHeader(ar.Code())
if ar.Empty() {
return nil
}
}
return json.NewEncoder(w).Encode(response)
}
// EncodeError encodes an error response.
func EncodeError(_ context.Context, err error, w http.ResponseWriter) {
w.Header().Set("Content-Type", ContentType)
if sdkErr, ok := err.(errors.SDKError); ok {
w.WriteHeader(sdkErr.StatusCode())
if err := json.NewEncoder(w).Encode(sdkErr); err != nil {
w.WriteHeader(http.StatusInternalServerError)
}
return
}
if errors.Contains(err, errors.ErrAuthentication) {
w.WriteHeader(http.StatusUnauthorized)
if err := json.NewEncoder(w).Encode(err); err != nil {
w.WriteHeader(http.StatusInternalServerError)
}
return
}
if errors.Contains(err, errors.ErrAuthorization) {
w.WriteHeader(http.StatusForbidden)
if err := json.NewEncoder(w).Encode(err); err != nil {
w.WriteHeader(http.StatusInternalServerError)
}
return
}
switch retErr := err.(type) {
case *errors.RequestError:
w.WriteHeader(http.StatusBadRequest)
if err := json.NewEncoder(w).Encode(retErr); err != nil {
w.WriteHeader(http.StatusInternalServerError)
}
return
case *errors.AuthNError:
w.WriteHeader(http.StatusUnauthorized)
if err := json.NewEncoder(w).Encode(retErr); err != nil {
w.WriteHeader(http.StatusInternalServerError)
}
return
case *errors.AuthZError:
w.WriteHeader(http.StatusForbidden)
if err := json.NewEncoder(w).Encode(retErr); err != nil {
w.WriteHeader(http.StatusInternalServerError)
}
return
case *errors.MediaTypeError:
w.WriteHeader(http.StatusUnsupportedMediaType)
if err := json.NewEncoder(w).Encode(retErr); err != nil {
w.WriteHeader(http.StatusInternalServerError)
}
return
case *errors.ServiceError:
w.WriteHeader(http.StatusUnprocessableEntity)
if err := json.NewEncoder(w).Encode(retErr); err != nil {
w.WriteHeader(http.StatusInternalServerError)
}
return
case *errors.NotFoundError:
w.WriteHeader(http.StatusNotFound)
if err := json.NewEncoder(w).Encode(retErr); err != nil {
w.WriteHeader(http.StatusInternalServerError)
}
return
case *errors.InternalError:
w.WriteHeader(http.StatusInternalServerError)
return
default:
w.WriteHeader(http.StatusInternalServerError)
}
}
+333
View File
@@ -0,0 +1,333 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package http_test
import (
"context"
"encoding/json"
"net/http"
"testing"
"time"
"github.com/absmach/magistrala"
api "github.com/absmach/magistrala/api/http"
apiutil "github.com/absmach/magistrala/api/http/util"
"github.com/absmach/magistrala/pkg/errors"
svcerr "github.com/absmach/magistrala/pkg/errors/service"
"github.com/absmach/magistrala/pkg/testsutil"
"github.com/stretchr/testify/assert"
)
var _ magistrala.Response = (*response)(nil)
var validUUID = testsutil.GenerateUUID(&testing.T{})
type responseWriter struct {
body []byte
statusCode int
header http.Header
}
func newResponseWriter() *responseWriter {
return &responseWriter{
header: http.Header{},
}
}
func (w *responseWriter) Header() http.Header {
return w.header
}
func (w *responseWriter) Write(b []byte) (int, error) {
w.body = b
return 0, nil
}
func (w *responseWriter) WriteHeader(statusCode int) {
w.statusCode = statusCode
}
func (w *responseWriter) StatusCode() int {
return w.statusCode
}
func (w *responseWriter) Body() []byte {
return w.body
}
type response struct {
code int
headers map[string]string
empty bool
ID string `json:"id"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
}
func (res response) Code() int {
return res.code
}
func (res response) Headers() map[string]string {
return res.headers
}
func (res response) Empty() bool {
return res.empty
}
type body struct {
Error string `json:"error,omitempty"`
Message string `json:"message"`
}
func TestValidateUUID(t *testing.T) {
cases := []struct {
desc string
uuid string
err error
}{
{
desc: "valid uuid",
uuid: validUUID,
err: nil,
},
{
desc: "invalid uuid",
uuid: "invalid",
err: apiutil.ErrInvalidIDFormat,
},
}
for _, c := range cases {
t.Run(c.desc, func(t *testing.T) {
err := api.ValidateUUID(c.uuid)
assert.Equal(t, c.err, err)
})
}
}
func TestEncodeResponse(t *testing.T) {
now := time.Now()
validBody := []byte(`{"id":"` + validUUID + `","name":"test","created_at":"` + now.Format(time.RFC3339Nano) + `"}` + "\n" + ``)
cases := []struct {
desc string
resp any
header http.Header
code int
body []byte
err error
}{
{
desc: "valid response",
resp: response{
code: http.StatusOK,
headers: map[string]string{
"Location": "/groups/" + validUUID,
},
ID: validUUID,
Name: "test",
CreatedAt: now,
},
header: http.Header{
"Content-Type": []string{"application/json"},
"Location": []string{"/groups/" + validUUID},
},
code: http.StatusOK,
body: validBody,
err: nil,
},
{
desc: "valid response with no headers",
resp: response{
code: http.StatusOK,
ID: validUUID,
Name: "test",
CreatedAt: now,
},
header: http.Header{
"Content-Type": []string{"application/json"},
},
code: http.StatusOK,
body: validBody,
err: nil,
},
{
desc: "valid response with many headers",
resp: response{
code: http.StatusOK,
headers: map[string]string{
"X-Test": "test",
"X-Test2": "test2",
},
ID: validUUID,
Name: "test",
CreatedAt: now,
},
header: http.Header{
"Content-Type": []string{"application/json"},
"X-Test": []string{"test"},
"X-Test2": []string{"test2"},
},
code: http.StatusOK,
body: validBody,
err: nil,
},
{
desc: "valid response with empty body",
resp: response{
code: http.StatusOK,
empty: true,
ID: validUUID,
},
header: http.Header{
"Content-Type": []string{"application/json"},
},
code: http.StatusOK,
body: []byte(``),
err: nil,
},
{
desc: "invalid response",
resp: struct {
ID string `json:"id"`
}{
ID: validUUID,
},
header: http.Header{},
code: 0,
body: []byte(`{"id":"` + validUUID + `"}` + "\n" + ``),
err: nil,
},
}
for _, c := range cases {
t.Run(c.desc, func(t *testing.T) {
responseWriter := newResponseWriter()
err := api.EncodeResponse(context.Background(), responseWriter, c.resp)
assert.Equal(t, c.err, err)
assert.Equal(t, c.header, responseWriter.Header())
assert.Equal(t, c.code, responseWriter.StatusCode())
assert.Equal(t, string(c.body), string(responseWriter.Body()))
})
}
}
func TestEncodeError(t *testing.T) {
cases := []struct {
desc string
err error
code int
hasBody bool
checkError bool
}{
{
desc: "RequestError - Missing Secret",
err: apiutil.ErrMissingSecret,
code: http.StatusBadRequest,
hasBody: true,
},
{
desc: "RequestError - Missing ID",
err: apiutil.ErrMissingID,
code: http.StatusBadRequest,
hasBody: true,
},
{
desc: "RequestError - Empty List",
err: apiutil.ErrEmptyList,
code: http.StatusBadRequest,
hasBody: true,
},
{
desc: "RequestError - Conflict",
err: svcerr.ErrConflict,
code: http.StatusBadRequest,
hasBody: true,
},
{
desc: "NotFoundError - Not Found",
err: svcerr.ErrNotFound,
code: http.StatusNotFound,
hasBody: true,
},
{
desc: "AuthNError - Authentication Failed",
err: svcerr.ErrAuthentication,
code: http.StatusUnauthorized,
hasBody: true,
},
{
desc: "Generic Authentication Failed",
err: errors.ErrAuthentication,
code: http.StatusUnauthorized,
hasBody: true,
},
{
desc: "AuthZError - Authorization Failed",
err: svcerr.ErrAuthorization,
code: http.StatusForbidden,
hasBody: true,
},
{
desc: "Generic Authorization Failed",
err: errors.Wrap(errors.New("not authorized"), errors.ErrAuthorization),
code: http.StatusForbidden,
hasBody: true,
},
{
desc: "AuthZError - Domain Authorization Failed",
err: svcerr.ErrDomainAuthorization,
code: http.StatusForbidden,
hasBody: true,
},
{
desc: "MediaTypeError - Unsupported Content Type",
err: apiutil.ErrUnsupportedContentType,
code: http.StatusUnsupportedMediaType,
hasBody: true,
},
{
desc: "ServiceError - Create Entity Failed",
err: svcerr.ErrCreateEntity,
code: http.StatusUnprocessableEntity,
hasBody: true,
},
{
desc: "ServiceError - Update Entity Failed",
err: svcerr.ErrUpdateEntity,
code: http.StatusUnprocessableEntity,
hasBody: true,
},
{
desc: "ServiceError - Remove Entity Failed",
err: svcerr.ErrRemoveEntity,
code: http.StatusUnprocessableEntity,
hasBody: true,
},
{
desc: "InternalError",
err: errors.NewInternalError(),
code: http.StatusInternalServerError,
hasBody: false,
},
}
for _, c := range cases {
t.Run(c.desc, func(t *testing.T) {
responseWriter := newResponseWriter()
api.EncodeError(context.Background(), c.err, responseWriter)
assert.Equal(t, c.code, responseWriter.StatusCode())
if !c.hasBody {
return
}
message := body{}
jerr := json.Unmarshal(responseWriter.Body(), &message)
assert.NoError(t, jerr)
assert.NotEmpty(t, message.Message)
})
}
}
+6
View File
@@ -0,0 +1,6 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Package api contains commonly used constants and functions
// for the HTTP API.
package http
+27
View File
@@ -0,0 +1,27 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package http
import (
"context"
"net/http"
"github.com/absmach/magistrala"
"github.com/go-chi/chi/v5/middleware"
)
func RequestIDMiddleware(idp magistrala.IDProvider) func(http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
requestID, err := idp.ID()
if err != nil {
EncodeError(r.Context(), err, w)
return
}
ctx := context.WithValue(r.Context(), middleware.RequestIDKey, requestID)
next.ServeHTTP(w, r.WithContext(ctx))
})
}
}
+280
View File
@@ -0,0 +1,280 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package util
import "github.com/absmach/magistrala/pkg/errors"
// Errors defined in this file are used by the LoggingErrorEncoder decorator
// to distinguish and log API request validation errors and avoid that service
// errors are logged twice.
var (
// ErrValidation indicates that an error was returned by the API.
ErrValidation = errors.NewRequestError("something went wrong with the request")
// ErrBearerToken indicates missing or invalid bearer user token.
ErrBearerToken = errors.NewAuthNError("missing or invalid bearer user token")
// ErrBearerKey indicates missing or invalid bearer entity key.
ErrBearerKey = errors.NewAuthNError("missing or invalid bearer entity key")
// ErrMissingID indicates missing entity ID.
ErrMissingID = errors.NewRequestError("missing entity id")
// ErrMissingEntityID indicates missing entity ID.
ErrMissingEntityID = errors.NewRequestError("missing entity id")
// ErrMissingClientID indicates missing client ID.
ErrMissingClientID = errors.NewRequestError("missing client id")
// ErrMissingChannelID indicates missing client ID.
ErrMissingChannelID = errors.NewRequestError("missing channel id")
// ErrMissingConnectionType indicates missing connection tpye.
ErrMissingConnectionType = errors.NewRequestError("missing connection type")
// ErrMissingParentGroupID indicates missing parent group ID.
ErrMissingParentGroupID = errors.NewRequestError("missing parent group id")
// ErrMissingChildrenGroupIDs indicates missing children group IDs.
ErrMissingChildrenGroupIDs = errors.NewRequestError("missing children group ids")
// ErrSelfParentingNotAllowed indicates child id is same as parent id.
ErrSelfParentingNotAllowed = errors.NewRequestError("self parenting not allowed")
// ErrInvalidChildGroupID indicates invalid child group ID.
ErrInvalidChildGroupID = errors.NewRequestError("invalid child group id")
// ErrInvalidAuthKey indicates invalid auth key.
ErrInvalidAuthKey = errors.New("invalid auth key")
// ErrInvalidIDFormat indicates an invalid ID format.
ErrInvalidIDFormat = errors.NewRequestError("invalid id format provided")
// ErrNameSize indicates that name size exceeds the max.
ErrNameSize = errors.NewRequestError("invalid name size")
// ErrEmailSize indicates that email size exceeds the max.
ErrEmailSize = errors.NewRequestError("invalid email size")
// ErrInvalidRole indicates that an invalid role.
ErrInvalidRole = errors.NewRequestError("invalid client role")
// ErrLimitSize indicates that an invalid limit.
ErrLimitSize = errors.NewRequestError("invalid limit size")
// ErrLevel indicates that an invalid level.
ErrLevel = errors.NewRequestError("invalid level")
// ErrOffsetSize indicates an invalid offset.
ErrOffsetSize = errors.NewRequestError("invalid offset size")
// ErrInvalidOrder indicates an invalid list order.
ErrInvalidOrder = errors.NewRequestError("invalid list order provided")
// ErrInvalidDirection indicates an invalid list direction.
ErrInvalidDirection = errors.NewRequestError("invalid list direction provided")
// ErrInvalidMemberKind indicates an invalid member kind.
ErrInvalidMemberKind = errors.NewRequestError("invalid member kind")
// ErrEmptyList indicates that entity data is empty.
ErrEmptyList = errors.NewRequestError("empty list provided")
// ErrMissingRoleName indicates that role name is empty.
ErrMissingRoleName = errors.NewRequestError("empty role name")
// ErrMissingRoleID indicates that role id is empty.
ErrMissingRoleID = errors.NewRequestError("empty role id")
// ErrMissingRoleOperations indicates that role operations are empty.
ErrMissingRoleOperations = errors.NewRequestError("empty role operations")
// ErrMissingRoleMembers indicates that role members are empty.
ErrMissingRoleMembers = errors.NewRequestError("empty role members")
// ErrMalformedPolicy indicates that policies are malformed.
ErrMalformedPolicy = errors.NewRequestError("malformed policy")
// ErrMissingPolicySub indicates that policies are subject.
ErrMissingPolicySub = errors.NewRequestError("malformed policy subject")
// ErrMissingPolicyObj indicates missing policies object.
ErrMissingPolicyObj = errors.NewRequestError("malformed policy object")
// ErrMalformedPolicyAct indicates missing policies action.
ErrMalformedPolicyAct = errors.NewRequestError("malformed policy action")
// ErrMissingPolicyEntityType indicates missing policies entity type.
ErrMissingPolicyEntityType = errors.NewRequestError("missing policy entity type")
// ErrMalformedPolicyPer indicates missing policies relation.
ErrMalformedPolicyPer = errors.NewRequestError("malformed policy permission")
// ErrMissingCertData indicates missing cert data (ttl).
ErrMissingCertData = errors.NewRequestError("missing certificate data")
// ErrInvalidCertData indicates invalid cert data (ttl).
ErrInvalidCertData = errors.NewRequestError("invalid certificate data")
// ErrInvalidTopic indicates an invalid subscription topic.
ErrInvalidTopic = errors.NewRequestError("invalid Subscription topic")
// ErrInvalidContact indicates an invalid subscription contract.
ErrInvalidContact = errors.NewRequestError("invalid Subscription contact")
// ErrMissingEmail indicates missing email.
ErrMissingEmail = errors.NewRequestError("missing email")
// ErrInvalidEmail indicates missing email.
ErrInvalidEmail = errors.NewRequestError("invalid email")
// ErrMissingHost indicates missing host.
ErrMissingHost = errors.NewRequestError("missing host")
// ErrMissingPass indicates missing password.
ErrMissingPass = errors.NewRequestError("missing password")
// ErrMissingConfPass indicates missing conf password.
ErrMissingConfPass = errors.NewRequestError("missing conf password")
// ErrInvalidResetPass indicates an invalid reset password.
ErrInvalidResetPass = errors.NewRequestError("invalid reset password")
// ErrInvalidComparator indicates an invalid comparator.
ErrInvalidComparator = errors.NewRequestError("invalid comparator")
// ErrMissingMemberIDs indicates missing member ids.
ErrMissingMemberIDs = errors.NewRequestError("missing member ids")
// ErrMissingMemberType indicates missing group member type.
ErrMissingMemberType = errors.NewRequestError("missing group member type")
// ErrMissingMemberKind indicates missing group member kind.
ErrMissingMemberKind = errors.NewRequestError("missing group member kind")
// ErrMissingRelation indicates missing relation.
ErrMissingRelation = errors.NewRequestError("missing relation")
// ErrInvalidRelation indicates an invalid relation.
ErrInvalidRelation = errors.NewRequestError("invalid relation")
// ErrInvalidAPIKey indicates an invalid API key type.
ErrInvalidAPIKey = errors.NewRequestError("invalid api key type")
// ErrInvitationState indicates an invalid invitation state.
ErrInvitationState = errors.NewRequestError("invalid invitation state")
// ErrMissingIdentity indicates missing entity Identity.
ErrMissingIdentity = errors.NewRequestError("missing entity identity")
// ErrMissingSecret indicates missing secret.
ErrMissingSecret = errors.NewRequestError("missing secret")
// ErrPasswordFormat indicates weak password.
ErrPasswordFormat = errors.NewRequestError("password does not meet the requirements")
// ErrMissingName indicates missing identity name.
ErrMissingName = errors.NewRequestError("missing identity name")
// ErrMissingRoute indicates missing route.
ErrMissingRoute = errors.NewRequestError("missing route")
// ErrInvalidLevel indicates an invalid group level.
ErrInvalidLevel = errors.NewRequestError("invalid group level (should be between 0 and 5)")
// ErrNotFoundParam indicates that the parameter was not found in the query.
ErrNotFoundParam = errors.NewRequestError("parameter not found in the query")
// ErrInvalidQueryParams indicates invalid query parameters.
ErrInvalidQueryParams = errors.NewRequestError("invalid query parameters")
// ErrInvalidVisibilityType indicates invalid visibility type.
ErrInvalidVisibilityType = errors.NewRequestError("invalid visibility type")
// ErrUnsupportedContentType indicates unacceptable or lack of Content-Type.
ErrUnsupportedContentType = errors.NewMediaTypeError("unsupported content type")
// ErrRollbackTx indicates failed to rollback transaction.
ErrRollbackTx = errors.NewRequestError("failed to rollback transaction")
// ErrInvalidAggregation indicates invalid aggregation value.
ErrInvalidAggregation = errors.NewRequestError("invalid aggregation value")
// ErrInvalidInterval indicates invalid interval value.
ErrInvalidInterval = errors.NewRequestError("invalid interval value")
// ErrMissingFrom indicates missing from value.
ErrMissingFrom = errors.NewRequestError("missing from time value")
// ErrMissingTo indicates missing to value.
ErrMissingTo = errors.NewRequestError("missing to time value")
// ErrEmptyMessage indicates empty message.
ErrEmptyMessage = errors.NewRequestError("empty message")
// ErrMissingEntityType indicates missing entity type.
ErrMissingEntityType = errors.NewRequestError("missing entity type")
// ErrInvalidEntityType indicates invalid entity type.
ErrInvalidEntityType = errors.NewRequestError("invalid entity type")
// ErrInvalidTimeFormat indicates invalid time format i.e not unix time.
ErrInvalidTimeFormat = errors.NewRequestError("invalid time format use unix time")
// ErrEmptySearchQuery indicates search query should not be empty.
ErrEmptySearchQuery = errors.NewRequestError("search query must not be empty")
// ErrLenSearchQuery indicates search query length.
ErrLenSearchQuery = errors.NewRequestError("search query must be at least 3 characters")
// ErrMissingDomainID indicates missing domainID.
ErrMissingDomainID = errors.NewRequestError("missing domainID")
// ErrMissingUsername indicates missing user name.
ErrMissingUsername = errors.NewRequestError("missing username")
// ErrInvalidUsername indicates invalid user name.
ErrInvalidUsername = errors.NewRequestError("invalid username")
// ErrMissingFirstName indicates missing first name.
ErrMissingFirstName = errors.NewRequestError("missing first name")
// ErrMissingLastName indicates missing last name.
ErrMissingLastName = errors.NewRequestError("missing last name")
// ErrInvalidProfilePictureURL indicates that the profile picture url is invalid.
ErrInvalidProfilePictureURL = errors.NewRequestError("invalid profile picture url")
ErrMultipleEntitiesFilter = errors.NewRequestError("multiple entities are provided in filter are not supported")
// ErrMissingDescription indicates missing description.
ErrMissingDescription = errors.NewRequestError("missing description")
// ErrUnsupportedTokenType indicates that this type of token is not supported.
ErrUnsupportedTokenType = errors.NewRequestError("unsupported content token type")
// ErrMissingUserID indicates missing user ID.
ErrMissingUserID = errors.NewRequestError("missing user id")
// ErrMissingPATID indicates missing pat ID.
ErrMissingPATID = errors.NewRequestError("missing pat id")
// ErrInvalidNameFormat indicates invalid name format.
ErrInvalidNameFormat = errors.NewRequestError("invalid name format")
// ErrInvalidRouteFormat indicates invalid route format.
ErrInvalidRouteFormat = errors.NewRequestError("invalid route format")
// ErrMissingUsernameEmail indicates missing user name / email.
ErrMissingUsernameEmail = errors.NewRequestError("missing username / email")
// ErrInvalidVerification indicates invalid email verification.
ErrInvalidVerification = errors.NewRequestError("invalid verification")
// ErrEmailNotVerified indicates invalid email not verified.
ErrEmailNotVerified = errors.NewRequestError("email not verified")
// ErrMalformedRequest indicates malformed request body.
ErrMalformedRequestBody = errors.NewRequestError("request body is not a valid JSON, expecting a valid JSON")
)
+10
View File
@@ -0,0 +1,10 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package util
// ErrorRes represents the HTTP error response body.
type ErrorRes struct {
Err string `json:"error"`
Msg string `json:"message"`
}
+42
View File
@@ -0,0 +1,42 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package util
import (
"net/http"
"strings"
)
const (
// BearerPrefix represents the token prefix for Bearer authentication scheme.
BearerPrefix = "Bearer "
// ClientPrefix represents the key prefix for Client authentication scheme.
ClientPrefix = "Client "
// BasicAuthPrefix represents the prefix for Basic authentication scheme.
BasicAuthPrefix = "Basic "
)
// ExtractBearerToken returns value of the bearer token. If there is no bearer token - an empty value is returned.
func ExtractBearerToken(r *http.Request) string {
token := r.Header.Get("Authorization")
if !strings.HasPrefix(token, BearerPrefix) {
return ""
}
return strings.TrimPrefix(token, BearerPrefix)
}
// ExtractClientSecret returns value of the client secret. If it's not present - an empty value is returned.
func ExtractClientSecret(r *http.Request) string {
token := r.Header.Get("Authorization")
if !strings.HasPrefix(token, ClientPrefix) {
return ""
}
return strings.TrimPrefix(token, ClientPrefix)
}
+112
View File
@@ -0,0 +1,112 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package util_test
import (
"net/http"
"testing"
apiutil "github.com/absmach/magistrala/api/http/util"
"github.com/stretchr/testify/assert"
)
func TestExtractBearerToken(t *testing.T) {
cases := []struct {
desc string
request *http.Request
token string
}{
{
desc: "valid bearer token",
request: &http.Request{
Header: map[string][]string{
"Authorization": {"Bearer 123"},
},
},
token: "123",
},
{
desc: "invalid bearer token",
request: &http.Request{
Header: map[string][]string{
"Authorization": {"123"},
},
},
token: "",
},
{
desc: "empty bearer token",
request: &http.Request{
Header: map[string][]string{
"Authorization": {""},
},
},
token: "",
},
{
desc: "empty header",
request: &http.Request{
Header: map[string][]string{},
},
token: "",
},
}
for _, c := range cases {
t.Run(c.desc, func(t *testing.T) {
token := apiutil.ExtractBearerToken(c.request)
assert.Equal(t, c.token, token)
})
}
}
func TestExtractClientSecret(t *testing.T) {
cases := []struct {
desc string
request *http.Request
token string
}{
{
desc: "valid bearer token",
request: &http.Request{
Header: map[string][]string{
"Authorization": {"Client 123"},
},
},
token: "123",
},
{
desc: "invalid bearer token",
request: &http.Request{
Header: map[string][]string{
"Authorization": {"123"},
},
},
token: "",
},
{
desc: "empty bearer token",
request: &http.Request{
Header: map[string][]string{
"Authorization": {""},
},
},
token: "",
},
{
desc: "empty header",
request: &http.Request{
Header: map[string][]string{},
},
token: "",
},
}
for _, c := range cases {
t.Run(c.desc, func(t *testing.T) {
token := apiutil.ExtractClientSecret(c.request)
assert.Equal(t, c.token, token)
})
}
}
+123
View File
@@ -0,0 +1,123 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package util
import (
"context"
"encoding/json"
"log/slog"
"net/http"
"strconv"
"github.com/absmach/magistrala/pkg/errors"
kithttp "github.com/go-kit/kit/transport/http"
)
// LoggingErrorEncoder is a go-kit error encoder logging decorator.
func LoggingErrorEncoder(logger *slog.Logger, enc kithttp.ErrorEncoder) kithttp.ErrorEncoder {
return func(ctx context.Context, err error, w http.ResponseWriter) {
if errors.Contains(err, ErrValidation) {
logger.Error(err.Error())
}
enc(ctx, err, w)
}
}
// ReadStringQuery reads the value of string http query parameters for a given key.
func ReadStringQuery(r *http.Request, key, def string) (string, error) {
vals := r.URL.Query()[key]
if len(vals) > 1 {
return "", ErrInvalidQueryParams
}
if len(vals) == 0 {
return def, nil
}
return vals[0], nil
}
// ReadMetadataQuery reads the value of json http query parameters for a given key.
func ReadMetadataQuery(r *http.Request, key string, def map[string]any) (map[string]any, error) {
vals := r.URL.Query()[key]
if len(vals) > 1 {
return nil, ErrInvalidQueryParams
}
if len(vals) == 0 {
return def, nil
}
m := make(map[string]any)
err := json.Unmarshal([]byte(vals[0]), &m)
if err != nil {
return nil, errors.Wrap(ErrInvalidQueryParams, err)
}
return m, nil
}
// ReadBoolQuery reads boolean query parameters in a given http request.
func ReadBoolQuery(r *http.Request, key string, def bool) (bool, error) {
vals := r.URL.Query()[key]
if len(vals) > 1 {
return false, ErrInvalidQueryParams
}
if len(vals) == 0 {
return def, nil
}
b, err := strconv.ParseBool(vals[0])
if err != nil {
return false, errors.Wrap(ErrInvalidQueryParams, err)
}
return b, nil
}
type number interface {
int64 | float64 | uint16 | uint64
}
// ReadNumQuery returns a numeric value.
func ReadNumQuery[N number](r *http.Request, key string, def N) (N, error) {
vals := r.URL.Query()[key]
if len(vals) > 1 {
return 0, ErrInvalidQueryParams
}
if len(vals) == 0 {
return def, nil
}
val := vals[0]
switch any(def).(type) {
case int64:
v, err := strconv.ParseInt(val, 10, 64)
if err != nil {
return 0, errors.Wrap(ErrInvalidQueryParams, err)
}
return N(v), nil
case uint64:
v, err := strconv.ParseUint(val, 10, 64)
if err != nil {
return 0, errors.Wrap(ErrInvalidQueryParams, err)
}
return N(v), nil
case uint16:
v, err := strconv.ParseUint(val, 10, 16)
if err != nil {
return 0, errors.Wrap(ErrInvalidQueryParams, err)
}
return N(v), nil
case float64:
v, err := strconv.ParseFloat(val, 64)
if err != nil {
return 0, errors.Wrap(ErrInvalidQueryParams, err)
}
return N(v), nil
default:
return def, nil
}
}
+364
View File
@@ -0,0 +1,364 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package util_test
import (
"context"
"fmt"
"net/http"
"net/http/httptest"
"net/url"
"testing"
apiutil "github.com/absmach/magistrala/api/http/util"
mglog "github.com/absmach/magistrala/logger"
"github.com/absmach/magistrala/pkg/errors"
svcerr "github.com/absmach/magistrala/pkg/errors/service"
"github.com/stretchr/testify/assert"
)
func TestReadStringQuery(t *testing.T) {
cases := []struct {
desc string
url string
key string
ret string
err error
}{
{
desc: "valid string query",
url: "http://localhost:8080/?key=test",
key: "key",
ret: "test",
err: nil,
},
{
desc: "empty string query",
url: "http://localhost:8080/",
key: "key",
ret: "",
err: nil,
},
{
desc: "multiple string query",
url: "http://localhost:8080/?key=test&key=random",
key: "key",
ret: "",
err: apiutil.ErrInvalidQueryParams,
},
}
for _, c := range cases {
t.Run(c.desc, func(t *testing.T) {
parsedURL, err := url.Parse(c.url)
assert.NoError(t, err)
r := &http.Request{URL: parsedURL}
ret, err := apiutil.ReadStringQuery(r, c.key, "")
assert.Equal(t, c.err, err)
assert.Equal(t, c.ret, ret)
})
}
}
func TestReadMetadataQuery(t *testing.T) {
cases := []struct {
desc string
url string
key string
ret map[string]any
err error
}{
{
desc: "valid metadata query",
url: "http://localhost:8080/?key={\"test\":\"test\"}",
key: "key",
ret: map[string]any{"test": "test"},
err: nil,
},
{
desc: "empty metadata query",
url: "http://localhost:8080/",
key: "key",
ret: nil,
err: nil,
},
{
desc: "multiple metadata query",
url: "http://localhost:8080/?key={\"test\":\"test\"}&key={\"random\":\"random\"}",
key: "key",
ret: nil,
err: apiutil.ErrInvalidQueryParams,
},
{
desc: "invalid metadata query",
url: "http://localhost:8080/?key=abc",
key: "key",
ret: nil,
err: apiutil.ErrInvalidQueryParams,
},
}
for _, c := range cases {
t.Run(c.desc, func(t *testing.T) {
parsedURL, err := url.Parse(c.url)
assert.NoError(t, err)
r := &http.Request{URL: parsedURL}
ret, err := apiutil.ReadMetadataQuery(r, c.key, nil)
assert.True(t, errors.Contains(err, c.err), fmt.Sprintf("expected: %v, got: %v", c.err, err))
assert.Equal(t, c.ret, ret)
})
}
}
func TestReadBoolQuery(t *testing.T) {
cases := []struct {
desc string
url string
key string
ret bool
err error
}{
{
desc: "valid bool query",
url: "http://localhost:8080/?key=true",
key: "key",
ret: true,
err: nil,
},
{
desc: "valid bool query",
url: "http://localhost:8080/?key=false",
key: "key",
ret: false,
err: nil,
},
{
desc: "invalid bool query",
url: "http://localhost:8080/?key=abc",
key: "key",
ret: false,
err: apiutil.ErrInvalidQueryParams,
},
{
desc: "empty bool query",
url: "http://localhost:8080/",
key: "key",
ret: false,
err: nil,
},
{
desc: "multiple bool query",
url: "http://localhost:8080/?key=true&key=false",
key: "key",
ret: false,
err: apiutil.ErrInvalidQueryParams,
},
}
for _, c := range cases {
t.Run(c.desc, func(t *testing.T) {
parsedURL, err := url.Parse(c.url)
assert.NoError(t, err)
r := &http.Request{URL: parsedURL}
ret, err := apiutil.ReadBoolQuery(r, c.key, false)
assert.True(t, errors.Contains(err, c.err), fmt.Sprintf("expected: %v, got: %v", c.err, err))
assert.Equal(t, c.ret, ret)
})
}
}
func TestReadNumQuery(t *testing.T) {
cases := []struct {
desc string
url string
key string
numType string
ret any
err error
}{
{
desc: "valid int64 query",
url: "http://localhost:8080/?key=123",
key: "key",
numType: "int64",
ret: int64(123),
err: nil,
},
{
desc: "valid float64 query",
url: "http://localhost:8080/?key=1.23",
key: "key",
numType: "float64",
ret: float64(1.23),
err: nil,
},
{
desc: "valid uint64 query",
url: "http://localhost:8080/?key=123",
key: "key",
numType: "uint64",
ret: uint64(123),
err: nil,
},
{
desc: "valid uint16 query",
url: "http://localhost:8080/?key=123",
key: "key",
numType: "uint16",
ret: uint16(123),
err: nil,
},
{
desc: "invalid int64 query",
url: "http://localhost:8080/?key=abc",
key: "key",
numType: "int64",
ret: int64(0),
err: apiutil.ErrInvalidQueryParams,
},
{
desc: "invalid float64 query",
url: "http://localhost:8080/?key=abc",
key: "key",
numType: "float64",
ret: float64(0),
err: apiutil.ErrInvalidQueryParams,
},
{
desc: "invalid uint64 query",
url: "http://localhost:8080/?key=abc",
key: "key",
numType: "uint64",
ret: uint64(0),
err: apiutil.ErrInvalidQueryParams,
},
{
desc: "invalid uint16 query",
url: "http://localhost:8080/?key=abc",
key: "key",
numType: "uint16",
ret: uint16(0),
err: apiutil.ErrInvalidQueryParams,
},
{
desc: "empty int64 query",
url: "http://localhost:8080/",
key: "key",
numType: "int64",
ret: int64(0),
err: nil,
},
{
desc: "empty float64 query",
url: "http://localhost:8080/",
key: "key",
numType: "float64",
ret: float64(0),
err: nil,
},
{
desc: "empty uint16 query",
url: "http://localhost:8080/",
key: "key",
numType: "uint16",
ret: uint16(0),
err: nil,
},
{
desc: "empty uint64 query",
url: "http://localhost:8080/",
key: "key",
numType: "uint64",
ret: uint64(0),
err: nil,
},
{
desc: "multiple int64 query",
url: "http://localhost:8080/?key=123&key=456",
key: "key",
numType: "int64",
ret: int64(0),
err: apiutil.ErrInvalidQueryParams,
},
{
desc: "multiple float64 query",
url: "http://localhost:8080/?key=1.23&key=4.56",
key: "key",
numType: "float64",
ret: float64(0),
err: apiutil.ErrInvalidQueryParams,
},
{
desc: "multiple uint16 query",
url: "http://localhost:8080/?key=123&key=456",
key: "key",
numType: "uint16",
ret: uint16(0),
err: apiutil.ErrInvalidQueryParams,
},
{
desc: "multiple uint64 query",
url: "http://localhost:8080/?key=123&key=456",
key: "key",
numType: "uint64",
ret: uint64(0),
err: apiutil.ErrInvalidQueryParams,
},
}
for _, c := range cases {
t.Run(c.desc, func(t *testing.T) {
parsedURL, err := url.Parse(c.url)
assert.NoError(t, err)
r := &http.Request{URL: parsedURL}
var ret any
switch c.numType {
case "int64":
ret, err = apiutil.ReadNumQuery[int64](r, c.key, 0)
case "float64":
ret, err = apiutil.ReadNumQuery[float64](r, c.key, 0)
case "uint64":
ret, err = apiutil.ReadNumQuery[uint64](r, c.key, 0)
case "uint16":
ret, err = apiutil.ReadNumQuery[uint16](r, c.key, 0)
}
assert.True(t, errors.Contains(err, c.err), fmt.Sprintf("expected: %v, got: %v", c.err, err))
assert.Equal(t, c.ret, ret)
})
}
}
func TestLoggingErrorEncoder(t *testing.T) {
cases := []struct {
desc string
err error
}{
{
desc: "error contains ErrValidation",
err: errors.Wrap(apiutil.ErrValidation, svcerr.ErrAuthentication),
},
{
desc: "error does not contain ErrValidation",
err: svcerr.ErrAuthentication,
},
}
for _, c := range cases {
t.Run(c.desc, func(t *testing.T) {
encCalled := false
encFunc := func(ctx context.Context, err error, w http.ResponseWriter) {
encCalled = true
}
errorEncoder := apiutil.LoggingErrorEncoder(mglog.NewMock(), encFunc)
errorEncoder(context.Background(), c.err, httptest.NewRecorder())
assert.True(t, encCalled)
})
}
}
-5
View File
@@ -1,5 +0,0 @@
# Mainflux OpenAPI Specification
This folder contains an OpenAPI specifications for Mainflux API.
View specification in Swagger UI at [api.mainflux.io](https://api.mainflux.io)
-735
View File
@@ -1,735 +0,0 @@
openapi: 3.0.1
info:
title: Mainflux authentication service
description: HTTP API for managing platform API keys.
version: "1.0.0"
paths:
/keys:
post:
summary: Issue API key
description: |
Generates a new API key. Thew new API key will
be uniquely identified by its ID.
tags:
- auth
requestBody:
$ref: "#/components/requestBodies/KeyRequest"
responses:
'201':
description: Issued new key.
'400':
description: Failed due to malformed JSON.
'409':
description: Failed due to using already existing ID.
'415':
description: Missing or invalid content type.
'500':
$ref: "#/components/responses/ServiceError"
/keys/{id}:
get:
summary: Gets API key details.
description: |
Gets API key details for the given key.
tags:
- auth
parameters:
- $ref: "#/components/parameters/ApiKeyId"
responses:
'200':
$ref: "#/components/responses/KeyRes"
'400':
description: Failed due to malformed query parameters.
'401':
description: Missing or invalid access token provided.
'500':
$ref: "#/components/responses/ServiceError"
delete:
summary: Revoke API key
description: |
Revoke API key identified by the given ID.
tags:
- auth
parameters:
- $ref: "#/components/parameters/ApiKeyId"
responses:
'204':
description: Key revoked.
'401':
description: Missing or invalid access token provided.
'500':
$ref: "#/components/responses/ServiceError"
/groups:
post:
summary: Creates new group
description: |
Creates new group that can be used for grouping entities - things, users.
tags:
- auth
parameters:
- $ref: "#/components/requestBodies/GroupCreateReq"
responses:
'201':
$ref: "#/components/responses/GroupCreateRes"
'400':
description: Failed due to malformed JSON.
'409':
description: Failed due to using an existing email address.
'415':
description: Missing or invalid content type.
'500':
$ref: "#/components/responses/ServiceError"
get:
summary: Gets all groups.
description: |
Gets all groups up to a max level of hierarchy that can be fetched in one
request ( max level = 5). Result can be filtered by metadata. Groups will
be returned as JSON array or JSON tree.
tags:
- auth
parameters:
- $ref: "#/components/parameters/Level"
- $ref: "#/components/parameters/Metadata"
- $ref: "#/components/parameters/Tree"
responses:
'200':
$ref: "#/components/responses/GroupsPageRes"
'400':
description: Failed due to malformed query parameters.
'401':
description: Missing or invalid access token provided.
'404':
description: Group does not exist.
'500':
$ref: "#/components/responses/ServiceError"
/groups/{groupId}:
get:
summary: Gets group info.
description: |
Gets info on a group specified by id.
tags:
- auth
parameters:
- $ref: "#/components/parameters/GroupId"
responses:
'200':
$ref: "#/components/responses/GroupRes"
'400':
description: Failed due to malformed query parameters.
'401':
description: Missing or invalid access token provided.
'404':
description: Group does not exist.
'500':
$ref: "#/components/responses/ServiceError"
put:
summary: Updates group data.
description: |
Updates Name, Description or Metadata of a group.
tags:
- auth
parameters:
- $ref: "#/components/parameters/GroupId"
requestBody:
$ref: "#/components/requestBodies/GroupUpdateReq"
responses:
'200':
description: Group updated.
'400':
description: Failed due to malformed query parameters.
'401':
description: Missing or invalid access token provided.
'404':
description: Group does not exist.
'500':
$ref: "#/components/responses/ServiceError"
delete:
summary: Deletes group.
description: |
Deletes group. If group is parent and descendant groups do not have any members
child groups will be deleted. Group cannot be deleted if has members or if
any descendant group has members.
tags:
- auth
parameters:
- $ref: "#/components/parameters/GroupId"
- $ref: "#/components/parameters/Level"
- $ref: "#/components/parameters/Metadata"
- $ref: "#/components/parameters/Tree"
responses:
'204':
description: Group removed.
'400':
description: Failed due to malformed query parameters.
'401':
description: Missing or invalid access token provided.
'404':
description: Group does not exist.
'500':
$ref: "#/components/responses/ServiceError"
/groups/{groupId}/children:
get:
summary: Gets group children.
description: |
Gets the whole tree of descendants of group for given id including itself.
For performance reason request is limited up to a given level of hierarchy
(max. 5).
tags:
- auth
parameters:
- $ref: "#/components/parameters/GroupId"
- $ref: "#/components/parameters/Level"
- $ref: "#/components/parameters/Metadata"
- $ref: "#/components/parameters/Tree"
responses:
'200':
$ref: "#/components/responses/GroupsPageRes"
'400':
description: Failed due to malformed query parameters.
'401':
description: Missing or invalid access token provided.
'404':
description: Group does not exist.
'500':
$ref: "#/components/responses/ServiceError"
/groups/{groupId}/parents:
get:
summary: Gets group info.
description: |
Gets a direct line of ancestors for a group specified by id.
Result is up to a specified hierarchy level or up to a root group.
Result can be a JSON array or a JSON tree.
tags:
- auth
parameters:
- $ref: "#/components/parameters/GroupId"
- $ref: "#/components/parameters/Level"
- $ref: "#/components/parameters/Metadata"
- $ref: "#/components/parameters/Tree"
responses:
'200':
$ref: "#/components/responses/GroupsPageRes"
'400':
description: Failed due to malformed query parameters.
'401':
description: Missing or invalid access token provided.
'404':
description: Group does not exist.
'500':
$ref: "#/components/responses/ServiceError"
/groups/{groupId}/members:
post:
summary: Assigns members to a group.
description: |
Assigns thing or user id to a group.
tags:
- auth
parameters:
- $ref: "#/components/parameters/GroupId"
requestBody:
$ref: "#/components/requestBodies/MembersReq"
responses:
'201':
$ref: "#/components/responses/GroupCreateRes"
'400':
description: Failed due to malformed JSON.
'401':
description: Missing or invalid access token provided.
'409':
description: Failed due to using an existing email address.
'415':
description: Missing or invalid content type.
'500':
$ref: "#/components/responses/ServiceError"
get:
summary: Gets members of a group.
description: |
Array of member ids that are in the group specified with groupID.
parameters:
- $ref: "#/components/parameters/GroupId"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Limit"
responses:
'200':
$ref: "#/components/responses/MembersRes"
'401':
description: Missing or invalid access token provided.
'500':
$ref: "#/components/responses/ServiceError"
/groups/{userGroupID}/share:
post:
summary: Adds access rights on thing groups to user group with userGroupID.
description: |
Takes user group id through parameter and adds access rights for user group on thing group received via request body.
tags:
- auth
parameters:
- $ref: "#/components/parameters/UserGroupID"
requestBody:
$ref: "#/components/requestBodies/ShareGroupAccessReq"
responses:
'200':
description: User group shared with thing group.
'400':
description: Failed due to malformed JSON.
'401':
description: Missing or invalid access token provided.
'415':
description: Missing or invalid content type.
'500':
$ref: "#/components/responses/ServiceError"
/members/{memberId}/groups:
get:
summary: Gets memberships for a member with member id.
description: |
Array of groups that member belongs to.
parameters:
- $ref: "#/components/parameters/MemberId"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Metadata"
responses:
'200':
$ref: "#/components/responses/GroupRes"
'401':
description: Missing or invalid access token provided.
'500':
$ref: "#/components/responses/ServiceError"
/policies:
post:
summary: Creates new policies.
description: |
Creates new policies. Only admin can use this endpoint. Therefore, you need an authentication token for the admin.
Also, only policies defined on the system are allowed to add. For more details, please see the docs for Authorization.
tags:
- auth
requestBody:
$ref: "#/components/requestBodies/PoliciesReq"
responses:
'201':
description: Policies created.
'400':
description: Failed due to malformed JSON.
'401':
description: Missing or invalid access token provided.
'403':
description: Unauthorized access token provided.
'409':
description: Failed due to using an existing email address.
'415':
description: Missing or invalid content type.
'500':
$ref: "#/components/responses/ServiceError"
put:
summary: Deletes policies.
description: |
Deletes policies. Only admin can use this endpoint. Therefore, you need an authentication token for the admin.
Also, only policies defined on the system are allowed to delete. For more details, please see the docs for Authorization.
tags:
- auth
requestBody:
$ref: "#/components/requestBodies/PoliciesReq"
responses:
'204':
description: Policies deleted.
'400':
description: Failed due to malformed JSON.
'409':
description: Failed due to using an existing email address.
'415':
description: Missing or invalid content type.
'500':
$ref: "#/components/responses/ServiceError"
/health:
get:
summary: Retrieves service health check info.
tags:
- health
responses:
'200':
$ref: "#/components/responses/HealthRes"
'500':
$ref: "#/components/responses/ServiceError"
components:
schemas:
Key:
type: object
properties:
id:
type: string
format: uuid
example: "c5747f2f-2a7c-4fe1-b41a-51a5ae290945"
description: API key unique identifier
issuer_id:
type: string
format: uuid
example: "9118de62-c680-46b7-ad0a-21748a52833a"
description: In ID of the entity that issued the token.
type:
type: integer
example: 0
description: API key type. Keys of different type are processed differently.
subject:
type: string
format: string
example: "test@example.com"
description: User's email or service identifier of API key subject.
issued_at:
type: string
format: date-time
example: "2019-11-26 13:31:52"
description: Time when the key is generated.
expires_at:
type: string
format: date-time
example: "2019-11-26 13:31:52"
description: Time when the Key expires. If this field is missing,
that means that Key is valid indefinitely.
GroupReqSchema:
type: object
properties:
name:
type: string
description: |
Free-form group name. Group name is unique on the given hierarchy level.
description:
type: string
description: Group description, free form text.
parent_id:
type: string
format: ulid
description: Id of parent group, it must be existing group.
metadata:
type: object
description: Arbitrary, object-encoded group's data.
GroupUpdateSchema:
type: object
properties:
name:
type: string
description: |
Free-form group name. Group name is unique on the given hierarchy level.
description:
type: string
description: Group description, free form text.
metadata:
type: object
description: Arbitrary, object-encoded group's data.
GroupResSchema:
type: object
properties:
id:
type: string
format: ulid
description: Unique group identifier generated by the service.
name:
type: string
description: Free-form group name.
parent_id:
type: string
description: Group ID of parent group.
owner_id:
type: string
format: uuid
description: UUID of user that created the group.
metadata:
type: object
description: Arbitrary, object-encoded group's data.
level:
type: integer
description: Level in hierarchy, distance from the root group.
path:
type: string
description: Hierarchy path, concatenated ids of group ancestors.
children:
type: object
# schema: GroupResSchema
created_at:
type: string
description: Datetime of group creation.
updated_at:
type: string
description: Datetime of last group updated.
required:
- id
- name
- owner_id
- description
- level
- path
- created_at
- updated_at
MembersReqSchema:
type: object
properties:
members:
type: array
minItems: 0
uniqueItems: true
items:
type: string
format: uuid | ulid
type:
type: string
description: Type of entity
ShareGroupAccessReqSchema:
type: object
properties:
thing_group_id:
type: string
description: Group ID of the Thing Group.
format: uuid
GroupsPage:
type: object
properties:
groups:
type: array
minItems: 0
uniqueItems: true
items:
$ref: "#/components/schemas/GroupResSchema"
total:
type: integer
description: Total number of items.
level:
type: integer
description: Level of hierarchy up to which groups are fetched.
required:
- groups
- total
- level
MembershipPage:
type: object
properties:
groups:
type: array
minItems: 0
uniqueItems: true
items:
$ref: "#/components/schemas/GroupResSchema"
offset:
type: integer
description: Number of items to skip during retrieval.
limit:
type: integer
description: Maximum number of items to return in one page.
total:
type: integer
description: Total number of items.
required:
- groups
PoliciesReqSchema:
type: object
properties:
object:
type: string
description: |
Specifies an object field for the field.
Object indicates application objects such as ThingID.
subjects:
type: array
minItems: 1
uniqueItems: true
items:
type: string
policies:
type: array
minItems: 1
uniqueItems: true
items:
type: string
parameters:
ApiKeyId:
name: id
description: API Key ID.
in: path
schema:
type: string
format: uuid
required: true
UserGroupID:
name: userGroupID
description: User Group ID.
in: path
schema:
type: string
format: uuid
required: true
GroupId:
name: groupId
description: Group ID.
in: path
schema:
type: string
format: uuid
required: true
MemberId:
name: memberId
description: Member id.
in: path
schema:
type: string
format: uuid | ulid
required: true
Limit:
name: limit
description: Size of the subset to retrieve.
in: query
schema:
type: integer
default: 10
maximum: 100
minimum: 1
required: false
Offset:
name: offset
description: Number of items to skip during retrieval.
in: query
schema:
type: integer
default: 0
minimum: 0
required: false
Level:
name: level
description: Level of hierarchy up to which to retrieve groups from given group id.
in: query
schema:
type: integer
minimum: 1
maximum: 5
required: false
Metadata:
name: metadata
description: Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.
in: query
required: false
schema:
type: object
additionalProperties: {}
Tree:
name: tree
description: Specify type of response, JSON array or tree.
in: query
required: false
schema:
type: boolean
default: false
requestBodies:
KeyRequest:
description: JSON-formatted document describing key request.
required: true
content:
application/json:
schema:
type: object
properties:
type:
type: integer
example: 0
description: API key type. Keys of different type are processed differently.
duration:
type: number
format: integer
example: 23456
description: Number of seconds issued token is valid for.
GroupCreateReq:
description: JSON-formatted document describing group create request.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/GroupReqSchema"
GroupUpdateReq:
description: JSON-formatted document describing group create request.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/GroupUpdateSchema"
MembersReq:
description: JSON array of member IDs.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/MembersReqSchema"
ShareGroupAccessReq:
description: test
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ShareGroupAccessReqSchema"
PoliciesReq:
description: JSON-formatted document describing adding policies request.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/PoliciesReqSchema"
responses:
ServiceError:
description: Unexpected server-side error occurred.
KeyRes:
description: Data retrieved.
content:
application/json:
schema:
$ref: "#/components/schemas/Key"
GroupCreateRes:
description: Group created.
headers:
Location:
content:
text/plain:
schema:
type: string
description: Created group's relative URL.
example: /groups/{groupId}
ShareAccessRightRes:
description: User group shared with thing group.
GroupRes:
description: Data retrieved.
content:
application/json:
schema:
$ref: "#/components/schemas/GroupResSchema"
GroupsPageRes:
description: Group data retrieved.
content:
application/json:
schema:
$ref: "#/components/schemas/GroupsPage"
MembersRes:
description: Groups data retrieved. Groups assigned to a member.
content:
application/json:
schema:
$ref: "#/components/schemas/MembershipPage"
MembershipPageRes:
description: Groups data retrieved. Groups assigned to a member.
content:
application/json:
schema:
$ref: "#/components/schemas/MembershipPage"
HealthRes:
description: Service Health Check.
content:
application/json:
schema:
$ref: "./schemas/HealthInfo.yml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
security:
- bearerAuth: []
-531
View File
@@ -1,531 +0,0 @@
openapi: 3.0.1
info:
title: Mainflux Bootstrap service
description: HTTP API for managing platform things configuration.
version: "1.0.0"
paths:
/things/configs:
post:
summary: Adds new config
description: |
Adds new config to the list of config owned by user identified using
the provided access token.
tags:
- configs
requestBody:
$ref: "#/components/requestBodies/ConfigCreateReq"
responses:
'201':
$ref: "#/components/responses/ConfigCreateRes"
'400':
description: Failed due to malformed JSON.
'401':
description: Missing or invalid access token provided.
'415':
description: Missing or invalid content type.
'500':
$ref: "#/components/responses/ServiceError"
get:
summary: Retrieves managed configs
description: |
Retrieves a list of managed configs. Due to performance concerns, data
is retrieved in subsets. The API configs must ensure that the entire
dataset is consumed either by making subsequent requests, or by
increasing the subset size of the initial request.
tags:
- configs
parameters:
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/State"
- $ref: "#/components/parameters/Name"
responses:
'200':
$ref: "#/components/responses/ConfigListRes"
'400':
description: Failed due to malformed query parameters.
'401':
description: Missing or invalid access token provided.
'500':
$ref: "#/components/responses/ServiceError"
/things/configs/{configId}:
get:
summary: Retrieves config info (with channels).
tags:
- configs
parameters:
- $ref: "#/components/parameters/ConfigId"
responses:
'200':
$ref: "#/components/responses/ConfigRes"
'401':
description: Missing or invalid access token provided.
'404':
description: Config does not exist.
'500':
$ref: "#/components/responses/ServiceError"
put:
summary: Updates config info
description: |
Update is performed by replacing the current resource data with values
provided in a request payload. Note that the owner, ID, external ID,
external key, Mainflux Thing ID and key cannot be changed.
tags:
- configs
parameters:
- $ref: "#/components/parameters/ConfigId"
requestBody:
$ref: "#/components/requestBodies/ConfigUpdateReq"
responses:
'200':
description: Config updated.
'400':
description: Failed due to malformed JSON.
'401':
description: Missing or invalid access token provided.
'404':
description: Config does not exist.
'415':
description: Missing or invalid content type.
'500':
$ref: "#/components/responses/ServiceError"
delete:
summary: Removes a Config
description: |
Removes a Config. In case of successful removal the service will ensure
that the removed config is disconnected from all of the Mainflux channels.
tags:
- configs
parameters:
- $ref: "#/components/parameters/ConfigId"
responses:
'204':
description: Config removed.
'400':
description: Failed due to malformed config ID.
'401':
description: Missing or invalid access token provided.
'500':
$ref: "#/components/responses/ServiceError"
/things/configs/certs/{configId}:
patch:
summary: Updates certs
description: |
Update is performed by replacing the current certificate data with values
provided in a request payload.
tags:
- configs
parameters:
- $ref: "#/components/parameters/ConfigId"
requestBody:
$ref: "#/components/requestBodies/ConfigCertUpdateReq"
responses:
'200':
description: Config updated.
'400':
description: Failed due to malformed JSON.
'401':
description: Missing or invalid access token provided.
'404':
description: Config does not exist.
'415':
description: Missing or invalid content type.
'500':
$ref: "#/components/responses/ServiceError"
/things/configs/connections/{configId}:
put:
summary: Updates channels the thing is connected to
description: |
Update connections performs update of the channel list corresponding
Thing is connected to.
tags:
- configs
parameters:
- $ref: "#/components/parameters/ConfigId"
requestBody:
$ref: "#/components/requestBodies/ConfigConnUpdateReq"
responses:
'200':
description: Config updated.
'400':
description: Failed due to malformed JSON.
'401':
description: Missing or invalid access token provided.
'404':
description: Config does not exist.
'415':
description: Missing or invalid content type.
'500':
$ref: "#/components/responses/ServiceError"
/things/bootstrap/{externalId}:
get:
summary: Retrieves configuration.
description: |
Retrieves a configuration with given external ID and external key.
tags:
- configs
security:
- bootstrapAuth: []
parameters:
- $ref: "#/components/parameters/ExternalId"
responses:
'200':
$ref: "#/components/responses/BootstrapConfigRes"
'400':
description: Failed due to malformed JSON.
'401':
description: Missing or invalid external key provided.
'404':
description: Failed to retrieve corresponding config.
'500':
$ref: "#/components/responses/ServiceError"
/things/bootstrap/secure/{externalId}:
get:
summary: Retrieves configuration.
description: |
Retrieves a configuration with given external ID and encrypted external key.
tags:
- configs
security:
- bootstrapEncAuth: []
parameters:
- $ref: "#/components/parameters/ExternalId"
responses:
'200':
$ref: "#/components/responses/BootstrapConfigRes"
'404':
description: |
Failed to retrieve corresponding config.
'500':
$ref: "#/components/responses/ServiceError"
/things/state/{configId}:
put:
summary: Updates Config state.
description: |
Updating state represents enabling/disabling Config, i.e. connecting
and disconnecting corresponding Mainflux Thing to the list of Channels.
tags:
- configs
parameters:
- $ref: "#/components/parameters/ConfigId"
requestBody:
$ref: '#/components/requestBodies/ConfigStateUpdateReq'
responses:
'204':
description: Config removed.
'400':
description: Failed due to malformed config's ID.
'401':
description: Missing or invalid access token provided.
'500':
$ref: "#/components/responses/ServiceError"
/health:
get:
summary: Retrieves service health check info.
tags:
- health
responses:
'200':
$ref: "#/components/responses/HealthRes"
'500':
$ref: "#/components/responses/ServiceError"
components:
schemas:
State:
type: integer
enum: [0, 1]
Config:
type: object
properties:
mainflux_id:
type: string
format: uuid
description: Corresponding Mainflux Thing ID.
mainflux_key:
type: string
format: uuid
description: Corresponding Mainflux Thing key.
mainflux_channels:
type: array
minItems: 0
items:
type: object
properties:
id:
type: string
format: uuid
description: Channel unique identifier.
name:
type: string
description: Name of the Channel.
metadata:
type: object
description: Custom metadata related to the Channel.
external_id:
type: string
description: External ID (MAC address or some unique identifier).
external_key:
type: string
description: External key.
content:
type: string
description: Free-form custom configuration.
state:
$ref: "#/components/schemas/State"
required:
- external_id
- external_key
ConfigList:
type: object
properties:
total:
type: integer
description: Total number of results.
minimum: 0
offset:
type: integer
description: Number of items to skip during retrieval.
minimum: 0
default: 0
limit:
type: integer
description: Size of the subset to retrieve.
maximum: 100
default: 10
configs:
type: array
minItems: 0
uniqueItems: true
items:
$ref: "#/components/schemas/Config"
required:
- configs
BootstrapConfig:
type: object
properties:
mainflux_id:
type: string
format: uuid
description: Corresponding Mainflux Thing ID.
mainflux_key:
type: string
format: uuid
description: Corresponding Mainflux Thing key.
mainflux_channels:
type: array
minItems: 0
items:
type: string
content:
type: string
description: Free-form custom configuration.
client_cert:
type: string
description: Client certificate.
client_key:
type: string
description: Key for the client_cert.
ca_cert:
type: string
description: Issuing CA certificate.
required:
- mainflux_id
- mainflux_key
- mainflux_channels
- content
parameters:
ConfigId:
name: configId
description: Unique Config identifier. It's the ID of the corresponding Thing.
in: path
schema:
type: string
format: uuid
required: true
ExternalId:
name: externalId
description: Unique Config identifier provided by external entity.
in: path
schema:
type: string
required: true
Limit:
name: limit
description: Size of the subset to retrieve.
in: query
schema:
type: integer
default: 10
maximum: 100
minimum: 1
required: false
Offset:
name: offset
description: Number of items to skip during retrieval.
in: query
schema:
type: integer
default: 0
minimum: 0
required: false
State:
name: state
description: A state of items
in: query
schema:
$ref: "#/components/schemas/State"
required: false
Name:
name: name
description: Name of the config. Search by name is partial-match and case-insensitive.
in: query
schema:
type: string
required: false
requestBodies:
ConfigCreateReq:
description: JSON-formatted document describing the new config.
required: true
content:
application/json:
schema:
type: object
properties:
external_id:
type: string
description: External ID (MAC address or some unique identifier).
external_key:
type: string
description: External key.
thing_id:
type: string
description: ID of the corresponding Mainflux Thing.
channels:
type: array
minItems: 0
items:
type: string
content:
type: string
required:
- external_id
- external_key
ConfigUpdateReq:
description: JSON-formatted document describing the updated thing.
content:
application/json:
schema:
type: object
properties:
content:
type: string
name:
type: string
required:
- content
- name
ConfigCertUpdateReq:
description: JSON-formatted document describing the updated thing.
content:
application/json:
schema:
type: object
properties:
client_cert:
type: string
client_key:
type: string
ca_cert:
type: string
ConfigConnUpdateReq:
description: Array if IDs the thing is be connected to.
content:
application/json:
schema:
type: object
properties:
channels:
type: array
minItems: 0
items:
type: string
ConfigStateUpdateReq:
description: Update the state of the Config.
content:
application/json:
schema:
type: object
properties:
state:
$ref: "#/components/schemas/State"
responses:
ConfigCreateRes:
description: Config registered.
headers:
Location:
content:
text/plain:
schema:
type: string
description: Created configuration's relative URL (i.e. /things/configs/{configId}).
ConfigListRes:
description: Data retrieved. Configs from this list don't contain channels.
content:
application/json:
schema:
$ref: "#/components/schemas/ConfigList"
ConfigRes:
description: Data retrieved.
content:
application/json:
schema:
$ref: "#/components/schemas/Config"
BootstrapConfigRes:
description: |
Data retrieved. If secure, a response is encrypted using
the secret key, so the response is in the binary form.
content:
application/json:
schema:
$ref: "#/components/schemas/BootstrapConfig"
ServiceError:
description: Unexpected server-side error occurred.
HealthRes:
description: Service Health Check.
content:
application/json:
schema:
$ref: "./schemas/HealthInfo.yml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
bootstrapAuth:
type: http
scheme: bearer
bearerFormat: string
description: |
* Things access: "Authorization: Thing <external_key>"
bootstrapEncAuth:
type: http
scheme: bearer
bearerFormat: aes-sha256-uuid
description: |
* Things access: "Authorization: Thing <external_enc_key>"
Hex-encoded configuration external key encrypted using
the AES algorithm and SHA256 sum of the external key
itself as an encryption key.
security:
- bearerAuth: []
-257
View File
@@ -1,257 +0,0 @@
openapi: 3.0.1
info:
title: Mainflux Certs service
description: HTTP API for Certs service
version: "1.0.0"
paths:
/certs:
post:
summary: Creates a certificate for thing
description: Creates a certificate for thing
tags:
- certs
requestBody:
$ref: "#/components/requestBodies/CertReq"
responses:
'201':
description: Created
'400':
description: Failed due to malformed JSON.
"401":
description: Missing or invalid access token provided.
'500':
description: Unexpected server-side error ocurred.
/certs/{certID}:
get:
summary: Retrieves a certificate
description: |
Retrieves a certificate for a given cert ID.
tags:
- certs
parameters:
- $ref: "#/components/parameters/CertID"
responses:
'200':
$ref: "#/components/responses/CertRes"
'400':
description: Failed due to malformed query parameters.
"401":
description: Missing or invalid access token provided.
'404':
description: |
Failed to retrieve corresponding certificate.
'500':
$ref: "#/components/responses/ServiceError"
delete:
summary: Revokes a certificate
description: |
Revokes a certificate for a given cert ID.
tags:
- certs
parameters:
- $ref: "#/components/parameters/CertID"
responses:
'200':
$ref: "#/components/responses/RevokeRes"
"401":
description: Missing or invalid access token provided.
'404':
description: |
Failed to revoke corresponding certificate.
'500':
$ref: "#/components/responses/ServiceError"
/serials/{thingID}:
get:
summary: Retrieves certificates' serial IDs
description: |
Retrieves a list of certificates' serial IDs for a given thing ID.
tags:
- certs
parameters:
- $ref: "#/components/parameters/ThingID"
responses:
'200':
$ref: "#/components/responses/SerialsPageRes"
'400':
description: Failed due to malformed query parameters.
"401":
description: Missing or invalid access token provided.
'404':
description: |
Failed to retrieve corresponding certificates.
'500':
$ref: "#/components/responses/ServiceError"
/health:
get:
summary: Retrieves service health check info.
tags:
- health
responses:
'200':
$ref: "#/components/responses/HealthRes"
'500':
$ref: "#/components/responses/ServiceError"
components:
parameters:
ThingID:
name: thingID
description: Thing ID
in: path
schema:
type: string
format: uuid
required: true
CertID:
name: certID
description: Serial of certificate
in: path
schema:
type: string
format: uuid
required: true
schemas:
Cert:
type: object
properties:
thing_id:
type: string
format: uuid
description: Corresponding Mainflux Thing ID.
client_cert:
type: string
description: Client Certificate.
client_key:
type: string
description: Key for the client_cert.
issuing_ca:
type: string
description: CA Certificate that is used to issue client certs, usually intermediate.
serial:
type: string
description: Certificate serial
expire:
type: string
description: Certificate expiry date
Serial:
type: object
properties:
serial:
type: string
description: Certificate serial
CertsPage:
type: object
properties:
certs:
type: array
minItems: 0
uniqueItems: true
items:
$ref: "#/components/schemas/Cert"
total:
type: integer
description: Total number of items.
offset:
type: integer
description: Number of items to skip during retrieval.
limit:
type: integer
description: Maximum number of items to return in one page.
SerialsPage:
type: object
properties:
serials:
type: array
description: Certificate serials IDs.
minItems: 0
uniqueItems: true
items:
type: string
total:
type: integer
description: Total number of items.
offset:
type: integer
description: Number of items to skip during retrieval.
limit:
type: integer
description: Maximum number of items to return in one page.
Revoke:
type: object
properties:
revocation_time:
type: string
description: Certificate revocation time
requestBodies:
CertReq:
description: |
Issues a certificate that is required for mTLS. To create a certificate for a thing
provide a thing id, data identifying particular thing will be embedded into the Certificate.
x509 and ECC certificates are supported when using when Vault is used as PKI.
content:
application/json:
schema:
type: object
required:
- thing_id
- ttl
- key_bits
- key_type
properties:
thing_id:
type: string
format: uuid
ttl:
type: string
key_type:
type: string
key_bits:
type: integer
responses:
ServiceError:
description: Unexpected server-side error occurred.
CertRes:
description: Certificate data.
content:
application/json:
schema:
$ref: "#/components/schemas/Cert"
CertsPageRes:
description: Certificates page.
content:
application/json:
schema:
$ref: "#/components/schemas/CertsPage"
SerialsPageRes:
description: Serials page.
content:
application/json:
schema:
$ref: "#/components/schemas/SerialsPage"
RevokeRes:
description: Certificate revoked.
content:
application/json:
schema:
$ref: "#/components/schemas/Revoke"
HealthRes:
description: Service Health Check.
content:
application/json:
schema:
$ref: "./schemas/HealthInfo.yml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
security:
- bearerAuth: []
-220
View File
@@ -1,220 +0,0 @@
openapi: 3.0.1
info:
title: Mainflux Notifiers service
description: HTTP API for Notifiers service.
version: "1.0.0"
paths:
/subscriptions:
post:
summary: Create subscription
description: Creates a new subscription give a topic and contact.
tags:
- notifiers
requestBody:
$ref: "#/components/requestBodies/Create"
responses:
"201":
$ref: "#/components/responses/Create"
"400":
description: Failed due to malformed JSON.
"409":
description: Failed due to using an existing topic and contact.
"415":
description: Missing or invalid content type.
"500":
$ref: "#/components/responses/ServiceError"
get:
summary: List subscriptions
description: List subscriptions given list parameters.
tags:
- notifiers
parameters:
- $ref: "#/components/parameters/Topic"
- $ref: "#/components/parameters/Contact"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Limit"
responses:
"200":
$ref: "#/components/responses/Page"
"400":
description: Failed due to malformed query parameters.
"401":
description: Missing or invalid access token provided.
"500":
$ref: "#/components/responses/ServiceError"
/subscriptions/{id}:
get:
summary: Get subscription with the provided id
description: Retrieves a subscription with the provided id.
tags:
- notifiers
parameters:
- $ref: "#/components/parameters/Id"
responses:
"200":
$ref: "#/components/responses/View"
"401":
description: Missing or invalid access token provided.
"500":
$ref: "#/components/responses/ServiceError"
delete:
summary: Delete subscription with the provided id
description: Removes a subscription with the provided id.
tags:
- notifiers
parameters:
- $ref: "#/components/parameters/Id"
responses:
"204":
description: Subscription removed
"401":
description: Missing or invalid access token provided.
"500":
$ref: "#/components/responses/ServiceError"
/health:
get:
summary: Retrieves service health check info.
tags:
- health
responses:
'200':
$ref: "#/components/responses/HealthRes"
'500':
$ref: "#/components/responses/ServiceError"
components:
schemas:
Subscription:
type: object
properties:
id:
type: string
format: ulid
example: 01EWDVKBQSG80B6PQRS9PAAY35
description: ULID id of the subscription.
owner_id:
type: string
format: uuid
example: 18167738-f7a8-4e96-a123-58c3cd14de3a
description: An id of the owner who created subscription.
topic:
type: string
example: topic.subtopic
description: Topic to which the user subscribes.
contact:
type: string
example: user@example.com
description: The contact of the user to which the notification will be sent.
Page:
type: object
properties:
subscriptions:
type: array
minItems: 0
uniqueItems: true
items:
$ref: "#/components/schemas/Subscription"
total:
type: integer
description: Total number of items.
offset:
type: integer
description: Number of items to skip during retrieval.
limit:
type: integer
description: Maximum number of items to return in one page.
parameters:
Id:
name: id
description: Unique identifier.
in: path
schema:
type: string
format: ulid
required: true
Limit:
name: limit
description: Size of the subset to retrieve.
in: query
schema:
type: integer
default: 10
maximum: 100
minimum: 1
required: false
Offset:
name: offset
description: Number of items to skip during retrieval.
in: query
schema:
type: integer
default: 0
minimum: 0
required: false
Topic:
name: topic
description: Topic name.
in: query
schema:
type: string
required: false
Contact:
name: contact
description: Subscription contact.
in: query
schema:
type: string
required: false
requestBodies:
Create:
description: JSON-formatted document describing the new subscription to be created
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Subscription"
responses:
Create:
description: Created a new subscription.
headers:
Location:
content:
text/plain:
schema:
type: string
description: Created subscription relative URL
example: /subscriptions/{id}
View:
description: View subscription.
content:
application/json:
schema:
$ref: "#/components/schemas/Subscription"
Page:
description: Data retrieved.
content:
application/json:
schema:
$ref: "#/components/schemas/Page"
ServiceError:
description: Unexpected server-side error occurred.
HealthRes:
description: Service Health Check.
content:
application/json:
schema:
$ref: "./schemas/HealthInfo.yml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
security:
- bearerAuth: []
-162
View File
@@ -1,162 +0,0 @@
openapi: 3.0.1
info:
title: Mainflux http adapter
description: HTTP API for sending messages through communication channels.
version: "1.0.0"
paths:
/channels/{id}/messages:
post:
summary: Sends message to the communication channel
description: |
Sends message to the communication channel. Messages can be sent as
JSON formatted SenML or as blob.
tags:
- messages
parameters:
- $ref: "#/components/parameters/ID"
requestBody:
$ref: "#/components/requestBodies/MessageReq"
responses:
"202":
description: Message is accepted for processing.
"400":
description: Message discarded due to its malformed content.
"401":
description: Missing or invalid access token provided.
"404":
description: Message discarded due to invalid channel id.
"415":
description: Message discarded due to invalid or missing content type.
'500':
$ref: "#/components/responses/ServiceError"
/health:
get:
summary: Retrieves service health check info.
tags:
- health
responses:
'200':
$ref: "#/components/responses/HealthRes"
'500':
$ref: "#/components/responses/ServiceError"
components:
schemas:
SenMLRecord:
type: object
properties:
bn:
type: string
description: Base Name
bt:
type: number
format: double
description: Base Time
bu:
type: number
format: double
description: Base Unit
bv:
type: number
format: double
description: Base Value
bs:
type: number
format: double
description: Base Sum
bver:
type: number
format: double
description: Version
n:
type: string
description: Name
u:
type: string
description: Unit
v:
type: number
format: double
description: Value
vs:
type: string
description: String Value
vb:
type: boolean
description: Boolean Value
vd:
type: string
description: Data Value
s:
type: number
format: double
description: Value Sum
t:
type: number
format: double
description: Time
ut:
type: number
format: double
description: Update Time
SenMLArray:
type: array
items:
$ref: "#/components/schemas/SenMLRecord"
parameters:
ID:
name: id
description: Unique channel identifier.
in: path
schema:
type: string
format: uuid
required: true
requestBodies:
MessageReq:
description: |
Message to be distributed. Since the platform expects messages to be
properly formatted SenML in order to be post-processed, clients are
obliged to specify Content-Type header for each published message.
Note that all messages that aren't SenML will be accepted and published,
but no post-processing will be applied.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/SenMLArray"
responses:
ServiceError:
description: Unexpected server-side error occurred.
content:
application/json:
schema:
type: string
format: byte
HealthRes:
description: Service Health Check.
content:
application/json:
schema:
$ref: "./schemas/HealthInfo.yml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: uuid
description: |
* Thing access: "Authorization: Thing <thing_key>"
basicAuth:
type: http
scheme: basic
description: |
* Things access: "Authorization: Basic <base64-encoded_credentials>"
security:
- bearerAuth: []
- basicAuth: []
-94
View File
@@ -1,94 +0,0 @@
openapi: 3.0.1
info:
title: Mainflux Provision service
description: HTTP API for Provision service
version: "1.0.0"
paths:
/mapping:
post:
summary: Adds new device to proxy
description: Adds new device to proxy
tags:
- provision
requestBody:
$ref: "#/components/requestBodies/ProvisionReq"
responses:
'201':
description: Created
'400':
description: Failed due to malformed JSON.
"401":
description: Missing or invalid access token provided.
'500':
$ref: "#/components/responses/ServiceError"
get:
summary: Gets current mapping.
description: Gets current mapping. This can be used in UI
so that when bootstrap config is created from UI matches
configuration created with provision service.
tags:
- provision
responses:
'200':
$ref: "#/components/responses/ProvisionRes"
"401":
description: Missing or invalid access token provided.
'500':
$ref: "#/components/responses/ServiceError"
/health:
get:
summary: Retrieves service health check info.
tags:
- health
responses:
'200':
$ref: "#/components/responses/HealthRes"
'500':
$ref: "#/components/responses/ServiceError"
components:
requestBodies:
ProvisionReq:
description: MAC address of device or other identifier
content:
application/json:
schema:
type: object
required:
- external_id
- external_key
properties:
external_id:
type: string
external_key:
type: string
name:
type: string
responses:
ServiceError:
description: Unexpected server-side error occurred.
ProvisionRes:
description: Current mapping JSON representation.
content:
application/json:
schema:
type: object
HealthRes:
description: Service Health Check.
content:
application/json:
schema:
$ref: "./schemas/HealthInfo.yml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
security:
- bearerAuth: []
-241
View File
@@ -1,241 +0,0 @@
openapi: 3.0.1
info:
title: Mainflux reader service
description: HTTP API for reading messages.
version: "1.0.0"
paths:
/channels/{chanId}/messages:
get:
summary: Retrieves messages sent to single channel
description: |
Retrieves a list of messages sent to specific channel. Due to
performance concerns, data is retrieved in subsets. The API readers must
ensure that the entire dataset is consumed either by making subsequent
requests, or by increasing the subset size of the initial request.
tags:
- messages
parameters:
- $ref: "#/components/parameters/ChanId"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Publisher"
- $ref: "#/components/parameters/Name"
- $ref: "#/components/parameters/Value"
- $ref: "#/components/parameters/BoolValue"
- $ref: "#/components/parameters/StringValue"
- $ref: "#/components/parameters/DataValue"
- $ref: "#/components/parameters/From"
- $ref: "#/components/parameters/To"
responses:
'200':
$ref: "#/components/responses/MessagesPageRes"
'400':
description: Failed due to malformed query parameters.
'401':
description: Missing or invalid access token provided.
'500':
$ref: "#/components/responses/ServiceError"
/health:
get:
summary: Retrieves service health check info.
tags:
- health
responses:
'200':
$ref: "#/components/responses/HealthRes"
'500':
$ref: "#/components/responses/ServiceError"
components:
schemas:
MessagesPage:
type: object
properties:
total:
type: number
description: Total number of items that are present on the system.
offset:
type: number
description: Number of items that were skipped during retrieval.
limit:
type: number
description: Size of the subset that was retrieved.
messages:
type: array
minItems: 0
uniqueItems: true
items:
type: object
properties:
channel:
type: integer
description: Unique channel id.
publisher:
type: integer
description: Unique publisher id.
protocol:
type: string
description: Protocol name.
name:
type: string
description: Measured parameter name.
unit:
type: string
description: Value unit.
value:
type: number
description: Measured value in number.
stringValue:
type: string
description: Measured value in string format.
boolValue:
type: boolean
description: Measured value in boolean format.
dataValue:
type: string
description: Measured value in binary format.
valueSum:
type: number
description: Sum value.
time:
type: number
description: Time of measurement.
updateTime:
type: number
description: Time of updating measurement.
parameters:
ChanId:
name: chanId
description: Unique channel identifier.
in: path
schema:
type: string
format: uuid
required: true
Limit:
name: limit
description: Size of the subset to retrieve.
in: query
schema:
type: integer
default: 10
maximum: 100
minimum: 1
required: false
Offset:
name: offset
description: Number of items to skip during retrieval.
in: query
schema:
type: integer
default: 0
minimum: 0
required: false
Publisher:
name: Publisher
description: Unique thing identifier.
in: query
schema:
type: string
format: uuid
required: false
Name:
name: name
description: SenML message name.
in: query
schema:
type: string
required: false
Value:
name: v
description: SenML message value.
in: query
schema:
type: string
required: false
BoolValue:
name: vb
description: SenML message bool value.
in: query
schema:
type: boolean
required: false
StringValue:
name: vs
description: SenML message string value.
in: query
schema:
type: string
required: false
DataValue:
name: vd
description: SenML message data value.
in: query
schema:
type: string
required: false
Comparator:
name: comparator
description: Value comparison operator.
in: query
schema:
type: string
default: eq
enum:
- eq
- lt
- le
- gt
- ge
required: false
From:
name: from
description: SenML message time in nanoseconds (integer part represents seconds).
in: query
schema:
type: number
required: false
To:
name: to
description: SenML message time in nanoseconds (integer part represents seconds).
in: query
schema:
type: number
required: false
responses:
MessagesPageRes:
description: Data retrieved.
content:
application/json:
schema:
$ref: "#/components/schemas/MessagesPage"
ServiceError:
description: Unexpected server-side error occurred.
HealthRes:
description: Service Health Check.
content:
application/json:
schema:
$ref: "./schemas/HealthInfo.yml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
thingAuth:
type: http
scheme: bearer
bearerFormat: uuid
description: |
* Things access: "Authorization: Thing <thing_key>"
security:
- bearerAuth: []
- thingAuth: []
-23
View File
@@ -1,23 +0,0 @@
type: object
properties:
status:
type: string
description: Service status.
enum:
- pass
version:
type: string
description: Service version.
example: 0.0.1
commit:
type: string
description: Service commit hash.
example: 7d6f4dc4f7f0c1fa3dc24eddfb18bb5073ff4f62
description:
type: string
description: Service description.
example: <service_name> service
build_time:
type: string
description: Service build time.
example: 1970-01-01_00:00:00
File diff suppressed because it is too large Load Diff
-379
View File
@@ -1,379 +0,0 @@
openapi: 3.0.1
info:
title: Mainflux twins service
description: HTTP API for managing digital twins and their states.
version: '1.0.0'
paths:
/twins:
post:
summary: Adds new twin
description: |
Adds new twin to the list of twins owned by user identified using
the provided access token.
tags:
- twins
requestBody:
$ref: "#/components/requestBodies/TwinReq"
responses:
'201':
$ref: "#/components/responses/TwinCreateRes"
'400':
description: Failed due to malformed JSON.
'401':
description: Missing or invalid access token provided.
'415':
description: Missing or invalid content type.
'500':
$ref: '#/components/responses/ServiceError'
get:
summary: Retrieves twins
description: |
Retrieves a list of twins. Due to performance concerns, data
is retrieved in subsets.
tags:
- twins
parameters:
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/Offset'
- $ref: '#/components/parameters/Name'
- $ref: '#/components/parameters/Metadata'
responses:
'200':
$ref: '#/components/responses/TwinsPageRes'
'400':
description: Failed due to malformed query parameters.
'401':
description: Missing or invalid access token provided.
'500':
$ref: '#/components/responses/ServiceError'
/twins/{twinID}:
get:
summary: Retrieves twin info
tags:
- twins
parameters:
- $ref: '#/components/parameters/TwinID'
responses:
'200':
$ref: '#/components/responses/TwinRes'
'400':
description: Failed due to malformed twin's ID.
'401':
description: Missing or invalid access token provided.
'404':
description: Twin does not exist.
'500':
$ref: '#/components/responses/ServiceError'
put:
summary: Updates twin info
description: |
Update is performed by replacing the current resource data with values
provided in a request payload. Note that the twin's ID cannot be changed.
tags:
- twins
parameters:
- $ref: '#/components/parameters/TwinID'
requestBody:
$ref: '#/components/requestBodies/TwinReq'
responses:
'200':
description: Twin updated.
'400':
description: Failed due to malformed twin's ID or malformed JSON.
'401':
description: Missing or invalid access token provided.
'404':
description: Twin does not exist.
'415':
description: Missing or invalid content type.
'500':
$ref: '#/components/responses/ServiceError'
delete:
summary: Removes a twin
description: Removes a twin.
tags:
- twins
parameters:
- $ref: '#/components/parameters/TwinID'
responses:
'204':
description: Twin removed.
'400':
description: Failed due to malformed twin's ID.
'401':
description: Missing or invalid access token provided
'404':
description: Twin does not exist.
'500':
$ref: '#/components/responses/ServiceError'
/states/{twinID}:
get:
summary: Retrieves states of twin with id twinID
description: |
Retrieves a list of states. Due to performance concerns, data
is retrieved in subsets.
tags:
- states
parameters:
- $ref: '#/components/parameters/TwinID'
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/Offset'
responses:
'200':
$ref: '#/components/responses/StatesPageRes'
'400':
description: Failed due to malformed query parameters.
'401':
description: Missing or invalid access token provided.
'404':
description: Twin does not exist.
'500':
$ref: '#/components/responses/ServiceError'
/health:
get:
summary: Retrieves service health check info.
tags:
- health
responses:
'200':
$ref: "#/components/responses/HealthRes"
'500':
$ref: "#/components/responses/ServiceError"
components:
parameters:
Limit:
name: limit
description: Size of the subset to retrieve.
in: query
schema:
type: integer
default: 10
maximum: 100
minimum: 1
required: false
Offset:
name: offset
description: Number of items to skip during retrieval.
in: query
schema:
type: integer
default: 0
minimum: 0
required: false
Name:
name: name
description: Twin name
in: query
schema:
type: string
required: false
Metadata:
name: metadata
description: |
Metadata filter. Filtering is performed matching the parameter with
metadata on top level. Parameter is json.
in: query
schema:
type: string
minimum: 0
required: false
TwinID:
name: twinID
description: Unique twin identifier.
in: path
schema:
type: string
format: uuid
minimum: 1
required: true
schemas:
Attribute:
type: object
properties:
name:
type: string
description: Name of the attribute.
channel:
type: string
description: Mainflux channel used by attribute.
subtopic:
type: string
description: Subtopic used by attribute.
persist_state:
type: boolean
description: Trigger state creation based on the attribute.
Definition:
type: object
properties:
delta:
type: number
description: Minimal time delay before new state creation.
attributes:
type: array
minItems: 0
uniqueItems: true
items:
$ref: '#/components/schemas/Attribute'
TwinReqObj:
type: object
properties:
name:
type: string
description: Free-form twin name.
metadata:
type: object
description: Arbitrary, object-encoded twin's data.
definition:
$ref: '#/components/schemas/Definition'
TwinResObj:
type: object
properties:
owner:
type: string
description: Email address of Mainflux user that owns twin.
id:
type: string
format: uuid
description: Unique twin identifier generated by the service.
name:
type: string
description: Free-form twin name.
revision:
type: number
description: Oridnal revision number of twin.
created:
type: string
format: date
description: Twin creation date and time.
updated:
type: string
format: date
description: Twin update date and time.
definitions:
type: array
minItems: 0
uniqueItems: true
items:
$ref: '#/components/schemas/Definition'
metadata:
type: object
description: Arbitrary, object-encoded twin's data.
TwinsPage:
type: object
properties:
twins:
type: array
minItems: 0
uniqueItems: true
items:
$ref: '#/components/schemas/TwinResObj'
total:
type: integer
description: Total number of items.
offset:
type: integer
description: Number of items to skip during retrieval.
limit:
type: integer
description: Maximum number of items to return in one page.
required:
- twins
State:
type: object
properties:
twin_id:
type: string
format: uuid
description: ID of twin state belongs to.
id:
type: number
description: State position in a time row of states.
created:
type: string
format: date
description: State creation date.
payload:
type: object
description: Object-encoded states's payload.
StatesPage:
type: object
properties:
twins:
type: array
minItems: 0
uniqueItems: true
items:
$ref: '#/components/schemas/State'
total:
type: integer
description: Total number of items.
offset:
type: integer
description: Number of items to skip during retrieval.
limit:
type: integer
description: Maximum number of items to return in one page.
required:
- twins
requestBodies:
TwinReq:
description: JSON-formatted document describing the twin to create or update.
content:
application/json:
schema:
$ref: '#/components/schemas/TwinReqObj'
required: true
responses:
TwinCreateRes:
description: Created twin's relative URL (i.e. /twins/{twinID}).
headers:
Location:
content:
text/plain:
schema:
type: string
TwinRes:
description: Data retrieved.
content:
application/json:
schema:
$ref: '#/components/schemas/TwinResObj'
TwinsPageRes:
description: Data retrieved.
content:
application/json:
schema:
$ref: '#/components/schemas/TwinsPage'
StatesPageRes:
description: Data retrieved.
content:
application/json:
schema:
$ref: '#/components/schemas/StatesPage'
ServiceError:
description: Unexpected server-side error occurred.
HealthRes:
description: Service Health Check.
content:
application/json:
schema:
$ref: "./schemas/HealthInfo.yml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
security:
- bearerAuth: []
-464
View File
@@ -1,464 +0,0 @@
openapi: 3.0.1
info:
title: Mainflux users service
description: HTTP API for managing platform users.
version: "1.0.0"
paths:
/users:
post:
summary: Registers user account
description: |
Registers new user account given email and password. New account will
be uniquely identified by its email address.
tags:
- users
requestBody:
$ref: "#/components/requestBodies/UserCreateReq"
responses:
'201':
$ref: "#/components/responses/UserCreateRes"
'400':
description: Failed due to malformed JSON.
'401':
description: Missing or invalid access token provided.
'409':
description: Failed due to using an existing email address.
'415':
description: Missing or invalid content type.
'500':
$ref: "#/components/responses/ServiceError"
get:
summary: Retrieves users
description: |
Retrieves a list of users. Due to performance concerns, data
is retrieved in subsets. The API things must ensure that the entire
dataset is consumed either by making subsequent requests, or by
increasing the subset size of the initial request.
tags:
- users
parameters:
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Metadata"
responses:
'200':
$ref: "#/components/responses/UsersPageRes"
'400':
description: Failed due to malformed query parameters.
'401':
description: |
Missing or invalid access token provided.
This endpoint is available only for administrators.
'404':
description: A non-existent entity request.
'422':
description: Database can't process request.
'500':
$ref: "#/components/responses/ServiceError"
put:
summary: Updates info on currently logged in user.
description: |
Updates info on currently logged in user. Info is updated using
authorization token and the new received info.
tags:
- users
requestBody:
$ref: "#/components/requestBodies/UserUpdateReq"
responses:
'200':
description: User updated.
'400':
description: Failed due to malformed JSON.
'404':
description: Failed due to non existing user.
'401':
description: Missing or invalid access token provided.
'500':
$ref: "#/components/responses/ServiceError"
/users/profile:
get:
summary: Gets info on currently logged in user.
description: |
Gets info on currently logged in user. Info is obtained using
authorization token
tags:
- users
responses:
'200':
$ref: "#/components/responses/UserRes"
'400':
description: Failed due to malformed query parameters.
'401':
description: Missing or invalid access token provided.
'500':
$ref: "#/components/responses/ServiceError"
/groups/{groupId}:
get:
summary: Retrieves users
description: |
Retrieves a list of users that belong to a group. Due to performance concerns, data
is retrieved in subsets. The API things must ensure that the entire
dataset is consumed either by making subsequent requests, or by
increasing the subset size of the initial request.
tags:
- users
parameters:
- $ref: "#/components/parameters/GroupId"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Metadata"
responses:
'200':
$ref: "#/components/responses/UsersPageRes"
'400':
description: Failed due to malformed query parameters.
'401':
description: Missing or invalid access token provided.
'404':
description: A non-existent entity request.
'422':
description: Database can't process request.
'500':
$ref: "#/components/responses/ServiceError"
/tokens:
post:
summary: User authentication
description: Generates an access token when provided with proper credentials.
tags:
- users
requestBody:
$ref: "#/components/requestBodies/UserCreateReq"
responses:
'201':
description: User authenticated.
content:
application/json:
schema:
$ref: '#/components/schemas/Token'
'400':
description: Failed due to malformed JSON.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Failed due to using invalid credentials.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'415':
description: Missing or invalid content type.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
$ref: '#/components/responses/ServiceError'
/password/reset-request:
post:
summary: User password reset request
description: |
Generates a reset token and sends and
email with link for resetting password.
tags:
- users
parameters:
- $ref: "#/components/parameters/Referer"
requestBody:
$ref: '#/components/requestBodies/RequestPasswordReset'
responses:
'201':
description: Users link for reseting password.
'400':
description: Failed due to malformed JSON.
'415':
description: Missing or invalid content type.
'500':
$ref: '#/components/responses/ServiceError'
/password/reset:
put:
summary: User password reset endpoint
description: |
When user gets reset token, after he submited
email to `/password/reset-request`, posting a
new password along to this endpoint will change password.
tags:
- users
requestBody:
$ref: '#/components/requestBodies/PasswordReset'
responses:
'201':
description: User link .
'400':
description: Failed due to malformed JSON.
'415':
description: Missing or invalid content type.
'500':
$ref: '#/components/responses/ServiceError'
/password:
patch:
summary: User password change endpoint
description: |
When authenticated user wants to change password.
tags:
- users
requestBody:
$ref: '#/components/requestBodies/PasswordChange'
responses:
'201':
description: User link .
'400':
description: Failed due to malformed JSON.
'415':
description: Missing or invalid content type.
'500':
$ref: "#/components/responses/ServiceError"
/health:
get:
summary: Retrieves service health check info.
tags:
- health
responses:
'200':
$ref: "#/components/responses/HealthRes"
'500':
$ref: "#/components/responses/ServiceError"
components:
schemas:
Token:
type: object
properties:
token:
type: string
format: jwt
description: Generated access token.
required:
- token
UserReqObj:
type: object
properties:
email:
type: string
format: email
example: "test@example.com"
description: User's email address will be used as its unique identifier
password:
type: string
format: password
minimum: 8
description: Free-form account password used for acquiring auth token(s).
required:
- email
- password
User:
type: object
properties:
id:
type: string
format: uuid
example: 18167738-f7a8-4e96-a123-58c3cd14de3a
description: User unique identifier.
email:
type: string
format: email
example: "test@example.com"
description: User's email address will be used as its unique identifier.
metadata:
type: object
description: Arbitrary, object-encoded user's data.
UsersPage:
type: object
properties:
things:
type: array
minItems: 0
uniqueItems: true
items:
$ref: "#/components/schemas/User"
total:
type: integer
description: Total number of items.
offset:
type: integer
description: Number of items to skip during retrieval.
limit:
type: integer
description: Maximum number of items to return in one page.
required:
- things
UserMetadata:
type: object
properties:
metadata:
type: object
description: Arbitrary, object-encoded user's data.
Error:
type: object
properties:
error:
type: string
description: Error message
parameters:
Referer:
name: Referer
description: Host being sent by browser.
in: header
schema:
type: string
required: true
Metadata:
name: metadata
description: Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.
in: query
schema:
type: string
minimum: 0
required: false
UserID:
name: userId
description: Unique user identifier.
in: path
schema:
type: string
format: uuid
required: true
GroupId:
name: groupId
description: Unique group identifier.
in: path
schema:
type: string
format: ulid
required: true
Limit:
name: limit
description: Size of the subset to retrieve.
in: query
schema:
type: integer
default: 10
maximum: 100
minimum: 1
required: false
Offset:
name: offset
description: Number of items to skip during retrieval.
in: query
schema:
type: integer
default: 0
minimum: 0
required: false
requestBodies:
UserCreateReq:
description: JSON-formatted document describing the new user to be registered
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UserReqObj'
UserUpdateReq:
description: JSON-formated document describing the metadata of user to be update
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UserMetadata"
RequestPasswordReset:
description: Initiate password request procedure.
required: true
content:
application/json:
schema:
type: object
properties:
email:
type: string
format: email
description: User email.
PasswordReset:
description: Password reset request data, new password and token that is appended on password reset link received in email.
content:
application/json:
schema:
type: object
properties:
password:
type: string
format: password
description: New password.
minimum: 8
confirm_password:
type: string
format: password
description: New confirmation password.
minimum: 8
token:
type: string
format: jwt
description: Reset token generated and sent in email.
PasswordChange:
description: Password change data. User can change its password.
required: true
content:
application/json:
schema:
type: object
properties:
password:
type: string
format: password
description: New password.
old_password:
type: string
format: password
description: Old password.
responses:
UserCreateRes:
description: Registered new user.
headers:
Location:
content:
text/plain:
schema:
type: string
format: url
description: Registered user relative URL.
example: /users/{userId}
UserRes:
description: Data retrieved.
content:
application/json:
schema:
$ref: "#/components/schemas/User"
UsersPageRes:
description: Data retrieved.
content:
application/json:
schema:
$ref: "#/components/schemas/UsersPage"
ServiceError:
description: Unexpected server-side error occurred.
HealthRes:
description: Service Health Check.
content:
application/json:
schema:
$ref: "./schemas/HealthInfo.yml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
security:
- bearerAuth: []
+119
View File
@@ -0,0 +1,119 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
asyncapi: '2.6.0'
id: 'https://github.com/absmach/magistrala/blob/main/api/asyncapi/mqtt.yaml'
info:
title: Magistrala MQTT Adapter
version: '0.18.0'
contact:
name: Magistrala Team
url: 'https://github.com/absmach/magistrala'
email: info@absmach.eu
description: |
MQTT adapter provides an MQTT API for sending messages through the platform. MQTT adapter uses [mProxy](https://github.com/absmach/mproxy) for proxying traffic between client and MQTT broker.
Additionally, the MQTT adapter and the message broker are replicating the traffic between brokers.
license:
name: Apache 2.0
url: 'https://github.com/absmach/magistrala/blob/main/LICENSE'
defaultContentType: application/json
servers:
dev:
url: localhost:{port}
protocol: mqtt
description: Test broker
variables:
port:
description: Secure connection (TLS) is available through port 8883.
default: '1883'
enum:
- '1883'
- '8883'
security:
- user-password: []
channels:
/m/{domainPrefix}/c/{channelPrefix}/{subtopic}:
parameters:
domainPrefix:
$ref: '#/components/parameters/domainPrefix'
in: path
required: true
channelPrefix:
$ref: '#/components/parameters/channelPrefix'
in: path
required: true
subtopic:
$ref: '#/components/parameters/subtopic'
in: path
required: false
publish:
traits:
- $ref: '#/components/operationTraits/mqtt'
message:
$ref: '#/components/messages/jsonMsg'
subscribe:
traits:
- $ref: '#/components/operationTraits/mqtt'
message:
$ref: '#/components/messages/jsonMsg'
components:
messages:
jsonMsg:
title: JSON Message
summary: Arbitrary JSON array or object.
contentType: application/json
payload:
$ref: "#/components/schemas/jsonMsg"
schemas:
jsonMsg:
type: object
description: Arbitrary JSON object or array. SenML format is recommended.
example: |
### SenML
```json
[{"bn":"some-base-name:","bt":1641646520, "bu":"A","bver":5, "n":"voltage","u":"V","v":120.1}, {"n":"current","t":-5,"v":1.2}, {"n":"current","t":-4,"v":1.3}]
```
### JSON
```json
{"field_1":"val_1", "t": 1641646525}
```
### JSON Array
```json
[{"field_1":"val_1", "t": 1641646520},{"field_2":"val_2", "t": 1641646522}]
```
parameters:
domainPrefix:
description: ID or route of the domain associated with the channel and client.
schema:
type: string
channelPrefix:
description: ID or route of the channel connected to the Client ID defined in the username.
schema:
type: string
subtopic:
description: Arbitrary message subtopic.
schema:
type: string
default: ''
securitySchemes:
user-password:
type: userPassword
description: |
username is client ID connected to the channel defined in the mqtt topic and
password is client secret corresponding to the client ID
operationTraits:
mqtt:
bindings:
mqtt:
qos: 2
+151
View File
@@ -0,0 +1,151 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
asyncapi: 2.6.0
id: 'https://github.com/absmach/magistrala/blob/main/api/asyncapi/websocket.yaml'
info:
title: Magistrala WebSocket adapter
description: WebSocket adapter provides a WebSocket API for sending messages through communication channels. WebSocket adapter uses [mProxy](https://github.com/absmach/mproxy) for proxying traffic between client and MQTT broker.
version: '0.18.0'
contact:
name: Magistrala Team
url: 'https://github.com/absmach/magistrala'
email: info@absmach.eu
license:
name: Apache 2.0
url: 'https://github.com/absmach/magistrala/blob/main/LICENSE'
tags:
- name: WebSocket
defaultContentType: application/json
servers:
dev:
url: 'ws://{host}:{port}'
protocol: ws
description: Default WebSocket Adapter URL
variables:
host:
description: Hostname of the WebSocket adapter
default: localhost
port:
description: Magistrala WebSocket Adapter port
default: '8008'
channels:
'm/{domainPrefix}/c/{channelPrefix}/{subtopic}':
parameters:
domainPrefix:
$ref: '#/components/parameters/domainPrefix'
in: path
required: true
channelPrefix:
$ref: '#/components/parameters/channelPrefix'
in: path
required: true
subtopic:
$ref: '#/components/parameters/subtopic'
in: path
required: false
publish:
summary: Publish messages to a channel
operationId: publishToChannel
message:
$ref: '#/components/messages/jsonMsg'
messageId: publishMessage
bindings:
ws:
method: POST
query:
subtopic: '{$request.query.subtopic}'
security:
- bearerAuth: []
subscribe:
summary: Subscribe to receive messages from a channel
operationId: subscribeToChannel
message:
$ref: '#/components/messages/jsonMsg'
messageId: subscribeMessage
bindings:
ws:
method: GET
query:
subtopic: '{$request.query.subtopic}'
security:
- bearerAuth: []
/version:
subscribe:
summary: Get the version of the Magistrala adapter
operationId: getVersion
bindings:
http:
method: GET
metrics:
description: Endpoint for getting service metrics.
subscribe:
operationId: metrics
summary: Service metrics
bindings:
http:
type: request
method: GET
components:
messages:
jsonMsg:
title: JSON Message
summary: Arbitrary JSON array or object.
contentType: application/json
payload:
$ref: '#/components/schemas/jsonMsg'
schemas:
jsonMsg:
type: object
description: Arbitrary JSON object or array. SenML format is recommended.
example: >
### SenML
```json
[{"bn":"some-base-name:","bt":1641646520, "bu":"A","bver":5,
"n":"voltage","u":"V","v":120.1}, {"n":"current","t":-5,"v":1.2},
{"n":"current","t":-4,"v":1.3}]
```
### JSON
```json
{"field_1":"val_1", "t": 1641646525}
```
### JSON Array
```json
[{"field_1":"val_1", "t": 1641646520},{"field_2":"val_2", "t":
1641646522}]
```
parameters:
domainPrefix:
description: ID or route of the domain associated with the channel and client.
schema:
type: string
channelPrefix:
description: ID or route of the channel connected to the Client ID defined in the username.
schema:
type: string
subtopic:
description: Arbitrary message subtopic.
schema:
type: string
default: ''
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: uuid
description: |
* Client access: "Authorization: Client <client_key>"
+5
View File
@@ -0,0 +1,5 @@
# Magistrala OpenAPI Specification
This folder contains an OpenAPI specifications for Magistrala API.
View specification in Swagger UI at [docs.api.magistrala.absmach.eu](https://docs.api.magistrala.absmach.eu)
+508
View File
@@ -0,0 +1,508 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
openapi: 3.0.1
info:
title: Magistrala Alarms API
description: |
HTTP API for managing alarms service.
Some useful links:
- [The Magistrala repository](https://github.com/absmach/magistrala)
contact:
email: info@absmach.eu
license:
name: Apache 2.0
url: https://github.com/absmach/magistrala/blob/main/LICENSE
version: 0.18.5
servers:
- url: http://localhost:8050
- url: https://localhost:8050
tags:
- name: alarms
description: Everything about your Alarms
externalDocs:
description: Find out more about alarms
url: https://magistrala.absmach.eu/docs/
paths:
/{domainID}/alarms:
get:
operationId: listAlarms
summary: List Alarms
description: |
Retrieves a list of alarms with optional filtering
tags:
- alarms
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/Offset'
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/Order'
- $ref: '#/components/parameters/Dir'
- $ref: '#/components/parameters/ChannelID'
- $ref: '#/components/parameters/ClientID'
- $ref: '#/components/parameters/Subtopic'
- $ref: '#/components/parameters/RuleID'
- $ref: '#/components/parameters/Status'
- $ref: '#/components/parameters/AssigneeID'
- $ref: '#/components/parameters/Severity'
- $ref: '#/components/parameters/UpdatedBy'
- $ref: '#/components/parameters/AssignedBy'
- $ref: '#/components/parameters/AcknowledgedBy'
- $ref: '#/components/parameters/ResolvedBy'
- $ref: '#/components/parameters/CreatedFrom'
- $ref: '#/components/parameters/CreatedTo'
security:
- bearerAuth: []
responses:
'200':
$ref: '#/components/responses/AlarmsPageRes'
'400':
description: Failed due to malformed query parameters
'401':
description: Missing or invalid access token
'422':
description: Database can't process request
'500':
$ref: '#/components/responses/ServiceError'
/{domainID}/alarms/{alarmID}:
get:
operationId: viewAlarm
summary: View Alarm
description: Retrieves an alarm by ID
tags:
- alarms
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/AlarmID'
security:
- bearerAuth: []
responses:
'200':
$ref: '#/components/responses/AlarmRes'
'400':
description: Missing or invalid alarm ID
'401':
description: Missing or invalid access token
'403':
description: Failed to perform authorization over the entity
'404':
description: Alarm does not exist
'422':
description: Database can't process request
'500':
$ref: '#/components/responses/ServiceError'
put:
operationId: updateAlarm
summary: Update Alarm
description: Updates an existing alarm
tags:
- alarms
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/AlarmID'
security:
- bearerAuth: []
requestBody:
$ref: '#/components/requestBodies/AlarmUpdateReq'
responses:
'200':
$ref: '#/components/responses/AlarmRes'
'400':
description: Failed due to malformed JSON
'401':
description: Missing or invalid access token
'403':
description: Failed to perform authorization over the entity
'404':
description: Alarm does not exist
'415':
description: Missing or invalid content type
'422':
description: Database can't process request
'500':
$ref: '#/components/responses/ServiceError'
delete:
operationId: deleteAlarm
summary: Delete Alarm
description: Deletes an alarm
tags:
- alarms
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/AlarmID'
security:
- bearerAuth: []
responses:
'204':
description: Alarm deleted successfully
'400':
description: Failed due to malformed alarm ID
'401':
description: Missing or invalid access token
'403':
description: Failed to perform authorization over the entity
'404':
description: Alarm does not exist
'422':
description: Database can't process request
'500':
$ref: '#/components/responses/ServiceError'
/health:
get:
summary: Retrieves service health check info
tags:
- health
security: []
responses:
'200':
$ref: '#/components/responses/HealthRes'
'500':
$ref: '#/components/responses/ServiceError'
components:
schemas:
Alarm:
type: object
properties:
id:
type: string
description: Unique alarm identifier
readOnly: true
rule_id:
type: string
description: Rule ID that triggered this alarm
domain_id:
type: string
description: Domain ID this alarm belongs to
channel_id:
type: string
description: Channel ID where the alarm was triggered
client_id:
type: string
description: Client ID that triggered the alarm
subtopic:
type: string
description: Subtopic associated with the alarm
status:
type: string
description: Alarm status
enum: [active, cleared]
measurement:
type: string
description: Measurement that triggered the alarm
value:
type: string
description: Value that triggered the alarm
unit:
type: string
description: Unit of measurement
threshold:
type: string
description: Threshold value that was exceeded
cause:
type: string
description: Cause or description of the alarm
severity:
type: integer
description: Severity level (0-100)
minimum: 0
maximum: 100
assignee_id:
type: string
description: ID of the user assigned to this alarm
created_at:
type: string
format: date-time
description: Creation timestamp
readOnly: true
updated_at:
type: string
format: date-time
description: Last update timestamp
readOnly: true
updated_by:
type: string
description: User who last updated the alarm
readOnly: true
assigned_at:
type: string
format: date-time
description: When the alarm was assigned
readOnly: true
assigned_by:
type: string
description: User who assigned the alarm
readOnly: true
acknowledged_at:
type: string
format: date-time
description: When the alarm was acknowledged
readOnly: true
acknowledged_by:
type: string
description: User who acknowledged the alarm
readOnly: true
resolved_at:
type: string
format: date-time
description: When the alarm was resolved
readOnly: true
resolved_by:
type: string
description: User who resolved the alarm
readOnly: true
metadata:
type: object
description: Custom metadata
additionalProperties: true
AlarmsPage:
type: object
properties:
offset:
type: integer
description: Number of items to skip during retrieval
minimum: 0
default: 0
limit:
type: integer
description: Size of the subset to retrieve
minimum: 1
maximum: 1000
default: 10
total:
type: integer
description: Total number of results
minimum: 0
alarms:
type: array
minItems: 0
items:
$ref: '#/components/schemas/Alarm'
required:
- alarms
- total
- offset
- limit
parameters:
DomainID:
name: domainID
description: Domain ID
in: path
required: true
schema:
type: string
AlarmID:
name: alarmID
description: Alarm ID
in: path
required: true
schema:
type: string
Offset:
name: offset
description: Number of items to skip
in: query
required: false
schema:
type: integer
default: 0
minimum: 0
Limit:
name: limit
description: Size of the subset to retrieve
in: query
required: false
schema:
type: integer
default: 10
minimum: 1
maximum: 1000
Order:
name: order
description: Order by field
in: query
required: false
schema:
type: string
enum: [created_at, updated_at]
default: created_at
Dir:
name: dir
description: Sort direction
in: query
required: false
schema:
type: string
enum: [asc, desc]
default: desc
ChannelID:
name: channel_id
description: Filter by channel ID
in: query
required: false
schema:
type: string
ClientID:
name: client_id
description: Filter by client ID
in: query
required: false
schema:
type: string
Subtopic:
name: subtopic
description: Filter by subtopic
in: query
required: false
schema:
type: string
RuleID:
name: rule_id
description: Filter by rule ID
in: query
required: false
schema:
type: string
Status:
name: status
description: Filter by alarm status
in: query
required: false
schema:
type: string
enum: [active, cleared, all]
default: all
AssigneeID:
name: assignee_id
description: Filter by assignee ID
in: query
required: false
schema:
type: string
Severity:
name: severity
description: Filter by severity level
in: query
required: false
schema:
type: integer
minimum: 0
maximum: 100
UpdatedBy:
name: updated_by
description: Filter by user who updated
in: query
required: false
schema:
type: string
AssignedBy:
name: assigned_by
description: Filter by user who assigned
in: query
required: false
schema:
type: string
AcknowledgedBy:
name: acknowledged_by
description: Filter by user who acknowledged
in: query
required: false
schema:
type: string
ResolvedBy:
name: resolved_by
description: Filter by user who resolved
in: query
required: false
schema:
type: string
CreatedFrom:
name: created_from
description: Filter alarms created after this time (RFC3339 format)
in: query
required: false
schema:
type: string
format: date-time
CreatedTo:
name: created_to
description: Filter alarms created before this time (RFC3339 format)
in: query
required: false
schema:
type: string
format: date-time
requestBodies:
AlarmUpdateReq:
description: JSON-formatted document describing the alarm update
required: true
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Alarm status
enum: [active, cleared]
assignee_id:
type: string
description: ID of the user assigned to this alarm
severity:
type: integer
description: Severity level (0-100)
minimum: 0
maximum: 100
metadata:
type: object
description: Custom metadata
additionalProperties: true
responses:
AlarmRes:
description: Alarm data retrieved
content:
application/json:
schema:
$ref: '#/components/schemas/Alarm'
links:
update:
operationId: updateAlarm
parameters:
alarmID: $response.body#/id
domainID: $response.body#/domain_id
delete:
operationId: deleteAlarm
parameters:
alarmID: $response.body#/id
domainID: $response.body#/domain_id
AlarmsPageRes:
description: Alarms page retrieved
content:
application/json:
schema:
$ref: '#/components/schemas/AlarmsPage'
ServiceError:
description: Unexpected server-side error occurred
HealthRes:
description: Service Health Check
content:
application/health+json:
schema:
$ref: "./schemas/health_info.yaml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
+851
View File
@@ -0,0 +1,851 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
openapi: 3.0.3
info:
title: Magistrala Auth Service
description: |
This is the Auth Server based on the OpenAPI 3.0 specification. It is the HTTP API for managing platform users. You can now help us improve the API whether it's by making changes to the definition itself or to the code.
Some useful links:
- [The Magistrala repository](https://github.com/absmach/magistrala)
contact:
email: info@absmach.eu
license:
name: Apache 2.0
url: https://github.com/absmach/magistrala/blob/main/LICENSE
version: 0.18.0
servers:
- url: http://localhost:9001
- url: https://localhost:9001
tags:
- name: Keys
description: Everything about your Keys.
externalDocs:
description: Find out more about keys
url: https://magistrala.absmach.eu/docs/
- name: PATs
description: Everything about your Personal Access Tokens.
externalDocs:
description: Find out more about Personal Access Tokens
url: https://magistrala.absmach.eu/docs/
- name: Health
description: Service health check endpoint.
externalDocs:
description: Find out more about health check
url: https://magistrala.absmach.eu/docs/
paths:
/keys:
post:
operationId: issueKey
tags:
- Keys
summary: Issue API key
description: |
Generates a new API key. Thew new API key will
be uniquely identified by its ID.
requestBody:
$ref: "#/components/requestBodies/KeyRequest"
responses:
"201":
description: Issued new key.
"400":
description: Failed due to malformed JSON.
"401":
description: Missing or invalid access token provided.
"409":
description: Failed due to using already existing ID.
"415":
description: Missing or invalid content type.
"500":
$ref: "#/components/responses/ServiceError"
/keys/{keyID}:
get:
operationId: getKey
summary: Gets API key details.
description: |
Gets API key details for the given key.
tags:
- Keys
parameters:
- $ref: "#/components/parameters/ApiKeyId"
responses:
"200":
$ref: "#/components/responses/KeyRes"
"400":
description: Failed due to malformed query parameters.
"401":
description: Missing or invalid access token provided.
"404":
description: A non-existent entity request.
"422":
description: Service can't process request.
"500":
$ref: "#/components/responses/ServiceError"
delete:
operationId: revokeKey
summary: Revoke API key
description: |
Revoke API key identified by the given ID.
tags:
- Keys
parameters:
- $ref: "#/components/parameters/ApiKeyId"
responses:
"204":
description: Key revoked.
"401":
description: Missing or invalid access token provided.
"404":
description: A non-existent entity request.
"422":
description: Service can't process request.
"500":
$ref: "#/components/responses/ServiceError"
/pats:
post:
operationId: createPAT
tags:
- PATs
summary: Create a new Personal Access Token
description: |
Creates a new Personal Access Token (PAT) for the authenticated user.
requestBody:
$ref: "#/components/requestBodies/CreatePATRequest"
responses:
"201":
$ref: "#/components/responses/PATRes"
"400":
description: Failed due to malformed JSON or validation errors.
"401":
description: Missing or invalid access token provided.
"415":
description: Missing or invalid content type.
"500":
$ref: "#/components/responses/ServiceError"
get:
operationId: listPATs
tags:
- PATs
summary: List all Personal Access Tokens
description: |
Lists all Personal Access Tokens (PATs) for the authenticated user.
parameters:
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Offset"
responses:
"200":
$ref: "#/components/responses/PATsPageRes"
"400":
description: Failed due to malformed query parameters.
"401":
description: Missing or invalid access token provided.
"500":
$ref: "#/components/responses/ServiceError"
delete:
operationId: clearAllPATs
tags:
- PATs
summary: Remove all Personal Access Tokens
description: |
Removes all Personal Access Tokens (PATs) for the authenticated user.
responses:
"200":
description: All PATs removed successfully.
"401":
description: Missing or invalid access token provided.
"500":
$ref: "#/components/responses/ServiceError"
/pats/{patID}:
get:
operationId: retrievePAT
tags:
- PATs
summary: Retrieve a Personal Access Token
description: |
Retrieves details of a specific Personal Access Token (PAT).
parameters:
- $ref: "#/components/parameters/PatID"
responses:
"200":
$ref: "#/components/responses/PATRes"
"400":
description: Failed due to malformed query parameters.
"401":
description: Missing or invalid access token provided.
"404":
description: PAT not found.
"500":
$ref: "#/components/responses/ServiceError"
delete:
operationId: deletePAT
tags:
- PATs
summary: Delete a Personal Access Token
description: |
Deletes a specific Personal Access Token (PAT).
parameters:
- $ref: "#/components/parameters/PatID"
responses:
"204":
description: PAT deleted successfully.
"401":
description: Missing or invalid access token provided.
"404":
description: PAT not found.
"500":
$ref: "#/components/responses/ServiceError"
/pats/{patID}/name:
patch:
operationId: updatePATName
tags:
- PATs
summary: Update Personal Access Token name
description: |
Updates the name of a specific Personal Access Token (PAT).
parameters:
- $ref: "#/components/parameters/PatID"
requestBody:
$ref: "#/components/requestBodies/UpdatePATNameRequest"
responses:
"202":
$ref: "#/components/responses/PATRes"
"400":
description: Failed due to malformed JSON or validation errors.
"401":
description: Missing or invalid access token provided.
"404":
description: PAT not found.
"415":
description: Missing or invalid content type.
"500":
$ref: "#/components/responses/ServiceError"
/pats/{patID}/description:
patch:
operationId: updatePATDescription
tags:
- PATs
summary: Update Personal Access Token description
description: |
Updates the description of a specific Personal Access Token (PAT).
parameters:
- $ref: "#/components/parameters/PatID"
requestBody:
$ref: "#/components/requestBodies/UpdatePATDescriptionRequest"
responses:
"202":
$ref: "#/components/responses/PATRes"
"400":
description: Failed due to malformed JSON or validation errors.
"401":
description: Missing or invalid access token provided.
"404":
description: PAT not found.
"415":
description: Missing or invalid content type.
"500":
$ref: "#/components/responses/ServiceError"
/pats/{patID}/secret/reset:
patch:
operationId: resetPATSecret
tags:
- PATs
summary: Reset Personal Access Token secret
description: |
Resets the secret of a specific Personal Access Token (PAT).
parameters:
- $ref: "#/components/parameters/PatID"
requestBody:
$ref: "#/components/requestBodies/ResetPATSecretRequest"
responses:
"200":
$ref: "#/components/responses/PATRes"
"400":
description: Failed due to malformed JSON or validation errors.
"401":
description: Missing or invalid access token provided.
"404":
description: PAT not found.
"415":
description: Missing or invalid content type.
"500":
$ref: "#/components/responses/ServiceError"
/pats/{patID}/secret/revoke:
patch:
operationId: revokePATSecret
tags:
- PATs
summary: Revoke Personal Access Token secret
description: |
Revokes the secret of a specific Personal Access Token (PAT).
parameters:
- $ref: "#/components/parameters/PatID"
responses:
"204":
description: PAT secret revoked successfully.
"401":
description: Missing or invalid access token provided.
"404":
description: PAT not found.
"500":
$ref: "#/components/responses/ServiceError"
/pats/{patID}/scope:
get:
operationId: listScopes
tags:
- PATs
summary: List scopes for a Personal Access Token
description: |
Lists all scopes for a specific Personal Access Token (PAT).
parameters:
- $ref: "#/components/parameters/PatID"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Offset"
responses:
"200":
$ref: "#/components/responses/ScopesPageRes"
"400":
description: Failed due to malformed query parameters.
"401":
description: Missing or invalid access token provided.
"404":
description: PAT not found.
"500":
$ref: "#/components/responses/ServiceError"
delete:
operationId: clearAllScopes
tags:
- PATs
summary: Remove all scopes from a Personal Access Token
description: |
Removes all scopes from a specific Personal Access Token (PAT).
parameters:
- $ref: "#/components/parameters/PatID"
responses:
"200":
description: All scopes removed successfully.
"401":
description: Missing or invalid access token provided.
"404":
description: PAT not found.
"500":
$ref: "#/components/responses/ServiceError"
/pats/{patID}/scope/add:
patch:
operationId: addScope
tags:
- PATs
summary: Add scope to a Personal Access Token
description: |
Adds a scope to a specific Personal Access Token (PAT).
parameters:
- $ref: "#/components/parameters/PatID"
requestBody:
$ref: "#/components/requestBodies/AddScopeRequest"
responses:
"200":
description: Scope added successfully.
"400":
description: Failed due to malformed JSON or validation errors.
"401":
description: Missing or invalid access token provided.
"404":
description: PAT not found.
"415":
description: Missing or invalid content type.
"422":
description: Database cannot process the request.
"500":
$ref: "#/components/responses/ServiceError"
/pats/{patID}/scope/remove:
patch:
operationId: removeScope
tags:
- PATs
summary: Remove scope from a Personal Access Token
description: |
Removes a scope from a specific Personal Access Token (PAT).
parameters:
- $ref: "#/components/parameters/PatID"
requestBody:
$ref: "#/components/requestBodies/RemoveScopeRequest"
responses:
"200":
description: Scope removed successfully.
"400":
description: Failed due to malformed JSON or validation errors.
"401":
description: Missing or invalid access token provided.
"404":
description: PAT not found.
"415":
description: Missing or invalid content type.
"500":
$ref: "#/components/responses/ServiceError"
/health:
get:
summary: Retrieves service health check info.
tags:
- Health
security: []
responses:
"200":
$ref: "#/components/responses/HealthRes"
"500":
$ref: "#/components/responses/ServiceError"
components:
schemas:
PAT:
type: object
properties:
id:
type: string
format: uuid
example: "c5747f2f-2a7c-4fe1-b41a-51a5ae290945"
description: Personal Access Token unique identifier
user_id:
type: string
format: uuid
example: "9118de62-c680-46b7-ad0a-21748a52833a"
description: User ID of the PAT owner
name:
type: string
example: "My PAT"
description: Name of the Personal Access Token
description:
type: string
example: "Token for automation"
description: Description of the Personal Access Token
secret:
type: string
example: "pat_1234567890abcdef"
description: Secret value of the Personal Access Token
issued_at:
type: string
format: date-time
example: "2019-11-26T13:31:52Z"
description: Time when the PAT was issued
expires_at:
type: string
format: date-time
example: "2020-11-26T13:31:52Z"
description: Time when the PAT expires
updated_at:
type: string
format: date-time
example: "2019-11-26T13:31:52Z"
description: Time when the PAT was last updated
last_used_at:
type: string
format: date-time
example: "2019-11-26T13:31:52Z"
description: Time when the PAT was last used
revoked:
type: boolean
example: false
description: Whether the PAT is revoked
revoked_at:
type: string
format: date-time
example: "2019-11-26T13:31:52Z"
description: Time when the PAT was revoked
PATsPage:
type: object
properties:
total:
type: integer
example: 10
description: Total number of PATs
offset:
type: integer
example: 0
description: Number of items to skip during retrieval
limit:
type: integer
example: 10
description: Size of the subset to retrieve
pats:
type: array
items:
$ref: "#/components/schemas/PAT"
description: List of Personal Access Tokens
Scope:
type: object
properties:
optional_domain_id:
type: string
format: uuid
example: "bb7edb32-2eac-4aad-aebe-ed96fe073879"
description: Optional domain ID for the scope
entity_type:
type: string
enum:
[groups, channels, clients, domains, users, dashboards, messages]
example: "groups"
description: Type of entity the scope applies to
entity_id:
type: string
example: "*"
description: ID of the entity the scope applies to. '*' means all entities of the specified type.
operation:
type: string
enum:
[
create,
read,
list,
update,
delete,
share,
unshare,
publish,
subscribe,
]
example: "read"
description: Operation allowed by this scope
ScopesPage:
type: object
properties:
total:
type: integer
example: 10
description: Total number of scopes
offset:
type: integer
example: 0
description: Number of items to skip during retrieval
limit:
type: integer
example: 10
description: Size of the subset to retrieve
scopes:
type: array
items:
$ref: "#/components/schemas/Scope"
description: List of scopes
Key:
type: object
properties:
id:
type: string
format: uuid
example: "c5747f2f-2a7c-4fe1-b41a-51a5ae290945"
description: API key unique identifier
issuer_id:
type: string
format: uuid
example: "9118de62-c680-46b7-ad0a-21748a52833a"
description: In ID of the entity that issued the token.
type:
type: integer
example: 0
description: API key type. Keys of different type are processed differently.
subject:
type: string
format: string
example: "test@example.com"
description: User's email or service identifier of API key subject.
issued_at:
type: string
format: date-time
example: "2019-11-26 13:31:52"
description: Time when the key is generated.
expires_at:
type: string
format: date-time
example: "2019-11-26 13:31:52"
description: Time when the Key expires. If this field is missing,
that means that Key is valid indefinitely.
parameters:
PatID:
name: patID
description: Personal Access Token ID.
in: path
schema:
type: string
format: uuid
required: true
DomainID:
name: domainID
description: Unique domain identifier.
in: path
schema:
type: string
format: uuid
required: true
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
Status:
name: status
description: Domain status.
in: query
schema:
type: string
default: enabled
required: false
example: enabled
DomainName:
name: name
description: Domain's name.
in: query
schema:
type: string
required: false
example: "domainName"
Permission:
name: permission
description: permission.
in: query
schema:
type: string
required: false
example: "edit"
ApiKeyId:
name: keyID
description: API Key ID.
in: path
schema:
type: string
format: uuid
required: true
Limit:
name: limit
description: Size of the subset to retrieve.
in: query
schema:
type: integer
default: 10
maximum: 100
minimum: 1
required: false
Offset:
name: offset
description: Number of items to skip during retrieval.
in: query
schema:
type: integer
default: 0
minimum: 0
required: false
Metadata:
name: metadata
description: Metadata filter. Filtering is performed matching the parameter with metadata on top level. Parameter is json.
in: query
required: false
schema:
type: object
additionalProperties: {}
Type:
name: type
description: The type of the API Key.
in: query
schema:
type: integer
default: 0
minimum: 0
required: false
Subject:
name: subject
description: The subject of an API Key
in: query
schema:
type: string
required: false
requestBodies:
CreatePATRequest:
description: JSON-formatted document describing PAT creation request.
required: true
content:
application/json:
schema:
type: object
required:
- name
- duration
properties:
name:
type: string
minLength: 1
example: "My PAT"
description: Name of the Personal Access Token
description:
type: string
example: "Token for automation"
description: Description of the Personal Access Token
duration:
type: string
pattern: "^[0-9]+(ns|us|µs|ms|s|m|h|d|w|y)$"
example: "30d"
description: Duration for which the PAT is valid. Format is a duration string (e.g. "30d", "24h", "1y").
UpdatePATNameRequest:
description: JSON-formatted document describing PAT name update request.
required: true
content:
application/json:
schema:
type: object
required:
- name
properties:
name:
type: string
example: "New PAT Name"
description: New name for the Personal Access Token
UpdatePATDescriptionRequest:
description: JSON-formatted document describing PAT description update request.
required: true
content:
application/json:
schema:
type: object
required:
- description
properties:
description:
type: string
example: "New PAT Description"
description: New description for the Personal Access Token
ResetPATSecretRequest:
description: JSON-formatted document describing PAT secret reset request.
required: true
content:
application/json:
schema:
type: object
required:
- duration
properties:
duration:
type: string
pattern: "^[0-9]+(ns|us|µs|ms|s|m|h|d|w|y)$"
example: "30d"
description: Duration for which the new PAT secret is valid. Format is a duration string (e.g. "30d", "24h", "1y").
AddScopeRequest:
description: JSON-formatted document describing add scope request.
required: true
content:
application/json:
schema:
type: object
required:
- scopes
properties:
scopes:
type: array
items:
$ref: "#/components/schemas/Scope"
description: List of scopes to add
RemoveScopeRequest:
description: JSON-formatted document describing remove scope request.
required: true
content:
application/json:
schema:
type: object
required:
- scopes_id
properties:
scopes_id:
type: array
items:
type: string
format: uuid
description: List of scope IDs to remove
KeyRequest:
description: JSON-formatted document describing key request.
required: true
content:
application/json:
schema:
type: object
properties:
type:
type: integer
example: 0
description: API key type. Keys of different type are processed differently.
duration:
type: number
format: integer
example: 23456
description: Number of seconds issued token is valid for.
responses:
PATRes:
description: Personal Access Token data.
content:
application/json:
schema:
$ref: "#/components/schemas/PAT"
PATsPageRes:
description: Page of Personal Access Tokens.
content:
application/json:
schema:
$ref: "#/components/schemas/PATsPage"
ScopesPageRes:
description: Page of scopes.
content:
application/json:
schema:
$ref: "#/components/schemas/ScopesPage"
ServiceError:
description: Unexpected server-side error occurred.
KeyRes:
description: Data retrieved.
content:
application/json:
schema:
$ref: "#/components/schemas/Key"
links:
revoke:
operationId: revokeKey
parameters:
keyID: $response.body#/id
HealthRes:
description: Service Health Check.
content:
application/health+json:
schema:
$ref: "./schemas/health_info.yaml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
security:
- bearerAuth: []
File diff suppressed because it is too large Load Diff
+722
View File
@@ -0,0 +1,722 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
openapi: 3.0.3
info:
title: Certs Service API
description: |
Certificate management service for issuing, renewing, revoking, and managing X.509 certificates.
This service provides PKI functionality including certificate lifecycle management, OCSP responder,
and CRL generation.
version: 1.0.0
contact:
name: Abstract Machines
license:
name: Apache-2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: http://localhost:9019
description: Development server
tags:
- name: certificates
description: Certificate lifecycle management operations
- name: pki
description: PKI infrastructure operations (OCSP, CRL, CA)
- name: health
description: Service health and monitoring
security:
- BearerAuth: []
paths:
/{domainID}/certs/issue/{entityID}:
post:
tags:
- certificates
summary: Issue a new certificate
description: Issues a new X.509 certificate for the specified entity with custom subject options
operationId: issueCert
security:
- BearerAuth: []
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/EntityID'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/IssueCertRequest'
responses:
'201':
description: Certificate successfully issued
content:
application/json:
schema:
$ref: '#/components/schemas/CertificateResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalServerError'
/{domainID}/certs/{id}/renew:
patch:
tags:
- certificates
summary: Renew a certificate
description: Renews an existing certificate with extended TTL and new serial number
operationId: renewCert
security:
- BearerAuth: []
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/CertID'
responses:
'200':
description: Certificate successfully renewed
content:
application/json:
schema:
$ref: '#/components/schemas/RenewCertResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalServerError'
/{domainID}/certs/{id}/revoke:
patch:
tags:
- certificates
summary: Revoke a certificate
description: Revokes a certificate by its serial number
operationId: revokeCert
security:
- BearerAuth: []
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/CertID'
responses:
'204':
description: Certificate successfully revoked
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'422':
$ref: '#/components/responses/UnprocessableEntity'
'500':
$ref: '#/components/responses/InternalServerError'
/{domainID}/certs/{entityID}/delete:
delete:
tags:
- certificates
summary: Delete certificates for an entity
description: Deletes all certificates associated with the specified entity
operationId: deleteCert
security:
- BearerAuth: []
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/EntityID'
responses:
'204':
description: Certificates successfully deleted
'401':
$ref: '#/components/responses/Unauthorized'
'422':
$ref: '#/components/responses/UnprocessableEntity'
'500':
$ref: '#/components/responses/InternalServerError'
/{domainID}/certs:
get:
tags:
- certificates
summary: List certificates
description: Retrieves a paginated list of certificates with optional filtering by entity ID
operationId: listCerts
security:
- BearerAuth: []
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/Offset'
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/EntityIDFilter'
responses:
'200':
description: Certificates successfully retrieved
content:
application/json:
schema:
$ref: '#/components/schemas/CertificateListResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalServerError'
/{domainID}/certs/{id}:
get:
tags:
- certificates
summary: View certificate details
description: Retrieves detailed information about a specific certificate by serial number
operationId: viewCert
security:
- BearerAuth: []
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/CertID'
responses:
'200':
description: Certificate details successfully retrieved
content:
application/json:
schema:
$ref: '#/components/schemas/ViewCertResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalServerError'
/{domainID}/certs/csrs/{entityID}:
post:
tags:
- certificates
summary: Issue certificate from CSR
description: Issues a certificate from a Certificate Signing Request (CSR)
operationId: issueFromCSR
security:
- BearerAuth: []
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/EntityID'
- $ref: '#/components/parameters/TTL'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/IssueFromCSRRequest'
responses:
'200':
description: Certificate successfully issued from CSR
content:
application/json:
schema:
$ref: '#/components/schemas/IssueFromCSRResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalServerError'
/certs/csrs/{entityID}:
post:
tags:
- certificates
summary: Issue certificate from CSR (Internal)
description: Issues a certificate from a CSR using internal agent authentication
operationId: issueFromCSRInternal
security:
- AgentAuth: []
parameters:
- $ref: '#/components/parameters/EntityID'
- $ref: '#/components/parameters/TTL'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/IssueFromCSRRequest'
responses:
'200':
description: Certificate successfully issued from CSR
content:
application/json:
schema:
$ref: '#/components/schemas/IssueFromCSRResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalServerError'
/certs/ocsp:
post:
tags:
- pki
summary: OCSP responder
description: |
Online Certificate Status Protocol (OCSP) responder endpoint.
Accepts both binary OCSP requests and JSON format requests.
operationId: ocsp
security: []
parameters:
- name: force_status
in: query
description: Force a specific OCSP status for testing
required: false
schema:
type: string
requestBody:
required: true
content:
application/ocsp-request:
schema:
type: string
format: binary
description: DER-encoded OCSP request
application/json:
schema:
$ref: '#/components/schemas/OCSPRequest'
responses:
'200':
description: OCSP response
content:
application/ocsp-response:
schema:
type: string
format: binary
description: DER-encoded OCSP response
'400':
$ref: '#/components/responses/BadRequest'
'500':
$ref: '#/components/responses/InternalServerError'
/certs/crl:
get:
tags:
- pki
summary: Generate Certificate Revocation List
description: Generates and returns the current Certificate Revocation List (CRL)
operationId: generateCRL
security: []
responses:
'200':
description: CRL successfully generated
content:
application/json:
schema:
$ref: '#/components/schemas/CRLResponse'
'500':
$ref: '#/components/responses/InternalServerError'
/certs/view-ca:
get:
tags:
- pki
summary: View CA certificate
description: Retrieves the CA certificate chain (root and intermediate certificates)
operationId: viewCA
security: []
responses:
'200':
description: CA certificate successfully retrieved
content:
application/json:
schema:
$ref: '#/components/schemas/ViewCertResponse'
'500':
$ref: '#/components/responses/InternalServerError'
/certs/download-ca:
get:
tags:
- pki
summary: Download CA certificate
description: Downloads the CA certificate as a ZIP file
operationId: downloadCA
security: []
responses:
'200':
description: CA certificate ZIP file
content:
application/zip:
schema:
type: string
format: binary
'500':
$ref: '#/components/responses/InternalServerError'
/health:
get:
summary: Retrieves service health check info.
tags:
- health
security: []
responses:
'200':
$ref: '#/components/responses/HealthRes'
'500':
$ref: '#/components/responses/InternalServerError'
/metrics:
get:
tags:
- health
summary: Prometheus metrics
description: Returns Prometheus metrics for monitoring
operationId: metrics
security: []
responses:
'200':
description: Metrics successfully retrieved
content:
text/plain:
schema:
type: string
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: User authentication token
AgentAuth:
type: http
scheme: bearer
description: Agent authentication token for internal operations
parameters:
DomainID:
name: domainID
in: path
required: true
description: Domain identifier
schema:
type: string
EntityID:
name: entityID
in: path
required: true
description: Entity identifier for the certificate
schema:
type: string
CertID:
name: id
in: path
required: true
description: Certificate serial number
schema:
type: string
Offset:
name: offset
in: query
description: Number of items to skip
schema:
type: integer
minimum: 0
default: 0
Limit:
name: limit
in: query
description: Maximum number of items to return
schema:
type: integer
minimum: 1
maximum: 100
default: 10
EntityIDFilter:
name: entity_id
in: query
description: Filter certificates by entity ID
schema:
type: string
TTL:
name: ttl
in: query
description: Time to live for the certificate (e.g., "8760h", "365d")
schema:
type: string
schemas:
IssueCertRequest:
type: object
required:
- options
properties:
ttl:
type: string
description: Time to live for the certificate (e.g., "8760h" for 1 year)
example: "8760h"
ip_addresses:
type: array
items:
type: string
description: IP addresses to include in the certificate
example: ["192.168.1.1", "10.0.0.1"]
options:
$ref: '#/components/schemas/SubjectOptions'
SubjectOptions:
type: object
required:
- common_name
properties:
common_name:
type: string
description: Common Name (CN) for the certificate subject
example: "example.com"
organization:
type: array
items:
type: string
description: Organization (O)
example: ["Abstract Machines"]
organizational_unit:
type: array
items:
type: string
description: Organizational Unit (OU)
example: ["Engineering"]
country:
type: array
items:
type: string
description: Country (C)
example: ["US"]
province:
type: array
items:
type: string
description: Province or State (ST)
example: ["California"]
locality:
type: array
items:
type: string
description: Locality or City (L)
example: ["San Francisco"]
street_address:
type: array
items:
type: string
description: Street Address
example: ["123 Main St"]
postal_code:
type: array
items:
type: string
description: Postal Code
example: ["94105"]
dns_names:
type: array
items:
type: string
description: DNS names for Subject Alternative Names
example: ["example.com", "www.example.com"]
ip_addresses:
type: array
items:
type: string
description: IP addresses for Subject Alternative Names
example: ["192.168.1.1"]
CertificateResponse:
type: object
properties:
serial_number:
type: string
description: Unique serial number of the certificate
example: "4a:3f:5e:2c:1b:8d:9e:7f"
certificate:
type: string
description: PEM-encoded certificate
example: "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
key:
type: string
description: PEM-encoded private key
example: "-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
revoked:
type: boolean
description: Whether the certificate is revoked
example: false
expiry_time:
type: string
format: date-time
description: Certificate expiration time
example: "2026-11-05T12:00:00Z"
entity_id:
type: string
description: Entity identifier associated with the certificate
example: "entity-123"
RenewCertResponse:
type: object
properties:
certificate:
$ref: '#/components/schemas/ViewCertResponse'
ViewCertResponse:
type: object
properties:
serial_number:
type: string
description: Certificate serial number
example: "4a:3f:5e:2c:1b:8d:9e:7f"
certificate:
type: string
description: PEM-encoded certificate
example: "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
key:
type: string
description: PEM-encoded private key
example: "-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
revoked:
type: boolean
description: Revocation status
example: false
expiry_time:
type: string
format: date-time
description: Expiration timestamp
example: "2026-11-05T12:00:00Z"
entity_id:
type: string
description: Associated entity identifier
example: "entity-123"
CertificateListResponse:
type: object
properties:
total:
type: integer
format: uint64
description: Total number of certificates
example: 100
offset:
type: integer
format: uint64
description: Current offset
example: 0
limit:
type: integer
format: uint64
description: Current limit
example: 10
certificates:
type: array
items:
$ref: '#/components/schemas/ViewCertResponse'
IssueFromCSRRequest:
type: object
required:
- csr
properties:
csr:
type: string
format: byte
description: PEM-encoded Certificate Signing Request
example: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURSBSRVFVRVNULS0tLS0K..."
IssueFromCSRResponse:
type: object
properties:
serial_number:
type: string
description: Serial number of the issued certificate
example: "4a:3f:5e:2c:1b:8d:9e:7f"
certificate:
type: string
description: PEM-encoded certificate
example: "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
revoked:
type: boolean
description: Revocation status
example: false
expiry_time:
type: string
format: date-time
description: Expiration timestamp
example: "2026-11-05T12:00:00Z"
entity_id:
type: string
description: Associated entity identifier
example: "entity-123"
OCSPRequest:
type: object
properties:
serial_number:
type: string
description: Certificate serial number to check
example: "4a:3f:5e:2c:1b:8d:9e:7f"
certificate:
type: string
description: PEM-encoded certificate to check
example: "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
status:
type: string
description: Force a specific status (for testing)
enum: [good, revoked, unknown]
CRLResponse:
type: object
properties:
crl:
type: string
format: byte
description: DER-encoded Certificate Revocation List
Error:
type: object
properties:
error:
type: string
description: Error message
example: "invalid request"
responses:
BadRequest:
description: Bad request - invalid parameters or malformed request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Unauthorized:
description: Unauthorized - invalid or missing authentication token
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
NotFound:
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
UnprocessableEntity:
description: Unprocessable entity - request cannot be processed
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
InternalServerError:
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
HealthRes:
description: Service Health Check.
content:
application/health+json:
schema:
$ref: './schemas/health_info.yaml'
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+193
View File
@@ -0,0 +1,193 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
openapi: 3.0.1
info:
title: Magistrala http adapter
description: |
HTTP API for sending messages through communication channels.
Some useful links:
- [The Magistrala repository](https://github.com/absmach/magistrala)
contact:
email: info@absmach.eu
license:
name: Apache 2.0
url: https://github.com/absmach/magistrala/blob/main/LICENSE
version: 0.18.0
servers:
- url: http://localhost:8008
- url: https://localhost:8008
tags:
- name: messages
description: Everything about your Messages
externalDocs:
description: Find out more about messages
url: https://magistrala.absmach.eu/docs/
paths:
/m/{domainPrefix}/c/{channelPrefix}:
post:
summary: Sends message to the communication channel
description: |
Sends message to the communication channel. Messages can be sent as
JSON formatted SenML or as blob.
tags:
- messages
parameters:
- $ref: "#/components/parameters/domainPrefix"
- $ref: "#/components/parameters/channelPrefix"
requestBody:
$ref: "#/components/requestBodies/MessageReq"
responses:
"202":
description: Message is accepted for processing.
"400":
description: Message discarded due to its malformed content.
"401":
description: Missing or invalid access token provided.
"403":
description: Access denied to the requested resource.
"404":
description: Message discarded due to invalid channel id.
"415":
description: Message discarded due to invalid or missing content type.
"500":
$ref: "#/components/responses/ServiceError"
/health:
get:
summary: Retrieves service health check info.
tags:
- health
security: []
responses:
"200":
$ref: "#/components/responses/HealthRes"
"500":
$ref: "#/components/responses/ServiceError"
components:
schemas:
SenMLRecord:
type: object
properties:
bn:
type: string
description: Base Name
bt:
type: number
format: double
description: Base Time
bu:
type: number
format: double
description: Base Unit
bv:
type: number
format: double
description: Base Value
bs:
type: number
format: double
description: Base Sum
bver:
type: number
format: double
description: Version
n:
type: string
description: Name
u:
type: string
description: Unit
v:
type: number
format: double
description: Value
vs:
type: string
description: String Value
vb:
type: boolean
description: Boolean Value
vd:
type: string
description: Data Value
s:
type: number
format: double
description: Value Sum
t:
type: number
format: double
description: Time
ut:
type: number
format: double
description: Update Time
SenMLArray:
type: array
items:
$ref: "#/components/schemas/SenMLRecord"
parameters:
domainPrefix:
name: domainPrefix
description: ID or route of the domain associated with the channel and client.
in: path
schema:
type: string
example: mydomain
required: true
channelPrefix:
name: channelPrefix
description: ID or route of the channel connected to the client.
in: path
schema:
type: string
example: mychannel
required: true
requestBodies:
MessageReq:
description: |
Message to be distributed. Since the platform expects messages to be
properly formatted SenML in order to be post-processed, clients are
obliged to specify Content-Type header for each published message.
Note that all messages that aren't SenML will be accepted and published,
but no post-processing will be applied.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/SenMLArray"
responses:
ServiceError:
description: Unexpected server-side error occurred.
HealthRes:
description: Service Health Check.
content:
application/health+json:
schema:
$ref: "./schemas/health_info.yaml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: uuid
description: |
* Client access: "Authorization: Client <client_key>"
basicAuth:
type: http
scheme: basic
description: |
* Clients access: "Authorization: Basic <base64-encoded_credentials>"
security:
- bearerAuth: []
- basicAuth: []
+292
View File
@@ -0,0 +1,292 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
openapi: 3.0.1
info:
title: Magistrala Notifiers service
description: |
HTTP API for Notifiers service.
Some useful links:
- [The Magistrala repository](https://github.com/absmach/magistrala)
contact:
email: info@absmach.eu
license:
name: Apache 2.0
url: https://github.com/absmach/magistrala/blob/main/LICENSE
version: 0.18.5
servers:
- url: http://localhost:9014
- url: https://localhost:9014
- url: http://localhost:9015
- url: https://localhost:9015
tags:
- name: notifiers
description: Everything about your Notifiers
externalDocs:
description: Find out more about notifiers
url: https://magistrala.absmach.eu/docs/
paths:
/subscriptions:
post:
operationId: createSubscription
summary: Create subscription
description: Creates a new subscription give a topic and contact.
tags:
- notifiers
requestBody:
$ref: "#/components/requestBodies/Create"
responses:
"201":
$ref: "#/components/responses/Create"
"400":
description: Failed due to malformed JSON.
"401":
description: Missing or invalid access token provided.
"403":
description: Failed to perform authorization over the entity.
"409":
description: Failed due to using an existing topic and contact.
"415":
description: Missing or invalid content type.
"422":
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
get:
operationId: listSubscriptions
summary: List subscriptions
description: List subscriptions given list parameters.
tags:
- notifiers
parameters:
- $ref: "#/components/parameters/Topic"
- $ref: "#/components/parameters/Contact"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Limit"
responses:
"200":
$ref: "#/components/responses/Page"
"400":
description: Failed due to malformed query parameters.
"401":
description: Missing or invalid access token provided.
"403":
description: Failed to perform authorization over the entity.
"404":
description: A non-existent entity request.
"422":
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
/subscriptions/{id}:
get:
operationId: viewSubscription
summary: Get subscription with the provided id
description: Retrieves a subscription with the provided id.
tags:
- notifiers
parameters:
- $ref: "#/components/parameters/Id"
responses:
"200":
$ref: "#/components/responses/View"
"400":
description: Failed due to malformed ID.
"401":
description: Missing or invalid access token provided.
"403":
description: Failed to perform authorization over the entity.
"404":
description: A non-existent entity request.
"422":
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
delete:
operationId: removeSubscription
summary: Delete subscription with the provided id
description: Removes a subscription with the provided id.
tags:
- notifiers
parameters:
- $ref: "#/components/parameters/Id"
responses:
"204":
description: Subscription removed
"401":
description: Missing or invalid access token provided.
"403":
description: Failed to perform authorization over the entity.
"404":
description: A non-existent entity request.
"422":
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
/health:
get:
summary: Retrieves service health check info.
tags:
- health
security: []
responses:
"200":
$ref: "#/components/responses/HealthRes"
"500":
$ref: "#/components/responses/ServiceError"
components:
schemas:
Subscription:
type: object
properties:
id:
type: string
format: ulid
example: 01EWDVKBQSG80B6PQRS9PAAY35
description: ULID id of the subscription.
owner_id:
type: string
format: uuid
example: 18167738-f7a8-4e96-a123-58c3cd14de3a
description: An id of the owner who created subscription.
topic:
type: string
example: topic/subtopic
description: Topic to which the user subscribes.
contact:
type: string
example: user@example.com
description: The contact of the user to which the notification will be sent.
CreateSubscription:
type: object
properties:
topic:
type: string
example: topic/subtopic
description: Topic to which the user subscribes.
contact:
type: string
example: user@example.com
description: The contact of the user to which the notification will be sent.
Page:
type: object
properties:
subscriptions:
type: array
minItems: 0
uniqueItems: true
items:
$ref: "#/components/schemas/Subscription"
total:
type: integer
description: Total number of items.
offset:
type: integer
description: Number of items to skip during retrieval.
limit:
type: integer
description: Maximum number of items to return in one page.
parameters:
Id:
name: id
description: Unique identifier.
in: path
schema:
type: string
format: ulid
required: true
Limit:
name: limit
description: Size of the subset to retrieve.
in: query
schema:
type: integer
default: 10
maximum: 100
minimum: 1
required: false
Offset:
name: offset
description: Number of items to skip during retrieval.
in: query
schema:
type: integer
default: 0
minimum: 0
required: false
Topic:
name: topic
description: Topic name.
in: query
schema:
type: string
required: false
Contact:
name: contact
description: Subscription contact.
in: query
schema:
type: string
required: false
requestBodies:
Create:
description: JSON-formatted document describing the new subscription to be created
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateSubscription"
responses:
Create:
description: Created a new subscription.
headers:
Location:
content:
text/plain:
schema:
type: string
description: Created subscription relative URL
example: /subscriptions/{id}
View:
description: View subscription.
content:
application/json:
schema:
$ref: "#/components/schemas/Subscription"
links:
delete:
operationId: removeSubscription
parameters:
id: $response.body#/id
Page:
description: Data retrieved.
content:
application/json:
schema:
$ref: "#/components/schemas/Page"
ServiceError:
description: Unexpected server-side error occurred.
HealthRes:
description: Service Health Check.
content:
application/health+json:
schema:
$ref: "./schemas/health_info.yaml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
security:
- bearerAuth: []
+314
View File
@@ -0,0 +1,314 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
openapi: 3.0.1
info:
title: Magistrala reader service
description: |
HTTP API for reading messages.
Some useful links:
- [The Magistrala repository](https://github.com/absmach/magistrala)
contact:
email: info@absmach.eu
license:
name: Apache 2.0
url: https://github.com/absmach/magistrala/blob/main/LICENSE
version: 0.18.5
servers:
- url: http://localhost:9003
- url: https://localhost:9003
- url: http://localhost:9005
- url: https://localhost:9005
- url: http://localhost:9009
- url: https://localhost:9009
- url: http://localhost:9011
- url: https://localhost:9011
tags:
- name: readers
description: Everything about your Readers
externalDocs:
description: Find out more about readers
url: https://magistrala.absmach.eu/docs/
paths:
/{domainID}/channels/{chanId}/messages:
get:
operationId: getMessages
summary: Retrieves messages sent to single channel
description: |
Retrieves a list of messages sent to specific channel. Due to
performance concerns, data is retrieved in subsets. The API readers must
ensure that the entire dataset is consumed either by making subsequent
requests, or by increasing the subset size of the initial request.
tags:
- readers
parameters:
- $ref: "#/components/parameters/DomainID"
- $ref: "#/components/parameters/ChanId"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Publisher"
- $ref: "#/components/parameters/Name"
- $ref: "#/components/parameters/Value"
- $ref: "#/components/parameters/BoolValue"
- $ref: "#/components/parameters/StringValue"
- $ref: "#/components/parameters/DataValue"
- $ref: "#/components/parameters/From"
- $ref: "#/components/parameters/To"
- $ref: "#/components/parameters/Aggregation"
- $ref: "#/components/parameters/Interval"
responses:
"200":
$ref: "#/components/responses/MessagesPageRes"
"400":
description: Failed due to malformed query parameters.
"401":
description: Missing or invalid access token provided.
"403":
description: Failed to perform authorization over the entity.
"500":
$ref: "#/components/responses/ServiceError"
/health:
get:
operationId: health
summary: Retrieves service health check info.
tags:
- health
security: []
responses:
"200":
$ref: "#/components/responses/HealthRes"
"500":
$ref: "#/components/responses/ServiceError"
components:
schemas:
MessagesPage:
type: object
properties:
total:
type: number
description: Total number of items that are present on the system.
offset:
type: number
description: Number of items that were skipped during retrieval.
limit:
type: number
description: Size of the subset that was retrieved.
messages:
type: array
minItems: 0
uniqueItems: true
items:
type: object
properties:
channel:
type: integer
description: Unique channel id.
publisher:
type: integer
description: Unique publisher id.
protocol:
type: string
description: Protocol name.
name:
type: string
description: Measured parameter name.
unit:
type: string
description: Value unit.
value:
type: number
description: Measured value in number.
stringValue:
type: string
description: Measured value in string format.
boolValue:
type: boolean
description: Measured value in boolean format.
dataValue:
type: string
description: Measured value in binary format.
valueSum:
type: number
description: Sum value.
time:
type: number
description: Time of measurement.
updateTime:
type: number
description: Time of updating measurement.
parameters:
DomainID:
name: domainID
description: Unique domain identifier.
in: path
schema:
type: string
format: uuid
required: true
ChanId:
name: chanId
description: Unique channel identifier.
in: path
schema:
type: string
format: uuid
required: true
Limit:
name: limit
description: Size of the subset to retrieve.
in: query
schema:
type: integer
default: 10
maximum: 100
minimum: 1
required: false
Offset:
name: offset
description: Number of items to skip during retrieval.
in: query
schema:
type: integer
default: 0
minimum: 0
required: false
Publisher:
name: Publisher
description: Unique thing identifier.
in: query
schema:
type: string
format: uuid
required: false
Name:
name: name
description: SenML message name.
in: query
schema:
type: string
required: false
Value:
name: v
description: SenML message value.
in: query
schema:
type: string
required: false
BoolValue:
name: vb
description: SenML message bool value.
in: query
schema:
type: boolean
required: false
StringValue:
name: vs
description: SenML message string value.
in: query
schema:
type: string
required: false
DataValue:
name: vd
description: SenML message data value.
in: query
schema:
type: string
required: false
Comparator:
name: comparator
description: Value comparison operator.
in: query
schema:
type: string
default: eq
enum:
- eq
- lt
- le
- gt
- ge
required: false
From:
name: from
description: SenML message time in nanoseconds (integer part represents seconds).
in: query
schema:
type: number
example: 1709218556069
required: false
To:
name: to
description: SenML message time in nanoseconds (integer part represents seconds).
in: query
schema:
type: number
example: 1709218757503
required: false
Aggregation:
name: aggregation
description: Aggregation function.
in: query
schema:
type: string
enum:
- MAX
- AVG
- MIN
- SUM
- COUNT
- max
- min
- sum
- avg
- count
example: MAX
required: false
Interval:
name: interval
description: Aggregation interval.
in: query
schema:
type: string
example: 10s
required: false
responses:
MessagesPageRes:
description: Data retrieved.
content:
application/json:
schema:
$ref: "#/components/schemas/MessagesPage"
ServiceError:
description: Unexpected server-side error occurred.
HealthRes:
description: Service Health Check.
content:
application/health+json:
schema:
$ref: "./schemas/health_info.yaml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
thingAuth:
type: http
scheme: bearer
bearerFormat: uuid
description: |
* Things access: "Authorization: Thing <thing_key>"
security:
- bearerAuth: []
- thingAuth: []
+553
View File
@@ -0,0 +1,553 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
openapi: 3.0.1
info:
title: Magistrala Reports Service API
description: |
HTTP API for managing reports service.
version: 0.18.5
servers:
- url: http://localhost:9017
tags:
- name: reports
description: Operations related to report configurations and generation
paths:
/{domainID}/reports:
post:
operationId: generateReport
summary: Generate a report
description: Generates a report based on the provided configuration or an existing config. The action determines the response format.
tags:
- reports
parameters:
- $ref: '#/components/parameters/DomainID'
security:
- bearerAuth: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateReportRequest'
responses:
'200':
description: Report generated successfully (content varies by action)
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateReportResponse'
application/octet-stream:
schema:
type: string
format: binary
'400':
description: Invalid request parameters
'401':
description: Missing or invalid access token
'500':
$ref: '#/components/responses/ServiceError'
/{domainID}/reports/configs:
post:
operationId: addReportConfig
summary: Create a report configuration
description: Creates a new report configuration.
tags:
- reports
parameters:
- $ref: '#/components/parameters/DomainID'
security:
- bearerAuth: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AddReportConfigRequest'
responses:
'201':
description: Report configuration created
headers:
Location:
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/ReportConfig'
'400':
description: Invalid request body
'401':
description: Missing or invalid access token
'500':
$ref: '#/components/responses/ServiceError'
get:
operationId: listReportConfigs
summary: List report configurations
description: Retrieves a paginated list of report configurations.
tags:
- reports
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/Offset'
- $ref: '#/components/parameters/Limit'
security:
- bearerAuth: []
responses:
'200':
description: List of report configurations
content:
application/json:
schema:
$ref: '#/components/schemas/ListReportsConfigResponse'
'400':
description: Invalid query parameters
'401':
description: Missing or invalid access token
'500':
$ref: '#/components/responses/ServiceError'
/{domainID}/reports/configs/{reportID}:
get:
operationId: viewReportConfig
summary: View a report configuration
description: Retrieves details of a specific report configuration.
tags:
- reports
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/ReportID'
security:
- bearerAuth: []
responses:
'200':
description: Report configuration details
content:
application/json:
schema:
$ref: '#/components/schemas/ReportConfig'
'404':
description: Report configuration not found
'401':
description: Missing or invalid access token
'500':
$ref: '#/components/responses/ServiceError'
patch:
operationId: updateReportConfig
summary: Update a report configuration
description: Updates specified fields of a report configuration.
tags:
- reports
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/ReportID'
security:
- bearerAuth: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateReportConfigRequest'
responses:
'200':
description: Report configuration updated
content:
application/json:
schema:
$ref: '#/components/schemas/ReportConfig'
'400':
description: Invalid request body
'401':
description: Missing or invalid access token
'404':
description: Report configuration not found
'500':
$ref: '#/components/responses/ServiceError'
delete:
operationId: deleteReportConfig
summary: Delete a report configuration
description: Permanently deletes a report configuration.
tags:
- reports
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/ReportID'
security:
- bearerAuth: []
responses:
'204':
description: Report configuration deleted
'401':
description: Missing or invalid access token
'404':
description: Report configuration not found
'500':
$ref: '#/components/responses/ServiceError'
/{domainID}/reports/configs/{reportID}/schedule:
patch:
operationId: updateReportSchedule
summary: Update report schedule
description: Updates the schedule of a report configuration.
tags:
- reports
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/ReportID'
security:
- bearerAuth: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Schedule'
responses:
'200':
description: Schedule updated
content:
application/json:
schema:
$ref: '#/components/schemas/ReportConfig'
'400':
description: Invalid schedule
'401':
description: Missing or invalid access token
'404':
description: Report configuration not found
'500':
$ref: '#/components/responses/ServiceError'
/{domainID}/reports/configs/{reportID}/enable:
post:
operationId: enableReportConfig
summary: Enable a report configuration
description: Enables a report configuration to generate scheduled reports.
tags:
- reports
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/ReportID'
security:
- bearerAuth: []
responses:
'200':
description: Report configuration enabled
content:
application/json:
schema:
$ref: '#/components/schemas/ReportConfig'
'401':
description: Missing or invalid access token
'404':
description: Report configuration not found
'500':
$ref: '#/components/responses/ServiceError'
/{domainID}/reports/configs/{reportID}/disable:
post:
operationId: disableReportConfig
summary: Disable a report configuration
description: Disables a report configuration, stopping scheduled reports.
tags:
- reports
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/ReportID'
security:
- bearerAuth: []
responses:
'200':
description: Report configuration disabled
content:
application/json:
schema:
$ref: '#/components/schemas/ReportConfig'
'401':
description: Missing or invalid access token
'404':
description: Report configuration not found
'500':
$ref: '#/components/responses/ServiceError'
/health:
get:
summary: Service health check
tags:
- health
responses:
'200':
$ref: '#/components/responses/HealthRes'
components:
schemas:
ReportConfig:
type: object
properties:
id:
type: string
readOnly: true
name:
type: string
description:
type: string
domain_id:
type: string
readOnly: true
schedule:
$ref: '#/components/schemas/Schedule'
config:
$ref: '#/components/schemas/MetricConfig'
email:
$ref: '#/components/schemas/EmailSetting'
metrics:
type: array
items:
$ref: '#/components/schemas/ReqMetric'
status:
$ref: '#/components/schemas/Status'
created_at:
type: string
format: date-time
readOnly: true
created_by:
type: string
readOnly: true
updated_at:
type: string
format: date-time
readOnly: true
updated_by:
type: string
readOnly: true
required:
- name
- metrics
- config
Schedule:
type: object
properties:
recurring:
type: string
enum: [None, Daily, Weekly, Monthly]
recurring_period:
type: integer
minimum: 1
start_time:
type: string
format: date-time
next_run:
type: string
format: date-time
readOnly: true
MetricConfig:
type: object
properties:
title:
type: string
maxLength: 100
format:
type: string
enum: [pdf, csv, html]
aggregation:
$ref: '#/components/schemas/AggConfig'
AggConfig:
type: object
properties:
window:
type: string
function:
type: string
enum: [sum, average, max, min]
EmailSetting:
type: object
properties:
recipients:
type: array
items:
type: string
format: email
subject:
type: string
body_template:
type: string
required:
- recipients
- subject
ReqMetric:
type: object
properties:
name:
type: string
type:
type: string
enum: [gauge, counter, histogram]
parameters:
type: object
required:
- name
- type
Status:
type: string
enum: [enabled, disabled]
GenerateReportRequest:
type: object
properties:
action:
type: string
enum: [view, download, email]
config_id:
type: string
name:
type: string
description:
type: string
schedule:
$ref: '#/components/schemas/Schedule'
config:
$ref: '#/components/schemas/MetricConfig'
email:
$ref: '#/components/schemas/EmailSetting'
metrics:
type: array
items:
$ref: '#/components/schemas/ReqMetric'
required:
- action
GenerateReportResponse:
type: object
properties:
total:
type: integer
from:
type: string
format: date-time
to:
type: string
format: date-time
aggregation:
$ref: '#/components/schemas/AggConfig'
reports:
type: array
items:
$ref: '#/components/schemas/Report'
Report:
type: object
properties:
timestamp:
type: string
format: date-time
value:
type: number
metric_name:
type: string
AddReportConfigRequest:
type: object
properties:
name:
type: string
description:
type: string
schedule:
$ref: '#/components/schemas/Schedule'
config:
$ref: '#/components/schemas/MetricConfig'
email:
$ref: '#/components/schemas/EmailSetting'
metrics:
type: array
items:
$ref: '#/components/schemas/ReqMetric'
status:
$ref: '#/components/schemas/Status'
required:
- name
- metrics
- config
UpdateReportConfigRequest:
type: object
properties:
name:
type: string
description:
type: string
schedule:
$ref: '#/components/schemas/Schedule'
config:
$ref: '#/components/schemas/MetricConfig'
email:
$ref: '#/components/schemas/EmailSetting'
metrics:
type: array
items:
$ref: '#/components/schemas/ReqMetric'
status:
$ref: '#/components/schemas/Status'
ListReportsConfigResponse:
type: object
properties:
total:
type: integer
offset:
type: integer
limit:
type: integer
report_configs:
type: array
items:
$ref: '#/components/schemas/ReportConfig'
parameters:
DomainID:
name: domainID
in: path
required: true
schema:
type: string
ReportID:
name: reportID
in: path
required: true
schema:
type: string
Offset:
name: offset
in: query
schema:
type: integer
default: 0
minimum: 0
Limit:
name: limit
in: query
schema:
type: integer
default: 10
minimum: 1
maximum: 100
responses:
ServiceError:
description: Unexpected server error
HealthRes:
description: Service Health Check.
content:
application/health+json:
schema:
$ref: './schemas/health_info.yaml'
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
+586
View File
@@ -0,0 +1,586 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
openapi: 3.0.1
info:
title: Magistrala Rules Engine API
description: |
HTTP API for managing rules engine service.
Some useful links:
- [The Magistrala repository](https://github.com/absmach/magistrala)
contact:
email: info@absmach.eu
license:
name: Apache 2.0
url: https://github.com/absmach/magistrala/blob/main/LICENSE
version: 0.18.5
servers:
- url: http://localhost:9008
- url: http://localhost:9008
tags:
- name: rules engine
description: Everything about your Rules Engine
externalDocs:
description: Find out more about rules engine
url: https://magistrala.absmach.eu/docs/
paths:
/{domainID}/rules:
post:
operationId: createRule
summary: Create Rule
description: |
Creates a new rule for message processing
tags:
- rules
parameters:
- $ref: '#/components/parameters/DomainID'
security:
- bearerAuth: []
requestBody:
$ref: '#/components/requestBodies/RuleCreateReq'
responses:
'201':
$ref: '#/components/responses/RuleCreateRes'
'400':
description: Failed due to malformed JSON
'401':
description: Missing or invalid access token
'415':
description: Missing or invalid content type
"500":
$ref: "#/components/responses/ServiceError"
"503":
description: Failed to receive response from the clients service.
get:
operationId: getRules
summary: List Rules
description: |
Retrieves a list of rules with optional filtering
tags:
- rules
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/Offset'
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/InputChannel'
- $ref: '#/components/parameters/OutputChannel'
- $ref: '#/components/parameters/Status'
security:
- bearerAuth: []
responses:
'200':
$ref: '#/components/responses/RuleListRes'
'400':
description: Failed due to malformed query parameters
'401':
description: Missing or invalid access token
"422":
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
/{domainID}/rules/{ruleID}:
get:
operationId: getRule
summary: View Rule
description: Retrieves a rule by ID
tags:
- rules
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/RuleID'
security:
- bearerAuth: []
responses:
'200':
$ref: '#/components/responses/RuleRes'
"400":
description: Missing or invalid rule
"403":
description: Failed to perform authorization over the entity
'401':
description: Missing or invalid access token
'404':
description: Rule does not exist
"422":
description: Database can't process request
"500":
$ref: "#/components/responses/ServiceError"
put:
operationId: updateRule
summary: Update Rule
description: Updates an existing rule
tags:
- rules
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/RuleID'
security:
- bearerAuth: []
requestBody:
$ref: '#/components/requestBodies/RuleUpdateReq'
responses:
'200':
$ref: '#/components/responses/RuleRes'
'400':
description: Failed due to malformed JSON
'401':
description: Missing or invalid access token
'404':
description: Rule does not exist
"415":
description: Missing or invalid content type.
"422":
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
delete:
operationId: removeRule
summary: Delete Rule
description: Deletes a rule
tags:
- rules
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/RuleID'
security:
- bearerAuth: []
responses:
'204':
description: Rule deleted successfully
"400":
description: Failed due to malformed rule ID
'401':
description: Missing or invalid access token
"403":
description: Failed to perform authorization over the entity
"422":
description: Database can't process request
"500":
$ref: "#/components/responses/ServiceError"
/{domainID}/rules/{ruleID}/enable:
put:
operationId: enableRule
summary: Enable Rule
description: Enables a rule for processing
tags:
- rules
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/RuleID'
security:
- bearerAuth: []
responses:
'200':
description: Rule enabled successfully
"400":
description: Failed due to malformed JSON
'401':
description: Missing or invalid access token
"403":
description: Failed to perform authorization over the entity
'404':
description: Rule does not exist
"422":
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
/{domainID}/rules/{ruleID}/disable:
put:
operationId: disableRule
summary: Disable Rule
description: Disables a rule from processing
tags:
- Rules
parameters:
- $ref: '#/components/parameters/DomainID'
- $ref: '#/components/parameters/RuleID'
security:
- bearerAuth: []
responses:
'200':
description: Rule disabled successfully
"400":
description: Failed due to malformed JSON
'401':
description: Missing or invalid access token
"403":
description: Failed to perform authorization over the entity
'404':
description: Rule does not exist
"422":
description: Database can't process request
"500":
$ref: "#/components/responses/ServiceError"
/health:
get:
summary: Retrieves service health check info.
tags:
- health
security: []
responses:
"200":
$ref: "#/components/responses/HealthRes"
"500":
$ref: "#/components/responses/ServiceError"
components:
schemas:
RulesListRes:
type: object
properties:
total:
type: integer
description: Total number of results
minimum: 0
offset:
type: integer
description: Number of items to skip during retrieval
minimum: 0
default: 0
limit:
type: integer
description: Size of the subset to retrieve
maximum: 100
default: 10
rules:
type: array
minItems: 0
uniqueItems: true
items:
$ref: '#/components/schemas/Rule'
required:
- rules
Rule:
type: object
properties:
id:
type: string
description: Unique rule identifier
name:
type: string
description: Rule name
domain:
type: string
description: Domain ID this rule belongs to
metadata:
type: object
description: Custom metadata
additionalProperties:
type: string
input_channel:
type: string
description: Input channel for receiving messages
input_topic:
type: string
description: Input topic for receiving messages
logic:
type: object
description: Rule processing logic script
properties:
script:
type: string
description: Script content
output_channel:
type: string
description: Output channel for processed messages
output_topic:
type: string
description: Output topic for processed messages
schedule:
type: object
description: Rule execution schedule
properties:
start_datetime:
type: string
format: date-time
description: When the schedule becomes active
time:
type: string
format: date-time
description: Specific time for the rule to run
recurring:
type: string
description: Schedule recurrence pattern
enum: [None, Daily, Weekly, Monthly]
recurring_period:
type: integer
minimum: 1
description: Controls how many intervals to skip between executions (1 = every interval, 2 = every second interval, etc.)
status:
type: string
description: Rule status
enum: [enabled, disabled]
created_at:
type: string
format: date-time
description: Creation timestamp
readOnly: true
created_by:
type: string
description: User who created the rule
updated_at:
type: string
format: date-time
description: Last update timestamp
readOnly: true
updated_by:
type: string
description: User who last updated the rule
required:
- name
- domain
- input_channel
- input_topic
- logic
- status
parameters:
DomainID:
name: domainID
description: Domain ID
in: path
required: true
schema:
type: string
RuleID:
name: ruleID
description: Rule ID
in: path
required: true
schema:
type: string
Offset:
name: offset
description: Number of items to skip
in: query
required: false
schema:
type: integer
default: 0
minimum: 0
Limit:
name: limit
description: Size of the subset
in: query
required: false
schema:
type: integer
default: 10
minimum: 1
InputChannel:
name: input_channel
description: Filter by input channel
in: query
required: false
schema:
type: string
OutputChannel:
name: output_channel
description: Filter by output channel
in: query
required: false
schema:
type: string
Status:
name: status
description: Filter by rule status
in: query
required: false
schema:
type: string
enum: [enabled, disabled]
default: enabled
requestBodies:
RuleCreateReq:
description: JSON-formatted document describing the new rule
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: Rule name
domain:
type: string
description: Domain ID this rule belongs to
metadata:
type: object
description: Custom metadata
additionalProperties:
type: string
input_channel:
type: string
description: Input channel for receiving messages
input_topic:
type: string
description: Input topic for receiving messages
logic:
type: object
description: Rule processing logic script
properties:
script:
type: string
description: Script content
output_channel:
type: string
description: Output channel for processed messages
output_topic:
type: string
description: Output topic for processed messages
schedule:
type: object
description: Rule execution schedule
properties:
start_datetime:
type: string
format: date-time
description: When the schedule becomes active
time:
type: string
format: date-time
description: Specific time for the rule to run
recurring:
type: string
description: Schedule recurrence pattern
enum: [None, Daily, Weekly, Monthly]
recurring_period:
type: integer
minimum: 1
description: Controls how many intervals to skip between executions
status:
type: string
description: Rule status
enum: [enabled, disabled]
required:
- name
- domain
- input_channel
- input_topic
- logic
- schedule
RuleUpdateReq:
description: JSON-formatted document describing the rule update
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: Rule name
metadata:
type: object
description: Custom metadata
additionalProperties:
type: string
input_channel:
type: string
description: Input channel for receiving messages
input_topic:
type: string
description: Input topic for receiving messages
logic:
type: object
description: Rule processing logic script
properties:
script:
type: string
description: Script content
output_channel:
type: string
description: Output channel for processed messages
output_topic:
type: string
description: Output topic for processed messages
schedule:
type: object
description: Rule execution schedule
properties:
start_datetime:
type: string
format: date-time
description: When the schedule becomes active
time:
type: string
format: date-time
description: Specific time for the rule to run
recurring:
type: string
description: Schedule recurrence pattern
enum: [None, Daily, Weekly, Monthly]
recurring_period:
type: integer
minimum: 1
description: Controls how many intervals to skip between executions
status:
type: string
description: Rule status
enum: [enabled, disabled]
responses:
RuleCreateRes:
description: Rule registered
headers:
Location:
content:
text/plain:
schema:
type: string
description: Created rule's relative URL (i.e. /rules/{ruleID})
RuleListRes:
description: Data retrieved
content:
application/json:
schema:
$ref: '#/components/schemas/RulesListRes'
RuleRes:
description: Data retrieved
content:
application/json:
schema:
$ref: '#/components/schemas/Rule'
links:
update:
operationId: updateRule
parameters:
ruleID: $response.body#/id
enable:
operationId: enableRule
parameters:
ruleID: $response.body#/id
disable:
operationId: disableRule
parameters:
ruleID: $response.body#/id
delete:
operationId: removeRule
parameters:
ruleID: $response.body#/id
ServiceError:
description: Unexpected server-side error occurred
HealthRes:
description: Service Health Check
content:
application/health+json:
schema:
$ref: "./schemas/health_info.yaml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
+30
View File
@@ -0,0 +1,30 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
type: object
properties:
status:
type: string
description: Service status.
enum:
- pass
version:
type: string
description: Service version.
example: v0.18.0
commit:
type: string
description: Service commit hash.
example: 73362210dd2e04e389eaddb802cab3fe03976593
description:
type: string
description: Service description.
example: <service_name> service
build_time:
type: string
description: Service build time.
example: 2024-02-01_12:18:15
instance_id:
type: string
description: Service instance ID.
example: 8edbf8af-7db7-4218-bb4f-a8a929ff5266
+395
View File
@@ -0,0 +1,395 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
components:
schemas:
NewRole:
type: object
properties:
id:
type: string
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
description: Role unique identifier.
name:
type: string
description: Role's name.
example: "roleName"
entity_id:
type: string
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
description: Entity unique identifier.
created_by:
type: string
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
description: Role creator unique identifier.
created_at:
type: string
format: date-time
example: "2019-11-26 13:31:52"
description: Time when the channel was created.
updated_by:
type: string
format: uuid
example: ""
description: Role updater unique identifier.
updated_at:
type: string
format: date-time
example: ""
description: Time when the channel was created.
Role:
type: object
properties:
id:
type: string
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
description: Role unique identifier.
name:
type: string
description: Role's name.
example: "roleName"
entity_id:
type: string
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
description: Entity unique identifier.
created_by:
type: string
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
description: Role creator unique identifier.
created_at:
type: string
format: date-time
example: "2019-11-26 13:31:52"
description: Time when the channel was created.
updated_by:
type: string
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
description: Role updater unique identifier.
updated_at:
type: string
format: date-time
example: "2019-11-26 13:31:52"
description: Time when the channel was created.
CreateRoleObj:
type: object
properties:
name:
type: string
description: Role's name.
example: "roleName"
optional_actions:
type: array
description: List of optional actions.
items:
type: string
example:
[
"read",
"update",
]
optional_members:
type: array
minItems: 0
description: List of optional members.
items:
type: string
example:
[
"5dc1ce4b-7cc9-4f12-98a6-9d74cc4980bb",
"c01ed106-e52d-4aa4-bed3-39f360177cfa",
]
UpdateRoleObj:
type: object
properties:
name:
type: string
description: Role's name.
RolesPage:
type: object
properties:
roles:
type: array
items:
$ref: '#/components/schemas/Role'
description: List of roles.
total:
type: integer
description: Total number of roles.
example: 1
offset:
type: integer
description: Number of items to skip during retrieval.
limit:
type: integer
example: 10
description: Maximum number of items to return in one page.
EntityMembersPage:
type: object
properties:
groups:
type: array
minItems: 0
uniqueItems: true
items:
$ref: "#/components/schemas/EntityMembersObj"
total:
type: integer
example: 1
description: Total number of items.
offset:
type: integer
description: Number of items to skip during retrieval.
limit:
type: integer
example: 10
description: Maximum number of items to return in one page.
required:
- groups
- total
- offset
RoleActionsObj:
type: object
properties:
actions:
type: array
description: List of actions to be added to a role.
items:
type: string
example:
[
"read",
"update",
]
RoleMembersObj:
type: object
properties:
members:
type: array
description: List of members to be added to a role.
items:
type: string
example:
[
"5dc1ce4b-7cc9-4f12-98a6-9d74cc4980bb",
"c01ed106-e52d-4aa4-bed3-39f360177cfa",
]
EntityMembersObj:
type: object
properties:
members:
type: array
description: List of members with assigned roles and actions.
items:
type: object
properties:
id:
type: string
format: uuid
description: Unique identifier of the member.
roles:
type: array
description: List of roles assigned to the member.
items:
type: object
properties:
id:
type: string
format: uuid
description: Unique identifier of the role.
name:
type: string
description: Name of the role.
actions:
type: array
description: List of actions the member can perform.
items:
type: string
access_type:
type: string
description: Type of access granted.
enum: [read, write, admin] # Adjust based on your actual access types.
example:
members:
- id: "5dc1ce4b-7cc9-4f12-98a6-9d74cc4980bb"
roles:
- id: "a1b2c3d4-e5f6-7890-1234-56789abcdef0"
name: "Admin"
actions: ["create", "update", "delete"]
access_type: "admin"
- id: "c01ed106-e52d-4aa4-bed3-39f360177cfa"
roles:
- id: "b2c3d4e5-f678-9012-3456-789abcdef012"
name: "Editor"
actions: ["read", "update"]
access_type: "write"
AvailableActionsObj:
type: object
properties:
available_actions:
type: array
description: List of all available actions.
items:
type: string
example:
[
"read",
"update",
]
parameters:
RoleName:
name: roleName
description: Role's name.
in: path
schema:
type: string
required: true
example: "roleName"
RoleID:
name: roleID
description: Role ID.
in: path
schema:
type: string
required: true
example: "roleID"
RoleIDQuery:
name: role_id
description: Filter by role ID.
in: query
schema:
type: string
format: uuid
required: false
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
RoleNameQuery:
name: role_name
description: Filter by role name.
in: query
schema:
type: string
required: false
example: admin
ActionsQuery:
name: actions
description: Filter by actions. Multiple actions can be specified separated by comma.
in: query
schema:
type: string
required: false
example: "action1,action2"
requestBodies:
CreateRoleReq:
description: JSON- formatted object decsribing a new role to be created.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateRoleObj'
UpdateRoleReq:
description: JSON- formatted object decsribing a role to be updated.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateRoleObj'
AddRoleActionsReq:
description: JSON- formatted object decsribing an action to be added to a role.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RoleActionsObj'
AddRoleMembersReq:
description: JSON- formatted object decsribing a member to be added to a role.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RoleMembersObj'
responses:
CreateRoleRes:
description: Role created successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/NewRole'
ListRolesRes:
description: Role retrieved successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/RolesPage'
GetRoleRes:
description: Role retrieved successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/Role'
AddRoleActionsRes:
description: Action added to role successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/RoleActionsObj'
ListRoleActionsRes:
description: Role actions retrieved successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/RoleActionsObj'
AddRoleMembersRes:
description: Member added to role successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/RoleMembersObj'
ListRoleMembersRes:
description: Role members retrieved successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/RoleMembersObj'
ListAvailableActionsRes:
description: Available actions retrieved successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/AvailableActionsObj'
ListEntityMembersRes:
description: Entity members retrieved successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/EntityMembersObj'
File diff suppressed because it is too large Load Diff
-5303
View File
File diff suppressed because it is too large Load Diff
-129
View File
@@ -1,129 +0,0 @@
// Copyright (c) Mainflux
// SPDX-License-Identifier: Apache-2.0
syntax = "proto3";
package mainflux;
import "google/protobuf/empty.proto";
service ThingsService {
rpc CanAccessByKey(AccessByKeyReq) returns (ThingID) {}
rpc IsChannelOwner(ChannelOwnerReq) returns (google.protobuf.Empty) {}
rpc CanAccessByID(AccessByIDReq) returns (google.protobuf.Empty) {}
rpc Identify(Token) returns (ThingID) {}
}
service AuthService {
rpc Issue(IssueReq) returns (Token) {}
rpc Identify(Token) returns (UserIdentity) {}
rpc Authorize(AuthorizeReq) returns (AuthorizeRes) {}
rpc AddPolicy(AddPolicyReq) returns (AddPolicyRes) {}
rpc DeletePolicy(DeletePolicyReq) returns (DeletePolicyRes) {}
rpc ListPolicies(ListPoliciesReq) returns (ListPoliciesRes) {}
rpc Assign(Assignment) returns(google.protobuf.Empty) {}
rpc Members(MembersReq) returns (MembersRes) {}
}
message AccessByKeyReq {
string token = 1;
string chanID = 2;
}
message ChannelOwnerReq {
string owner = 1;
string chanID = 2;
}
message ThingID {
string value = 1;
}
message ChannelID {
string value = 1;
}
message AccessByIDReq {
string thingID = 1;
string chanID = 2;
}
// If a token is not carrying any information itself, the type
// field can be used to determine how to validate the token.
// Also, different tokens can be encoded in different ways.
message Token {
string value = 1;
}
message UserIdentity {
string id = 1;
string email = 2;
}
message IssueReq {
string id = 1;
string email = 2;
uint32 type = 3;
}
message AuthorizeReq {
string sub = 1;
string obj = 2;
string act = 3;
}
message AuthorizeRes {
bool authorized = 1;
}
message AddPolicyReq {
string sub = 1;
string obj = 2;
string act = 3;
}
message AddPolicyRes {
bool authorized = 1;
}
message DeletePolicyReq {
string sub = 1;
string obj = 2;
string act = 3;
}
message DeletePolicyRes {
bool deleted = 1;
}
message ListPoliciesReq {
string sub = 1;
string obj = 2;
string act = 3;
}
message ListPoliciesRes {
repeated string policies = 1;
}
message Assignment {
string token = 1;
string groupID = 2;
string memberID = 3;
}
message MembersReq {
string token = 1;
string groupID = 2;
uint64 offset = 3;
uint64 limit = 4;
string type = 5;
}
message MembersRes {
uint64 total = 1;
uint64 offset = 2;
uint64 limit = 3;
string type = 4;
repeated string members = 5;
}
+394 -58
View File
@@ -1,32 +1,35 @@
# Auth - Authentication and Authorization service
Auth service provides authentication features as an API for managing authentication keys as well as administering groups of entities - `things` and `users`.
Auth service provides authentication features as an API for managing authentication keys as well as administering groups of entities - `clients` and `users`.
## Authentication
# Authentication
User service is using Auth service gRPC API to obtain login token or password reset token. Authentication key consists of the following fields:
- ID - key ID
- Type - one of the three types described below
- IssuerID - an ID of the Mainflux User who issued the key
- Subject - user email
- IssuerID - an ID of the Magistrala User who issued the key
- Subject - user ID for which the key is issued
- IssuedAt - the timestamp when the key is issued
- ExpiresAt - the timestamp after which the key is invalid
There are *three types of authentication keys*:
There are four types of authentication keys:
- User key - keys issued to the user upon login request
- API key - keys issued upon the user request
- Access key - keys issued to the user upon login request
- Refresh key - keys used to generate new access keys
- Recovery key - password recovery key
- API key - keys issued upon the user request
- Invitation key - keys used to invite new users
Authentication keys are represented and distributed by the corresponding [JWT](jwt.io).
User keys are issued when user logs in. Each user request (other than `registration` and `login`) contains user key that is used to authenticate the user.
API keys are similar to the User keys. The main difference is that API keys have configurable expiration time. If no time is set, the key will never expire. For that reason, API keys are _the only key type that can be revoked_. This also means that, despite being used as a JWT, it requires a query to the database to validate the API key. The user with API key can perform all the same actions as the user with login key (can act on behalf of the user for Thing, Channel, or user profile management), *except issuing new API keys*.
API keys are similar to the User keys. The main difference is that API keys have configurable expiration time. If no time is set, the key will never expire. For that reason, API keys are _the only key type that can be revoked_. This also means that, despite being used as a JWT, it requires a query to the database to validate the API key. The user with API key can perform all the same actions as the user with login key (can act on behalf of the user for Client, Channel, or user profile management), _except issuing new API keys_.
Recovery key is the password recovery key. It's short-lived token used for password recovery process.
For in-depth explanation of the aforementioned scenarios, as well as thorough
understanding of Mainflux, please check out the [official documentation][doc].
For in-depth explanation of the aforementioned scenarios, as well as thorough understanding of Magistrala, please check out the [official documentation][doc].
The following actions are supported:
@@ -35,63 +38,84 @@ The following actions are supported:
- obtain (API keys only)
- revoke (API keys only)
# Groups
User and Things service are using Auth gRPC API to get the list of ids that are part of a group. Groups can be organized as tree structure.
Group consists of the following fields:
## Domains
- ID - ULID id uniquely representing group
- Name - name of the group, name of the group is unique at the same level of tree hierarchy for a given tree.
- ParentID - id of the parent group
- OwnerID - id of the user that created a group
- Description - free form text, up to 1024 characters
- Metadata - Arbitrary, object-encoded group's data
- Path - tree path consisting of group ids
- CreatedAt - timestamp at which the group is created
- UpdatedAt - timestamp at which the group is updated
Domains are used to group users and clients. Each domain has a unique `route` that is associated with the domain. Domains are used to group users and their entities.
Domain consists of the following fields:
- ID - UUID uniquely representing domain
- Name - name of the domain
- Tags - array of tags
- Metadata - Arbitrary, object-encoded domain's data
- Route - unique route of the domain used in messaging
- CreatedAt - timestamp at which the domain is created
- UpdatedAt - timestamp at which the domain is updated
- UpdatedBy - user that updated the domain
- CreatedBy - user that created the domain
- Status - domain status
## Configuration
The service is configured using the environment variables presented in the
following table. Note that any unset variables will be replaced with their
default values.
The service is configured using the environment variables presented in the following table. Note that any unset variables will be replaced with their default values.
| Variable | Description | Default |
|-------------------------------|--------------------------------------------------------------------------|----------------|
| MF_AUTH_LOG_LEVEL | Service level (debug, info, warn, error) | error |
| MF_AUTH_DB_HOST | Database host address | localhost |
| MF_AUTH_DB_PORT | Database host port | 5432 |
| MF_AUTH_DB_USER | Database user | mainflux |
| MF_AUTH_DB_PASSWORD | Database password | mainflux |
| MF_AUTH_DB | Name of the database used by the service | auth |
| MF_AUTH_DB_SSL_MODE | Database connection SSL mode (disable, require, verify-ca, verify-full) | disable |
| MF_AUTH_DB_SSL_CERT | Path to the PEM encoded certificate file | |
| MF_AUTH_DB_SSL_KEY | Path to the PEM encoded key file | |
| MF_AUTH_DB_SSL_ROOT_CERT | Path to the PEM encoded root certificate file | |
| MF_AUTH_HTTP_PORT | Auth service HTTP port | 8180 |
| MF_AUTH_GRPC_PORT | Auth service gRPC port | 8181 |
| MF_AUTH_SERVER_CERT | Path to server certificate in pem format | |
| MF_AUTH_SERVER_KEY | Path to server key in pem format | |
| MF_AUTH_SECRET | String used for signing tokens | auth |
| MF_AUTH_LOGIN_TOKEN_DURATION | The login token expiration period | 10h |
| MF_JAEGER_URL | Jaeger server URL | localhost:6831 |
| MF_KETO_READ_REMOTE_HOST | Keto Read Host | mainflux-keto |
| MF_KETO_WRITE_REMOTE_HOST | Keto Write Host | mainflux-keto |
| MF_KETO_READ_REMOTE_PORT | Keto Read Port | 4466 |
| MF_KETO_WRITE_REMOTE_PORT | Keto Write Port | 4467 |
| Variable | Description | Default |
| :------------------------------- | :----------------------------------------------------------------------------------- | :----------------------------- |
| `MG_AUTH_LOG_LEVEL` | Log level for the Auth service (debug, info, warn, error) | info |
| `MG_AUTH_DB_HOST` | Database host address | localhost |
| `MG_AUTH_DB_PORT` | Database host port | 5432 |
| `MG_AUTH_DB_USER` | Database user | magistrala |
| `MG_AUTH_DB_PASSWORD` | Database password | magistrala |
| `MG_AUTH_DB_NAME` | Name of the database used by the service | auth |
| `MG_AUTH_DB_SSL_MODE` | Database connection SSL mode (disable, require, verify-ca, verify-full) | disable |
| `MG_AUTH_DB_SSL_CERT` | Path to the PEM encoded certificate file | "" |
| `MG_AUTH_DB_SSL_KEY` | Path to the PEM encoded key file | "" |
| `MG_AUTH_DB_SSL_ROOT_CERT` | Path to the PEM encoded root certificate file | "" |
| `MG_AUTH_HTTP_HOST` | Auth service HTTP host | "" |
| `MG_AUTH_HTTP_PORT` | Auth service HTTP port | 8189 |
| `MG_AUTH_HTTP_SERVER_CERT` | Path to the PEM encoded HTTP server certificate file | "" |
| `MG_AUTH_HTTP_SERVER_KEY` | Path to the PEM encoded HTTP server key file | "" |
| `MG_AUTH_GRPC_HOST` | Auth service gRPC host | "" |
| `MG_AUTH_GRPC_PORT` | Auth service gRPC port | 8181 |
| `MG_AUTH_GRPC_SERVER_CERT` | Path to the PEM encoded gRPC server certificate file | "" |
| `MG_AUTH_GRPC_SERVER_KEY` | Path to the PEM encoded gRPC server key file | "" |
| `MG_AUTH_GRPC_SERVER_CA_CERTS` | Path to the PEM encoded gRPC server CA certificate file | "" |
| `MG_AUTH_GRPC_CLIENT_CA_CERTS` | Path to the PEM encoded gRPC client CA certificate file | "" |
| `MG_AUTH_SECRET_KEY` | String used for signing tokens | secret |
| `MG_AUTH_ACCESS_TOKEN_DURATION` | The access token expiration period | 1h |
| `MG_AUTH_REFRESH_TOKEN_DURATION` | The refresh token expiration period | 24h |
| `MG_AUTH_INVITATION_DURATION` | The invitation token expiration period | 168h |
| `MG_AUTH_CACHE_URL` | Redis URL for caching PAT scopes | redis://localhost:6379/0 |
| `MG_AUTH_CACHE_KEY_DURATION` | Duration for which PAT scope cache keys are valid | 10m |
| `MG_SPICEDB_HOST` | SpiceDB host address | localhost |
| `MG_SPICEDB_PORT` | SpiceDB host port | 50051 |
| `MG_SPICEDB_PRE_SHARED_KEY` | SpiceDB pre-shared key | 12345678 |
| `MG_SPICEDB_SCHEMA_FILE` | Path to SpiceDB schema file | ./docker/spicedb/schema.zed |
| `MG_JAEGER_URL` | Jaeger server URL | <http://jaeger:4318/v1/traces> |
| `MG_JAEGER_TRACE_RATIO` | Jaeger sampling ratio | 1.0 |
| `MG_SEND_TELEMETRY` | Send telemetry to magistrala call home server | true |
| `MG_ADAPTER_INSTANCE_ID` | Adapter instance ID | "" |
| `MG_CALLOUT_URLS` | Comma-separated list of callout URLs | "" |
| `MG_CALLOUT_METHOD` | Callout method | POST |
| `MG_CALLOUT_TLS_VERIFICATION` | Enable TLS verification for callouts | true |
| `MG_CALLOUT_TIMEOUT` | Callout timeout | 10s |
| `MG_CALLOUT_CA_CERT` | Path to CA certificate file | "" |
| `MG_CALLOUT_CERT` | Path to client certificate file | "" |
| `MG_CALLOUT_KEY` | Path to client key file | "" |
| `MG_CALLOUT_OPERATIONS` | Invoke callout if the authorization permission matches any of the given permissions. | "" |
## Deployment
The service itself is distributed as Docker container. Check the [`auth`](https://github.com/mainflux/mainflux/blob/master/docker/docker-compose.yml#L71-L94) service section in
docker-compose to see how service is deployed.
The service itself is distributed as Docker container. Check the [`auth`](https://github.com/absmach/magistrala/blob/main/docker/docker-compose.yaml) service section in docker-compose file to see how service is deployed.
Running this service outside of container requires working instance of the postgres database, SpiceDB, and Jaeger server.
To start the service outside of the container, execute the following shell script:
```bash
# download the latest version of the service
go get github.com/mainflux/mainflux
git clone https://github.com/absmach/magistrala
cd $GOPATH/src/github.com/mainflux/mainflux
cd magistrala
# compile the service
make auth
@@ -100,14 +124,326 @@ make auth
make install
# set the environment variables and run the service
MF_AUTH_LOG_LEVEL=[Service log level] MF_AUTH_DB_HOST=[Database host address] MF_AUTH_DB_PORT=[Database host port] MF_AUTH_DB_USER=[Database user] MF_AUTH_DB_PASS=[Database password] MF_AUTH_DB=[Name of the database used by the service] MF_AUTH_DB_SSL_MODE=[SSL mode to connect to the database with] MF_AUTH_DB_SSL_CERT=[Path to the PEM encoded certificate file] MF_AUTH_DB_SSL_KEY=[Path to the PEM encoded key file] MF_AUTH_DB_SSL_ROOT_CERT=[Path to the PEM encoded root certificate file] MF_AUTH_HTTP_PORT=[Service HTTP port] MF_AUTH_GRPC_PORT=[Service gRPC port] MF_AUTH_SECRET=[String used for signing tokens] MF_AUTH_SERVER_CERT=[Path to server certificate] MF_AUTH_SERVER_KEY=[Path to server key] MF_JAEGER_URL=[Jaeger server URL] MF_AUTH_LOGIN_TOKEN_DURATION=[The login token expiration period] $GOBIN/mainflux-auth
MG_AUTH_LOG_LEVEL=info \
MG_AUTH_DB_HOST=localhost \
MG_AUTH_DB_PORT=5432 \
MG_AUTH_DB_USER=magistrala \
MG_AUTH_DB_PASSWORD=magistrala \
MG_AUTH_DB_NAME=auth \
MG_AUTH_DB_SSL_MODE=disable \
MG_AUTH_DB_SSL_CERT="" \
MG_AUTH_DB_SSL_KEY="" \
MG_AUTH_DB_SSL_ROOT_CERT="" \
MG_AUTH_HTTP_HOST=localhost \
MG_AUTH_HTTP_PORT=8189 \
MG_AUTH_HTTP_SERVER_CERT="" \
MG_AUTH_HTTP_SERVER_KEY="" \
MG_AUTH_GRPC_HOST=localhost \
MG_AUTH_GRPC_PORT=8181 \
MG_AUTH_GRPC_SERVER_CERT="" \
MG_AUTH_GRPC_SERVER_KEY="" \
MG_AUTH_GRPC_SERVER_CA_CERTS="" \
MG_AUTH_GRPC_CLIENT_CA_CERTS="" \
MG_AUTH_SECRET_KEY=secret \
MG_AUTH_ACCESS_TOKEN_DURATION=1h \
MG_AUTH_REFRESH_TOKEN_DURATION=24h \
MG_AUTH_INVITATION_DURATION=168h \
MG_SPICEDB_HOST=localhost \
MG_SPICEDB_PORT=50051 \
MG_SPICEDB_PRE_SHARED_KEY=12345678 \
MG_SPICEDB_SCHEMA_FILE=./docker/spicedb/schema.zed \
MG_JAEGER_URL=http://localhost:14268/api/traces \
MG_JAEGER_TRACE_RATIO=1.0 \
MG_SEND_TELEMETRY=true \
MG_AUTH_ADAPTER_INSTANCE_ID="" \
MG_CALLOUT_URLS="" \
MG_CALLOUT_METHOD="POST" \
MG_CALLOUT_TLS_VERIFICATION=true \
$GOBIN/magistrala-auth
```
If `MF_EMAIL_TEMPLATE` doesn't point to any file service will function but password reset functionality will not work.
Setting `MG_AUTH_HTTP_SERVER_CERT` and `MG_AUTH_HTTP_SERVER_KEY` will enable TLS against the service. The service expects a file in PEM format for both the certificate and the key.
Setting `MG_AUTH_GRPC_SERVER_CERT` and `MG_AUTH_GRPC_SERVER_KEY` will enable TLS against the service. The service expects a file in PEM format for both the certificate and the key. Setting `MG_AUTH_GRPC_SERVER_CA_CERTS` will enable TLS against the service trusting only those CAs that are provided. The service expects a file in PEM format of trusted CAs. Setting `MG_AUTH_GRPC_CLIENT_CA_CERTS` will enable TLS against the service trusting only those CAs that are provided. The service expects a file in PEM format of trusted CAs.
## Personal Access Tokens (PATs)
Personal Access Tokens (PATs) provide a secure way to authenticate with Magistrala APIs without using your primary credentials. They are particularly useful for automation, CI/CD pipelines, and integrating with third-party services.
### Overview
PATs in Magistrala are designed with the following features:
- **Scoped Access**: Each token can be limited to specific operations on specific resources
- **Expiration Control**: Set custom expiration times for tokens
- **Revocable**: Tokens can be revoked at any time
- **Auditable**: Track when tokens were last used
- **Secure**: Tokens are stored as hashes, not in plaintext
### Token Structure
A PAT consists of three parts separated by underscores:
```bash
pat_<encoded-user-and-pat-id>_<random-string>
```
Where:
- `pat` is a fixed prefix
- `<encoded-user-and-pat-id>` is a base64-encoded combination of the user ID and PAT ID
- `<random-string>` is a randomly generated string for additional security
### PAT Operations
Magistrala supports the following operations for PATs:
| Operation | Description |
| ----------- | ------------------------------------ |
| `create` | Create a new resource |
| `read` | Read/view a resource |
| `list` | List resources |
| `update` | Update/modify a resource |
| `delete` | Delete a resource |
| `share` | Share a resource with others |
| `unshare` | Remove sharing permissions |
| `publish` | Publish messages to a channel |
| `subscribe` | Subscribe to messages from a channel |
### Entity Types
PATs can be scoped to the following entity types:
| Entity Type | Description |
| ------------ | ---------------------- |
| `groups` | User groups |
| `channels` | Communication channels |
| `clients` | Client applications |
| `domains` | Organizational domains |
| `users` | User accounts |
| `dashboards` | Dashboard interfaces |
| `messages` | Message content |
### API Examples
#### Creating a PAT
```bash
curl --location 'http://localhost:9001/pats' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <access_token>' \
--data '{
"name": "test pat",
"description": "testing pat",
"duration": "24h"
}'
```
Response:
```json
{
"id": "a2500226-95dc-4285-87e2-e693e4a0a976",
"user_id": "user123",
"name": "pat 1",
"description": "for creating any client or channel",
"secret": "pat_dXNlcjEyM19hMjUwMDIyNi05NWRjLTQyODUtODdlMi1lNjkzZTRhMGE5NzY=_randomstring...",
"issued_at": "2025-02-27T11:20:59Z",
"expires_at": "2025-02-28T11:20:59Z"
}
```
#### Adding Scopes to a PAT
```bash
curl --location --request PATCH 'http://localhost:9001/pats/a2500226-95dc-4285-87e2-e693e4a0a976/scope/add' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <access_token>' \
--data '{
"scopes": [
{
"optional_domain_id": "c16c980a-9d4c-4793-8fb2-c81304cf1d9f",
"entity_type": "clients",
"operation": "create",
"entity_id": "*"
},
{
"optional_domain_id": "c16c980a-9d4c-4793-8fb2-c81304cf1d9f",
"entity_type": "channels",
"operation": "create",
"entity_id": "cfbc6936-5748-4339-a8ef-37b64b02bc96"
},
{
"entity_type": "dashboards",
"optional_domain_id": "c16c980a-9d4c-4793-8fb2-c81304cf1d9f",
"operation": "read",
"entity_id": "*"
}
]
}'
```
#### Listing PATs
```bash
curl --location 'http://localhost:9001/pats' \
--header 'Authorization: Bearer <access_token>'
```
#### Listing Scopes for a PAT
```bash
curl --location 'http://localhost:9001/pats/a2500226-95dc-4285-87e2-e693e4a0a976/scopes' \
--header 'Authorization: Bearer <access_token>'
```
#### Revoking a PAT
```bash
curl --location --request PATCH 'http://localhost:9001/pats/a2500226-95dc-4285-87e2-e693e4a0a976/revoke' \
--header 'Authorization: Bearer <access_token>'
```
#### Resetting a PAT Secret
```bash
curl --location --request PATCH 'http://localhost:9001/pats/a2500226-95dc-4285-87e2-e693e4a0a976/reset' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <access_token>' \
--data '{
"duration": "720h"
}'
```
### Using PATs for Authentication
When making API requests, include the PAT in the Authorization header:
```bash
Authorization: Bearer pat_<encoded-user-and-pat-id>_<random-string>
```
#### Example: Creating a Client Using PAT
```bash
curl --location 'http://localhost:9006/c16c980a-9d4c-4793-8fb2-c81304cf1d9f/clients' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer pat_etKoiXKTR6a0zdgsBHC00qJQAiaV3EKFh+Lmk+SgqXY=_u7@5fyjgti9V@#Bw^bS*SPmX3OnH=HTvKwmIbxIuyBjoI|6FASo9egjKD^u-M$b|2Dpt3CXZtv&4k+hmYYjk&C$57AV59P%-iDV0' \
--data '{
"name": "test client",
"tags": [
"tag1",
"tag2"
],
"metadata":{"units":"km"},
"status": "enabled"
}'
```
This example shows how to create a client in a specific domain (`c16c980a-9d4c-4793-8fb2-c81304cf1d9f`) using a PAT for authentication. The PAT must have the appropriate scope (e.g., `clients` entity type with `create` operation) for this domain.
### Wildcard Entity IDs
When defining scopes for PATs, you can use the wildcard character `*` for the `entity_id` field to grant permissions for all entities of a specific type. This is particularly useful for automation tasks that need to operate on multiple resources.
For example:
- `"entity_id": "*"` - Grants permission for all entities of the specified type
- `"entity_id": "specific-id"` - Grants permission only for the entity with the specified ID
Using wildcards should be done carefully, as they grant broader permissions. Always follow the principle of least privilege by granting only the permissions necessary for the intended use case.
### Scope Examples
#### Allow Creating Any Client in a Domain
```json
{
"optional_domain_id": "domain_id",
"entity_type": "clients",
"operation": "create",
"entity_id": "*"
}
```
This scope allows the PAT to create any client within the specified domain. The wildcard `*` for `entity_id` means the token can create any client, not just a specific one.
#### Allow Publishing to a Specific Channel
```json
{
"optional_domain_id": "domain_id",
"entity_type": "channels",
"operation": "publish",
"entity_id": "channel_id"
}
```
This scope restricts the PAT to only publish to a specific channel (`channel_id`) within the specified domain. No wildcard is used, so the permission is limited to just this one channel.
#### Allow Reading All Dashboards
```json
{
"optional_domain_id": "domain_id",
"entity_type": "dashboards",
"operation": "read",
"entity_id": "*"
}
```
This scope allows the PAT to read all dashboards within the specified domain. The wildcard `*` for `entity_id` means the token can read any dashboard in that domain.
### Best Practices
1. **Limit Scope**: Always use the principle of least privilege when creating PATs
2. **Set Expirations**: Use reasonable expiration times for tokens
3. **Rotate Regularly**: Reset token secrets periodically
4. **Audit Usage**: Monitor when tokens are used
5. **Revoke Unused**: Remove tokens that are no longer needed
### Implementation Details
PATs are stored in the database with the following schema:
```sql
CREATE TABLE IF NOT EXISTS pats (
id VARCHAR(36) PRIMARY KEY,
name VARCHAR(254) NOT NULL,
user_id VARCHAR(36),
description TEXT,
secret TEXT,
issued_at TIMESTAMPTZ,
expires_at TIMESTAMPTZ,
updated_at TIMESTAMPTZ,
revoked BOOLEAN,
revoked_at TIMESTAMPTZ,
last_used_at TIMESTAMPTZ,
UNIQUE (id, name, secret)
)
CREATE TABLE IF NOT EXISTS pat_scopes (
id VARCHAR(36) PRIMARY KEY,
pat_id VARCHAR(36) REFERENCES pats(id) ON DELETE CASCADE,
optional_domain_id VARCHAR(36),
entity_type VARCHAR(50) NOT NULL,
operation VARCHAR(50) NOT NULL,
entity_id VARCHAR(50) NOT NULL,
UNIQUE (pat_id, optional_domain_id, entity_type, operation, entity_id)
)
```
### Authorization
When a PAT is used for authentication:
1. The system parses the token to extract the user ID and PAT ID
2. It verifies the token hasn't been revoked or expired
3. It checks if the requested operation is allowed by the token's scopes
4. If all checks pass, the operation is authorized
## Usage
For more information about service capabilities and its usage, please check out
the [API documentation](https://api.mainflux.io/?urls.primaryName=auth-openapi.yml).
For more information about service capabilities and its usage, please check out the [API documentation](https://docs.api.magistrala.absmach.eu/?urls.primaryName=auth.yaml).
[doc]: https://docs.mainflux.io
[doc]: https://magistrala.absmach.eu/docs/
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright (c) Mainflux
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Package api contains implementation of Auth service HTTP API.
+150
View File
@@ -0,0 +1,150 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package auth
import (
"context"
"time"
grpcAuthV1 "github.com/absmach/magistrala/api/grpc/auth/v1"
"github.com/absmach/magistrala/auth"
grpcapi "github.com/absmach/magistrala/auth/api/grpc"
"github.com/go-kit/kit/endpoint"
kitgrpc "github.com/go-kit/kit/transport/grpc"
"google.golang.org/grpc"
)
const authSvcName = "auth.v1.AuthService"
type authGrpcClient struct {
authenticate endpoint.Endpoint
authorize endpoint.Endpoint
timeout time.Duration
}
var _ grpcAuthV1.AuthServiceClient = (*authGrpcClient)(nil)
// NewAuthClient returns new auth gRPC client instance.
func NewAuthClient(conn *grpc.ClientConn, timeout time.Duration) grpcAuthV1.AuthServiceClient {
return &authGrpcClient{
authenticate: kitgrpc.NewClient(
conn,
authSvcName,
"Authenticate",
encodeIdentifyRequest,
decodeIdentifyResponse,
grpcAuthV1.AuthNRes{},
).Endpoint(),
authorize: kitgrpc.NewClient(
conn,
authSvcName,
"Authorize",
encodeAuthorizeRequest,
decodeAuthorizeResponse,
grpcAuthV1.AuthZRes{},
).Endpoint(),
timeout: timeout,
}
}
func (client authGrpcClient) Authenticate(ctx context.Context, token *grpcAuthV1.AuthNReq, _ ...grpc.CallOption) (*grpcAuthV1.AuthNRes, error) {
ctx, cancel := context.WithTimeout(ctx, client.timeout)
defer cancel()
res, err := client.authenticate(ctx, authenticateReq{token: token.GetToken()})
if err != nil {
return &grpcAuthV1.AuthNRes{}, grpcapi.DecodeError(err)
}
ir := res.(authenticateRes)
return &grpcAuthV1.AuthNRes{Id: ir.id, UserId: ir.userID, UserRole: uint32(ir.userRole), Verified: ir.verified, TokenType: uint32(ir.tokenType)}, nil
}
func encodeIdentifyRequest(_ context.Context, grpcReq any) (any, error) {
req := grpcReq.(authenticateReq)
return &grpcAuthV1.AuthNReq{Token: req.token}, nil
}
func decodeIdentifyResponse(_ context.Context, grpcRes any) (any, error) {
res := grpcRes.(*grpcAuthV1.AuthNRes)
return authenticateRes{id: res.GetId(), userID: res.GetUserId(), userRole: auth.Role(res.UserRole), verified: res.GetVerified(), tokenType: auth.KeyType(res.GetTokenType())}, nil
}
func (client authGrpcClient) Authorize(ctx context.Context, req *grpcAuthV1.AuthZReq, _ ...grpc.CallOption) (r *grpcAuthV1.AuthZRes, err error) {
ctx, cancel := context.WithTimeout(ctx, client.timeout)
defer cancel()
var authReqData authReq
if req != nil {
policyReq := req.GetPolicyReq()
patReq := req.GetPatReq()
if policyReq != nil {
authReqData = authReq{
Domain: policyReq.GetDomain(),
SubjectType: policyReq.GetSubjectType(),
Subject: policyReq.GetSubject(),
SubjectKind: policyReq.GetSubjectKind(),
Relation: policyReq.GetRelation(),
Permission: policyReq.GetPermission(),
ObjectType: policyReq.GetObjectType(),
Object: policyReq.GetObject(),
}
}
if patReq != nil {
if patReq.GetDomain() != "" {
authReqData.Domain = patReq.GetDomain()
}
authReqData.UserID = patReq.GetUserId()
authReqData.PatID = patReq.GetPatId()
authReqData.EntityType = patReq.GetEntityType()
authReqData.Operation = patReq.GetOperation()
authReqData.EntityID = patReq.GetEntityId()
}
}
res, err := client.authorize(ctx, authReqData)
if err != nil {
return &grpcAuthV1.AuthZRes{}, grpcapi.DecodeError(err)
}
ar := res.(authorizeRes)
return &grpcAuthV1.AuthZRes{Authorized: ar.authorized, Id: ar.id}, nil
}
func decodeAuthorizeResponse(_ context.Context, grpcRes any) (any, error) {
res := grpcRes.(*grpcAuthV1.AuthZRes)
return authorizeRes{authorized: res.Authorized, id: res.Id}, nil
}
func encodeAuthorizeRequest(_ context.Context, grpcReq any) (any, error) {
req := grpcReq.(authReq)
authZReq := &grpcAuthV1.AuthZReq{
PolicyReq: &grpcAuthV1.PolicyReq{
Domain: req.Domain,
SubjectType: req.SubjectType,
Subject: req.Subject,
SubjectKind: req.SubjectKind,
Relation: req.Relation,
Permission: req.Permission,
ObjectType: req.ObjectType,
Object: req.Object,
},
}
if req.PatID != "" {
authZReq.PatReq = &grpcAuthV1.PATReq{
PatId: req.PatID,
Domain: req.Domain,
Operation: req.Operation,
UserId: req.UserID,
EntityId: req.EntityID,
EntityType: req.EntityType,
}
}
return authZReq, nil
}
+5
View File
@@ -0,0 +1,5 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Package auth contains implementation of Auth service gRPC API.
package auth
+69
View File
@@ -0,0 +1,69 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package auth
import (
"context"
"github.com/absmach/magistrala/auth"
"github.com/absmach/magistrala/pkg/policies"
"github.com/go-kit/kit/endpoint"
)
func authenticateEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(authenticateReq)
if err := req.validate(); err != nil {
return authenticateRes{}, err
}
key, err := svc.Identify(ctx, req.token)
if err != nil {
return authenticateRes{}, err
}
return authenticateRes{id: key.ID, userID: key.Subject, userRole: key.Role, verified: key.Verified, tokenType: key.Type}, nil
}
}
func authorizeEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(authReq)
if err := req.validate(); err != nil {
return authorizeRes{}, err
}
var pat *auth.PATAuthz
if req.PatID != "" {
entityType, err := auth.ParseEntityType(req.EntityType)
if err != nil {
return authorizeRes{authorized: false}, err
}
pat = &auth.PATAuthz{
PatID: req.PatID,
UserID: req.UserID,
EntityType: entityType,
EntityID: req.EntityID,
Operation: req.Operation,
Domain: req.Domain,
}
}
err := svc.Authorize(ctx, policies.Policy{
Domain: req.Domain,
SubjectType: req.SubjectType,
SubjectKind: req.SubjectKind,
Subject: req.Subject,
Relation: req.Relation,
Permission: req.Permission,
ObjectType: req.ObjectType,
Object: req.Object,
}, pat)
if err != nil {
return authorizeRes{authorized: false}, err
}
return authorizeRes{authorized: true}, nil
}
}
+70
View File
@@ -0,0 +1,70 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package auth
import (
apiutil "github.com/absmach/magistrala/api/http/util"
)
type authenticateReq struct {
token string
}
func (req authenticateReq) validate() error {
if req.token == "" {
return apiutil.ErrBearerToken
}
return nil
}
// authReq represents authorization request. It contains:
// 1. subject - an action invoker
// 2. object - an entity over which action will be executed
// 3. action - type of action that will be executed (read/write).
type authReq struct {
Domain string
SubjectType string
SubjectKind string
Subject string
Relation string
Permission string
ObjectType string
Object string
// PAT authorization fields
UserID string
PatID string
EntityType string
Operation string
EntityID string
}
func (req authReq) validate() error {
if req.PatID != "" {
if req.UserID == "" {
return apiutil.ErrMissingUserID
}
if req.EntityID == "" {
return apiutil.ErrMissingID
}
if req.EntityType == "" {
return apiutil.ErrMissingPolicyObj
}
}
if req.Subject == "" || req.SubjectType == "" {
return apiutil.ErrMissingPolicySub
}
if req.Object == "" || req.ObjectType == "" {
return apiutil.ErrMissingPolicyObj
}
if req.Permission == "" {
return apiutil.ErrMalformedPolicyPer
}
return nil
}
+19
View File
@@ -0,0 +1,19 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package auth
import "github.com/absmach/magistrala/auth"
type authenticateRes struct {
id string
userID string
userRole auth.Role
verified bool
tokenType auth.KeyType
}
type authorizeRes struct {
id string
authorized bool
}
+107
View File
@@ -0,0 +1,107 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package auth
import (
"context"
grpcAuthV1 "github.com/absmach/magistrala/api/grpc/auth/v1"
"github.com/absmach/magistrala/auth"
grpcapi "github.com/absmach/magistrala/auth/api/grpc"
kitgrpc "github.com/go-kit/kit/transport/grpc"
)
var _ grpcAuthV1.AuthServiceServer = (*authGrpcServer)(nil)
type authGrpcServer struct {
grpcAuthV1.UnimplementedAuthServiceServer
authorize kitgrpc.Handler
authenticate kitgrpc.Handler
}
// NewAuthServer returns new AuthnServiceServer instance.
func NewAuthServer(svc auth.Service) grpcAuthV1.AuthServiceServer {
return &authGrpcServer{
authorize: kitgrpc.NewServer(
(authorizeEndpoint(svc)),
decodeAuthorizeRequest,
encodeAuthorizeResponse,
),
authenticate: kitgrpc.NewServer(
(authenticateEndpoint(svc)),
decodeAuthenticateRequest,
encodeAuthenticateResponse,
),
}
}
func (s *authGrpcServer) Authenticate(ctx context.Context, req *grpcAuthV1.AuthNReq) (*grpcAuthV1.AuthNRes, error) {
_, res, err := s.authenticate.ServeGRPC(ctx, req)
if err != nil {
return nil, grpcapi.EncodeError(err)
}
return res.(*grpcAuthV1.AuthNRes), nil
}
func (s *authGrpcServer) Authorize(ctx context.Context, req *grpcAuthV1.AuthZReq) (*grpcAuthV1.AuthZRes, error) {
_, res, err := s.authorize.ServeGRPC(ctx, req)
if err != nil {
return nil, grpcapi.EncodeError(err)
}
return res.(*grpcAuthV1.AuthZRes), nil
}
func decodeAuthenticateRequest(_ context.Context, grpcReq any) (any, error) {
req := grpcReq.(*grpcAuthV1.AuthNReq)
return authenticateReq{token: req.GetToken()}, nil
}
func encodeAuthenticateResponse(_ context.Context, grpcRes any) (any, error) {
res := grpcRes.(authenticateRes)
return &grpcAuthV1.AuthNRes{Id: res.id, UserId: res.userID, UserRole: uint32(res.userRole), Verified: res.verified, TokenType: uint32(res.tokenType)}, nil
}
func decodeAuthorizeRequest(_ context.Context, grpcReq any) (any, error) {
req := grpcReq.(*grpcAuthV1.AuthZReq)
if req == nil {
return authReq{}, nil
}
policyReq := req.GetPolicyReq()
patReq := req.GetPatReq()
if policyReq == nil {
return authReq{}, nil
}
authRequest := authReq{
Domain: policyReq.GetDomain(),
SubjectType: policyReq.GetSubjectType(),
SubjectKind: policyReq.GetSubjectKind(),
Subject: policyReq.GetSubject(),
Relation: policyReq.GetRelation(),
Permission: policyReq.GetPermission(),
ObjectType: policyReq.GetObjectType(),
Object: policyReq.GetObject(),
}
if patReq != nil {
if patReq.GetDomain() != "" {
authRequest.Domain = patReq.GetDomain()
}
authRequest.UserID = patReq.GetUserId()
authRequest.PatID = patReq.GetPatId()
authRequest.EntityType = patReq.GetEntityType()
authRequest.Operation = patReq.GetOperation()
authRequest.EntityID = patReq.GetEntityId()
}
return authRequest, nil
}
func encodeAuthorizeResponse(_ context.Context, grpcRes any) (any, error) {
res := grpcRes.(authorizeRes)
return &grpcAuthV1.AuthZRes{Authorized: res.authorized, Id: res.id}, nil
}
-334
View File
@@ -1,334 +0,0 @@
// Copyright (c) Mainflux
// SPDX-License-Identifier: Apache-2.0
package grpc
import (
"context"
"time"
"github.com/go-kit/kit/endpoint"
kitot "github.com/go-kit/kit/tracing/opentracing"
kitgrpc "github.com/go-kit/kit/transport/grpc"
"github.com/golang/protobuf/ptypes/empty"
"github.com/mainflux/mainflux"
opentracing "github.com/opentracing/opentracing-go"
"google.golang.org/grpc"
)
const (
svcName = "mainflux.AuthService"
)
var _ mainflux.AuthServiceClient = (*grpcClient)(nil)
type grpcClient struct {
issue endpoint.Endpoint
identify endpoint.Endpoint
authorize endpoint.Endpoint
addPolicy endpoint.Endpoint
deletePolicy endpoint.Endpoint
listPolicies endpoint.Endpoint
assign endpoint.Endpoint
members endpoint.Endpoint
timeout time.Duration
}
// NewClient returns new gRPC client instance.
func NewClient(tracer opentracing.Tracer, conn *grpc.ClientConn, timeout time.Duration) mainflux.AuthServiceClient {
return &grpcClient{
issue: kitot.TraceClient(tracer, "issue")(kitgrpc.NewClient(
conn,
svcName,
"Issue",
encodeIssueRequest,
decodeIssueResponse,
mainflux.UserIdentity{},
).Endpoint()),
identify: kitot.TraceClient(tracer, "identify")(kitgrpc.NewClient(
conn,
svcName,
"Identify",
encodeIdentifyRequest,
decodeIdentifyResponse,
mainflux.UserIdentity{},
).Endpoint()),
authorize: kitot.TraceClient(tracer, "authorize")(kitgrpc.NewClient(
conn,
svcName,
"Authorize",
encodeAuthorizeRequest,
decodeAuthorizeResponse,
mainflux.AuthorizeRes{},
).Endpoint()),
addPolicy: kitot.TraceClient(tracer, "add_policy")(kitgrpc.NewClient(
conn,
svcName,
"AddPolicy",
encodeAddPolicyRequest,
decodeAddPolicyResponse,
mainflux.AddPolicyRes{},
).Endpoint()),
deletePolicy: kitot.TraceClient(tracer, "delete_policy")(kitgrpc.NewClient(
conn,
svcName,
"DeletePolicy",
encodeDeletePolicyRequest,
decodeDeletePolicyResponse,
mainflux.DeletePolicyRes{},
).Endpoint()),
listPolicies: kitot.TraceClient(tracer, "list_policies")(kitgrpc.NewClient(
conn,
svcName,
"ListPolicies",
encodeListPoliciesRequest,
decodeListPoliciesResponse,
mainflux.ListPoliciesRes{},
).Endpoint()),
assign: kitot.TraceClient(tracer, "assign")(kitgrpc.NewClient(
conn,
svcName,
"Assign",
encodeAssignRequest,
decodeAssignResponse,
mainflux.AuthorizeRes{},
).Endpoint()),
members: kitot.TraceClient(tracer, "members")(kitgrpc.NewClient(
conn,
svcName,
"Members",
encodeMembersRequest,
decodeMembersResponse,
mainflux.MembersRes{},
).Endpoint()),
timeout: timeout,
}
}
func (client grpcClient) Issue(ctx context.Context, req *mainflux.IssueReq, _ ...grpc.CallOption) (*mainflux.Token, error) {
ctx, close := context.WithTimeout(ctx, client.timeout)
defer close()
res, err := client.issue(ctx, issueReq{id: req.GetId(), email: req.GetEmail(), keyType: req.Type})
if err != nil {
return nil, err
}
ir := res.(identityRes)
return &mainflux.Token{Value: ir.id}, nil
}
func encodeIssueRequest(_ context.Context, grpcReq interface{}) (interface{}, error) {
req := grpcReq.(issueReq)
return &mainflux.IssueReq{Id: req.id, Email: req.email, Type: req.keyType}, nil
}
func decodeIssueResponse(_ context.Context, grpcRes interface{}) (interface{}, error) {
res := grpcRes.(*mainflux.UserIdentity)
return identityRes{id: res.GetId(), email: res.GetEmail()}, nil
}
func (client grpcClient) Identify(ctx context.Context, token *mainflux.Token, _ ...grpc.CallOption) (*mainflux.UserIdentity, error) {
ctx, close := context.WithTimeout(ctx, client.timeout)
defer close()
res, err := client.identify(ctx, identityReq{token: token.GetValue()})
if err != nil {
return nil, err
}
ir := res.(identityRes)
return &mainflux.UserIdentity{Id: ir.id, Email: ir.email}, nil
}
func encodeIdentifyRequest(_ context.Context, grpcReq interface{}) (interface{}, error) {
req := grpcReq.(identityReq)
return &mainflux.Token{Value: req.token}, nil
}
func decodeIdentifyResponse(_ context.Context, grpcRes interface{}) (interface{}, error) {
res := grpcRes.(*mainflux.UserIdentity)
return identityRes{id: res.GetId(), email: res.GetEmail()}, nil
}
func (client grpcClient) Authorize(ctx context.Context, req *mainflux.AuthorizeReq, _ ...grpc.CallOption) (r *mainflux.AuthorizeRes, err error) {
ctx, close := context.WithTimeout(ctx, client.timeout)
defer close()
res, err := client.authorize(ctx, authReq{Act: req.GetAct(), Obj: req.GetObj(), Sub: req.GetSub()})
if err != nil {
return &mainflux.AuthorizeRes{}, err
}
ar := res.(authorizeRes)
return &mainflux.AuthorizeRes{Authorized: ar.authorized}, err
}
func decodeAuthorizeResponse(_ context.Context, grpcRes interface{}) (interface{}, error) {
res := grpcRes.(*mainflux.AuthorizeRes)
return authorizeRes{authorized: res.Authorized}, nil
}
func encodeAuthorizeRequest(_ context.Context, grpcReq interface{}) (interface{}, error) {
req := grpcReq.(authReq)
return &mainflux.AuthorizeReq{
Sub: req.Sub,
Obj: req.Obj,
Act: req.Act,
}, nil
}
func (client grpcClient) AddPolicy(ctx context.Context, in *mainflux.AddPolicyReq, opts ...grpc.CallOption) (*mainflux.AddPolicyRes, error) {
ctx, close := context.WithTimeout(ctx, client.timeout)
defer close()
res, err := client.addPolicy(ctx, policyReq{Act: in.GetAct(), Obj: in.GetObj(), Sub: in.GetSub()})
if err != nil {
return &mainflux.AddPolicyRes{}, err
}
apr := res.(addPolicyRes)
return &mainflux.AddPolicyRes{Authorized: apr.authorized}, err
}
func decodeAddPolicyResponse(_ context.Context, grpcRes interface{}) (interface{}, error) {
res := grpcRes.(*mainflux.AddPolicyRes)
return addPolicyRes{authorized: res.Authorized}, nil
}
func encodeAddPolicyRequest(_ context.Context, grpcReq interface{}) (interface{}, error) {
req := grpcReq.(policyReq)
return &mainflux.AddPolicyReq{
Sub: req.Sub,
Obj: req.Obj,
Act: req.Act,
}, nil
}
func (client grpcClient) DeletePolicy(ctx context.Context, in *mainflux.DeletePolicyReq, opts ...grpc.CallOption) (*mainflux.DeletePolicyRes, error) {
ctx, close := context.WithTimeout(ctx, client.timeout)
defer close()
res, err := client.deletePolicy(ctx, policyReq{Act: in.GetAct(), Obj: in.GetObj(), Sub: in.GetSub()})
if err != nil {
return &mainflux.DeletePolicyRes{}, err
}
dpr := res.(deletePolicyRes)
return &mainflux.DeletePolicyRes{Deleted: dpr.deleted}, err
}
func decodeDeletePolicyResponse(_ context.Context, grpcRes interface{}) (interface{}, error) {
res := grpcRes.(*mainflux.DeletePolicyRes)
return deletePolicyRes{deleted: res.GetDeleted()}, nil
}
func encodeDeletePolicyRequest(_ context.Context, grpcReq interface{}) (interface{}, error) {
req := grpcReq.(policyReq)
return &mainflux.DeletePolicyReq{
Sub: req.Sub,
Obj: req.Obj,
Act: req.Act,
}, nil
}
func (client grpcClient) ListPolicies(ctx context.Context, in *mainflux.ListPoliciesReq, opts ...grpc.CallOption) (*mainflux.ListPoliciesRes, error) {
ctx, close := context.WithTimeout(ctx, client.timeout)
defer close()
res, err := client.listPolicies(ctx, listPoliciesReq{Obj: in.GetObj(), Act: in.GetAct(), Sub: in.GetSub()})
if err != nil {
return &mainflux.ListPoliciesRes{}, err
}
lpr := res.(listPoliciesRes)
return &mainflux.ListPoliciesRes{Policies: lpr.policies}, err
}
func decodeListPoliciesResponse(_ context.Context, grpcRes interface{}) (interface{}, error) {
res := grpcRes.(*mainflux.ListPoliciesRes)
return listPoliciesRes{policies: res.GetPolicies()}, nil
}
func encodeListPoliciesRequest(_ context.Context, grpcReq interface{}) (interface{}, error) {
req := grpcReq.(listPoliciesReq)
return &mainflux.ListPoliciesReq{
Sub: req.Sub,
Obj: req.Obj,
Act: req.Act,
}, nil
}
func (client grpcClient) Members(ctx context.Context, req *mainflux.MembersReq, _ ...grpc.CallOption) (r *mainflux.MembersRes, err error) {
ctx, close := context.WithTimeout(ctx, client.timeout)
defer close()
res, err := client.members(ctx, membersReq{
token: req.GetToken(),
groupID: req.GetGroupID(),
memberType: req.GetType(),
offset: req.GetOffset(),
limit: req.GetLimit(),
})
if err != nil {
return &mainflux.MembersRes{}, err
}
mr := res.(membersRes)
return &mainflux.MembersRes{
Offset: mr.offset,
Limit: mr.limit,
Total: mr.total,
Type: mr.groupType,
Members: mr.members,
}, err
}
func encodeMembersRequest(_ context.Context, grpcReq interface{}) (interface{}, error) {
req := grpcReq.(membersReq)
return &mainflux.MembersReq{
Token: req.token,
Offset: req.offset,
Limit: req.limit,
GroupID: req.groupID,
Type: req.memberType,
}, nil
}
func decodeMembersResponse(_ context.Context, grpcRes interface{}) (interface{}, error) {
res := grpcRes.(*mainflux.MembersRes)
return membersRes{
offset: res.Offset,
limit: res.Limit,
total: res.Total,
members: res.Members,
}, nil
}
func (client grpcClient) Assign(ctx context.Context, req *mainflux.Assignment, _ ...grpc.CallOption) (r *empty.Empty, err error) {
ctx, close := context.WithTimeout(ctx, client.timeout)
defer close()
_, err = client.assign(ctx, assignReq{token: req.GetToken(), groupID: req.GetGroupID(), memberID: req.GetMemberID()})
if err != nil {
return &empty.Empty{}, err
}
return &empty.Empty{}, err
}
func encodeAssignRequest(_ context.Context, grpcRes interface{}) (interface{}, error) {
res := grpcRes.(*mainflux.AuthorizeRes)
return authorizeRes{authorized: res.Authorized}, nil
}
func decodeAssignResponse(_ context.Context, grpcReq interface{}) (interface{}, error) {
req := grpcReq.(authReq)
return &mainflux.AuthorizeReq{
Sub: req.Sub,
Obj: req.Obj,
Act: req.Act,
}, nil
}

Some files were not shown because too many files have changed in this diff Show More