Compare commits

..

1771 Commits

Author SHA1 Message Date
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
Dušan Borovčanin 92d8fb99bf NOISSUE - Update changelog for release 0.13.0 (#1595)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2022-04-15 15:51:35 +02:00
Dušan Borovčanin ad80cf868b Update VerneMQ release (#1593)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2022-04-15 15:25:39 +02:00
Dušan Borovčanin f0dac5c6ac 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>
2022-04-15 12:37:55 +02:00
Manuel Imperiale 48d6a95a21 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>
2022-04-11 13:52:20 +02:00
Dušan Borovčanin c6f7c69798 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>
2022-03-30 16:52:10 +02:00
Manuel Imperiale ce46723a8f NOISSUE - Unify MF_INFLUX_READER_DB_HOST and MF_INFLUX_WRITER_DB_HOST envars (#1585)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-03-29 11:53:27 +02:00
Hasan98-git 29f9cbb10a 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>
2022-03-23 13:19:59 +01:00
ibalboteo 127044efad 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>
2022-03-14 11:03:07 +01:00
Manuel Imperiale f3ed852b36 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>
2022-03-06 01:58:47 +01:00
Manuel Imperiale 0a6b2f135a MF-1567 - Use Bearer, Thing or Basic scheme in Authorization header (#1568)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-03-06 01:49:34 +01:00
Manuel Imperiale e5278c463f 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>
2022-03-03 17:13:46 +01:00
b1ackd0t cc5d5195ab 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>
2022-03-02 23:37:54 +01:00
stefankovacevic123 5ca8495f35 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>
2022-02-18 14:56:01 +01:00
Manuel Imperiale 9972d1d1a4 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>
2022-02-14 22:49:23 +01:00
Dušan Borovčanin 8b94199785 Update dependencies (#1564)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2022-02-12 19:07:48 +01:00
Ivan Milošević d51a79c538 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>
2022-02-11 14:27:33 +01:00
Manuel Imperiale 09cbc3f14b 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>
2022-02-11 13:22:57 +01:00
Mirko Teodorovic 655ac838be 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>
2022-02-09 21:25:34 +01:00
__touk__ f8ce94e9bb 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>
2022-02-09 10:19:09 +01:00
Ivan Milošević 1f8a221c22 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>
2022-02-07 13:51:43 +01:00
Manuel Imperiale 9e0947a355 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>
2022-02-01 17:33:23 +01:00
Manuel Imperiale e8a51842aa 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>
2022-01-27 18:39:35 +01:00
Manuel Imperiale 6ad654d7cb 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>
2022-01-27 17:03:57 +01:00
Filip Bugarski 4f56986c8e NOISSUE - Add API keys functions to CLI (#1537)
* Add API keys to cli

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Fix typo

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Fix issue func, and sdk

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Remove email, hide type and fix name

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Remove type and add README

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Fix issue response

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Fix magic number and move struct to private

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Remove const and import auth

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Removing auth

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-01-27 15:42:31 +01:00
b1ackd0t 81b2a1a2d3 Fix SDK for group members (#1553)
Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
2022-01-27 11:08:27 +01:00
Ivan Milošević 89061d33e5 NOISSUE - Fix Swagger UI (#1552)
* test github action

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* separate openapi and asyncapi

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove openapi from old location

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* change cname for production use

Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2022-01-26 10:33:08 +01:00
b1ackd0t 2abf9da27e MF-1008 - Make token duration configurable (#1550)
* Make token duration configurable

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

* Change env variable name

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

* Add MF_AUTH_LOGIN_TOKEN_DURATION in environment variable

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

* Change tests

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

* Document MF_AUTH_LOGIN_TOKEN_DURATION

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

* Change default login duration

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

* Change declaration of loginduration

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

* Add space after port

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

* Change time to hours

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

* Remove constant login duration

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

* Keep back recovery duration

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

* Change docs for login token duration

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

* Change login description

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

* Remove blank lines

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>
2022-01-25 19:42:41 +01:00
Manuel Imperiale 42dd813521 MF-1308 - Use IETF Health Check standard (#1541)
* MF-1308 - Use IETF Health Check standard

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add nginx health endpoint

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm github.com/nelkinda dependency

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Check error

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Replace Version by Health in the CLI and SDK

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use new build flag go:build

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert wrong renaming

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* sdk health test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add /health endpoint to openapi doc

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use const for description message

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add version and build time during build

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Time format

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add version and commit using git and build args

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add comments

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add missing api properties

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix api

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use ./schemas/HealthInfo.yml as

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix example

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use content type application/health+json

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Set Makefile variables only if empty

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-01-24 21:18:53 +01:00
Dušan Borovčanin bcc8cf7119 Fix user listing access control (#1546)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2022-01-19 16:46:10 +01:00
Dušan Borovčanin d86a4dee92 Update dependencies (#1545)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2022-01-18 15:28:46 +01:00
JohnC 864ad144e6 MF-1478 - TimescaleDB writer and reader add-on (#1542)
* MF-1478 - TimescaleDb Reader/Writer Add-on

Signed-off-by: John Cleasby <john.cleasby@gmail.com>

* pull request 1542 change requests

Signed-off-by: corp0529 <john.cleasby@gmail.com>

* pull request 1542 change requests 2

Signed-off-by: corp0529 <john.cleasby@gmail.com>

* removed unused separator const from timescale reader and writer cmd

Signed-off-by: corp0529 <john.cleasby@gmail.com>

* Fixed naming of timescaleRepo instance

Signed-off-by: corp0529 <john.cleasby@gmail.com>

* Fixed indentation and renamed repo to tr

Signed-off-by: corp0529 <john.cleasby@gmail.com>
2022-01-18 12:08:54 +01:00
Manuel Imperiale bea09d97dd MF-1149 - Add AsyncAPI MQTT API doc (#1539)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2022-01-14 23:53:35 +01:00
Filip Bugarski 6483969927 MF-1535 - Add API keys functions to SDK (#1536)
* Add API keys to sdk.

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Add issue key

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Fix typo

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Fix comments

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Remove unused code

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Fix typo

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>
2022-01-12 13:24:51 +01:00
Manuel Imperiale aa014c2191 NOISSUE - Add view and list serials endpoints in certs service (#1483)
* NOISSUE - Add view and list serials endpoints in certs service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix vault-unseal.sh script

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename Cert field days_valid into hours_valid

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix provision service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use ownerID, rename daysValid -> hoursValid

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add key_type to api

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix tabulation

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add expiration date in view response

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename HoursValid -> Expiration and remove unecessary expiration convertion

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add ListSerials tests and fix mocks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix RetrieveByThing count

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add ViewCert tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add missing error check

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify API

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert Makefile

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* NOISSUE - Add view and list serials endpoints in certs service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix vault-unseal.sh script

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename Cert field days_valid into hours_valid

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix provision service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use ownerID, rename daysValid -> hoursValid

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add key_type to api

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix tabulation

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add expiration date in view response

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename HoursValid -> Expiration and remove unecessary expiration convertion

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add ListSerials tests and fix mocks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix RetrieveByThing count

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add ViewCert tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add missing error check

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify API

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert Makefile

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm if else

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename HoursValid -> TTL

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* revert typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* revert typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename hoursValid -> ttl

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-01-04 19:42:13 +01:00
Filip Bugarski dd7d52ef10 MF-1516 - Fix API key issuing (#1530)
* Fix API keys saving

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Fix API key creation

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Fix tests

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Delete empty lines

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Remove empty lines

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Fix typo

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Change user key to login key

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>
2021-12-24 14:53:06 +01:00
Manuel Imperiale ad8b7ddf5a NOISSUE - Add disconnect endpoint in nginx conf (#1528)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-12-15 13:20:56 +01:00
Manuel Imperiale b18c9e79dc NOISSUE - Add timestamp transformation rules for specifc JSON fields (#1514)
* NOISSUE - Add timestamp transformation rules for specifc JSON fields

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add tests and defaults

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix Created

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix READMEs

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix Config file

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Improve the timestamp Config structure

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typos

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix smpp

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm duplicated Unmarshal

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Extract the error var

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix review

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Return error if time field transformation fails

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-12-14 11:17:23 +01:00
qs-wang 7e9ab453d4 MF-1425 - Support external UUIDs for Things and Channels (#1518)
* MF-1425 - Rebase mainflux master to resolve conflicts

MF-1425 Enhancement to supply an external UUID for Things and Channels.
Resolve conflicts.




Signed-off-by: Q.s <wangqs_eclipse@yahoo.com>

* MF-1425 - Test cases changes for SDK

MF-1425 Enhancement to supply an external UUID for Things and Channels.
These are the new testcases added for
- Things Service Testcases
- SDK Things and Channel Testcases

Signed-off-by: Anand Sivaram Palassery <aspnair@gmail.com>
Signed-off-by: Q.s <wangqs_eclipse@yahoo.com>

* MF-1425 - Fixing Testcases

MF-1425 Enhancement to supply an external UUID for Things and Channels.
Because of the previous commits, the testcases were getting failed
because the way ID was modified.  This change is to make sure that
all testcases are revisited to get them fixed.

Signed-off-by: Anand Sivaram Palassery <aspnair@gmail.com>
Signed-off-by: Q.s <wangqs_eclipse@yahoo.com>

* MF-1425 - Fixing review comments

Fixing the review comments provided.

Signed-off-by: Anand Sivaram Palassery <aspnair@gmail.com>
Signed-off-by: Q.s <wangqs_eclipse@yahoo.com>

* MF-1425 - Fixing more review comments

Signed-off-by: Anand Sivaram Palassery <aspnair@gmail.com>
Signed-off-by: Q.s <wangqs_eclipse@yahoo.com>

* MF-1425 - Fixing conflicts

MF-1425 Enhancement to supply an external UUID for Things and Channels.
Fixing the conflicts between aspnair master, and the mainflux master.

Signed-off-by: Q.s <wangqs_eclipse@yahoo.com>

* MF-1425 Fix the comment and code format per review comments

MF-1425 Enhancement to supply an external UUID for Things and Channels.
1. Remove un-valued comment for a private function
2. Format the code for better readibility

Signed-off-by: Q.S. Wang <wangqs_eclipse@yahoo.com>

* MF-1425 Enhancement to supply an external UUID for Things and Channels.

Fix the format of the API document

Signed-off-by: Q.S. Wang <wangqs_eclipse@yahoo.com>

* MF-1425 Enhancement to supply an external UUID for Things and Channels.

Rename the variable to make it readible.

Signed-off-by: Q.s <wangqs_eclipse@yahoo.com>

Co-authored-by: Anand Sivaram Palassery <aspnair@gmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2021-12-08 12:46:59 +01:00
Ivan Milošević 309ef512cb MF-1521 - Fix email headers (#1522)
Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-12-08 10:48:05 +01:00
Dušan Borovčanin db6fab961e Fix SenML lib dependency version (#1519)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2021-12-06 19:03:09 +01:00
Ivan Milošević f99f5d228d Bump vernemq to 1.12.3 (#1520)
Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-12-06 16:13:34 +01:00
Filip Bugarski 5112ef681a NOISSUE - Remove auth URL from SDK (#1511)
* Remove auth URL from SDK

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Update CLi/main.go authURL to GroupsURL

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Add authURL back

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Refactor group structures

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Add AuthURL back to cli/main.go

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>
2021-12-02 13:50:39 +01:00
Burak Sekili 31d30b204d NOISSUE - Apply policies to Channels (#1505)
* Add policies for channels

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Update single channel retrieval

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* update indentation

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

update indentation

Signed-off-by: Burak Sekili <buraksekili@gmail.com>
2021-11-26 14:12:08 +01:00
Burak Sekili be3e98f677 remove dead code (#1503)
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
2021-11-24 16:55:29 +01:00
Burak Sekili 87510288c2 NOISSUE - Fix listing (#1502)
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
2021-11-19 17:25:48 +01:00
Burak Sekili b78928c998 NOISSUE - Listing Policies (#1498)
* allow admin to fetch all things

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* enable users to fetch their own things via owner field in db

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* add listpolicies RPC

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* add listPolicies gRPC methods for client and server, and update keto initialization

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* update fetching things method

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* remove log

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* update retrieving policies

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* fix linter error

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* update mock

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* remove checking subject set while parsing subject sets

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* move subject declaration to constant value

Signed-off-by: Burak Sekili <buraksekili@gmail.com>
2021-11-19 14:32:38 +01:00
Dušan Borovčanin 39133b06a4 Fix standalone mode (#1497)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2021-11-16 13:02:31 +01:00
Burak Sekili 3042d6b40b MF-1489 - Add API for deleting policies (#1491)
* MF-1489 - Add API for deleting policies

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* update request and decoder naming

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* update swagger doc summary for the endpoint

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2021-11-08 14:45:38 +01:00
Burak Sekili c70fb576b6 NOISSUE - Update group sharing policies (#1494)
* Update group sharing policies

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Replace string with constant

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2021-11-08 12:55:18 +01:00
__touk__ 9f5a319519 NOISSUE - Refactor InfluxDB Reader: explicit check event + add safe conversion (#1460)
* refactore(reader/influxdb): explicit check event + add safe conversion

Signed-off-by: tzzed <zerouali.t@gmail.com>

* apply review suggestion

Signed-off-by: tzzed <zerouali.t@gmail.com>

* Delete useless space.

Signed-off-by: tzzed <zerouali.t@gmail.com>

* apply review suggestion

Signed-off-by: tzzed <zerouali.t@gmail.com>

* apply review suggestion, replace require.NoError(t, err) by assert.Nil

Signed-off-by: tzzed <zerouali.t@gmail.com>

* Fix tests when message time is randomly equal to 0 in tests cases.

Signed-off-by: tzzed <zerouali.t@gmail.com>

* apply review suggestion use constant

Signed-off-by: tzzed <zerouali.t@gmail.com>

* use const offset

Signed-off-by: tzzed <zerouali.t@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2021-11-08 12:26:11 +01:00
Burak Sekili b570c38ed0 NOISSUE - Update users create command for CLI (#1495)
* NOISSUE - Update users create command for CLI

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* update if check

Signed-off-by: Burak Sekili <buraksekili@gmail.com>
2021-11-08 11:40:27 +01:00
Burak Sekili dc935858bd NOISSUE - Update self register environment variable name (#1493)
* NOISSUE - Update naming of env variable (#1484)

Signed-off-by: Burak Sekili <buraksekili@gmail.com>
2021-11-03 10:30:52 +01:00
Drasko DRASKOVIC 90e4561491 Bring back the job add 2021-11-01 00:48:57 +01:00
Burak Sekili 30912e5a45 NOISSUE - Fix assigning invalid group policy (#1487)
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
2021-10-28 13:10:03 +02:00
Dušan Borovčanin 27d4646db4 MF-1443 - Add policies (#1482)
* MF-1443 - add policies

Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* fix users create

Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* MF-1454 - Add Policies for sharing a Thing (#1463)

* MF-1454 - Add policies for sharing a Thing

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Add a test case for sharing thing and update mock of AddPolicy

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Update ShareThing parameter naming

Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* MF-1454 - Policy Removal  (#1466)

* Add DeletePolicy gRPC endpoint in auth package

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Update default admin creation

Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* NOISSUE - Add policy addition endpoint (#1479)

* NOISSUE - Add policy addition endpoint

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Update name of the method

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

remove build tag

Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* NOISSUE - Add tests for AddPolicies (#1480)

* NOISSUE - Add tests for adding policy and update authz check

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Add more tests and update request body validation

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Update test case structure and utilize mock prefix for test ids

Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* MF-1454 - Add initial policies for Group access control (#1467)

Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>

* Resolve PR comments

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

Co-authored-by: Author: Burak Sekili <buraksekili@gmail.com>
2021-10-27 00:38:28 +02:00
Burak Sekili 042ff98509 NOISSUE - Fix retrieving all users (#1477)
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
2021-10-18 17:00:15 +02:00
smartyfi 5e9a91bd03 MF-1468 - Fix ThingsURL in Certs Service (#1474)
* fix issue #1468

Signed-off-by: smartyfi <a.shabrawy@smarty-fi.com>

* update env variable to MF_THINGS_URL

Signed-off-by: smartyfi <a.shabrawy@smarty-fi.com>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2021-10-16 00:26:18 +02:00
Dušan Borovčanin 39ae7bdfa1 NOISSUE - Refactor single-user mode (#1471)
* Refactor single user mode

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

* Fix Twins dependency

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

* Rename `single-user` to `standalone`

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

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2021-10-11 16:08:26 +02:00
Dušan Borovčanin 94cba4aab2 Fix UpdateChannelHandler for Redis producer (#1473)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-10-11 15:36:35 +02:00
Ivan Milošević 66d3da0531 NOISSUE - Add SMPP notifier (#1464)
* Add SMPP notifier

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* fix readme
remove env file

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* resolve conversations

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Remove debug log

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Rename transmiter and transformer fields in struct

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* fix typo

Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-10-06 14:34:23 +02:00
Dušan Borovčanin f4312aef8a NOISSUE - Update dependencies (#1453)
* Fix Dockerfile base Go version

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

* Update Go version and dependencies

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-08-24 13:41:57 +02:00
Dušan Borovčanin caa4bda1a1 NOISSUE - Fix security warnings for dependencies (#1452)
* Fix security warnings for dependencies

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

* Omit `.mod` and `.sum` files in dependencies

This feature is introduced here: https://tip.golang.org/doc/go1.17#vendor.

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-08-23 15:26:35 +02:00
Drasko DRASKOVIC e1a66b3268 Bump docker-compose version in prereq (#1449)
Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com>
2021-08-13 18:30:14 +02:00
Mirko Teodorovic 7b3c26f60f NOISSUE - Fix bootstraping (#1448)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix url for sdk

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* revert init.go

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>
2021-08-13 13:56:05 +02:00
Drasko DRASKOVIC d73a5d53fe MF 1413 - Use per-service URL in SDK (#1444)
* Use per-service URL in SDK

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

* Fix CLI

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

* Fix CLI messaging

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

* Fix message tests

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

* Simplify Bootstrap

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

* Update API doc and responses

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

* fix failing certs, bootstrap tests

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix failing certs, bootstrap tests

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* Fix tests and rename to auth service

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

* Clean the code

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

* Remove unnecessary Repository logs

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

* Always return error in case of repo failure

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

* Cleanup SDK and CLI

Update tests, remove linter warnings, remove dead code.

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

* Clean the code

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

* Undo Bootstrap changes

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

* Fix tests

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

* Fix linter

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

Co-authored-by: mteodor <mirko.teodorovic@gmail.com>
Co-authored-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-08-11 16:58:10 +02:00
Dušan Borovčanin d6a3830ef4 MF-1439 - Add support for Basic Authentication in HTTP Adapter (#1441)
* Add support for basic auth for HTTP adapter

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

* Fix API docs

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

* Inline BasicAuth check

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-07-22 15:47:55 +02:00
Burak Sekili 5ac1203b55 MF-1421 - Make flattening of JSON transformer only available on InfluxDB (#1432)
* MF-1421 - Add a flag for making flattening JSON transformer optional

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Add test cases for JSON transformer without flattening

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Add a comment for Transform

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Separate TestTransformJSON into two tests

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Replace flatten flag

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Remove unnecessary flattening while reading a message

Signed-off-by: Burak Sekili <buraksekili@gmail.com>
2021-07-22 11:20:47 +02:00
Burak Sekili 19f0437f57 NOISSUE - Update the /disconnect endpoint HTTP method as PUT (#1438)
* NOISSUE - Update the /disconnect endpoint HTTP method as POST

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Update disconnection request name in spec

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

Update description

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Replaced POST with PUT

Signed-off-by: Burak Sekili <buraksekili@gmail.com>
2021-07-13 13:31:20 +02:00
Burak Sekili 2cfff01979 MF-1389 - Add /disconnect endpoint in Things service (#1433)
* MF-1389 - Add /disconnect endpoint in Things service

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Add db transaction in Postgres' Disconnect

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Reformat things mock and things http api

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Update naming of /disconnect endpoint decoder

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Update naming for /connect endpoint

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

Update naming based on new endpoint

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Update disconnect endpoint test case descriptions

Signed-off-by: Burak Sekili <buraksekili@gmail.com>
2021-07-10 00:59:12 +02:00
Manuel Imperiale bb072b8ad2 NOISSUE - Fix httputil implementation in users service (#1434)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-07-08 16:14:49 +02:00
Burak Sekili af0162f0df Fix fetching user members of an empty group (#1436)
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
2021-07-08 13:51:37 +02:00
Ivan Milošević 68af0e32b5 Change to user friendly docs urls (#1430)
Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-06-23 14:52:29 +02:00
Ivan Milošević cddfdf4038 NOISSUE - Use github action for showing OpenAPI spec with Swagger UI (#1427)
* init swaggerui action

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove dep

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* fix filename

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* add checkout master

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* try diffrent action

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* change path for search

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* change path

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* change path

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* put almost all openapi spec to one folder

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* fix pattern

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* try servers changing

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* test k8s

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove servers

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* use blokovi action

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* add cname

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Parameters ready for PR to upstream

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Fix errors in Auth openapi spec

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove white line

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* fix link in README

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* change docs and api links in readme files

Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-06-23 13:31:46 +02:00
Dušan Borovčanin 0a89f1dae1 Fix JSON Transformer empty format handling (#1429)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-06-22 12:32:16 +02:00
Drasko DRASKOVIC d3e34b1662 Update README
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2021-06-14 23:39:05 +02:00
Manuel Imperiale 9e5e50b347 NOISSUE - Update docker-compose images to latest release (#1419)
* MF-1390 - Fix docker-compose env_file

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Update README

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* NOISSUE - Update docker-compose images to latest release

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use Postgres 13.3-alpine

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-05-24 18:35:07 +02:00
Dušan Borovčanin 516c02bebe MF-1378 - Update dependencies (#1379)
* Update dependencies

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

* Fix compose files and configs

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

* Upgrade image versions

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

* Update Postgres version

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

* Update test dependencies

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

* Fix fkey error handling

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-05-20 20:53:56 +02:00
Manuel Imperiale 38ca7f761b NOISSUE - Update version.go with 0.12.1 (#1418)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-05-11 11:49:41 +02:00
Manuel Imperiale 9ce31b65a6 NOISSUE - Update CHANGELOG for release 0.12.1 (#1415)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-05-07 09:55:10 +02:00
Mirko Teodorovic 79af1ba9a8 NOISSUE - Refactor SDK memberships and fix openapi for memberships. (#1412)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix groups sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move Memberships from users to groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove tree param for memberships

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add memberships endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert file to master ver

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-05-03 22:27:10 +02:00
Dušan Borovčanin e04d94ecc7 MF-1288 - Add tests for JSON messages in message writers and readers (#1407)
* Add JSON Writer tests

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

* Add Posgres Reader JSON tests

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

* Add ID comment

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

* Add MongoDB Reader tests for JSON

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

* Rename test message

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

* Add tests for InfluxDB JSON messages

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

* Use test file for constants block

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

* Rename MongoDB imports

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

* Add Cassandra reader JSON tests

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

* Simplify test payload

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

* Handle wrong format uniformly across Readers

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-04-20 21:33:26 +02:00
chengyou tang e02e9c2387 MF-1408-Fix error handling for Thing update SQL(#1408) (#1409)
Signed-off-by: Chengyou Tang <tcy277813009@gmail.com>

Co-authored-by: Chengyou Tang <tcy277813009@gmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2021-04-20 14:26:16 +02:00
Mirko Teodorovic 063f73076d fix influx pass (#1410)
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-04-20 12:11:42 +02:00
Dušan Borovčanin 84978c034b Fix order (#1406)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-04-19 11:54:08 +02:00
Manuel Imperiale 0fe9f55bae NOISSUE - Add tests and connection route-map to lora-adapter (#1404)
* NOISSUE - Add tests and connection route-map to lora-adapter

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename LoraServer -> ChirpStack and fix links

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove ctx arg from Publish method

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert LoRa Server

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix links

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Check ids before to modify connection route-map

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Log conn errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-04-14 22:26:49 +02:00
Mirko Teodorovic 00dc197fa6 NOISSUE - Fix nginx configuration for groups (#1405)
* fix configuration for groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add location header

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix for https

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-04-09 17:25:20 +02:00
Ivan Milošević cd11728073 Change vernemq building source revision (#1402)
Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-04-08 18:16:21 +02:00
Manuel Imperiale 6770c19279 NOISSUE - Rm content-type check from list endpoint (#1400)
* NOISSUE - Rm content-type check from list endpoint

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix decode func naming

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-03-30 11:32:28 +02:00
Drasko DRASKOVIC 4efd25eed5 Bump Mainflux version to 0.12.0 (#1399)
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2021-03-29 12:13:20 +02:00
Drasko DRASKOVIC 6b6f18317f Add CHANGELOG for 0.12.0 (#1398)
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2021-03-29 00:57:08 +02:00
Mirko Teodorovic 0cdcf28683 MF-1394 - SDK groups (#1396)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix groups sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix groups sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix groups sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small fix, revert some changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test fail

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix unassign request

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* decouple util method form group repo

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix param parsing

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-03-26 22:51:02 +01:00
Mirko Teodorovic f9f51470b1 NOISSUE - fix response for passwd endpoints (#1393)
* fix response for passwd endpoints

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test for passwd related responses

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test for passwd related responses

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-03-23 17:43:06 +01:00
Mirko Teodorovic e87715ba31 dont retrieve groups (#1392)
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-03-23 12:20:56 +01:00
Manuel Imperiale 9245e2593b MF-1368 - Add internal http api package for query params reading (#1384)
* MF-1368 - Add internal http api package for query params reading

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix comments

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix comments

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use internal/http and internalhttp alias

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Mv errors types to pkg

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use httputil/query.go and remove aliases

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add blank lines after error definitions

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add ReadBoolValueQuery

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Mv readBoolValueQuery

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* User ErrNotFoundParam instead of pointer

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert ReadUintQuery to use default values

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use default values for all query readers

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-03-23 11:48:05 +01:00
Manuel Imperiale bcdc6d21f6 MF-1390 - Fix docker-compose env_file (#1391)
* MF-1390 - Fix docker-compose env_file

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Update README

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-03-23 11:39:40 +01:00
Ivan Milošević 0f3a262ca3 put order direction in response body (#1387)
Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-03-15 19:55:57 +01:00
Mirko Teodorovic 74aa93fbb6 NOISSUE - Certs service refactor (#1369)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add certs mock

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove not wanted changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor certs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* addint tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* addint tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add certs test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add certs test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add cert test, remove default implementation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix default value for vault host

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add cert test, remove default implementation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* linter cleaning

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comments, and logging

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* use mocks from other services

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename struct and url path params

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve minor comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* align url params naming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix typo

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove struct revoke

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor certRes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-03-15 12:27:32 +01:00
Ivan Milošević 30ba38c919 MF-1357 - Add new endpoint for searching things (#1383)
* Add new enpoint for thing search

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Rename endpoint to /search
Use same request as list endpoint

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Add optional parameters in body (offset, limit)
Add swagger file

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* move all parameters into body

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* fix swagger

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* fix error description

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Add tests

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove dead code
fix tests

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove unused var

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* fix sdk tests

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* add url endpoint for search test

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* description in swagger
fix tracer string
change test offset

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* rename in tests searchThReq to searchThingReq

Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-03-11 10:28:44 +01:00
Ivan Milošević a1e18a770a init commmit (#1385)
Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-03-10 11:52:33 +01:00
Mirko Teodorovic 259950b009 NOISSUE - Add missing auth port in nginx enrypoint.sh (#1380)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix auth http port

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-03-04 19:02:59 +01:00
Mirko Teodorovic 530f925c4d MF-1346 - Create Groups API - add grouping of entities (#1334)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users endpoint for retrieving users from group

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove  groups from things and users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move groups into auth

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* separate endpoints for users and things

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix problems with retrieving members

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add groups test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove groups from users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove groups from things

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename constant

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add new errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove unnecessary constants

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix validation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* create groups db mock

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert changes to docker related files

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove groups endpoints from users openapi

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove groups endpoints from users openapi

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move constant from postgres to groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move constant from postgres to groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move constant from postgres to groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove testing group

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renam typ to groupType

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add error for max level

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove print

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove groups.Member interface

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix query building and add test cases

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* uncomment tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move groups package

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove group type, add bulk assign and unassign

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update openapi, remove parentID from create request, reorder endpoints

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update openapi

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update openapi for users and things

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix groups test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix linter errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename assignReq structure

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor mocks, response, remove type from endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* some refactor, renaming, errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* simplify check

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove package alias

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix naming and comment

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* additional comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add members grpc endpoint test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix retrieving members for different types

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix retrieving members for different types

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove unecessary structure

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix api grpc

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename const

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactore retrieve parents and children with common function

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small changes for errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix compile error

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix sorting in mock

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove regexp for groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert as change is made by mistake

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert as change is made by mistake

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor groups and keys package

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix naming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix naming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test for timestamp compare

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix error handling

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove errors not being used

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* var renaming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add endpoints for groups into nginx

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize endpoints, remove some errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize endpoints, remove some errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small fix

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix linter errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix group save path problem

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* description constant

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename variables

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix validation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* get back return

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix compile

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-03-04 10:29:03 +01:00
Mirko Teodorovic 6b1f4d54f8 NOISSUE - Fix certs and vault deployment, reorganize and remove unnecessary vars (#1368)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix certs, fix scripts, reorganize env vars

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* set pki path vars

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add certs mock

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove not wanted changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update readme

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* correct rsa_bits to key_bits

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix tabulation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* hardcode vault version

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add env desc

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renam variables

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* use Mainflux Labs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* replace BG with Belgrade

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-03-02 12:20:52 +01:00
Ivan Milošević 7bcaa323d4 MF-1317 - Configurable regexp rule for password (#1355)
* read and validate regex envar

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* pass regexp to user/api

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* resolve conflicts

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* use exported regexp variable

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* move password validation from users package

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove dead code

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* add password change request

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* move regexp from api to users package

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* fix tests

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove commented code

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* add regexp as field in userService, remove it as user exported global var

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* add passwd validation in service

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Add psswd validation for change password in service

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* add password validation in password reset

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Remove password validation from user validation test

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Replace email and passwords in test with constants

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* compile error not fail silently

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* fix tempate path

Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-03-01 15:22:57 +01:00
Dušan Borovčanin e334569d81 Fix CoAP Adapter README (#1376)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-03-01 12:25:39 +01:00
Mirko Teodorovic 0432b2aa03 NOISSUE - Fix default values for port and x509 provision (#1367)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix default port and certs settings

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small typo fix

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor env vars

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-02-27 01:01:48 +01:00
Filip Bugarski 56d04cda64 NOISSUE - Added missing endpoints for users service (#1372)
* Added missing endpoints for user's service

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>

* Type fix

Signed-off-by: Filip Bugarski <filipbugarski@gmail.com>
2021-02-25 17:19:35 +01:00
Nikola Marčetić e01874e557 MF-1365 - Add ADOPTERS.md file (#1371)
* Added ADOPTERS.md file

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>

* Add Note

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>

* Remarks resolved

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>
2021-02-25 13:46:07 +01:00
Darko Draskovic 9e532d2a72 Fix grpc endpoint parameter permutation (#1370)
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2021-02-24 13:23:50 +01:00
Darko Draskovic 7ba3fdb3bf NOISSUE - Add IsChannelOwner grpc endpoint (#1366)
* Add CanAccessChannelByOwner grpc endpoint

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Rename grpc endpoint to IsChannelOwner

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add tests for IsChannelOwner grpc

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Bump protoc version

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Make proto

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2021-02-22 19:41:59 +01:00
Manuel Imperiale 7834cc48b3 MF-1362 - Sort Things and Channels connections by name (#1363)
* MF-1362 - Sort Things and Channels connections by name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add order and direction tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-02-17 16:21:40 +01:00
Manuel Imperiale f0f60e2d2a MF-1314 - Add value comparison filters for readers (#1353)
* MF-1314 - Add value comparison filters for readers

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Check if comparison parameter is valid

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use eq, lt, lte, gt, gte as comparison operator keys

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use consts for comparison operators

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use comparator naming instead of comparison

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix openapi.yml

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-02-09 22:44:04 +01:00
Dušan Borovčanin 24b902d049 Fix env configuration and documentation (#1360)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-02-08 22:38:52 +01:00
Dušan Borovčanin 13c426c09c NOISSUE - Support disabling Email Agent authentication (#1356)
* Fix mailer configuration

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

* Remove unused Driver option

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

* Add Email Agent README

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-02-08 13:21:52 +01:00
Manuel Imperiale ca5ff63dfb NOISSUE - Upgrade Mongo, Cassandra and Influx docker images (#1354)
* NOISSUE - Upgrade Mongo, Cassandra and Influx docker images

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use cassandra version 3.11.9

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add MF_INFLUXDB_HTTP_AUTH_ENABLED envar

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use influxdb 1.8.4-alpine

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use influxdb 1.8.4

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-02-05 12:32:21 +01:00
Darko Draskovic 8b2ae46324 Add READMEs to pkg packages (#1352)
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2021-02-04 20:04:41 +01:00
Drasko DRASKOVIC 241ccf8fb4 Correct README (#1349)
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2021-02-02 17:18:12 +01:00
Mirko Teodorovic 39a649c1bb MF-1342 - Use environment variables in docker-compose to use tagged version of image (#1343)
* add MF_RELEASE_TAG

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update readme file for MF_RELEASE_TAG

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update readme file for MF_RELEASE_TAG

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix explanation, space

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix bad search/replace

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix bad search/replace

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix readme

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* improve explanation for tag

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* replace snippet with link to code section

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* improve explanation for tag

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* replace snippet with link to code section

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove MF_RELEASE_TAG from service readme

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-02-02 16:26:02 +01:00
Dušan Borovčanin a3dbfecb2d MF-1311 - Add Notifications service (#1324)
* Add repo to Notify

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

* Remove notify

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

* Add initial repo implementation

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

* Add Subscriptions repo implementation

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

* Add working version of main method

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

* Add Notifier API

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

* Add API layer

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

* Add Notifier interface

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

* Fix SMTP notifier main

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

* Fix email sending

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

* Fix main log

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

* Add Readme and fix env vars

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

* Update README

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

* Remove commented code

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

* Rename notifiers to notify

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

* Move Consumer API to writers

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

* Fix contact naming

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

* Fix spacing in init.go

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

* Fix API

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

* Add mocks

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

* Add initial service test

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

* Use pagination

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

* Update List method

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

* Fix listing

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

* Rename SubscriptionPage to Page

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

* Finish service tests

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

* Add DB tests

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

* Add API tests

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

* Add more API tests

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

* Remove Things dependency

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

* Add API docs

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

* Add docs

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

* Fix Things references

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

* Fix AuthN typo

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

* Fix linter warnings

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

* Add license comments

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

* Fix test order

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

* Use service error for wrappers

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

* Fix repo setup test

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

* Use total const in tests

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

* Use constant contacts

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

* Fix code formatting

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

* Rename notifier implementation

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

* Rename Notify to Notifiers

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

* Resolve remarks

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

* Fix naming and docs

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

* Fix docker-compose

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

* Rename Subscriptions to Notifiers service

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

* Fix logging

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

* Fix formatting and typo

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

* Resolve remarks

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

* Fix topic request

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-02-01 14:08:10 +01:00
Jonathan Dreyer 73c175020e MF-1344 - Fix links to API documentations #1345
Signed-off-by: Jonathan Dreyer <jonathan.dreyer@he-arc.ch>
2021-01-31 20:25:19 +01:00
Manuel Imperiale 1bf485b71b NOISSUE - Upgrade influxdb and postgres docker images (#1341)
* NOISSUE - Upgrade influxdb and postgres docker images

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Upgrade grafana version

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Upgrade influxdb to 1.8.3-alpine

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-01-29 12:37:50 +01:00
Manuel Imperiale 8c87ee8328 NOISSUE - Revert cli to use user token from command args (#1339)
* NOISSUE - Revert cli to use user token from command args

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove CLI binary

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add offset, limit, name and rawOutput to config file

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert cli.ParseConfig()

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Check config values before to use them

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-01-28 11:29:32 +01:00
Manuel Imperiale 0631900d5c MF-1276 - Fix openapi IDs and Keys format (#1338)
* MF-1276 - Fix openapi IDs and Keys format

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix jwt

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix acces-by-key

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-01-27 11:42:55 +01:00
Manuel Imperiale 4619576e94 MF-1061 - Add PageMetadata to readers (#1333)
* MF-1061 - Add PageMetadata to readers

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix merge conflicts

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Mv Total to MessagesPage

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix review

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix readers mock and add filters tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add Total check and allow combinations of query parameters

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use slices length as Total

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify readers mock

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add empty lines

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-01-26 12:23:15 +01:00
Dušan Borovčanin 31f5bf714a NOISSUE - Fix run script and compiler warnings (#1336)
* Fix NATS server naming in run script

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

* Fix warnings

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

* Fix typo

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-01-26 01:07:06 +01:00
Dušan Borovčanin bf5ede086a Fix Postgres writer transaction handling (#1335)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-01-23 02:03:33 +01:00
Dušan Borovčanin 5cfc9305e5 Make Transformer type configurable (#1331)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-01-20 13:10:40 +01:00
Manuel Imperiale 85f73a87b6 MF-1061 - Implement v, vb, vs, vd and from/to mongodb-reader filters (#1326)
* MF-1061 - Implement v, vb, vs, vd and from/to mongodb-reader filters

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm duplicated test parameters

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use pubID2 naming

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix merge

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix merge

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm unecessary *bson.D pointer

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use from >= and to <= conditions and add tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert to half open interva

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-01-19 09:30:48 +01:00
Manuel Imperiale 0f856f5667 NOISSUE - Rename package aliases uuidProvider into uuid (#1323)
* NOISSUE - Rename pkg aliases uuidProvider into uuid and fix authn typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add missing error checks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use global uuidProvider

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use expTime globally

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix user uuid provider

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix review

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use idProvider name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use idProvider instead of uuidProvider

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use idProvider instead of uuidProvider

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-01-17 23:12:45 +01:00
Ivan Milošević 0516fe2fd7 MF-1034 - Wrapping MQTT client (#1318)
* use subscribe interface

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* delete old implementation

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* add subscribeToLoRaBroker method
change declaration

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove alias for package

Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-01-15 23:22:18 +01:00
Manuel Imperiale a8c652f96c MF-1061 - Fix cassandra-reader count for json format (#1327)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-01-13 10:23:05 +01:00
Manuel Imperiale 8e5a9cfc9a MF-1061 - Implement v, vb, vs, vd and from/to cassandra-reader filters (#1325)
* MF-1061 - Implement v, vb, vs, vd and from/to cassandra-reader filters

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert JSON implementation

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-01-12 20:39:31 +01:00
Dušan Borovčanin 6b7dc54c8b NOISSUE - Switch to Consumers interface (#1316)
* Replace Writer with Consumer

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

* Add Notifications package

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

* Update Consumer Start

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

* Fix Readers

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

* Fix Consumer naming

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

* Add repo to Notify

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

* Remove notify

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

* Rename consumer field in middlewares

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

* Fix remarks and add Readme

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2021-01-11 23:55:34 +01:00
Manuel Imperiale 973ca177ea MF-1061 - Implement protocol, name, v, vb, vs, vd and from/to Postgres reader… (#1322)
* MF-1061 - Implement protocol, name, v, vb, vs, vd and from/to postgres-reader filters and tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-01-11 13:17:12 +01:00
Manuel Imperiale a185855c06 MF-1061 - Add name, protocol and publisher tests to influxdb-reader (#1320)
* MF-1061 - Add name, protocol and publisher tests to influxdb-reader

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use short package aliases

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-01-11 10:53:38 +01:00
Manuel Imperiale ac09815457 NOISSUE - Fix Auth typo (#1319)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2021-01-11 10:00:13 +01:00
Ivan Milošević 3eca6920e1 NOISSUE - Add health check for MQTT broker (#1305)
* Add health check

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* update readme
use constants

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* close body after each HEAD request

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* log and close health check response body

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* use healthcheck endpoint instead ping for docker healthcheck

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* remove for loop, only one check and exit if failed healthcheck

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* changed cmd for healthcheck
new version of verne image

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* use false instead exit 1

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* return for loop

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* review

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* add continue after unsuccesful http.get

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* Use backoff package

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* extracting healtcheck function outside main()

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* go mod vendor

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* go mod tidy

Signed-off-by: Ivan Milosevic <iva@blokovi.com>

* go mod vendor

Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2021-01-05 19:45:09 +01:00
Dušan Borovčanin e326494166 MF-1264 - Add support for JSON readers (#1295)
* MF-1254 - Create universal JSON writer (#1260)

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

* Add JSON support to Readers

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

* Fix Influx Reader tests

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

* Fix messages format query

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

* Fix Postgres reader

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

* Fix Cassandra Readers and writers

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

* Fix Mongo reader

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

* Extract utility method to the JSON transformer

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

* Fix Influx and Postgres count

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

* Update JSON transformer

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

* Fix Influxdb Reader total count

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

* Refactor init.go for Cassandra writer

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

* Create a Payload type

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

* Add comments for defaults

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

* Fix variable declarations

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

* Replace interface{} with a new type

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

* Don't set channel just to overwrite it later

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

* Fix range search

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

* Rename Messages field

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

Co-authored-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-12-30 15:43:04 +01:00
Mirko Teodorovic 47217cb5b9 NOISSUE - Merge authz and authn into new service auth (#1313)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move authz into authn and merge into new service

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add groups endpoints

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add group type

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding mocks, some renaming, refactor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update proto

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding mocks, some renaming, refactor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix linter err,and comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* undo renaming, add interface for authn and authz

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renam some variables

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove extra slashes from comment

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolving small remarks

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-12-29 23:02:35 +01:00
Manuel Imperiale b2ccbaec27 MF-1061 - Implement InfluxDB filters value, v, vb, vs, vd, from, to (#1312)
* MF-1061 - Implement InfluxDB filters value, v, vb, vs, vd, from, to

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use time filters as float64 instead of int64

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove unnecessary cast

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use a const for limit in tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert float64 cast when dividing

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove value filter in favour to v

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use v, vb, vs, vd

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use v, vb, vs, vd

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm unecessary cast

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-12-25 19:23:54 +01:00
Manuel Imperiale cb9985d160 NOISSUE - Correct readers openapi.yml (#1310)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-12-21 11:45:37 +01:00
Dušan Borovčanin 1810cec82b NOISSUE - Fix MQTT Forwarder client id (#1309)
* Fix MQTT Forwarder client ID

Don't set client ID for MQTT client in MQTT forwarder. It results in
error in case of multiple instances of the MQTT adapter because they all
share MQTT client ID, which makes broker disconnect all the other
adapters.

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

* Inline broker address option

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

* Add MQTT client username

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

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2020-12-17 17:17:33 +01:00
Mirko Teodorovic d2af0602a0 NOISSUE - Fix dates not being init properly on save, change path construction, replace UUID with ULID for group ID (#1300)
* fix path, group saving with parent

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change path, enable name change

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert changes for port

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* replace UUID with ULID

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add ulid

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix migrations

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert user groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add ulid provider

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* enable group name change

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* use null string for parent id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove migrations, disable group delete if group not empty

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert docker compose

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add ulid provider

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove dash character replacment

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add ulid lib

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename UUIDProvider

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename package alias

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove unused error

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-12-17 17:08:28 +01:00
Mirko Teodorovic 8aadc0ff40 NOISSUE - Remove authz from docker comp (#1307)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove authz from docker

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert init.go

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-12-16 18:15:27 +01:00
Darko Draskovic c7d2feb434 Shorten descriptions and add formats (#1306)
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-12-16 16:00:56 +01:00
Mirko Teodorovic 18dd8967cc NOISSUE - remove owner id from user table and object (#1303)
* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove owner id

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-12-15 15:57:37 +01:00
Darko Draskovic 9864b27271 NOISSUE - Add missing fields to openapi specs and enclose http codes in single quotes (#1302)
* Add req body to token req

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Shorten summaries and add/remove keys

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add single quotes to html response codes

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-12-15 00:20:42 +01:00
Manuel Imperiale 3653e6b5d2 MF-1290 - Sort Things and Channels by name (#1293)
* MF-1290 - Sort Things and Channels by name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add sort HTTP parameter and use PageMetadata to pass filters

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix channels conn list

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix logs

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Replace sort naming by order

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add order in responses

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Improve tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Improve order tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Improve getNameQuery func

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix commits

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add name-asc and name-desc

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add dir query parameter

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix openapi

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix openapi format

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test messages and openapi.yml

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix openapi uuid format

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Check query parameters in endpoint layer

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add asc endpoint tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename pageMeta into pageMetadata

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-12-08 21:30:47 +01:00
Mirko Teodorovic fbba7aaa1a MF-1248 - Add access policies for users (#1246)
* authz service init

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* authz service init

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add proto

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add proto

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* authorize method

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add casbib

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add casbib

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add casbib

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add policy grpc

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add policy grpc

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix db connection, add environment variables, docker-compose

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add model.conf policy

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add model.conf policy

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding tests, and token for auth

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix auth service

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small changes, add model conf env var

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove users grpc for now

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix error

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* some cosmetics

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolvin minor comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change endpoint, add file to fix test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix docker env

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix alignment and path for model.conf

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-12-08 17:04:09 +01:00
Ivan Savčić 20f5290d7a Fixes, without spaces. (#1296)
Signed-off-by: Ivan Savcic <isavcic@gmail.com>
2020-12-04 18:59:16 +01:00
Darko Draskovic 23bc822433 Add different CNs for CA and certs (#1292)
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-11-26 15:32:52 +01:00
Mirko Teodorovic 7195cad0f6 MF-397 - Introduce Thing Groups (#1259)
* add things group

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add things group repository

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add things group repository

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add things group repository

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add parents and children methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add parents and children methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix logging message and temporary test fix

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix bootstrap test fail

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move groups to pkg

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move groups to pkg

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move groups to pkg

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move groups to internal

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move groups to internal

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix import

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix linter errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments, add hierarchy info when retrieving groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* code refactor, separate http into multiple files

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* code refactor, separate http into multiple files

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix group update

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* use user id when saving

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* use user id when saving

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move code

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move code

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove temporary test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add groups test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comments, fix responses in api for groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add checks for name length

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

fix validation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

small change to response

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add comment for Level

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add level to limit hierarchy retrieval

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

tidy vendor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add level to limit hierarchy retrieval

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

mod tidy

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

revert

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

small naming and code organize refactor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

revert Member type

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

fix typo

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

use ltree

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

use ltree

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add level for retrieving

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add level

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add ltre

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

upgrade postgres version in test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

add ltre

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

remove test for now

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

minor fixes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

fix id setting

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

fix tree endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

minor style changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small changes, adding new lines

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change function signature

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change primary key

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change function signature

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* simplufy code

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove groups test for now

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix tabulation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix whitespace

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove white space, fix grammar

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix sqls so that not additional retrieve is needed

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix sqls so that not additional retrieve is needed

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

fix primary key

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

remove retrive by name

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove name and parent update

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix cound sql

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add line

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* simplify sql, fix table name

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add date

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add date

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add timestamp to api

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix var name

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix var name

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-11-23 11:34:29 +01:00
Dušan Borovčanin 663bd4e18d Add Enhancement section to the issue template (#1284)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2020-11-17 22:52:56 +01:00
Darko Draskovic c03644524e Fix hardcoded env var values (#1283)
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-11-16 20:44:25 +01:00
Dušan Borovčanin f1aa32d89c NOISSUE - Improve AuthN service docs (#1282)
* Update AuthN service README

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

* Update Authn service docs

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2020-11-13 21:46:04 +01:00
João Matos 3273c30d8b MF-1268 - CLI improvements (#1274)
* Prefix error messages in CLI with a bold "error: ".

Signed-off-by: Joao Matos <joao@tritao.eu>

* Remove duplicated "Usage: " from groups command help.

Signed-off-by: Joao Matos <joao@tritao.eu>

* Add a raw output mode for CLI and use it on logCreated.

Signed-off-by: Joao Matos <joao@tritao.eu>

* Add CLI global flag for user auth token.

Signed-off-by: Joao Matos <joao@tritao.eu>

* Add CLI config flag and parsing logic.

Signed-off-by: Joao Matos <joao@tritao.eu>

* Refactor CLI users commands outside array structure.

Signed-off-by: Joao Matos <joao@tritao.eu>

* Refactor CLI certificates commands using flags.

Signed-off-by: Joao Matos <joao@tritao.eu>

* Refactor CLI things create command using flags.

Signed-off-by: Joao Matos <joao@tritao.eu>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2020-11-01 00:29:06 +01:00
João Matos 46c675cd5f NOISSSUE - Vault integration as an addon. (#1266)
Integrates Vault PKI service as a service addon.

Also adds some helper scripts to help setup the CA in Vault, as well as
some docs to explain how to use them.

Originally based from https://github.com/mteodor/vault.

Signed-off-by: Joao Matos <joao@tritao.eu>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-10-31 21:44:25 +01:00
Dušan Borovčanin 02db4066b1 Fix naming in Authn API tests (#1275)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2020-10-27 20:08:16 +01:00
Dušan Borovčanin f6b1ae735c MF-1244 - Return UserID alongside with user Email in Identify response (#1245)
* Add both an ID and an Email to API key requests

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

* Use return UserIdentity response

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

* Replace GetValue with GetEmail

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

* Refactor Mainflux Key

Add `Subject` field and reorganize Key manipulation.
**Remove backward compatibility**

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

* Fix service test

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

* Fix DB tests

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

* Fix API tests

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

* Fix JWT tests

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

* Uncomment and fix API tests

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

* Fix SQL statements alignment

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

* Fix Issue method docs

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

* Fix Retrieve API and API docs

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

* Update tests

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2020-10-27 19:42:53 +01:00
Manuel Imperiale 926e9799d6 NOISSUE - Fix ViewGroup and UpdateGroup (#1269)
* NOISSUE - Fix ViewGroup and UpdateGroup

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add ID check and fix naming

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix id in groupUpdateReq

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix review

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-10-27 11:26:32 +01:00
Manuel Imperiale 1c298d8f27 NOISSUE - Add ListUsers, ViewUser and ViewProfile methods (#1262)
* NOISSUE - Add admin method in users service to return users list

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix loggings and metrics

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add email and metadata filters

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Retrieve User infos by ID if Admin

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove admin checks and fix comments

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix missing query

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use generic funccs to create email and metadata queries

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add /users/profile endpoint

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify db helpers

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix View, List, Retrieve prefix methods naming

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix tracer endpoints naming

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add tests and remove TODO comments

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-10-26 10:17:08 +01:00
Manuel Imperiale 420b598ac7 NOISSUE - Rm users http package (#1256)
* NOISSUE - Mv users http gokit layers to http package

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove users/api/http dir

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-10-16 18:00:24 +02:00
Manuel Imperiale 86fe3f7cdb NOISSUE - Remove content-type check from decodeListUserGroupsRequest (#1255)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-10-16 12:54:27 +02:00
Darko Draskovic 3c794d4a03 NOISSUE - Migrate swaggers to openapi 3 spec (#1250)
* Migrate authn swagger to openapi 3

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Migrate http swagger to openapi 3

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Migrate bootstrap swagger to openapi 3

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix users spec parameters indentation

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Refactor user svc errs to return input related errors

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Migrate certs swagger to openapi 3

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Migrate provision swagger to openapi 3

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Migrate provision swagger to openapi 3

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Migrate readers swagger to openapi 3

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Migrate twins swagger to openapi 3

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Refactor and rename bootstrap swagger

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Rename certs, http, provision and readers swagger to openapi

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Refactor and rename user swagger to openapi

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Refactor twins swagger and rename to openapi

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Refactor things swagger and rename to openapi

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Cleanup whitespace

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-10-09 15:25:09 +02:00
Dušan Borovčanin 8dd59f8557 Update MQTT Broker Docker scripts (#1253)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2020-10-09 11:57:08 +02:00
Ivan Milošević bc41c32cf5 update mproxy version (#1251)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-10-09 01:55:09 +02:00
Mirko Teodorovic 42e4e054c2 NOISSUE - Fix group retrieval when parent id is not specified (#1247)
* fix group retrieval

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor for better readability

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-10-01 17:03:35 +02:00
Mirko Teodorovic 9ed5f8334f NOISSUE - Add new endpoint to retrieve configuration to be used as a template. (#1242)
* add provision service

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix code style

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test for provision

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* extra line

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* return map[string]interface instead of interface

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-09-29 10:25:26 +02:00
Mirko Teodorovic 8ea26c5ab7 NOISSUE - Add user groups (#1228)
* adding group

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding user group

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding group

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add retrieve methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default admin user

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default admin user

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding endpoints

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding endpoints

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* changes signature for AssignUser

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* bug fixing retrieving groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove unused code

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* bug fixing retrieving groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* retrieve groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change environment for admin

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change environment for admin

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* retrieve groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove adding default group

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* expose port for debugging purposes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix tests, and linter errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add prefix Users for groups endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix linter problems

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix endpoint prefix url

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix endpoint test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add group features in cli

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove println

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* when user is created return id in response

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* when user is created return id in response

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding default admin env

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* proper alignment

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* proper alignment

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename  method

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* return user id when created

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* return user id when created

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove unused variable

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix to retrieve whole tree starting from parent

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add endpoint to list groups for user

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add readme for groups

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fixing bugs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fixing bugs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add group commands for add and remove user

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* replace default email, use example.com

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix capital letters beginning of sentence

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove warning for deprecated api, mistakenly copied

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* simplify repo methods, rely on db driver rather than the check before operation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* check if group is valid

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* openapi spec 3.0

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove check for existing users in groups before delete

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change func signature

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change func signature

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix bugs, resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix bugs, resolve comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix alignment

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add missing command

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize envs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix doc

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix compile

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize cli commands

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor corrections

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix naming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renaming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolve comments, minor changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-09-23 23:18:53 +02:00
Darko Draskovic 043d1e0aac MF-1237 - Return to transport only things service errors (#1236)
* Replace error messages for things and channels with error messages for entities

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add db and cache errors

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Migrate swagger to openapi

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove db and cache specific err msgs and generalize errs

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Redefine status codes

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Define endpoint error codes in service and swagger

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Refactor sdk errors

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix grpc tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Reformat and add err check

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-09-23 15:44:39 +02:00
Dušan Borovčanin f10e49e6b5 MF-928 - Change CoAP lib (#1233)
* Switch CoAP lib

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

* Revert removed adapter code

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

* WIP CoAP refactor

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

* Add auth key

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

* Fix observers map

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

* Fix reading message body

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

* Fix subtopic parsing

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

* Fix error handling

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

* Fix multi-protocol communication

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

* Separate client from observer

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

* Remove unused config

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

* Remove TCP option

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

* Inline error check

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

* Add logging client errors

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

* Replace RWMutex since we're not using RLock

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

* Inline error handling

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

* Inline error handling

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2020-09-22 11:59:10 +02:00
Manuel Imperiale f18f2c1c98 NOISSUE - Simplify make cleandocker (#1230)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-09-09 22:32:05 +02:00
Darko Draskovic dfa6d8ba0d [NOISSUE] - Fix malformed Swagger API specs (#1229)
* Fix authn swagger

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix certs swagger

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix http swagger

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix provision swagger

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix readers swagger

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix things swagger

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix users swagger

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add missing description strings and improve naming in definitions

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-09-09 13:05:36 +02:00
Al Hoang e272d9f7ad MF-435 - Add support for env file loading (#1223)
* NO-ISSUE - add support for env file loading

Signed-off-by: Al Hoang <hoanga@gmail.com>

* update go mod

Signed-off-by: Al Hoang <hoanga@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-09-07 15:45:36 +02:00
Mirko Teodorovic 26c944b5c3 update certs docs (#1227)
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-08-07 17:35:11 +02:00
Mirko Teodorovic 3694a82de6 NOISSUE - Fix certs update in bootstrap config and make content handling in config.toml user friendly (#1221)
* adding certificate issuing

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add certs update

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix minor comments, default env vars, add agent and export config into config.toml for provision

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* simplify check

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-07-29 14:20:43 +02:00
Ivan Milošević 930f8beb29 NOISSUE - Fix typo in authorization.js (#1226)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-07-28 11:09:18 +02:00
Manuel Imperiale 9334568ba2 MF-983 - Add HTTP query param to connections list endpoints to fetch disconnected Things or Channels (#1217)
* MF-983 - Add HTTP query param to connections list endpoints to fetch non connected Things or Channels

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typos and add Swagger

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Update SDK and CLI

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Simplify queries

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix tabulation

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>
2020-07-26 22:47:15 +02:00
Mirko Teodorovic b91024465c MF-1179 - Add a certificate service and certs endpoint to SDK (#1188)
* adding certificate issuing

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding cert endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update envs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update envs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move certs creation to sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move certs creation to sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move certs creation to sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix env vars

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add comment

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix vars

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add volumes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix merge config for int

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove env

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix error handling

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add cert test, change receiver to pointer

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add docs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix var naming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* correct error naming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding certs service

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add certs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add certs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change func receiever

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default cert issue method

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add config

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small fix

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove some testing code

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add cert issue

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add vault api client

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* additional endpoints

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add swagger for certs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove certs from provision

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* clean provision from certs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add list certificates endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add vault api in vendor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add certs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add revoke, fix bugs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix sdk for certs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor changes, add env, doc

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor changes, add env, doc

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor changes, add env, doc

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove CA for signing from provision

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add docker file for certs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix mock sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add line

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix RevokeCert

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renam ENV

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove tests temporarily

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix naming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* renam vars

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add cli for issue cert

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add cli for issue cert

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add cli for issue cert

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add cli for issue cert

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove not needed envs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix linter errors, add cli

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix linter errors, add cli, var rename

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix reviews, add viewcert, fix view all certs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove view cert, as it will be retrieved from PKI

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change endpoints

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default env val

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove some errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor, make wrapper lib for vault

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor, make wrapper lib for vault

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor, make wrapper lib for vault

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix revoking

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor, make wrapper lib for vault

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update vendor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comment

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove unused

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove unused field

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update vendor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor pki

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor pki

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor pki, update vendor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor pki

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comment

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor fix

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove methods, use fields

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comments and package desc

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comments and package desc

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-07-21 12:53:21 +02:00
Dušan Borovčanin be1361311d NOISUE - Fix cache error when key is not in Redis (#1220)
* Fix cache error when key is not in Redis

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

* Fix tests

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

* Fix errors message

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2020-07-14 22:54:33 +02:00
Darko Draskovic c1088b9315 MF-1199 - Add NATS messaging tests (#1209)
* Add test setup for mqtt

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add pubsub tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add message and payload helper funcs

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add time.Sleep after subscribe to topic

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add NATS tests setup

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add NATS test cases

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add message forwarded check to handler

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove race affected mqtt tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-07-14 18:11:27 +02:00
Mirko Teodorovic 2453cd75ed NOISSUE: Fix emailer (#1219)
* update swagger

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* dont return nil

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* simplify emailer New

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-07-14 03:06:13 +02:00
Dušan Borovčanin 7dc6b0d879 NOISSUE - Update dependencies (#1218)
* Update Go version

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

* Update dependencies

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2020-07-13 15:24:55 +02:00
Darko Draskovic 381ebb1e51 NOISSUE - Add subtopic wildcard for twin attribute's definition (#1214)
* Add wildcard to attribute subtopic

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add MF_TWINS_SUBTOPIC_WILDCARD env var

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove configurable wildcard env var and mqtt notif leftovers

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add mongodb RetrieveByAttribute tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add redis wildcard subtopic IDs retrieval

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add tests for wildcard state save

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-07-09 12:18:19 +02:00
Mirko Teodorovic 09d09c6ef5 fix envs for nginx (#1215)
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-07-08 10:42:33 +02:00
Darko Draskovic a7eee53dfb Remove twin mqtt related obsolete var and fix es-redis address (#1213)
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-07-02 18:03:59 +02:00
Alexander Obukhov e6b7fd818b NOISSUE - Remove unused MF_THINGS_SECRET env var (#1211)
Signed-off-by: Alexander Obukhov <dev@sprql.space>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-06-29 22:28:20 +02:00
Alexander Obukhov ecff066421 NOISSUE - Fix some typos (#1212)
Signed-off-by: Alexander Obukhov <dev@sprql.space>
2020-06-29 20:48:14 +02:00
Dušan Borovčanin 8d33285489 NOISSUE - Remove unknown Bootstrap requests (#1210)
* Remove unknown Bootstrap requests

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

* Update docs

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

* Fix migrations

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2020-06-26 13:24:56 +02:00
Alexander Obukhov ee5c76395a NOISSUE — Use pgcrypto instead uuid-ossp for UUIDs generation (version 4) (#1208)
According to
https://www.postgresql.org/docs/current/uuid-ossp.html
it's recommended to use
https://www.postgresql.org/docs/current/pgcrypto.html
for randomly-generated (version 4) UUIDs

Signed-off-by: Alexander Obukhov <dev@sprql.space>
2020-06-19 00:37:54 +02:00
Darko Draskovic 4a9c7403d8 MF-1198 - Add errors package tests (#1207)
* Add tests for errors package

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add recursive fn to gen wrapped errs and func to gen corresponding msg

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add TestWrap func

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Replace literal string msgs with res of messages()

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add nil tests for errors.Contains()

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add nil tests for Wrap()

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-06-12 12:13:23 +02:00
Mirko Teodorovic 381a15a695 MF-1025 - timeout env in sec, use parseduration (#1206)
* timeout env in sec, use parsduration

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* timeout env in sec, use parsduration

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename var

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-06-08 18:17:16 +02:00
Manuel Imperiale a7b81dc37a MF-1201 - Fix MF_THINGS_AUTH_GRPC_URL mongo reader ENVAR (#1203)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-06-05 17:39:22 +02:00
Dušan Borovčanin a1643b1e7e NOISSUE - Fix CI (#1204)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2020-06-05 17:29:24 +02:00
Darko Draskovic 340e685d70 MF-1180 - Add redis based twins and states cache (#1184)
* Add twins redis cache

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add connectToRedis to twins main and twinCache to twins service

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add tracing to twins cache

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add twins cache mock and test setup for redis cache

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add TestTwinSave to redis twins cache tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add remove twin redis cache test

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add channels param to CreateDefinition helper method in mocks

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add IDs test to redis twins cache

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Simplify senml rec array and attribute creation funcs by removing unnecessary params

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Align cache remove twin method with service remove twin method

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add cache funcs to twins save, update and remove

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add def SaveIDs to redis cache and ref to service SaveStates

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add TwinSaveIDs tests for redis cache

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add cache related env vars desc to README.md

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add twinid bson key constant

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add Update method to cache

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Integrate uuid unification related changes

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Use named arguments in interface method declarations

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add env vars to docker-compose file

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Make parameter names in interface methods and implementations consistent

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Wrap vars and consts in var and const blocks

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-06-05 11:42:16 +02:00
Manuel Imperiale 97f8d65885 MF-739 - Add ID to the User entity (#1152)
* MF-739 - Add ID to the User entity

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Resolve remarks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Move idp to project root

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use RetrieveByEmail func and UUIDProvider

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm idp.go

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename UserInfo into ViewUser

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix ViewUser naming

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-06-04 22:29:16 +02:00
Ivan Milošević 7f3e2c1b21 NOISSUE - Fix default db name for storage databases (#1194)
* Fix db name in influxdb

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Align db name and namespace from .env with default values  in mongodb and cassandra also

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Rename databases' names to mainflux

Signed-off-by: Ivan Milošević <iva@blokovi.com>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2020-06-03 20:33:52 +02:00
Alexander Obukhov 8b004b3daf NOISSUE - Add MF_DOCKER_IMAGE_NAME_PREFIX to Makefile (#1173)
Signed-off-by: Alexander Obukhov <dev@sprql.space>
2020-06-03 20:27:09 +02:00
Manuel Imperiale a7c3cfcf1c MF-1154 - Move UUID provider to project root (#1172)
* MF-1154 - Move UUID provider to project root

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use naming uuidProvider/up instead of identityProvider/idp

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Mutualize UUID mocks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Move uuid into pkg directory

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-06-03 18:49:44 +02:00
Ivan Milošević f1ee9d0665 Fix typo in error messages (#1193)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-06-03 17:34:01 +02:00
Dušan Borovčanin ea3a891c91 MF-1190 - Add pkg for library packages (#1191)
* Move messaging to pkg

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

* Move errors to pkg

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

* Move Transformers to pkg

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

* Move SDK to pkg

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

* Remove Transformers from root

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

* Fix make proto

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

* Add copyrights header

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

* Fix CI

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

* Move Auth client to pkg

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

* Fix dependencies

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

* Update dependencies and vendors

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

* Fix CI

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2020-06-03 15:16:19 +02:00
Dušan Borovčanin c26c7f34cd MF-1177 - Implement caching in MQTT adapter (#1187)
* Add auth cache to MQTT adapter

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

* Remove unused fields from MQTT adapter

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

* Fix removal from Things cache bug

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

* Use Auth cache naming

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

* Parse duration instead of int

This is more convenient because duration contains unit.

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

* Remove commented code

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

* Remove unused environment variables

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

* Update README.md

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

* Remove unused code

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

* Fix Things mocks

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

* Fix README timeouts

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

* Remove WS Scheme

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

* Remove address from the mProxy target

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2020-06-02 21:21:30 +02:00
Ivan Milošević a5fb55c328 NOISSUE - Refactor provision tool (#1189)
* Use bulk sdk functions for generating Things and Channels
Add prefix option

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Update readme
Remove dead code
Rename variable

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-06-01 17:34:10 +02:00
Drasko DRASKOVIC 8906943d1d Prepare 0.11.0 release (#1186)
Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com>
2020-05-29 16:05:55 +02:00
Drasko DRASKOVIC a57fb03c01 Add VerneMQ docker image build from source (#1178)
Signed-off-by: Drasko Draskovic <drasko.draskovic@gmail.com>
2020-05-25 12:24:21 +02:00
Darko Draskovic 877005538c MF-994 - Add tracing middleware for twins and states repos (#1181)
* Add tracing for twin repository

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add state repository tracer

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove unused tracer meant for NATS publisher

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-05-21 13:06:31 +02:00
Darko Draskovic b4c80132e6 MF-995 - Add Twins tests for endpoint list twins and list states (#1174)
* Add ListTwins test

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove monotonic time from twins, definitions and attributes creation and update

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Separate twins and states endpoint tests in two files

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add state generation helper funcs to state endpoint tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add createStateResponse() to states test

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add states test cases

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Simplify RetrieveAll twins and states methods

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add service.go to mocks

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Rename mocks.NewService to mocks.New

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add error checking to endpoint state tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix method comment

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add json response decode success check

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove created and updated fields from twin and state res

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove definition fields from twin req and res

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add Create funcs to mocks package

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add service save state tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add service list states test

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-05-18 18:46:50 +02:00
Dušan Borovčanin d7670e7adb NOISSUE - Update dependencies (#1176)
* Update dependencies

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix mProxy version

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

Co-authored-by: dusanb <borovcanindusan1@gmail.com.com>
2020-05-14 19:09:55 +02:00
Manuel Imperiale df6f5adff8 MF-1163 - Fix influxdb-reader to use nanoseconds precision (#1171)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-05-12 18:19:04 +02:00
Ivan Milošević 5089fccf36 Rename environment variable MF_MQTT_ADAPTER_PORT to MF_MQTT_ADAPTER_MQTT_PORT in docker environment (#1170)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-05-12 14:28:59 +02:00
Darko Draskovic b13a3135dd Remove thing related code from twins service (#1169)
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-05-07 17:26:34 +02:00
Darko Draskovic 4d9694c027 MF-997 - Add twins service swagger file (#1167)
* Add twins service swagger file

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add TwinRes and TwinsPage definitions

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add StateRes and StatesPage

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add missing response codes

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add name parameter

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-05-07 14:58:23 +02:00
Dušan Borovčanin b8be18129c MF-1079 - Add MQTT forwarder (#1164)
* Add MQTT forwarder

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Cleanup forwarder code

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use MQTT Publisher in MQTT forwarder

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Cleanup MQTT messaging

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add Paho client timeout errors

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Simplify MQTT fowarder

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix naming in main method

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use interface and struct instead of function

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use Mainflux errors package

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename `tkn` to `token`

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use "/" instead of "." as topic separator

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use async MQTT Publisher

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix timeout errors messages

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add connect token check

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename package alias

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-05-07 09:34:09 +02:00
Mirko Teodorovic f9432c6525 MF-1159 - add gateway metadata update in provision method (#1160)
* provision fix

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update config

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix naming, Boostrap to Bootstrap

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add name as param

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add name as param

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix typo, and remove some props

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add name as param

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add name as param

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix typo

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix typo

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor service

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* improve gateway provision

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert content

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change docs, and error in service

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change docs, and error in service

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-05-06 16:53:32 +02:00
Mirko Teodorovic f482df9033 MF-1055 - rollback/release transaction on error (#1166)
* fix error message

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* release transaction on error

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reove println

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move defer func up

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor errors handling

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor errors handling

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move defer

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-05-06 15:15:19 +02:00
Manuel Imperiale 16ac44f377 NOISSUE - Use log level error for VermeMQ docker (#1162)
* NOISSUE - Use log level error for VermeMQ docker

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add vermemq ENVARS

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove DOCKER_VERNEMQ_ALLOW_ANONYMOUS from docker-compose

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert DOCKER_VERNEMQ_ALLOW_ANONYMOUS

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-05-05 16:44:06 +02:00
Manuel Imperiale 2b4cf8a990 NOISSUE - Fix default nats pubsub subject (#1153)
* NOISSUE - Fix default nats publisher subject

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use created timestamp inn transformer

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use created timestamp in transformer

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* rename topic -> subject for nats

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* revert

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* revert

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix subscriber topic

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix timestamp

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use int64 nanoseconds Created timestamp

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add comment to created protobuf field

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm gogo from scripts/ci.sh

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Return publisher in NewPublisher

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-05-04 13:14:06 +02:00
Mirko Teodorovic 0c016cd7ce MF-1125 - Document Provision service (#1143)
* update readme

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update docs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update docs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update docs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update docs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update docs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* additional paragraphs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* additional paragraphs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* additional paragraphs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add some space

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-05-01 01:31:02 +02:00
Manuel Imperiale f872546925 NOISSUE - Fix bootstrap SDK args naming (#1151)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-29 20:05:08 +02:00
Nikola Marčetić 9d5202c46b Use VerneMQ default log level (#1150)
Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>
2020-04-29 13:13:40 +02:00
Mirko Teodorovic bf189fbd23 NOISSUE - Update provision service (#1133)
* Add provision service

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* delete sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add provision file

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add provision

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add provision

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix envs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix vendor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* deleete LICENSE

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix modules

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix modules

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix modules

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactoring provison service

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* provision

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test, and use sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove bootstrap mock

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* implement channel

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* export errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add new line

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove docker-compse

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add new line

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix load config

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix load config

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move certs to sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move certs to sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move certs to sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move certs to sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change dflt file

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix content

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* cert sdk

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix bootstraping

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update swagger

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix mproxy mod

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix linter messages

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix linter errors

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* upd vendor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* upd vendor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove dead code

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add some space for readability

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* use snake case

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* use snake case

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* use snake case

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* use snake case

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* use snake case

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remov thingids

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert readme

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix logging

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* use snake_case

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix var naming

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix signature

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* aling with defaults

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix logging info

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix logging

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix tag

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-29 00:39:23 +02:00
Dušan Borovčanin c3019fffb6 NOISSUE - Refactor messaging (#1141)
* Refactor messaging

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename SubscribeHandler to MessageHandler

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove `Auth` event logs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update message pubsub APi

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix topics handling

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update CoAP adapter

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update Twins service

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update LoRa adapter

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update OPC UA adapter

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove broker package

Package `broker` is conceptually renamed to package `nats`.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update makefile

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add comment explanation

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix MQTT adapter

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix typo

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Move NATS pub/sub implementation to pubsub pkg

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove an empty line in main methods

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Move messaging-related code to messaging package

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix Twins mocks

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Change Occurred back to Created

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix tranformer test

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix message proto commands

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Replace string literal with constant

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove alias from main method

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Change messaging pubsub alias

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename occured to created

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Handle NATS connection in the NATS PubSub

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename n to pub/pubSub

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix typos

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-28 11:02:35 +02:00
Manuel Imperiale 36d00d8b9e Add JSON tags to SDK entities (#1146)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-27 18:49:09 +02:00
Manuel Imperiale 9b4eb7056f NOISSUE - Update CLI README.md (#1139)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-23 10:24:42 +02:00
Dušan Borovčanin cb3b70d567 NOISSUE - Update mProxy version (#1137)
* Use Events interface in MQTT adapter

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Switch to the new version of mProxy

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update vendor

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update mProxy version

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-22 20:41:51 +02:00
Mirko Teodorovic c7a8e75353 fix nginx, channel connect (#1136)
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-04-22 18:59:50 +02:00
Ivan Milošević 9d430fa02c Remove concurrency flag for golangci-lint (#1134)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-04-21 19:49:37 +02:00
Manuel Imperiale 7a18d3fa56 MF-1088 - Remove message payload content type (#1121)
* MF-1088 - Remove message payload content type

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add default contentFormat

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-21 19:33:11 +02:00
Manuel Imperiale ccbfe20607 MF-1129 - Use snake_case for Lora and OPC-UA metadata fields (#1130)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-21 17:49:17 +02:00
Ivan Milošević eb9092494e MF-1128 - Add golangci-linter to a CI script (#1131)
* Add golangci-linter to CI script

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* add no-config flag

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* disable staticcheck

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* disable all except errcheck

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* add more linters

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* add verbose flag for debug
decrease concurrency to 1

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove errcheck and verbose flag

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* enable just golint

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix lint errors

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-04-21 17:05:19 +02:00
Dušan Borovčanin 88fa724fc3 MF-1123 - Move Provision service to monorepo (#1132)
* Add provision service

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix Provision service initial version

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-21 16:05:11 +02:00
Manuel Imperiale 7910d64ad4 MF-845 - Add FOSSA badge for licensing (#1127)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-20 18:21:55 +02:00
Manuel Imperiale 01aa4190c5 MF-1087 - Remove WebSocket adapter (#1120)
* MF-1087 - Remove WebSocket adapter

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm all ws directory

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert authorization.js

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove /ws endpoint from ssl/authorization.js

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm gorilla from vendor

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert gorilla to vendor

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-17 13:16:21 +02:00
Manuel Imperiale f982b8ccc6 NOISSUE - Use HTTP Status in SDK error messages (#1119)
* NOISSUE - Use HTTP Status in SDK error messages

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add helper function to create errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fyx Typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert ErrNotFound

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm InvalidArgs and NotFoundound errors from SDK

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-16 14:45:28 +02:00
Manuel Imperiale 7d839b7b61 NOISSUE - Fix bootstrap token naming and interfaces named args (#1117)
* NOISSUE - Fix bootstrap token naming and interfaces named args

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix CI bot

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use owner for repository layer

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-16 12:32:21 +02:00
Manuel Imperiale 6bd74575ff MF-1115 - Improve the SDK error encoding (#1118)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-15 23:41:31 +02:00
Manuel Imperiale 4c970a8079 MF-862 - Add boostrap CRUD to SDK and CLI (#1114)
* MF-862 - Add boostrap CRUD to SDK and CLI

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert ReaderPrefix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-15 17:38:20 +02:00
Manuel Imperiale b8bd011f9d NOISSUE - Update coding style in Things service (#1116)
* NOISSUE - Update coding style in Things service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix things.Page

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-15 15:15:30 +02:00
Alexander Obukhov fbbf2c07a5 NOISSUE - Remove defers from TestMain (#1111)
Defers will not be run when using os.Exit (https://github.com/golang/go/issues/34129)

Signed-off-by: Alexander Obukhov <dev@sprql.space>
2020-04-14 14:47:34 +02:00
Manuel Imperiale 5b5229975b NOISSUE - Create func to encode SDK errors (#1110)
* NOISSUE - Create func to encode SDK errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use var declaration

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-14 11:04:33 +02:00
Manuel Imperiale d8dca28072 MF-1078 - Add timestamp to published messages and use it in Transformer (#1106)
* MF-1078 - Add reception time to published messages and use it if SenML time is missing

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix comments

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add message timestamp

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix pub

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Mv timestamp to service layer

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert WS

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix coap

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix CI bot

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename Timestamp Created

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Mv Created field to message creation

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Mv Created field to message creation

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use UnixNano

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use google.protobuf.Timestamp

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add protoc-gen-gogo and gogoproto to CI script

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use TimestampProto to generate timestamp

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-13 15:05:05 +02:00
Ivan Milošević 537d73d0c6 Fix prometheus namespace in postgres reader & writer (#1109)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-04-13 14:01:59 +02:00
Ivan Milošević 880e193b0a NOISSUE - Implement errors package in senml transformer, readers and writers (#1108)
* Implement errors package in senml transformer, readers and writers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove unused const
Return wrapped error in postgres writer

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix default db host in postgres writer

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix capital letters in errors messages

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* use svcName instead of postgres for Promethius initialization

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-04-13 12:57:53 +02:00
Ivan Milošević e438be4250 NOISSUE - Implement errors package in Authentication service (#1105)
* Implement errors package in Authn service

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove imported and not used fmt package

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* wrapped errors when issued new key

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove blank line

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Change error message in tests
Remove nil case in encode error

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* return back nil value error handling

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-04-10 17:43:42 +02:00
Dušan Borovčanin 57f7ee2595 MF-1103 - API key should ignore empty expiration time (#1104)
* Fix API keys expiration validation

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix API docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-04-07 14:32:02 +02:00
Manuel Imperiale 6c39c85cc8 MF-1096 - Fix AuthN and Things Auth ENVARS (#1066)
* NOISSUE - Fix AuthN and Things Auth ENVARS

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add DB envars to env.go

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix envars

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add DefLogLLevelError

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix DB names

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix DB names

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix DB names and HTTP ports

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix .env

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert writers DB names

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm unused Twins envars

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 typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove definitions from env.go

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert HTTP gRPC ports

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use default NATS URL as string

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert default ports

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix cassandra ENVARS

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix cassandra reader ENVARS

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix readers and writers envars

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix readers and writers .env

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-07 12:02:17 +02:00
Ivan Milošević 338c55e554 fix Contains function for nil arguments (#1102)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-04-07 10:35:38 +02:00
Manuel Imperiale 382bc89161 MF-1099 - Add email subdomain validator (#1101)
* MF-1099 - Add email subdomain validator

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add unlimited sub domains

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix users tests with error nil

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert users test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-07 10:16:46 +02:00
Manuel Imperiale 8325c1caf6 MF-1091 - Use channels. as broker prefix (#1098)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-06 12:30:26 +02:00
Manuel Imperiale 1d78233fe6 MF-1090 - Use named Interfaces args (#1097)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-05 13:15:47 +02:00
Manuel Imperiale fff492bd50 NOISSUE - Create broker package for NATS (#1080)
* NOISSUEE - Create broker package for NATS

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Create funcs to return NATS connection

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* mv os.exit to main

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix Reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix tests and typos

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix CI

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Unify Publisher and Subscriber interfaces

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename Nats interface

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Mv message.pb.go, messsage.proto and topics.go to broker directory

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix go.mod

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use mainflux broker for writers and twins services

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix go.mod

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix twins tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix make proto

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix message.proto

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix golangcibot

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* regenerate message.pb.go

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix make proto

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add NATS errors

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-01 21:22:13 +02:00
Ivan Milošević 51ec256664 NOISSUE - Implement errors package in bootstrap service (#1093)
* implement errors in bootstrap service

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove dead code

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* change errors messages

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* edit more errors messages

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-04-01 15:54:26 +02:00
Manuel Imperiale c20b43ed41 NOISSUE - Fix writers loadSubjectsConfig if file is missing (#1094)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-01 14:40:59 +02:00
Jonathan Dreyer 46aadcfd9d NOISSUE - Adding subtopics filtering in writer services (#1072)
* Add feature of filtering by subtopics in writer

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Fix mistake

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Refactoring writer sevices

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Rename variables related to filter (channels & subtopics)

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Set default value of filtering when configuration file doesn't exist

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Add a blank line at the end of the file

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Refactor loading filters configuration (moving into writer package, merge both loading methods & returning error)

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Remove useless log

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Change type of variables (channels & subtopics) and simplify loading method

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Add logging error when loading filters

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Simplify return configuration in loading method

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Merge both filter files into one file

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Move loading subjects into writer package

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Add subscribe to selected subjects

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Edit README of writer services

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Keep only subscribe loop

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Use full NATS subjects

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

* Edit comment in subjects files

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2020-03-30 18:24:27 +02:00
Ivan Milošević d2153a8846 [NOISSUE] - Improve errors package (#1086)
* Init commit - implement errors package on things service

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* things service errors issue

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Decode errors
Add authn service to run script

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Modify tests

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* service_test

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* debug lines

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Regulate tests

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Improve errors in Redis

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove dead code
Inline if conditions
Rename err var

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Transform errors messages to lowercase

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* improve errors package

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* modify wrap method
inline wrapping errors in redis

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add copyright to errors package

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* wrapping nil error returns wrapper (instead of nil)

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* move response messages in test to vars

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* golangcibot review fix

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* golangbot fix review in transport

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-03-30 15:22:18 +02:00
Nikola Marčetić 70955d1937 NOISSUE - Enable MQTT over WS in docker composition (#1085)
* Enable WS over MQTT docker composition

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>

* Remove commented code

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>
2020-03-25 22:26:50 +01:00
Manuel Imperiale c1df2cb21c NOISSUE - Rm unused opc-ua envars (#1083)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-03-25 16:56:57 +01:00
Vadim Filin b8818c4dd2 MF-798 - Add utf8 support for email validation (#1082)
* Add utf8 support for email validation

Signed-off-by: Vadim Filin <phil192@yandex.ru>

* Fix review comments

Signed-off-by: Vadim Filin <phil192@yandex.ru>

* Refactor

Signed-off-by: Vadim Filin <phil192@yandex.ru>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2020-03-25 15:30:20 +01:00
Ivan Milošević a2d70c8907 Remove unused Tokenizer interface (#1084)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-03-25 10:29:48 +01:00
Nikola Marčetić 6ffa916ed2 Update mqtt adapter imports (#1081)
* Fixed mqtt adapter imports

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>

* PR remakrs resolved

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>
2020-03-24 11:07:41 +01:00
Darko Draskovic 19503742a6 NOISSUE - Update state based on SenML time value (#1075)
* Update state based on SenML time value

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Use Modf to parse SenML rec time

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add Update to State in mocks

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add Delta to Twin Definition and iota consts for state actions

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Use action consts for switch statement

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-03-18 19:56:39 +01:00
Manuel Imperiale c91fe0d453 NOISSUE - Fix StatusBadDecodingError for opc-ua browse (#1074)
* NOISSUE - Fix StatusBadDecodingError for opc-ua browse

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Reduce number of browse childrens level

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-03-14 20:09:02 +01:00
Darko Draskovic 3e4a9eb16a Save senml array msg to multiple states (#1073)
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-03-13 16:20:57 +01:00
Manuel Imperiale b3f91f5c9e NOISSUE - Fix opc-ua message type handling (#1071)
* NOISSUE - Fix opc-ua message type handling

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add comments

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Return error

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-03-12 11:20:05 +01:00
Dušan Borovčanin ba97e865a4 NOISSUE - Add Publisher field to MQTT adapter (#1067)
* Add publisher field to the message

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update SenML lib

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-03-10 11:44:48 +01:00
Manuel Imperiale cc5e0288df NOISSUE - Fix users CLI (#1062)
* NOISSSUE - Fix users CLI

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix README

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* use Mainflux entities

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Mv ConnectionIDs to requests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-03-09 11:31:19 +01:00
Manuel Imperiale 6e4e5b351a NOISSUE - Fix SDK Messages response (#1064)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-03-07 05:02:26 +01:00
Drasko DRASKOVIC d587921eda Merged MQTT docker compose in core composition file (#1060)
Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>
2020-03-05 13:34:07 +01:00
Manuel Imperiale 7df2ababc4 MF-1016 - Add UserUpdate and UpdatePassword to sdk and CLI (#1057)
* MF-1016 - Add UserUpdate and UpdatePassword to sdk and CLI

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Update READMEs

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-03-04 18:37:41 +01:00
Dušan Borovčanin 63dc1f69b6 Update mProxy (#1058)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-03-04 15:25:09 +01:00
Dušan Borovčanin 1c6f124062 MF-1053 - Add disconnect event to MQTT adapter (#1056)
* Add disconnect event to mProxy

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename publishers to pubs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use acync publishers

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-03-03 19:23:57 +01:00
Ivan Milošević cc90f568b6 Fix data type for data_value in databases (#1054)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-03-03 15:35:26 +01:00
Manuel Imperiale 5e145858f1 NOISSUE - Fix opc-ua subscriptions store (#1052)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-03-03 15:05:22 +01:00
Manuel Imperiale 9e2bb4933a NOISSUE - Fix connect CLI command and remove ConnectThing func from SDK (#1051)
* NOISSUE - Fix connect CLI command and remove ConnectThing func from SDK

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm ConnectThing from bootstrap

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-03-03 10:58:30 +01:00
Nikola Marčetić 3f77b87a91 NOISSUE - Update Vernemq image repository (#1050)
Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>
2020-03-02 18:21:44 +01:00
Nikola Marčetić dcba41e8c4 Removed VerneMQ auth plugin, Aedes impl. Added mproxy support in docker (#1049)
Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>
2020-03-01 23:55:43 +01:00
Manuel Imperiale f6c813ea8c NOISSUE - Add default subscription nodeID and Interval ENVAR (#1046)
* NOISSUE - Fix NodeID

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add default subscription nodeID and Interval ENVAR

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* updatee README

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-02-27 01:06:14 +01:00
Nikola Marčetić 42b3682352 MF-415 - Merge mProxy support (#1045)
* NOISSUE - Add mProxy support (#1017)

* Add mproxy

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

* Fix docker and add EMQ compose

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

* Fix EMQX name

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

* Add nats, auth and es

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

* Removed unucessary vendoring

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

* Update vendoring

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

* Fix mproxy interface implementation

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

 NOISSUE - Aligned Event interface method signatures with new spec (#1025)

* Aligned Event interface method signatures with new spec

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>

* Updated deps

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>

NOISSUE - Update mproxy dependency (#1038)

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>

Update Vendor with new mProxy (#1043)

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

Twins merge conflict reverted

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>

Twins merge conflict reverted

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>

Twins fixed nats import

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>

Update deps

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>

* Resolved GolangCI remarks

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>

Resolved GolangCI remarks

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>

Resolved GolangCI remarks

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>

* Fixed Event interface Unsubscribe() typo

Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>

* Update vendors

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Upgrade CI script

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-02-26 17:14:16 +01:00
Darko Draskovic 3b5d51276f NOISSUE - Remove twins-service mqtt dependency and publish notifs to nats (#1042)
* Add Publish func to nats

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove mqtt client

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add nats publisher

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Separate nats publisher from subscriber

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Update tests creation methods

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add logger to NATS Publisher

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-02-20 00:10:10 +01:00
Darko Draskovic a30a3b9063 Add arbitrary SenML value type saving to twin state (#1039)
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-02-18 19:56:39 +01:00
Nikola Marčetić e22d1fbbb4 Fixed Aedes dependencies (#1036)
Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>
2020-02-13 14:37:16 +01:00
Darko Draskovic 51cd0524a1 MF-998 - Add Twins service to Makefile and docker-compose.yml (#1035)
* Add separate twins mongodb

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Move twins docker compose file to addons

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add depends_on to mainflux-twins container

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove hard-coded vals from .env

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add start explanation to README.md

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Bump mongo image to latest version

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-02-12 18:34:48 +01:00
Manuel Imperiale 1c2c86b030 MF-1032 - Fix redis docker volume of opcua-adapter (#1033)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-02-07 17:13:37 +01:00
Mirko Teodorovic a1078e6999 NOISSUE - add nats conf (#1031)
* add nats conf

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change max payload

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-02-06 18:44:29 +01:00
antonio-salieri b8138fac32 MF-442 - Add SSL encryption to the MongoDB, InfluxDB and Cassanda readers (#1024)
* Add possibility of running influxdb-reader http server with tls

Signed-off-by: Lazar Ivanovic <laza@opencores.org>

* Add possibility of running mongodb-reader http server with tls

Signed-off-by: Lazar Ivanovic <laza@opencores.org>

* Add possibility of running cassandra-reaeder http server with tls

Signed-off-by: Lazar Ivanovic <laza@opencores.org>

* Addressed pr comments

Signed-off-by: Lazar Ivanovic <laza@opencores.org>

Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2020-02-05 20:24:36 +01:00
Manuel Imperiale 2b7637fd75 NOISSUE - Add opc-ua type handling and unsubscription (#1029)
* NOISSUE - Add opc-ua type handling and unsubscription

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Create const for max childrens

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-02-05 17:16:45 +01:00
Darko Draskovic f785116a6f NOISSUE - Add aggregate attribute-based search for twin retrieval (#1027)
* Add attribute map for twin retrieval

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Restructure attributes from map[string] to []

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove RAM attribute map and use mongo aggregation

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Update tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove attribute map service property

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-02-04 23:25:51 +01:00
Manuel Imperiale 3f6a0cd14b NOISSUE - Fix metadata in add Things endpoint (#1028)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-02-04 12:33:28 +01:00
Aleksandar Novaković 269fe89a42 NOISSUE - Fix minimal password length (#1023)
* Fix minimum password length

Increase minimum password length to 8.

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

* Update tests with valid password length

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

* Update minimal pass length in the docs

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2020-01-29 18:54:34 +01:00
Jonathan Dreyer bdf1326933 MF-1020 - Change default password for CLI provision test (#1021)
Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>

Co-authored-by: Nikola Marčetić <n.marcetic86@gmail.com>
2020-01-29 12:31:15 +01:00
Manuel Imperiale a96db05cc0 NOISSUE - Add subtopic to opcua messages (#1022)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-01-28 23:30:55 +01:00
Manuel Imperiale 7b62f1ce8a NOISSUE - Add details to browsed OPC-UA nodes (#1019)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-01-27 12:25:16 +01:00
Darko Draskovic 575d1d6bbf NOISSUE Fix obsolete attribute persistance (#1018)
* Fix obsolete attribute update

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Inlined map key presence check

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-01-27 02:15:10 +01:00
Darko Draskovic 0d361f3df1 Fix twins update revision counter (#1011)
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-01-22 15:58:24 +01:00
Nikola Marčetić 5714a6dfcb Fixed docs instructions in README (#1010)
Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>
2020-01-17 14:44:13 +01:00
Ivan Milošević decfae9c9d Fix copyright year (#1009)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2020-01-17 12:51:01 +01:00
Dušan Borovčanin c4fa27fd7e Fix issuing recovery key (#1007)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2020-01-16 18:43:06 +01:00
Nikola Marčetić 8475e87fe7 Removed gatling load-test (#1005)
Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>
2020-01-16 11:57:34 +01:00
Nikola Marčetić 0d3adfdc5c Removed old k8s manifests (#1004)
Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>
2020-01-16 11:37:07 +01:00
Manuel Imperiale 160fda4d37 NOISSUE - Remove UI from docker-compose (#1001)
* NOISSUE - Remove UI from docker-compose

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm MF_UI_PORT envar

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-01-15 15:27:24 +01:00
Manuel Imperiale 4ba1717582 NOISSUE - Store successfull OPC-UA subscriptions (#999)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-01-10 17:56:03 +01:00
Darko Draskovic b3991b8497 MF-730 - Add digital twin service for things (#855)
* Add starter kit

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add http

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add cmd/main.go

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove reference to things from README.md

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add starter kit

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add http

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add cmd/main.go

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove reference to things from README.md

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix env vars in README.md

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix env vars in README.md

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Rename kit to mfxkit

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Rename kit to mfxkit

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add docker compose related files

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add docker compose related files

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add Dockerfile to mfxkit

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add Dockerfile to mfxkit

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add twin service to docker-compose.yml

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add twin service to docker-compose.yml

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add mongo db connection

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add mongo db connection

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add TwinRepository mockup

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix docker env vars

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix docker env vars

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add twins repo mongodb routines

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add twins repo mongodb routines

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add mongo db docker test suite

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add mongo db docker test suite

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add idp and toDBTwin

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add idp and toDBTwin

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add test cases to repo twin save test

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add test cases to repo twin save test

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add users grpc

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add users grpc

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add methods and tests for udpate and update key

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add methods and tests for udpate and update key

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add methods and tests for remove twin

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add methods and tests for remove twin

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add svc methods to loggin and metrics

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add svc methods to loggin and metrics

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add AddTwin endpoint

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add AddTwin endpoint

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add update endpoints

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add update endpoints

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add view and remove endpoints

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add view and remove endpoints

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add twin repo mock

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add twin repo mock

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add owner arg to twins repo methods

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add owner arg to twins repo methods

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add mock idp service

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add mock users service

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add tests for service

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add tests for service

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add mqtt client to twins service

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add mqtt client to twins service

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add protocol to mqtt string var

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add protocol to mqtt string var

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add time and attributes related data to Twin struct

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add time and attributes related data to Twin struct

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add mqtt publish JSON serialized twin to service

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add mqtt publish JSON serialized twin to service

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add endpoint tests for save and update twin

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add endpoint tests for save and update twin

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add endpoint tests for update key and view thing

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add endpoint tests for update key and view thing

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix test error for view twin

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix test error for view twin

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add endpoint tests for remove twin

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add endpoint tests for remove twin

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add NATS client

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add NATS client

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add normalizer to nats

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add normalizer to nats

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Refactor nats publish() and remove normalizer

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Refactor nats publish() and remove normalizer

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add ListThingsByChannel() and RetrieveByChannel()

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add ListThingsByChannel() and RetrieveByChannel()

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add Twin struct directly in mongodb

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add Twin struct directly in mongodb

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Change limit type to uint64

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Change limit type to uint64

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Compose nats subject from msg ch and subtopic

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Compose nats subject from msg ch and subtopic

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add mqtt notifs for thing creation and key update

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add mqtt notifs for thing creation and key update

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add RetrieveAll to twinRepository and ListTwins to service

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add RetrieveAll to twinRepository and ListTwins to service

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add tests for RetrieveAll and ListTwins

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add tests for RetrieveAll and ListTwins

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix Service interface error

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove test Ping endpoint

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add mqtt topic to service config

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove UpdateKey request and add fields to Twin related requests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add Attributes and State add and view

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add ListTwins endpoint

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix service and database tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add ListTwinsByThing endpoint

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove twin directory

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add States and Definitions to Twin

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add defer publish to AddTwin

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add refactored and deferred mqtt client publish to Service methods

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add paho subservice

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add paho client to nats

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add mqtt publish and state update

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add Publish wrapper

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Use paho Publish wrapper

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Save states in separate collection

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Replace []byte payload by []map[string]interface{}

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add offset to PageMetadata

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Rename TwinsPage to Page

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add StateRepository

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add StateRepository, mongodb StateRepository adapter and ListStates endpoint

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add RetrieveLast twin to states repository

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Parse def in nats to update state attrib

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add prepareState() helper

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Replace list things by id by view thing by id

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add state repo mock

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix service tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix mongo twins repo tests and remove owner from RetrieveByID params

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix mongo twins repo tests and remove owner from Remove params

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Replace ChannelID in Attribute by Channel

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix endpoint tests for add and update twin

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix endpoint tests for view and remove twin

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Use new auth service

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix mocks auth and mongodb tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix licensing info

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix 'for for'

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Replace short dec by var for default vals and add string map for mqtt op info

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Use Record from mainflux/senml and rename broker to nats in main.go

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove Key from Twin

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove redundant id uniqueness check from mongodb

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add attrib name to attrib update info

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix typos and remove isZeroOfUnderlyingType() helper

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Rename paho to mqtt

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix env vars in main.go and README.md

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Move twins/api/twins to twins/api and rename twins- prefix to tw- in main.go

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove flows for manual testing and revert to master docker-compose.yml

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove publish from nats and fix tests by updating package names

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Rename users.go to authn.go

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix crud op names

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Change id to twinID

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Inline if err != nil and change <prefix>ID to <prefix>_id

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix metadata db search test

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Rename mqtt and nats related files to publisher and subscriber respectively

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Move save state logic from nats to service

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix endpoint tests

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove close check from main.go

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Complete deploy section

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add unit tests for states

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove debugging artefacts and unneeded comments to exported funcs

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add port num to defAuthnURL

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2020-01-10 17:25:36 +01:00
Drasko DRASKOVIC 5834d364ad Fix Redis event naming (#996)
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2020-01-09 14:18:23 +01:00
Manuel Imperiale f42f2095ba NOISSUE - Add a Browse endpoint in opcua-adapter (#988)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

Co-authored-by: Nikola Marčetić <n.marcetic86@gmail.com>
2019-12-23 17:30:44 +01:00
Drasko DRASKOVIC 60a90d84d5 NOISSUE - Add Redis ES Username/Pass for VerneMQ (#991)
* Add Redis DB and Pass options

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

* Fix ENV var parsing

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

* Update protobuf for VerneMQ

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

* Fix regular expression for MQTT re-publish

Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2019-12-23 00:17:39 +01:00
Nick Neisen 887bc2d9c0 MF-982 - Add error when connecting empty channels or things (#985)
* Add error when connecting empty channels or things

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Add more detailed test descriptions

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Add to test descriptions

Signed-off-by: nwneisen <nwneisen@gmail.com>

* fix channel ids

Signed-off-by: nwneisen <nwneisen@gmail.com>
2019-12-17 19:53:45 +01:00
Nikola Marčetić 2080ee8afa Added changelog for 0.10.0 release (#984)
Signed-off-by: Nikola Marcetic <n.marcetic86@gmail.com>
2019-12-17 17:32:27 +01:00
Dušan Borovčanin 9c1743c080 Fix MQTT protobuf file name (#981)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-12-16 18:05:59 +01:00
Dušan Borovčanin 9f37927dec MF-932 - User API keys (#941)
* Add inital Auth implementation

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Extract IssuedAt on transport layer

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add token type

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix Auth service URL in Things service

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add User Keys revocation check

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove unused tracing methods

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix Key retrival and parsing

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove unused code

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Increase test coverage

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix compose files

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix typos

Simplify tests.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix typos and remove useless comments

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename Auth to Authn

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename database.go to tracin.go

A new name (`tracing.go`) describes better the purpose of the file.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Increase test coverage

Fix typo.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Increase test coverage

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove token from Users service

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix identify login keys

Rename token parsing method.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Extract tokenizer to interface

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove pointer time

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use pointer for expiration time in response

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use uppercase N

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove unnecessary email check

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Cleanup unused code and env vars

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename tokenizer field

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use slices and named fields in test cases

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update AuthN keys naming

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove package-lock.json changes

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove Secret from issuing request

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-12-16 16:22:09 +01:00
Manuel Imperiale bdeb7711ce NOISSUE - Use opcua server timestamp in opcua-adapter messages (#980)
* NOISSUE - Use opcua server timestamp in opcua-adapter messages

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename pubsub -> subscribe

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-12-16 16:06:37 +01:00
Dušan Borovčanin e960004b44 Simplify CI script (#979)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-12-10 18:53:14 +01:00
Manuel Imperiale 76b68e10a8 NOISSUE - Add opcua-adapter conn route-map, use ServerURI and NodeID (#975)
* NOISSUE - Add opcua-adapter conn route-map, use ServerURI and NodeID

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* NOISSUE - Add dynamic subscription

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-12-09 23:16:18 +01:00
Drasko DRASKOVIC 5120a71595 Move docs to a separate repo (#976)
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2019-12-04 13:31:23 +01:00
Dušan Borovčanin 8c4da85039 MF-950 - Runtime error in normalizer - CBOR SenML (#974)
* Add Transformer tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix readers and writers

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix README typo

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Tidy vendor

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove link field from docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-11-29 20:47:28 +01:00
Manuel Imperiale 237514ee33 NOISSUE - Support multiple types values in opcua-adapter (#973)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-11-28 18:08:43 +01:00
Aleksandar Novaković 263108cc85 Migrate from dep to go modules (#971)
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-11-27 15:29:34 +01:00
Manuel Imperiale 277342b8ca NOISSUE - Add Node IdentifierType config in opcua-adapter (#967)
* NOISSUE - Add Node IdentifierType config in opcua-adapter

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm Read from subscribeToOpcServers

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-11-26 20:07:04 +01:00
Manuel Imperiale 87dd91e328 NOISSUE - Remove messages limit in influxdb-reader (#968)
* NOISSUE - Remove messages limit in influxdb-reader

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm too large limit test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-11-26 18:58:45 +01:00
Manuel Imperiale 6da650645f NOISSUE - Fix opcua-adapter events warnings (#965)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-11-25 17:53:18 +01:00
Manuel Imperiale 8602185b74 NOISSUE - Fix opcua-adapter events decode (#951)
* NOISSUE - Enable multi OPC-UA Subscriptions

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* NOISSUE - Fix opcua-adapter events decode

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use a config file to subscribe to multiple nodes

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add subscription config file

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use Mainflux errors package

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-11-25 14:14:57 +01:00
Drasko DRASKOVIC b8ac6ca2bf Fix subtopic handling in VerneMQ (#962)
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2019-11-24 18:21:00 +01:00
Nick Neisen 76908d7c8b MF-898 - Add bulk connect to CLI and SDK (#956)
* Add bulk connect to CLI and SDK

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add test for bulk connect

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Update docs

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add file example

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add JSON example to CLI docs

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Change some value datatypes back

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Use constants for file extensions

Signed-off-by: Nick Neisen <nwneisen@gmail.com>
2019-11-21 12:29:37 +01:00
Ivan Milošević 0ab627730f MF-538 - Improve logging and API errors (#866)
* user service - wraping errors

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* wrapping more errors
unwrap only wrapped errors

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add internal database error
Wrap internal database error

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Wrap user not found error

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Wrapping errors in idp and hasher

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Use error.Is for testing errors in Identify test

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Get wraper from wrapped errors

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Switch order of wrapping errors
Remove dead code (comments)

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* assert true in tests

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Change comparing errors in tests (assert.True)

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add errorRes structure to API responses in body in things service

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* resolve conflicts after rebasing

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Create errors package

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* implement new errors package

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Modify tests

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* return copyright comments

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove changes from .gitignore

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Move logging to encode errors
Comment exported vars and methods
Formatting

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Login function returns errors.Error

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Modify login tests to meet login returning errors.Error

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Error interface

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Change parameter in Wrapper to interface Error

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* implement new error interface

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Modify tests to use new Error interface

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix Login

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove unnecessary errir casting

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* new error interface implementation

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* check if Error is empty in registrationEndpoint

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add Empty factory function
Use new Empty factory function
Use isEmpty method

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Lose else in encodeError

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Modify tests

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove *json.UnmarshalTypeError and *json.SyntaxError types from encodeError type switch

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix nil error value in jwtIdentityProvider

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix gprc to use new error package

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* rename receiver in errors package
grpc errors

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove debugging code

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Resolving conflicts after rebase

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove comment

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove Empty from custom error
Implement custom error on new methods

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* WIP tests

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove wrap from Error interface

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* password-change related tests
remove debug code

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove dead code

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Move all errors casting to errors package

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix comment in error package

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Change struct pointer to interface in package methods

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* resolving reviews

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix return in database.go

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix copyright header

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix comment in hasher

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-11-20 14:43:41 +01:00
Manuel Imperiale 1b427f4396 NOISSUE - Fix Update User (#959)
* NOISSUE - Fix Update User

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm duplicated test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-11-20 14:03:17 +01:00
Manuel Imperiale 52c4d4a824 NOISSUE - Fix make dockers (#957)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-11-20 09:24:58 +01:00
Nick Neisen ced90b21a4 Add dev_ back to make dockers_dev (#955)
Signed-off-by: Nick Neisen <nwneisen@gmail.com>
2019-11-19 17:21:13 +01:00
Manuel Imperiale ac3ff5221a NOISSUE - Remove Elm UI (#953)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-11-19 09:31:41 +01:00
Mirko Teodorovic 5e35cbe06b NOISSUE - Fix docs (#952)
* fix missing timeout

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* upd tools readme.md

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* upd tools readme.md

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add mising Referer header required for pass reset request

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-11-16 16:20:29 +01:00
Nick Neisen 894e1b83ec MF-898 - Add bulk connections endpoint (#948)
* Change connect endpoint to use bulk connections

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Add documentation for bulk connect

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Update service and postgres for multiple channels

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Update bulk connect endpoint

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Fix missed test

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Improve test code coverage

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Change methods to use shared data type

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Fix provisioning example

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Change depreciation messages to specify v1.0.0

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Switch singluar log to plural

Signed-off-by: nwneisen <nwneisen@gmail.com>
2019-11-15 18:44:31 +01:00
Manuel Imperiale afeec81a5e MF-916 - Fix Things and Channels counters (#947)
* MF-916 - Fix Things and Channels counters

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use NamedQueryContext to count rows

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Create single helper total() func

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm useless LOWER

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert previous commit

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-11-13 15:26:57 +01:00
Nick Neisen 67d518821a MF-898 - Change thing's service to use bulk connect (#946)
* Change thing's service to use bulk connect

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Move owner check outside of loop

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Change invalid user to unauthorized access error

Signed-off-by: Nick Neisen <nwneisen@gmail.com>
2019-11-12 01:24:29 +01:00
Nick Neisen 5446d88abf MF-898 - Add transactions to postgres connect (#940)
* Add transactions to postgres connect

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Change to use shorthand notation

Signed-off-by: Nick Neisen <nwneisen@gmail.com>
2019-11-11 14:22:30 +01:00
Mirko Teodorovic 9e8dd4b149 MF-942 - Fix email template logic (#944)
* fix email template

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename resetPasswEmail.tmpl

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add env var

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename resetPasswEmail.tmpl

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename resetPasswEmail.tmpl

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* upd docs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* upd docs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* upd docs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove not needed file

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move email tmpl

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move email tmpl

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move email tmpl

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* variable for tmpl

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix ident and caps

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-11-11 12:13:48 +01:00
Mirko Teodorovic e735e5c01b add missing user service tests (#945)
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-11-10 02:47:14 +01:00
Manuel Imperiale 841b943718 NOISSUE - Fix HTTP header for Things and Channels creation (#939)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-11-07 13:57:47 +01:00
Manuel Imperiale 3bfdcfe83c NOISSUE - Fix docker ui image name (#938)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-11-06 13:44:58 +01:00
Dušan Borovčanin 66f2332674 Remove Normalizer service from compose (#937)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-11-05 12:34:36 +01:00
Dušan Borovčanin f50335ab33 MF-919 - Mainflux message updates (#924)
* Remove RawMessage

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove Normalizer

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Replace normalizer with senml-transformer

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename Transformer interface and package

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove SenML transformer service

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove SenML Protobuf support

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix readers

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix writers tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Refactor tests and remove normalizer

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Reanme Service interface to Transformer

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use msg instead of rawmsg

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove rawMsg from Aedes code

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix VerneMQ files

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove RawMessage code

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix missing subtopic return

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove remaining RawMessage reference

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix formatting

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix readers and writers tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename SenML transformer variables

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix readers and writers tests constants

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-11-05 11:57:16 +01:00
Manuel Imperiale d7dc836714 NOISSUE - Fix lora-adapter (#936)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-11-05 11:49:39 +01:00
Manuel Imperiale 887542aab3 NOISSUE - Fix lora creation events (#933)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-11-05 10:23:30 +01:00
Drasko DRASKOVIC 1d2c8b25a1 NOISSUE - Remove ARM multi-arch images (#929)
* emove ARM multi-arch

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

* Fix tabs

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

* Remove arch tagging

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

* Fix MQTT build

Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2019-11-05 10:12:49 +01:00
Nick Neisen 1a31ecd044 MF-906 - Change single creation endpoints to use bulk service calls (#927)
* Change single endpoints to use bulk creation

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Remove single creation from thing's service

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Remove single save from thing's postgres

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Change BulkSave to Save

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Change service calls to use variadic parameters

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Change postgres things to use variadic functions

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add depreciation warnings

Signed-off-by: Nick Neisen <nwneisen@gmail.com>
2019-11-04 21:14:17 +01:00
Manuel Imperiale 28a176ac1d MF-922 - Add UpdateUser endpoint (#923)
* MF-922 - Add User Update endpoint

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Revert Update function

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Update swagger

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix Things swagger

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix swagger

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* update Things swagger

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix users swagger

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix mocks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix method name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix swagger

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix swagger

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix swagger

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use User instead of metadata

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 reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-10-31 16:36:19 +01:00
Dušan Borovčanin 8be2516321 MF-780 - Use Normalizer as a lib (#915)
* Use Normalizer as a lib

To normalize messages on the consumer side, Normalizer is moved
to the internal pkgs. Writers being message consumers are modified to
do message normalization instead of subscribing to normalized messages
subject.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix logging middleware for readers and writers

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove normalizer interface

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use Normalizer in writers

As we agreed on #919, we'll use normalizer as an interface and provide
the default SenML implementation. Because of that, Normalizer is removed
from `internal` and we'll use the project structure proposed in the
aforementioned issue.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove unused batch settings from influxDB reader

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update docs

Move Normalizer service to `addons`.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename channels input topic

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update Noramlizer docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove commented code

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update readers logging

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update addons docker-compose files

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update topcis explanations

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-10-31 14:04:47 +01:00
Drasko DRASKOVIC 380af878d2 Fix doc for ENV vars in README (#920)
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2019-10-29 21:28:59 +01:00
Drasko DRASKOVIC da4fc62440 NOISSUE - Switch to grpcbox for VerneMQ (#914)
* Switch to grpcbox

Use grpcbox as a gRPC client library, because
it is much better maintained.

Shows good performance and generation of protobuf
files is simple and automatic.

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

* Fix typo

Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2019-10-29 20:35:09 +01:00
Nick Neisen 426813cec4 Change channels to chs (#918)
Signed-off-by: nwneisen <nwneisen@gmail.com>
2019-10-29 19:06:48 +01:00
Nick Neisen 8f3dff837b MF-484 - Add bulk provisioning for things and channels (#889)
* Add provisioning to postgres

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add provisioning to things and channels service

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add JSON provisioning endpoint to things API

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add provisioning to SDK and CLI

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Update docs

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Remove response location and adjust channelsFromFile

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Change naming from 'provison' to 'bulkCreate'

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add gocsv to vendors folder

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Update "bulk" naming

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Move CSV to CLI and remove gocsv dependancy

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Update docs and responses

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Change AddThings to be CreateThings

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Improve test coverage

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Fixes after review

Signed-off-by: nwneisen <nwneisen@gmail.com>
2019-10-29 12:59:54 +01:00
Nick Neisen 5f5d7e4cfa MF-899 - Update README and official docs (#910)
* Update root README.md

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Update official documents

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Move docker template version location

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Move template to dev guide and remove bold

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Remove double spaces after periods

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Change repo to repository

Signed-off-by: nwneisen <nwneisen@gmail.com>
2019-10-29 10:22:41 +01:00
Manuel Imperiale fec058c614 NOISSUE - Fix Redis envars (#903)
* NOISSUE - Fix Redis envars

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix url

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-10-28 09:49:34 +01:00
Drasko DRASKOVIC 613e75f7ee Add disconnect on gen_server terminate() (#913)
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2019-10-27 17:57:43 +01:00
Drasko DRASKOVIC 7499f8deea Fix compilation (#911)
Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2019-10-26 17:46:23 +02:00
Dušan Borovčanin 02fd492105 Revert "NOISSUE - Make event sourcing optional (#907)" (#909)
This reverts commit d309973a23.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-10-25 13:57:41 +02:00
Aleksandar Novaković d309973a23 NOISSUE - Make event sourcing optional (#907)
* Add ES flat to the things service

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

* Add env var for optional ES

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-10-25 00:12:31 +02:00
Manuel Imperiale e45e0ab307 NOISSUE - Fix InfluxDB env vars (#908)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-10-24 18:52:53 +02:00
Manuel Imperiale dea7c67ddb MF-890 - Add OPC-UA docs (#904)
* MF-890 - Add OPC-UA docs

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add opcua.md in mkdocs.yml

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-10-24 09:49:11 +02:00
Dušan Borovčanin 2e664ffe10 Fix Elm version for ARM Docker images (#905)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-10-23 18:08:38 +02:00
Dušan Borovčanin cdf9347b01 NOISSUE - Update Protobuf version (#902)
* Update Protobuf version

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update gRPC version

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-10-22 20:33:44 +02:00
Manuel Imperiale e16a025fba MF-886 - Add OPC-UA adapter (#878)
* NOISSUE- Add OPC-UA adapter

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* NOISSUE - Add opc-adapter PoC, docker and vendor

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Convert OPC messages to SenML

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add gopcua package

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* lora-adapter typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add OPC Reader

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Update copyright headers

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>

* Add opc config

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add all opc envars in the config

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Config typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add route map

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use opcua package instead of opc

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix OPCUA typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm MQTT sub

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Move interefaces to root

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix revieews and typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Update Gopkg.toml

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add all envars into .env

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-10-22 17:44:19 +02:00
Dušan Borovčanin 8ab0b08c39 Fix Elm version in Dockerfile (#901)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-10-22 17:30:09 +02:00
Mirko Teodorovic f4f938a730 MF-532 - Password reset (#873)
* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default value for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default value for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default value for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default value for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default value for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default value for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* when metadata is not set dont save 'null' string

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* when metadata is not set dont save 'null' string

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* when metadata is not set dont save 'null' string

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change metadata type, add error handling

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change metadata type, add error handling

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change metadata type, add error handling

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove extra char

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove extra char

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove extra char

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* few small fixes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* few small fixes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* few small fixes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix identityRes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix identityRes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix identityRes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* mail

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* mail

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reset request endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reset request endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reset request endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add token

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add token

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add token

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add token methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add token methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add token methods

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding token endpoints

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding token endpoints

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding token endpoints

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding reset passw endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding reset passw endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding reset passw endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add logic for token verifying

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add logic for token verifying

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add logic for token verifying

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove mail from main

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove mail from main

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove mail from main

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* token and passwd  update logic

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* token and passwd  update logic

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* token and passwd  update logic

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize mailing code

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add comments for password reset flow

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add comments for password reset flow

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change struct members to private

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add space

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add space

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add space

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert back changes used for testing

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert back changes used for testing

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert back changes used for testing

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize endpoints, extract host for link from Referer

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize endpoints, extract host for link from Referer

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding swagger docs for reset passw

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding swagger docs for reset passw

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix imports and some typos

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix imports and some typos

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding swagger docs for reset passw

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize endpoints, extract host for link from Referer

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize endpoints, extract host for link from Referer

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* addint test and update swagger for pass reset

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* addint test and update swagger for pass reset

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* addint test and update swagger for pass reset

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding test for endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding test for endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding test for endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding test for endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding endpoint test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding endpoint test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding endpoint test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change token generation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change token generation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change token generation

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize and change token gen

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize and change token gen

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize and change token gen

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* addint token and mail

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding token env

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding token env

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix error reporting

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix some comments and update readme

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix some comments and update readme

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix some comments and update readme

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update readme

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix problmes due merge

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix problmes due merge

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix typos

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix typos

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add trusted certificates

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add endpoint for password change of currently authenticated user

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add env variable for conf reset endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default value for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default value for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* when metadata is not set dont save 'null' string

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change metadata type, add error handling

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove extra char

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* few small fixes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix identityRes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* password reset, sketching

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reset request endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding token endpoints

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding reset passw endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add logic for token verifying

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove mail from main

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add space

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert back changes used for testing

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize endpoints, extract host for link from Referer

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize endpoints, extract host for link from Referer

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* addint test and update swagger for pass reset

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding endpoint test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix some comments and update readme

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add env variable for conf reset endpoint

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolving some style comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor fixes due to bad merge

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix problem with unsigned commits

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix problem with unsigned commits

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix call to users.New

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix call to users.New

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename file

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename to email.go

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* additional comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* additional comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor email util

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor email util

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor email util

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor email util

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove debug bin

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add driver conf for mail

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor email

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor email

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix failing tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add testify

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small fix

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add token conf

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small fix

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small fix

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* configurable  email template

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix missing var

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add env for email template file

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add env for email template file

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert to master

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove dev container

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small fixes, typos, namings

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix typo

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolving comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolving comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolving comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolving comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* resolving comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add line

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* return err from email New()

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change MF_TOKEN_RESET_ENDPOINT

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add and remove env vars

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* separate password logic into two methods Change and Reset

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove blank line

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update docs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* dont use camel case

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small fix

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize email template for passw reset

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize email template for passw reset

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-10-22 14:53:14 +02:00
Nick Neisen 6687a738ce MF-785 - Change CanAccess to CanAccessByKey (#894)
* Change CanAccess to CanAccessByKey for things

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Change CanAccess in remaining occurances

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Regenerate generated files

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Generate pb.go files with protoc 3.6.1

Signed-off-by: Nick Neisen <nwneisen@gmail.com>
2019-10-21 23:24:45 +02:00
Manuel Imperiale 1da48afc4c NOISSUE - fix security doc (#897)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-10-21 15:02:21 +02:00
Manuel Imperiale ddbf172ed5 NOISSUE - Fix typo in docs and README (#891)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-10-17 22:15:45 +02:00
Dušan Borovčanin df2cb80f12 Fix Nginx mTLS configuration (#885)
Sync mTLS and TLS config logs.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-10-15 16:39:46 +02:00
Drasko DRASKOVIC b3ce48aca6 NOISSUE - Add MQTT UserName check on register and InstanceId in Redis (#884)
* Add InstanceId and verify UserName

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

* Fix thingID check (compare with UserName)

Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2019-10-14 15:09:53 +02:00
Jovan Kostovski 351b04cd2e Add MQTT troubleshooting section (#882)
Signed-off-by: Jovan Kostovski <chombium@gmail.com>
2019-10-14 09:18:29 +02:00
Dušan Borovčanin 23b421bdc5 Fix provision tool connect error handling (#879)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-10-08 19:31:13 +02:00
Nick Neisen 93d939ea52 MF-875 - Add tracing to official documentation (#877)
* Tracing docs without example

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Add tracing example using provisioning traces

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add link to Jaeger offical website

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Remove extra http:// from UI URL

Signed-off-by: nwneisen <nwneisen@gmail.com>
2019-10-07 17:49:29 +02:00
Nick Neisen 66487eda42 MF-788 - Remove date and minimize copyright comments (#876)
* Update copyright comment for go files

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Update copyright in assortment of file types

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Remove missed copyright date

Signed-off-by: nwneisen <nwneisen@gmail.com>
2019-10-07 16:14:47 +02:00
Nick Neisen 23dff53a08 MF-787 - Add tags to user, thing, and channel spans (#869)
* Add span tags to tracing functions

Signed-off-by: nwneisen <nwneisen@gmail.com>
Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add span tags to database funcions

Signed-off-by: nwneisen <nwneisen@gmail.com>
Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add database interface for things tags

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add channels database interface for tags

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Add database interface for users tags

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Fix borken tests due to database interface

Signed-off-by: Nick Neisen <nwneisen@gmail.com>

* Update database interface naming

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Adjust tests for name changes

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Return previous db variable name

Signed-off-by: nwneisen <nwneisen@gmail.com>

* Add ctx after rebase

Signed-off-by: nwneisen <nwneisen@gmail.com>
2019-10-07 13:32:09 +02:00
Aleksandar Novaković 19f8922a9e Update docker-compose version for addons (#874)
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-10-02 11:57:12 +02:00
Mirko Teodorovic ecc15b64b6 MF-859 - Channels metadata search (#867)
* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* run.sh

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default value for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default value for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* when metadata is not set dont save 'null' string

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* when metadata is not set dont save 'null' string

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to channels

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to channels

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change metadata type, add error handling

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add pause

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove extra char

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* retype from string to []byte

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to channels

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to channels

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add wait logic for gnatsd

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* few small fixes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix identityRes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to channels

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to channels

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to channels

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix waiting for gnatsd

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix waiting for gnatsd

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix waiting for gnatsd

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* changes to wait gnatsd logic

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* changes to wait gnatsd logic

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* testing query

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix query

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix query

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix merge problem

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* Update requests.go

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* Delete pwdrecovery.go

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix merge problem

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix merge problem

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small change in comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove unused struct

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-10-01 14:12:52 +02:00
Mirko Teodorovic 92a640f6fc MF-858 Users metadata (#861)
* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* run.sh

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata to users

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default value for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add default value for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* when metadata is not set dont save 'null' string

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* when metadata is not set dont save 'null' string

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change metadata type, add error handling

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add pause

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove extra char

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* retype from string to []byte

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add wait logic for gnatsd

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* few small fixes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix identityRes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add users metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert run.sh for now as gnats availability check is solved in other PR

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change metadata database/sql handling

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix commit issues

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small change to errors handling

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor comment change

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-09-28 13:15:41 +02:00
Dušan Borovčanin 873ef4c96f NOISSUE - Simplify MQTT benchmarking tool (#852)
* Fix user creation

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Extract client creation to separate method

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove message generating in separate goroutine

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove runSub and runPub methods

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Refactor benchmark code

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix typos

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update client message handling

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix microseconds typo

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Simplify client

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Don't take zero-messages clients int count

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix token timeout condition

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add timeout for publisher

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update Paho lib version

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Temporary drop SenML and subscribe support

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Calculate payload size

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove templates

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-09-25 19:02:29 +02:00
Ivan Milošević 5e3bb270a3 NOISSUE - Upgrade Go version to 1.13 in container images (#868)
* Change go version to 1.13 in docker images

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* update go version on CI

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix and add debug code in ci.sh

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove other Go version from PATH on semaphoreci
Add new go installation to PATH

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Create dir for golang 1.13

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove debug code

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add check for current go version before upgrade in ci script

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-09-23 21:43:21 +02:00
Parham Alvani c8cb2655c0 MF-820 - Fetch messages for a particular device (#843)
* feat: Add Support for Publisher Query in Postgres

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* chore: Remove Redundant Case

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>

* chore: Add Test for Postgres Query

Signed-off-by: Parham Alvani <parham.alvani@gmail.com>
2019-09-21 00:20:09 +02:00
Aleksandar Novaković b83439fcc2 Update gorilla websocket version (#865)
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-09-18 18:25:18 +02:00
Aleksandar Novaković 08105205e1 NOISSUE - Update aedes version and fix Dockerfile (#863)
* Update MQTT adapter and add message TTL

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

* Fix clean command

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-09-17 20:25:38 +02:00
Mirko Teodorovic d20dfa84bc NOISSUE - Search by metadata (#849)
* add metadata search

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata search

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata search

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata search

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata search

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata search

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add metadata search

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add space

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* metadata test case

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add docs and update swagger

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add test for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add test for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove commented out section

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small change to test

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove debug printf

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small fix for metadata

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix tests

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* and => and/or

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add line

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix mixed func params

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* metadata will be added to channels later

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix return type

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix typings

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix typings

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add migration

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove var

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* respecting the order of migrations

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-09-17 15:46:24 +02:00
Ivan Milošević a6cf76709d MF-846 - Install python in docker build for aedes mqtt image (#860)
* Multi-stage docker build for aedes mqtt image

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add copyright header

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-09-16 18:25:34 +02:00
Drasko DRASKOVIC 5ef6aa84de NOISSUE - Clean NginX files, move .gitignores to dirs (#853)
* Remove nginx entrypoint trash, move .gitignore

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

* Add node_modules to Aedes .gitignore

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

* Move docker .gitignore to nginx

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-09-16 11:47:34 +02:00
Drasko DRASKOVIC 3b19292966 NOISSUE - Add docker-compose for MQTT cluster (#841)
* Add MQTT cluster configs

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

* Bump worker_connections value in nginx.conf

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

* Revert config.toml

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

* Fix cluster

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

* Move non-ssl server into the same directive

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

* Fix cluster

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

* Remove unnecessary comments

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

* Organize docker-compose and nginx conf files

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

* Correct nginx.conf for mTLS and aux changes

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

* Fix NginX conf trailing slash in proxy_pass

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

* Fix path for MQTT

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

* Fix minorstuff in gitignore and comments

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-09-12 16:55:24 +02:00
Aleksandar Novaković 4870119270 Add debug logs to the WS adapter (#848)
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-09-11 15:34:04 +02:00
Mirko Teodorovic 97327ab05f NOISSUE - Add measuring time from pub to sub (#839)
* refactor code

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* connect each thing with each channel

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reverting - structure fields must be exported

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reverting - structure fields must be exported

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert some names

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move meausuring time start

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add pub-to-sub delivery time measure

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add pub-to-sub delivery time measure

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add pub-to-sub delivery time measure

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add pub-to-sub delivery time measure

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* improve sync between pub and sub

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* improve sync between pub and sub

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* improve sync between pub and sub

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* improve sync between pub and sub

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* improve sync between pub and sub

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* improve sync between pub and sub

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add random payload

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert changes for config.toml

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add random payload

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove printfs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add logging

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add payload

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add payload

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename variable

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add payload

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor sync

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor sync

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* refactor results

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change sync and result collecting for sub

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-09-06 14:59:35 +02:00
Parham Alvani 115d94bd1b fix: Correct 404 and Content-Type Issues in MQTT Version Endpoint (#837)
Signed-off-by: Parham Alvani <parham.alvani@gmail.com>
2019-09-05 15:10:18 +02:00
Mirko Teodorovic 640dfb7e19 NOISSUE - update mqtt prov tool and some refactor (#831)
* refactor code

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* connect each thing with each channel

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add some comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* connect each thing with each channel

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reverting - structure fields must be exported

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reverting - structure fields must be exported

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert some names

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move meausuring time start

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* revert changes to .gitignore

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-09-05 13:39:58 +02:00
Dušan Borovčanin e17a3de1d0 NOISSUE - Use Thing ID to update certs data (#827)
* Use ThingID to update certs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix logging typo

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update API tests and service mock

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-09-03 13:54:56 +02:00
Drasko DRASKOVIC ec4b46b669 NOISSUE - Improve VerneMQ plugin code, add configurable gRPC pool size (#836)
* Enable gRPC support

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

* Add poolboy process pool

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

* Add Verne docker-compose

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

* Improve code, add settings for pool size

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-09-03 01:05:36 +02:00
Drasko DRASKOVIC 38d85ae03b NOISSUE - Use gRPC for VerneMQ (#835)
* Enable gRPC support

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

* Add poolboy process pool

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

* Add Verne docker-compose

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

* Clean the code in genservers

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-09-02 23:22:46 +02:00
Drasko DRASKOVIC 655f421ca9 NOISSUE - Fix proto files in VerneMQ (#834)
* Add socket pool and fix pattern matching

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

* Fix hackney req

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

* Change docker-compose

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

* Correct protobuf and add MQTT loback ignore

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

* Bring back docker-compose

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-09-02 21:20:18 +02:00
Drasko DRASKOVIC 9ccc37c4b1 NOISSUE - Fix hackney HTTP request (#833)
* Add socket pool and fix pattern matching

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

* Fix hackney req

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-09-02 18:11:58 +02:00
Drasko DRASKOVIC a8836d67e0 Add socket pool and fix pattern matching (#830)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-09-01 21:53:04 +02:00
Ivan Milošević 2d1347eee3 Switch secure of WS connection according to secure of http connection of UI (#829)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-08-30 16:23:28 +02:00
Alexander Obukhov 1a4844cee1 NOISSUE - Use current hostname instead of localhost for a WebSocket connection in the UI (#826)
Signed-off-by: Alexander Obukhov <dev@sprql.space>
2019-08-30 14:21:29 +02:00
Drasko DRASKOVIC f090573567 NOISSUE - Improve MQTT benchmarking tools (#828)
* Refactor mqtt-bench

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

* Refactor mqtt-bench and provision tools

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

* Improve README

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

* Remove provision generated toml file

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

* Update README

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

* Replace `tcp` with `tcps` for mtls

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-08-30 14:09:12 +02:00
Mirko Teodorovic bfd12304ac NOISSUE - update mqtt benchmark (#824)
* update gitignore

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix dates for cert

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* reorganize code

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update docs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* print to stdout for creating result file from script

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add script for testing

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add time measeuring

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* separate test in one file each

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* move config.toml

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update docs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add connection check, and prevent blocking of publisher when connection fails

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-08-27 14:21:39 +02:00
Dušan Borovčanin e7891ec6ab Add encryption key to env vars table (#823)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-08-15 16:26:31 +02:00
Dušan Borovčanin 5c924bd5a3 NOISSUE - Add version endpoint to MQTT adapter (#816)
* Add version endpoint to MQTT adapter

Expose CoAP version endpoint in the default docker-compose.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use /tcp insted of implicit protocol name

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-08-14 01:07:11 +02:00
Mirko Teodorovic 19834dfc51 MF-295 add mqtt benchmark tool (#817)
* adding mqtt benchmark tool

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding mqtt benchmark tool - vendoring

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add mtls support

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update readme

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* tool for channel provision, reorganize code

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* adding config toml

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* tool for channel provision, adding ssl cert gen

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add config toml

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add readme for provision

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update readme

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove some printing

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add test configs

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove some dead code, and sort comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* replace statistics lib

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* replace statistics lib

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* add cobra and viper

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* styling changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* styling changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* styling changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove statistic lib

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* change type visibility

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove empty line

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update vendor

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update deps

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* rename variable

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* small changes, adding comments

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* error handling

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-08-13 12:56:31 +02:00
Mirko Teodorovic 9a78b1111f update mqtts commands (#815)
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-08-05 11:43:05 +02:00
Mirko Teodorovic 9c52c3816a Fix typo (#814)
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-08-02 15:22:28 +02:00
Dušan Borovčanin f03949a003 NOISSUE - Support encrypted bootstrap (#796)
* Fix API docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Provide secured bootstrapping

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix test and mock methods signatures

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix typos

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add encrypte bootstrap test

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove duplicated docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use secret key to encrypt bootstrap request

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use secret key for secure bootstrapping

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Move encryption to ConfigReader

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove ConfigReader from Service

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add reader tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update API docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Unset key env variable

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add endpoint test for secure bootstrap

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-08-02 14:35:31 +02:00
Aleksandar Novaković 68e8eda92d Add config to writers docs (#812)
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-08-01 13:13:24 +02:00
Drasko DRASKOVIC c751d0e656 NOISSUE - Add VerneMQ support (#809)
* Add VerneMQ

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

* Fix Aedes build

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

* Update VerneMQ README

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

* Remove unused gRPC client proto files

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

* Add topic rewrite for CT

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

* Fix CT links on NATS SUB

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

* Fix NATS PUB/SUB with spawned process

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

* Fix typos

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

* Fix README

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-08-01 12:40:49 +02:00
Aleksandar Novaković 55d03ecdda NOISSUE - Add content type as part of MQTT subscription topic (#810)
* Add content type to MQTT sub topic

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

* Remove default content type value

Remove default content type value (SenML JSON) and replace it with
an empty string.

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

* Update docs in accordance with changes

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-07-29 17:42:04 +02:00
Nikola Marčetić 2996193a50 Updated Readme (#808)
* Updated Readme

Signed-off-by: nmarcetic <n.marcetic86@gmail.com>

* Fix typo

Signed-off-by: nmarcetic <n.marcetic86@gmail.com>

* Fix grammar

Signed-off-by: nmarcetic <n.marcetic86@gmail.com>
2019-07-25 19:20:11 +02:00
Ivan Milošević 6d2aa71ccc NOISSUE - Add rungw command to Makefile (#805)
* Add `make rungw` command to run mainflux without jaeger
Add name to jaeger container

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add explanatory comment in Makefile

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add new line on end file

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-07-25 17:24:26 +02:00
Ivan Milošević 54823bed25 NOISSUE - Fix building UI docker image for arm (#806)
* Add entrypoint in arm Dockerfile
Switch from ash to dash in entrypoint script

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add new line on file end

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-07-25 17:15:06 +02:00
Aleksandar Novaković 649986b19f MF-757 - Add support for explicit content type (#771)
* Add format to raw message and content type mapping

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

* Add format as part of content type header

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

* Add format to content-type header for WS adapter

Add format as part of content-type and add support for
content-type header and query parameter.

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

* Add support for format and content-type in MQTT adapter

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

* Add format and content-type to CoAP adapter

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

* Add documentation for content type and format

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

* Add comments to MQTT code

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

* Fix SenML JSON CoAP code type

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

* Remove format from the adapters

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

* Remove format from the docs

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

* Remove format field from MQTT adapter

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

* Update content type to be optional

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

* Add support for CBOR content type in the normalizer

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

* Update docs for MQTT content type

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-07-25 02:22:28 +02:00
Nikola Marčetić 99ced38229 Updated Readme (#807)
Signed-off-by: nmarcetic <n.marcetic86@gmail.com>
2019-07-24 15:02:21 +02:00
Mirko Teodorovic 8efcaee350 NOISSUE - make correct reference to MF_UI_PORT (#804)
* make correct reference to MF_UI_PORT

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove echo

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-07-24 12:44:39 +02:00
Aleksandar Novaković a3de6953f8 Add support for optional Jaeger (#801)
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-07-23 14:31:02 +02:00
Dušan Borovčanin 748b7c1ee8 Fix CoAP adapter subtopics (#797)
Remove `messages` part from the subtopics.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-07-22 13:24:50 +02:00
Nikola Marčetić 6af65ea159 Added changelog for 0.9.0 release (#799)
Signed-off-by: nmarcetic <n.marcetic86@gmail.com>
2019-07-19 17:56:23 +02:00
Aleksandar Novaković b95bb82e0b Fix users service to work in offline mode (#795)
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-07-19 12:28:45 +02:00
Ivan Milošević 8bda799ef9 Create and push docker manifest for new release from Makefile (#794)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-07-18 17:31:37 +02:00
Aleksandar Novaković 61f1c2e379 MF-399 - Add open tracing support (#782)
* Add open tracing dependencies

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

* Add open tracing to users service

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

* Add open tracing to the things service

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

* Add open tracing to the http adapter

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

* Add open tracing to the ws adapter

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

* Add open tracing to the CoAP adapter

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

* Update LoRa adapter in accordance with changes

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

* Update SDK tests in accordance with changes

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

* Update bootstrap service in accordance with changes

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

* Update reader services with accordance with changes

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

* Update .env and docker-compose file

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

* Add jaeger and timeout env vars

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

* Fix broken test for can access by id endpoint

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

* Update deps with proto empty package

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-07-18 15:01:09 +02:00
Ivan Milošević 1ad14e7fd3 fix mainflux_id parameter in bootstrap swagger (#789)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-07-16 16:21:37 +02:00
Aleksandar Novaković a6a8648e4f MF-783 - Allow access checking by a thing ID (#784)
* Add can access by things ID endpoint to things service

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

* Add new auth endpoint to the swagger docs

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

* Add test for the new endpoint of the things service

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-07-15 18:28:15 +02:00
Dušan Borovčanin 4a7af7c0b3 NOISSUE - Fix CoAP adapter (#779)
* Fix CoAP mux

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove prints and commented code

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-07-15 17:49:02 +02:00
Ivan Milošević b0a79436b8 Fix MF_THINGS_AUTH_GRPC_PORT in addons' docker-compose files (#781)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-07-11 23:19:08 +02:00
Aleksandar Novaković 4ab2e396c2 NOISSUE - Add authorization HTTP API to things service (#772)
* Add authorization HTTP API to things service

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

* Add new tests and update existing ones

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

* Update swagger documentation

Update swagger documentation for auth endpoints.

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

* Update README docs for things service

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

* Update docker-compose and fix endpoint typo

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

* Remove commented code

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-07-04 17:06:55 +02:00
Manuel Imperiale 22a3b881fd NOISSUE - Typo fix (#777)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-07-04 09:57:03 +02:00
Aleksandar Novaković aeebf06799 Remove cli executable from repo (#776)
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-07-04 05:19:49 +08:00
Mirko Teodorovic c396e6ded8 fix docker-compose env (#775)
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-07-03 20:50:28 +02:00
Manuel Imperiale f5b6c63cca NOISSUE - Use .env vars in docker-compose (#770)
* NOISSUE - Use .enr vars in docker-compose

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add README and dupllicated .env in docker repo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use .env for Bootstrap Docker Composition

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use .env for Cassandra (Reader-Writer) Docker Composition

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use .env for InfluxDB (Reader-Writer) Docker Composition

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use .env for MongoDB (Reader-Writer) Docker Composition

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use .env for Postgres (Reader-Writer) Docker Composition

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use .env for LoRa adapter Docker Composition

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix Grafana port in .env file

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Update README.md

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove docker/.env and update README.md

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-07-02 14:22:12 +02:00
Dušan Borovčanin 81cd73e277 Use errors and null packets in authorized pub/sub (#773)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-07-01 11:22:31 +02:00
Mirko Teodorovic 204aec6171 MF-663 - enable nginx port conf from docker env (#769)
* MF-722 - Change UUID lib (#746)

* Update uuid package and update things serivce

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

* Update bootstrap service tests

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

* Update existing postgres writer tests

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

* MF-732 - Add Postgres reader (#740)

* NOISSUE - Fix Readers logs

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* MF-732 - Add Postgres reader

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix total count

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm commented code

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add Postgres reader tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix editor format

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Change UUID lib

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* MF-742 - Things to support single user scenario (#749)

* Add single user mode to things service

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

* Add tests for things/users package

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

* Update init order in main

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

* Update grpc and protobuf deps in mqtt adapter (#751)

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

* Fix MQTT raw message deserialization (#753)

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

* NOISSUE - Add certificate fields to the Bootstrap service (#752)

* Add cert fields to the BS

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add cert fields when creating a config

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add update cert endpoint

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix key column name

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add cert fields to db converters

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Secure cert update endpoint

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Authroize cert update methods

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix Bootstrap service tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add cert update service tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update endpoit tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update API docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update request tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix request tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update repository tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix typo in repo tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* NOISSUE - Add searchable Things name (#750)

* NOISSUE - Add searchable Things name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add postgres schema validation and tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add namme tests in requests_test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm requests_test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add name in ListThings loggins

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add invalidName var for tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Set maxNameSize to 1024

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix postgres test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix total when filtering things by name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix review

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* Add missing Websocket.js into docker ui image (#755)

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* MF-466 - ARM docker deployment (#756)

* Add arm Dockerfiles
Change version of postgres images in docker-compose to use versions with  multiarch

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* docker compose file

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove bin qemu file

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove unnecesarry comments

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add make dockers_arm32v7 in Makefile

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove docker/Dockerfile.arm

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add build for arm32v7 in ui Makefile

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add arm32v7 tags

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* add docker-compose for arm
remove thing-db in docker compose (use same db as user)
fix dockerfile and makefile

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix thing database env variable

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Switch back to separate database for things and users

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* rename arm32v7 to arm

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove arm32v7 tag
rename arm32v7 image names

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Rename command for making mqtt and ui individual images, to match other miscroservices

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Push arm docker images

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix fucntion call in ci.sh

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* mergiing ui/Dockerfile

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

*  NOISSUE - Add searchable Channels name  (#754)

* NOISSUE - Add searchable Things name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add postgres schema validation and tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add namme tests in requests_test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* NOISSUE - Add searchable Channels name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix bootstrap mocks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* NOISSUE - Remove installing non-existent package in ci (#758)

* Remove installing non-existent  package from ci

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove branch master condition in ci.sh to test it

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix syntax error

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* update apt

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* build arm images for latest release
push ui and mqtt arm images
install only qemu-user-static

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* clean docker after pushing amd64 images

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* installing all qemu app

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove docker images before building ui and mqtt arm-images

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* prune dockers and test only arm build

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix syntax error

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix moving qemu-arm-static

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* installing qemu with apt-get

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* add another apt-get update

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* apt install one liner

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* testing ci script

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* After installing qemu, get appropriate version

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Test ci without amd64 dockers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove tests from ci for test purpose

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Uncomment commands

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove whitespace and change order of building images

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* nginx

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* change to openresty

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* change to openresty and accept env from docker compose

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* revert to master

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* revert to master

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* revert to master

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* NOISSUE - Fix Docker for ARM (#760)

* NOISSUE - Fix Docker for ARM

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

* Correct ARGs

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

* Fix docker-compose for ARM

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

* Add docker manifest

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

* cp not mv qemu from mf root

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix amd64 docker names for ui and mqtt images

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* edit ci.sh for testing purposes

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove bachslash from make manifest
edits in ci for testing purposes

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix manifest call

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* add manifest on version realese
delete space before latest argument
fix for loop in manifest creation

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* include tests

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* docker system prune
remove tests for testin purposes

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add variant in manifest file for armv7

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove white space

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* paralelise the compilation

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix place of -j$NPROC

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* adding env variable

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* fix variant option for manifest annotate (#765)

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* enable port configure from env var in docker-compose

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* enable port configure from env var in docker-compose

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* enable port configure from env var in docker-compose

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* use docker env to set port

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* add env to conf port in nginx.conf

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* replace string with docker env

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* replace string with docker env

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* Update docs (#766)

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* remove not needed comment

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* adding .env file for default UI_PORT - if no enviroment UI_PORT is set value from .env file is used

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* get default UI_PORT variable value from .env file

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* set default port value to 3000

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>
2019-06-24 20:13:02 +02:00
Dušan Borovčanin aa219b6f99 NOISSUE - Fix count when search by name is performed (#767)
* Fix total field when search by name

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix tests to check total count

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-06-24 14:03:48 +02:00
Dušan Borovčanin f27cb1d019 Update docs (#766)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-06-21 14:07:24 +02:00
Ivan Milošević 41897cee11 fix variant option for manifest annotate (#765)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-06-20 15:31:56 +02:00
Drasko DRASKOVIC 91274aca9b NOISSUE - Fix Docker for ARM (#760)
* NOISSUE - Fix Docker for ARM

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

* Correct ARGs

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

* Fix docker-compose for ARM

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

* Add docker manifest

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

* cp not mv qemu from mf root

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix amd64 docker names for ui and mqtt images

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* edit ci.sh for testing purposes

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove bachslash from make manifest
edits in ci for testing purposes

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix manifest call

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* add manifest on version realese
delete space before latest argument
fix for loop in manifest creation

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* include tests

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* docker system prune
remove tests for testin purposes

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add variant in manifest file for armv7

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove white space

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* paralelise the compilation

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix place of -j$NPROC

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-06-20 14:14:06 +02:00
Ivan Milošević b53979104c NOISSUE - Remove installing non-existent package in ci (#758)
* Remove installing non-existent  package from ci

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove branch master condition in ci.sh to test it

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix syntax error

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* update apt

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* build arm images for latest release
push ui and mqtt arm images
install only qemu-user-static

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* clean docker after pushing amd64 images

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* installing all qemu app

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove docker images before building ui and mqtt arm-images

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* prune dockers and test only arm build

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix syntax error

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix moving qemu-arm-static

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* installing qemu with apt-get

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* add another apt-get update

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* apt install one liner

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* testing ci script

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* After installing qemu, get appropriate version

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Test ci without amd64 dockers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove tests from ci for test purpose

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Uncomment commands

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove whitespace and change order of building images

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-06-12 21:11:45 +02:00
Manuel Imperiale 63de955a7c NOISSUE - Add searchable Channels name (#754)
* NOISSUE - Add searchable Things name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add postgres schema validation and tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add namme tests in requests_test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* NOISSUE - Add searchable Channels name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix test description

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix bootstrap mocks

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-06-11 10:37:25 +02:00
Ivan Milošević 44cc20b9ca MF-466 - ARM docker deployment (#756)
* Add arm Dockerfiles
Change version of postgres images in docker-compose to use versions with  multiarch

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* docker compose file

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove bin qemu file

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove unnecesarry comments

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add make dockers_arm32v7 in Makefile

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove docker/Dockerfile.arm

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add build for arm32v7 in ui Makefile

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add arm32v7 tags

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* add docker-compose for arm
remove thing-db in docker compose (use same db as user)
fix dockerfile and makefile

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix thing database env variable

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Switch back to separate database for things and users

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* rename arm32v7 to arm

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove arm32v7 tag
rename arm32v7 image names

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Rename command for making mqtt and ui individual images, to match other miscroservices

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Push arm docker images

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix fucntion call in ci.sh

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* mergiing ui/Dockerfile

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-06-11 02:14:05 +02:00
Ivan Milošević 62e7d69f7b Add missing Websocket.js into docker ui image (#755)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-06-10 00:15:12 +02:00
Manuel Imperiale c8979ac297 NOISSUE - Add searchable Things name (#750)
* NOISSUE - Add searchable Things name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add postgres schema validation and tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add namme tests in requests_test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm requests_test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add name in ListThings loggins

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add invalidName var for tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Set maxNameSize to 1024

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix postgres test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix total when filtering things by name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix review

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-05-30 15:33:49 +02:00
Dušan Borovčanin cac1e35b58 NOISSUE - Add certificate fields to the Bootstrap service (#752)
* Add cert fields to the BS

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add cert fields when creating a config

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add update cert endpoint

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix key column name

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add cert fields to db converters

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Secure cert update endpoint

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Authroize cert update methods

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix Bootstrap service tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add cert update service tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update endpoit tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update API docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update request tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix request tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update repository tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix typo in repo tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-05-22 23:22:19 +02:00
Aleksandar Novaković 6d6f3cc858 Fix MQTT raw message deserialization (#753)
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-05-21 11:27:26 +02:00
Aleksandar Novaković 066057d914 Update grpc and protobuf deps in mqtt adapter (#751)
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-05-17 16:51:22 +02:00
Aleksandar Novaković f9093413ee MF-742 - Things to support single user scenario (#749)
* Add single user mode to things service

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

* Add tests for things/users package

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

* Update init order in main

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-05-17 16:06:21 +02:00
Manuel Imperiale 5fec0a9e92 MF-732 - Add Postgres reader (#740)
* NOISSUE - Fix Readers logs

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* MF-732 - Add Postgres reader

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix total count

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm commented code

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add Postgres reader tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix editor format

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Change UUID lib

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-05-16 18:00:19 +02:00
Aleksandar Novaković 3125f0bbc2 MF-722 - Change UUID lib (#746)
* Update uuid package and update things serivce

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

* Update bootstrap service tests

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

* Update existing postgres writer tests

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-05-16 13:35:13 +02:00
Aleksandar Novaković 0dc4d12e73 Add performance improvement to writer filtering (#744)
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-05-16 13:19:05 +02:00
Dušan Borovčanin 9d30006d31 NOISSUE - Update nginx version (#748)
* Update version of the Nginx image

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add undefined check for HTTP and WS

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-05-16 11:59:23 +02:00
Aleksandar Novaković 5202d734c9 MF-574 - Add missing environment variables to Cassandra writer (#745)
* Add username, password and port env var

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

* Update existing readme files with new env vars

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-05-15 23:31:40 +02:00
Aleksandar Novaković cc5c66bfba Fix CI with fixed plugin versions (#747)
Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2019-05-15 17:41:18 +02:00
Dušan Borovčanin f5bb65d0e4 NOISSUE - Add compile test to CI (#743)
* Add compile tests to CI script

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix parallelization flag

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-05-13 14:48:54 +02:00
Mirko Teodorovic e46164f93f fix building problems (#741)
Signed-off-by: mteodor <mirko.teodorovic@gmail.com>
2019-05-11 17:16:25 +02:00
Manuel Imperiale d2fc379e3f NOISSUE - Fix Postgres logs in Things service (#734)
* NOISSUE - Fix Postgres logs in Things service

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 reviews

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 uuid package

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-05-10 18:55:13 +02:00
Aleksandar Novaković 5e5fe88927 MF-708 - Assign Writer(s) to a channel (#737)
* Add support for channel filtering using config

Add support for channel filtering using yaml configuration files
for writers.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update writers documentation with new env var

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add info comment to configuration file

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix configuration and update yaml dep

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update config from yaml to toml

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-05-10 14:36:27 +02:00
Manuel Imperiale 886c8b2467 MF-732 - Add PostgreSQL writer (#733)
* MF-732 - Add PostgreSQL writer

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add README

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Unify writers api

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix host and port

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-05-07 19:09:28 +02:00
Manuel Imperiale 138dae9277 NOISSUE - Fix Readers logs (#735)
* NOISSUE - Fix Readers logs

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-05-07 15:59:18 +02:00
Manuel Imperiale 9f1151b8dc NOISSUE - Add readers pagination in SDK (#736)
* NOISSUE - Add readers pagination in SDK

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-05-07 15:10:02 +02:00
Darko Draskovic 700cfdf6f3 Add UI websocket open/close and send/receive (#728)
* Add websocket open/close and send/receive

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add websocket feedback/log to Elm

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Align WS open/close buttons

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add websocket query for channel list

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add websocket related encoders/decoders for port interops

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix .js indentation and simplify ws (dis)connect method

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Use single quotes consistently

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add HTTP Send and WS Listen

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2019-04-26 19:17:04 +02:00
Aleksandar Novaković dc9333237f MF-707 - Allow custom Thing key (#726)
* Add support for setting up thing key manually

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix existing tests and add new ones

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update SQL schema for things entity

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add update thing key endpoint to swagger docs

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix response code when handling conflicting key

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-04-25 14:37:51 +02:00
Aleksandar Novaković aba7d909ed MF-525 - Add pagination response to the readers (#729)
* Add pagination response to the readers

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Remove println from influx reader

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-04-25 00:18:43 +02:00
Manuel Imperiale 04281f2388 NOISSUE - Rm Things type from lora-adapter (#727)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-04-22 21:31:08 +02:00
Milan Andric 08f2545df9 fix to makefile for OSX/Darwin (#724)
Signed-off-by: Milan Andric <mandric@gmail.com>
2019-04-22 21:03:05 +02:00
Darko Draskovic 64f154dcc9 Fix .dockerignore file by removing index.html (#725)
* Fix .dockerignore file by removing index.html

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add autogen main.js to .dockerignore

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2019-04-21 20:10:24 +02:00
Darko Draskovic 9688fc316a Fix things and channels metadata create and edit & remove thing type (#721)
* Add basic websocket support

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add separate cards for base and regular attribs

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add arbitrary json metadata enc/dec

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add JsonMF module for JSON val handling

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Rename json related func for naming consistency

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove Thing type from user interface

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add arbitrary metadata json to channels

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Change json string identation

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2019-04-21 02:40:14 +02:00
Jovan Kostovski 5b66b6e169 skip deleting of persistent volumes by default (#723)
This commit, intruduces changes to the current behavior of the "make cleandocker" command.
From now on, an extra parameter must be given in order to delete the persistent volumes,  which up until now was done by default. The new command which represents the old behavior (deleting all artifacts created from the docker composition) is "make pv=true cleandocker".

Signed-off-by: Jovan Kostovski <chombium@gmail.com>
2019-04-20 17:56:51 +02:00
Manuel Imperiale b97deb50b2 MF-488 - Remove Thing type (app or device) (#718)
* MF-488 - Remove Thing type (app or device)

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix

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 reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-04-20 14:09:11 +02:00
Dušan Borovčanin 44615c5ff0 Remove empty channels check (#720)
Remove empty list of channels check from the default Bootstrap
reader implementation.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-04-18 18:02:20 +02:00
Jovan Kostovski a30666d999 MF-655 Proper usage of docker volumes (#657)
* added filter and a switch for volume deletion

Signed-off-by: Jovan Kostovski <chombium@gmail.com>

* added persistent volume configuration

Signed-off-by: Jovan Kostovski <chombium@gmail.com>
2019-04-18 17:31:24 +02:00
Drasko DRASKOVIC baebe8abc1 NOISSUE - Improve UI styling (#719)
* Add styling

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

* Fix errors

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

* Fix env

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-04-18 13:29:38 +02:00
Dušan Borovčanin d9d9da49a8 MF-715 - Conflict on updating connection with a valid list of channels (#716)
* Add check if Channels already exist

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update streams tests to use time offset

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-04-17 19:41:37 +02:00
Aleksandar Novaković 2f17a05b3e MF-711 - Create separate Redis instance for ES (#717)
* Fix Redis connection error handling in MQTT adapter

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add separate env vars for ES in MQTT adapter

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Create dedicated redis service for ES

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update docs according to changes

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-04-17 12:39:47 +02:00
Dušan Borovčanin fe9f4dca8e NOISSUE - Update event fields naming (#713)
* Update event fields naming

Replace `id` with `thing_id`.
Fix typo in `success` field.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-04-16 18:32:05 +02:00
Aleksandar Novaković de736a5c47 MF-698 - Add missing info and docs about sys event sourcing (#712)
* Add event sourcing section in dev guide

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix spelling in the docs

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix notice formatting in docs

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix typos in docs

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add highlight for event type

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-04-16 17:28:43 +02:00
Aleksandar Novaković 5799356b14 MF-549 - Change metadata format from JSON string to JSON object (#706)
* Update metadata type in things service

Update things service so that metadata has map type. Update repo
implementation by adding sqlx lib.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add sqlx lib to bootstrap service

Add sqlx lib to bootstrap service and update metadata field type.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update metadata in redis streams consumer

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update tests for bootstrap service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix mongo reader logging and driver version

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix mongo reader and writer

Fix mongo reader and writer by updating driver version.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update SDK with new metadata format

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update LoRa adapter with new metadata format

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update users service in order to use sqlx

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Replace anonymous struct with map

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update docs for LoRa adapter

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix LoRa application metadata format

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix metadata format in LoRa docs

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add metadata2 var to SDK things test

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-04-16 14:58:56 +02:00
Dušan Borovčanin 0bbc4f54ab Fix Bootstrap service event map keys (#705)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-04-11 13:55:21 +02:00
Darko Draskovic 0b89975947 NOISSUE - Replace repeating code by card gen func (#697)
* Replace repeating code by card gen func

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove absolute URL from Env.elm

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix md links in README.md

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Refactor appendIF helper func

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2019-04-09 16:21:26 +02:00
Dušan Borovčanin df11a20a32 Update Bootstrap service docker-compose.yml (#700)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-04-09 02:44:50 -07:00
Ivan Milošević 77ce0f9fab Remove Debug function (#699)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-04-09 01:50:23 -07:00
Dušan Borovčanin 6ebc758f89 MF-687 - Add event sourcing to Bootstrap service (#695)
* Add initial Bootstrap event producer

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add operation name to events

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add ES path for BS events

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add BS event sourcing tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add connections update events

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Extract event XADD to separeate method

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add header comments

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix service docs typo

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update BS service README.md

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update Service method tests

Tests for handler methods are not added.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-04-08 08:46:07 -07:00
Ivan Milošević 98d588e8ef NOISSUE - Remove debugging message from response of handle error function (#696)
* Remove debugging message from response of handle error function

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Print error in debug console in case of bad body HTTP response

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-04-08 13:44:11 +02:00
Aleksandar Novaković 12a85f565c Fix logging in publish event callback (#694)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-04-05 17:29:43 +02:00
Aleksandar Novaković 5fcf0aa229 Add event stream to MQTT adapter for conn status (#692)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-04-05 11:25:39 +02:00
Drasko DRASKOVIC 9b41c2db3a NOISSUE - Improve UI style (#691)
* Improve UI style

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

* Remove unused font

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-04-04 20:28:56 +02:00
Dušan Borovčanin e4d3b1d8c3 Fix InfluxDB time bug (#689)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-04-04 18:10:01 +02:00
Dušan Borovčanin 4f62f89b87 Update docs structure (#686)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-04-04 12:10:46 +02:00
Dušan Borovčanin 06f4c6e059 Use images instead of carousel (#685)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-04-04 11:19:43 +02:00
Dušan Borovčanin 25d9783514 NOISSUE - Update docs (#683)
* Add authorization section to the docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Slow down Bootstrap gif

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use heading 4 instead of italic

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Replace gif with carousel

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-04-04 10:22:09 +02:00
Ivan Milošević 56a50962b6 MF-662 - Change menu style (#678)
* env variable for local dev

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Change menu style

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Revert "env variable for local dev"

This reverts commit 205e13be6cdde930f02e7bda2019bb615267ed14.

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Move font awesome class names to record in Helper

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-04-02 19:17:28 +02:00
Dušan Borovčanin f9b17d5f24 MF-651 - X509 Mutual TLS authentication (#676)
* Use NginX njs module for mutual authentication

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add Makefile for cert management

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Move certificates make context to scripts dir

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Move nginx.conf to separate directory

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Choose between two NginX configurations

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Move certs Makefile to docker/ssl/

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use default key-based authentication

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add mTLS docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update Makefile

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add check if Authorization is present

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add check if Will Flag is 1

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Return MQTT over WS

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix docker-compose.yml volume mapping

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename security section in docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add message type check before message parsing

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove double comments

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove s.AGAIN in return

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update Makefile

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove CSR and key from the root

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Drop TLS version below 1.2

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add comments for cert and key paths

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-04-02 17:54:24 +02:00
Ivan Milošević bc49f6a543 Fix offset calculation after deleting thing/channel, not to go to negative offset after deleting last thing/channel (#679)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-04-01 17:49:10 +02:00
Aleksandar Novaković 83cafeb6be Update Aedes version for MQTT adapter (#677)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-03-29 14:04:02 +01:00
Ivan Milošević c634bf8c7d MF-661 - Bootstrap pagination in UI (#672)
* Add bootstrap pagination

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix enviroment variable in readme

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Change style
Remove pagination from channels and things lists if total less then limit

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Hide pagination when not needed on connection and message page
Code refacotoring

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove debug module and local dev variable.

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove debug logging

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add trailing slash note in README

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* proto

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-03-28 10:20:15 +01:00
Aleksandar Novaković 86a3115804 Update subtopics section in documentation (#670)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-03-22 16:47:30 +01:00
Darko Draskovic 4a31f11615 Remove default base URL value (#671)
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2019-03-22 14:53:03 +01:00
Nikola Marčetić ea79f22269 Changelog updates regarding to 0.8 Milestone (#669)
Signed-off-by: nmarcetic <n.marcetic86@gmail.com>
2019-03-20 18:10:32 +01:00
Nikola Marčetić 767c900c48 Bump version to 0.8 (#668)
Signed-off-by: nmarcetic <n.marcetic86@gmail.com>
2019-03-20 17:44:38 +01:00
Darko Draskovic d504c4f67d MF-571 - Add Env.elm to set custom base URL (#654)
* Add Env module

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Modify README.md

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove literal vals from Env.elm

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Replace protocol, host and port env setting by url

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove default env.url value and update README.md

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add http://localhost:80/ as a default baseURL val

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Replace Gateflux by Mainflux

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2019-03-20 14:30:38 +01:00
Jovan Kostovski e95e010a3a added docs about docker-compose config overriding (#653)
Signed-off-by: Jovan Kostovski <chombium@gmail.com>
2019-03-19 22:32:07 +01:00
Aleksandar Novaković a09e3e214a NOISSUE - Fix subtopic regex and restrict empty subtopic parts (#659)
* Fix subtopic regex and restrict empty subtopic parts

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update mqtt adapter subtopic processing

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Return old MQTT adapter implementation

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Allow dots and handle empty parts

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add malformed subtopic error encoding

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix MQTT topic validation

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix MQTT topic parsing

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix subtopic filtering

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-03-19 16:05:56 +01:00
tony-ward 7c4c6109f4 MF-639 Split Content-Type header field on semicolon and evaluate all substrings (#644)
* Split Content-Type header field on semicolon and evaluate all substrings

Signed-off-by: Tony Ward <tony@lucidtron.com>

* included strings library
Signed-off-by: Tony Ward <tony0ward@hotmail.com>

* simplify code, run gofmt

Signed-off-by: tony <tony0ward@hotmail.com>
Signed-off-by: tony <tony@lucidtron.com>

* allow Content-Type to only contain the required type

Signed-off-by: Tony Ward <tony@lucidtron.com>
2019-03-19 12:00:11 +01:00
Aleksandar Novaković 8c3bff5f4b MF-656 - Change bootstrap service port to 8200 (#658)
* Change bootstrap service port to 8200

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix redis streams tests in things service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-03-18 13:50:44 +01:00
Dušan Borovčanin 2ed1471d5f MF-539 - Improve Bootstrap Service documentation (#646)
* Fix infinte loop in Subscribe method

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update API docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update service README

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add bootstrapping flow gif

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update bootstrapping flow gif

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-03-15 19:11:26 +01:00
beres 61b2d6b87b MF-596 - Add subtopic to RawMessage (#642)
* Commit for mainflux-596
Modified and tested:
- cli
- http
- mqtt
- normalizer
- all readers
- sdk messages
- all writers
- ws
Missing:
- coap
- lora

Signed-off-by: ale <ale@metaverso.org>

* - fix subtopic name in, when starting with dot, http/ws/mqtt
- add some test on readers

Signed-off-by: ale <ale@metaverso.org>

* - fix string concatenation
- update http/transport regexp to match subtopic names with only \w-
- update ws/transport regexp like http ones with also the wildcard * and >

Signed-off-by: ale <ale@metaverso.org>

* added subtopic support to coap adapter

Signed-off-by: ale <ale@metaverso.org>

* - update replace functions with replaceall when needed
- renamed getDestChannel to fmtSubject
- update api/transport and ws/transport route to be more readable
- fix mqtt syntax
- renamed func andQuery to query as suggested by @anovakovic01
- have a nice we :)

Signed-off-by: ale <ale@metaverso.org>

* - fix error declaration on ws/nat/publisher
- fix regexp added missing allowed chars - and _ on coap/api/transport
- fix subtopic clean suffix / if present on coap/api/transport
- improve regexp on http and ws /api/transport, now does not accept url that do not strictly match
- add some ws subtopic tests

Signed-off-by: ale <ale@metaverso.org>

* - enabled wildcard chars on coap/api/transport
- allow use special chars on http and ws api/transport

Signed-off-by: ale <ale@metaverso.org>

* - use strings.Replace() insted ReplaceAll()

Signed-off-by: ale <ale@metaverso.org>

* - allow every chars on subtopics
- fix replace error on mqtt

Signed-off-by: ale <ale@metaverso.org>

* fix cassandra test

Signed-off-by: ale <ale@metaverso.org>

* fix ws test with invalid subtopic

Signed-off-by: ale <ale@metaverso.org>

* fix invalid GOCACHE in go1.12, replaced by -count 1, see https://golang.org/doc/go1.10#test

Signed-off-by: ale <ale@metaverso.org>

* - improve regexp on http/ws api/transport
- minor changes

Signed-off-by: ale <ale@metaverso.org>

* - add generic function parseSubtopic on ws/http adapters

Signed-off-by: ale <ale@metaverso.org>

* - add generic function fmtSubtopic on coap adapter

Signed-off-by: ale <ale@metaverso.org>
2019-03-15 18:38:07 +01:00
Manuel Imperiale 2f09701028 NOISSUE - Prevent infinite loop in lora-adapter if Redis init fail (#647)
* NOISSUE - Prevent infinite loop in lora-adapter if Redis init fail

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix line length

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-03-14 18:10:51 +01:00
Darko Draskovic a0ed73d09b Replace crossOrigin with relative path and fix messaging bug (#645)
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2019-03-13 13:58:03 +01:00
Alwin Doss 74dfd69767 Corrected grammar and rephrased a few sentences to read nicely (#641)
Signed-off-by: Alwin Doss <alwindoss84@gmail.com>

Incorporated review comments

Signed-off-by: Alwin Doss <alwindoss84@gmail.com>

Fixed grammar

Signed-off-by: Alwin Doss <alwindoss84@gmail.com>
2019-03-07 16:25:37 +01:00
Darko Draskovic b2ce9f5597 Fix missing css in container ui (#638)
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2019-03-07 13:39:35 +01:00
Darko Draskovic 3255f32a9c MF-571 - Elm UI (#632)
* Initial commit

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add user create form

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add Makefile and README

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove elm-stuff

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add url parsing

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add channels retrive and remove

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Refactor request f and add f annotations

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add things provision

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add thing retrieve and remove

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Rename Channel.elm methods

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix trailing slash and add url constants

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add module User with separate model, view and update

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Modularize channels

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Modularize version and things

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Refactor module methods

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Modularize messaging

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add channel pagination

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix initial channel model

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add access control (connect and disconnect things from channel)

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add pagination to Things

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Using Url.Builder in connection and messaging
Rename Acces module to Connection
Rename attribute in Bootstrap code
Remove debug logging

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add login

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add dynamic menu

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix empty name channel/thing bug

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove menu from login screen and add response helper

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add version, channels, things direct display

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add channels table

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Change var names and add refreshChannelList helper

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add Things list

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix response behavior

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove version page button

Signed-off-by: drasko <drasko.draskovic@gmail.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Move everything to ui folder

Signed-off-by: drasko <drasko.draskovic@gmail.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove dashflux

Signed-off-by: drasko <drasko.draskovic@gmail.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* MF-571 Add things and channels lists to Connection module (#580)

* Add thing and channel lists to Connection module

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix form reset bug & remember checkbox status in Connection module

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* MF-571 - Add batch things-channels connection modification (#588)

* Add batch things-channels connection modification

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove unused token arg and reposition buttons

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* NOISSUE - messaging in UI (#578)

* Add thing and channel lists to Connection module

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* init commit

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* list channels and things

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* list channels with radio buttons

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Listing channels for selected thing

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* fix list channels for selected thing

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Use records instead of hardcode values
Use genFormField from Helpers
Remove dead comments

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* NOISSUE - Add Docker build for UI (#582)

* Add Docker build for UI

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

* Fix entrypoint and ports

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

* Add NginX server. Fix port.

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

* NOISSUE - Fix layout and add custom CSS (#593)

* Fix layout and add custom CSS

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

* Remove comments, add copyright headers

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

* Add newline at the end of the css file

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

* NOISSUE -update message module (#599)

* Update message module
Sending message as selected thing to multiple channels

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Rename token to thingkey

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Reset model on send message and reset list of channels on selecting thing

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove logout button and add logout header (#604)

* Remove logout button and add logout header

* Removed dead code.

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* MF-571 - Pagination (#606)

* Add total # things to Thing model

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add basic pagination for Thing

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add pagination helper function & Channel pagination

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* NOISSUE - Add bootstrap cards in version view (#607)

* Add total # things to Thing model

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add basic pagination for Thing

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add bootstrap cards in version view

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add pagination helper function & Channel pagination

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* modify styling

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Styling

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Mainflux logo

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Revert "NOISSUE - Add bootstrap cards in version view (#607)"

This reverts commit a9a4dd7c73.

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Pagination (#613)

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* MF-571 - Add dashboard (#614)

* Add Dashboard module and simplify Main module

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove unused code and Version module

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add helper funcs to Main.elm update method

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Improve Main and Message module organization

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add dashboard Things and Channels buttons

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add Modal to edit thing

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add RemoveThing msg and AwesomeFont

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Unify provision and retrieve request

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Reorganize code by making funcs and code repositioning

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add fon-awesome 5.* support

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add metadata edit

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove table header add thing and removed dead code

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* MF-571 - UI modal buttons (#617)

* Add Dashboard module and simplify Main module

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove unused code and Version module

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add helper funcs to Main.elm update method

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Improve Main and Message module organization

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add dashboard Things and Channels buttons

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add Modal to edit thing

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add RemoveThing msg and AwesomeFont

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Unify provision and retrieve request

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Reorganize code by making funcs and code repositioning

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add fon-awesome 5.* support

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add metadata edit

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove table header add thing and removed dead code

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add complete Thing edit modal buttons

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add card style to channels (#618)

Add dropdown user menu
Add font awesome to main menu

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* MF-571 - UI Thing module with modals (#620)

* Add Thing provision modal

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add app/dev dropdown to Thing provision modal

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Refactor Thing to have separate Update and Provision msg handling

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove fontAwesome import and fix Dict import

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* MF-571 - UI channel modals (#621)

* Add Thing provision modal

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add app/dev dropdown to Thing provision modal

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Refactor Thing to have separate Update and Provision msg handling

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove fontAwesome import and fix Dict import

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add provision and edit modals to Channel

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add HttpMF http custom library

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add ModalMF Bootstrap modal custom library

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Moved all http funcs to HttpMF

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Moved expect funcs from Connection and Message to HttpMF

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add cards and change tables (#622)

* Change type of tables
Add tables to cards
Colorize buttons

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* remove comments

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* MF-571 - Fix user login and refactor User (#623)

* Fix user login and refactor User

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove redundant Grid.row nesting

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix links in README (#624)

Signed-off-by: Ivan Milošević <iva@blokovi.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix ui/Makefile and ui/README.md

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add copyright header to .elm files

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix missing README.md after migration

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix typo

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add install options to README.md

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Rename Url to URL and Id to ID

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2019-03-06 16:21:09 +01:00
Vladimir Starčević dbd8f9be23 MF-579 Things & Channels returns 404 when not found or ID is malformed, not 500 (#633)
* Things returns 404 when not found, not 500

Signed-off-by: Vladimir Starcevic <vstarcevic@gmail.com>

* MF-579 Things returns 404 when not found or thingid is in invalid format

Signed-off-by: Vladimir Starcevic <vstarcevic@gmail.com>

* MF-579 Things and channels returns 404 when not found, or ID is malformed not 500

Signed-off-by: Vladimir Starcevic <vstarcevic@gmail.com>

* MF-579 Things & Channels returns 404 when not found or ID is malformed, not 500

Signed-off-by: Vladimir Starcevic <vstarcevic@gmail.com>
2019-03-06 14:10:01 +01:00
Dušan Borovčanin 3300814026 MF-552 - Use event sourcing to keep Bootstrap service in sync with Things service (#603)
* Use separate table for Channels

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

* Add inital event sourcing subscription

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

* Add Channel update sync

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

* Add Thing remove sync

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

* Add Channel remove sync

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

* Update service add method marshalling metadata

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

* Make separate methods for connection update

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

* Add diconnect event sync

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

* Update Configs repository mock

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

* Fix service tests

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

* Update repository tests

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

* Update API docs

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

* Update Location header

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

* Update README.md

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

* Fix tests mutex lock

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

* Fix method names in logs

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2019-03-04 17:41:38 +01:00
Manuel Imperiale a60a5c1ba1 NOISSUE - Fix lora-adapter Object decode (#610)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-02-22 15:30:37 +01:00
Dušan Borovčanin fa7d638453 MF-540 - Add pagination in API responses for Bootstrap service (#575)
* Add Page to List response

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

* Add request validation tests

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

* Update endpoint routes

Update API docs accordingly.

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

* Add optional Thing ID to config add request

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

* Extract literals to constants

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

* Update comments

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

* Fix count logs

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2019-02-22 14:54:09 +01:00
Manuel Imperiale 1c09632671 MF-600 - Handle custom LoRa Server application decoder (#608)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-02-22 09:31:44 +01:00
Ivan Milošević 06921fbee6 Fix run command in dev guide (#605)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2019-02-21 15:56:51 +01:00
caztial b69d31817d update docker-compose (#590)
add udp instead of default tcp to the docker coap port.
2019-02-20 00:17:13 +01:00
Dušan Borovčanin 225f56fc3e Update generated code (#602)
Use latest release of `protobuf` 3.6.1.

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2019-02-18 17:10:25 +01:00
Dušan Borovčanin 133383ecb7 Add generated files check (#601)
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2019-02-17 18:40:30 +01:00
Mirko Teodorovic 2ee0ed18e0 MF-597 - Removed legacy code as not needed anymore (#598)
* Removed legacy code as not needed anymore

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* Small correction

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>

* Remove git as not needed

Signed-off-by: mteodor <mirko.teodorovic@gmail.com>
2019-02-15 18:35:52 +01:00
mteodor c418a9a4cf NOISSUE - Added normalizer service to run script (#594)
* Added normalizer service to be run

* Update run.sh
2019-02-13 12:05:29 +01:00
Kai-Chu Chung 351d6e7bfb MF-583 - Correct cmd/mongodb-reader HTTPServer log Info (#584)
Signed-off-by: Kai-Chu Chung <cage.chung@gmail.com>
2019-02-12 11:36:58 +01:00
Nikola Marčetić 434a57d8e1 Changed RawMessage (#587)
Signed-off-by: nmarcetic <n.marcetic86@gmail.com>
2019-02-11 14:27:56 +01:00
Manuel Imperiale 94574e3707 NOISSUE - fix CLI log (#581)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-02-08 15:38:07 +01:00
Juanma Fernandez b12bb3374b NOISSUE - Fix users logs in main.go (#577)
Signed-off-by: juanmagal <juanma.galmes@gmail.com>
2019-02-07 08:43:43 +01:00
Dušan Borovčanin 3f3b42b511 MF-519 - Refine Message (#567)
* Enable Message JSON mashaling/unmarshaling

Update Protobuf generated files.

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

* Update readers and SDK to use Mainflux Message

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

* Fix alignment

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2019-02-06 13:57:12 +01:00
Dušan Borovčanin 1df4dcd7b7 NOISSUE - Add name field for Bootstrap Config (#564)
* Add name field to Config

Enable search by name.

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

* Create separate response for unknown Configs

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

* Use meaningful names for filters

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

* Add name search tests

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

* Update API docs

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

* Break mocks check into multiple lines

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

* Create new instances in a consistent way

Reformat `return` statements.

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2019-02-06 10:28:54 +01:00
Aleksandar Novaković 8966a13760 Fix non-SenML message routing in normalizer (#573)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-02-04 13:07:05 +01:00
Drasko DRASKOVIC 0fbb21c3fb Fix Dusan Maldenovic GitHub (#570)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-02-03 09:12:40 +01:00
Drasko DRASKOVIC 998c7ef9ef NOISSUE - Update authors list (#569)
* NOISSUE - Update authors list

Add Dejan's recognition

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

* Fix Manu's GitHub nick

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-02-02 22:21:33 +01:00
Manuel Imperiale dc16eb5451 Update lora.md (#568)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-02-01 23:46:02 +01:00
Manuel Imperiale 53036b5ae7 Fix CLI docs (#566)
* Fix CLI docs

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix CLI docs typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix CLI docs typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix CLI docs typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-02-01 23:17:09 +01:00
Manuel Imperiale c04909d645 NOISSUE- Improve LoRa doc (#562)
* Improve lora docs

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-01-31 18:26:00 +01:00
Dušan Borovčanin bf9e148120 MF-551 - Add metadata fields to Bootstrap Channels (#563)
* Save MF channel name and metadata to the BS

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

* Remove separate Channels table

Use nested JSON field instead.

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

* Fix tests

Use proper JSON format for Bootstrap response fields.

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

* Update API docs

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

* Remove unnecessary comments

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

* Extract Config fields to constants

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

* Inline if statements

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2019-01-30 16:40:37 +01:00
Aleksandar Novaković 330545ad38 Fix MQTT adapter by setting subscription queue (#561)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-01-28 22:55:14 +01:00
Nikola Marčetić 1947d39119 MF-558 - Add MQTT subtopics documentation (#559)
* Added MQTT subtopic's doc section

Signed-off-by: nmarcetic <n.marcetic86@gmail.com>

* Resolving remarks

Signed-off-by: nmarcetic <n.marcetic86@gmail.com>

* Resolving remarks

Signed-off-by: nmarcetic <n.marcetic86@gmail.com>

* Resolved remarks

Signed-off-by: nmarcetic <n.marcetic86@gmail.com>
2019-01-28 14:36:29 +01:00
Drasko DRASKOVIC 0b770ce49e Fix regexp for SUB (#557)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-01-26 20:53:35 +01:00
Drasko DRASKOVIC 2c6379f823 Simplify MQTT topipc regexp (#555)
Current regexp makes 2 selection groups, while
capturing just the first group (the only one of
interest) into variable.

This PR simplifies the regexp and avoids capturing
secound group.

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-01-26 19:53:01 +01:00
Nikola Marčetić c8e7a97122 MF-429 -Enabled MQTT subtopic's (#554)
* Enabled MQTT subtopic

Signed-off-by: nmarcetic <n.marcetic86@gmail.com>

* Removed debug logs

Signed-off-by: nmarcetic <n.marcetic86@gmail.com>

* Resolved remarks

Signed-off-by: nmarcetic <n.marcetic86@gmail.com>

* Resolved remarks

Signed-off-by: nmarcetic <n.marcetic86@gmail.com>
2019-01-25 22:22:36 +01:00
Manuel Imperiale 6bc287e028 NOISSUE - Fix normalizer exposed port in docker-compose (#548)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-01-21 09:28:50 +01:00
Aleksandar Novaković f9f25e2d2f Fix pagination response for empty page (#547)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-01-17 17:31:30 +01:00
Aleksandar Novaković ca6968f8d0 Fix swagger and provisioning docs (#546)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-01-17 16:56:03 +01:00
Aleksandar Novaković a618627599 Add env var for number of concurrent messages (#545)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-01-17 02:26:58 +01:00
Aleksandar Novaković fedbe1c422 NOISSUE - Update doc and fix empty key bug (#544)
* Update docs with new connection endpoints

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix empty key bug

Return key that was absent from things that are returned in
connections endpoint.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-01-15 18:51:06 +01:00
Dušan Borovčanin 7ff738360b MF-370 - Simplify and refine CI (#541)
* Add CI script

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

* Fix indentetion

Add script explanation comment.

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2019-01-11 13:57:47 +01:00
Manuel Imperiale a0505e0eeb NOISSUE - Add connection commands to CLI (#542)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-01-10 21:42:31 +01:00
Drasko DRASKOVIC 3bbd21f583 NOISSUE - Refine docs (#537)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-01-09 17:04:34 +01:00
Dušan Borovčanin c788ef64c0 Update licnese year (#533)
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2019-01-09 16:23:30 +01:00
Dušan Borovčanin 22fc26b375 MF-513 - Add Bootstrapping service (#524)
* Introduce Config response for bootstrap procedure

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

* Add inital service implementation

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

* Enable status change

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

* Fix logger import

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

* Update BSS to send config in valid format

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

* Use ConfigReader to create valid format response

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

* Update config retrieval error handle

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

* Enable Thing deletion API

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

* Add API support for fetching Thing by ID

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

* Add list Things endpoint

Update database schema

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

* Use MF API to update status

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

* Use Channels list

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

* Fix reading Thing from the database

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

* Create Mainflux Thing when adding new Thing to BS

Create MF Thing as soon as Bootstrap service thing is added. There are 2
main reasons to create Thing when adding a new BS Thing over creating
Thing on bootstrapping:
1) On bootstrapping time, user JWT will not be sent as a part of
request, so there is no mechanism to send a valid API call to Mainflux.
2) This way, Bootstrap service will be in sync with Mainlux: each Thing
existing in BS will also be in Mainflux.

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

* Add Thing update

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

* Remove API key from BS service

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

* Improve channels update algorithm

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

* Refactor code

Remove unused fields, comment code and simplfy some method signatures.

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

* Remove Identity Provider and use gRPC

Update dependencies

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

* Add external auth key

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

* Update BS config reader

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

* Update docker-compose

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

* Update env variable read

Add MQTT password to bootstrap response.

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

* Update response fields and tags

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

* Remove status check

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

* Enable BS of active Things

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

* Add NewThing state

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

* Rename Status to State

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

* Update README.md

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

* Add filterng

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

* Update List endpoint

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

* Fix Database query

Remove copyright headers.

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

* Add filter type

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

* Gateway provisioning (1.d)

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

* Update self-bootstrapping feature

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

* Add mocks

Update dependencies to the newest Mainflux version.

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

* Add thing service tests

Mocks fix.
Some of the service code intentionally left untested due to possible
changes in future.
Fix copyright headers and update Mainflux and other dependencies.

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

* Use name "Config" instead of "Thing"

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

* Refactor code

Remove commented code.
Fix typo.
Remove unused exported error.

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

* Simplify service tests

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

* Remove Assign method

Raise test coverage.

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

* Update database schema

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

* Store unknown bootstrap attempts

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

* Update unknown bootstrap handling

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

* Update naming

Fix uses of `Thing` in DB and `api` package.

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

* Add endpoint tests

Currently, only test for adding a new Config are implemented.

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

* Add initialization of DB tests

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

* Add DB tests

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

* Update readme file

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

* Add API docs

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

* Remove Mainflux from vendor

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

* Add licence headers

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

* Fix service and endpoint tests

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

* Raise test coverage

Remove unused repsonse type.

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

* Update build and deployment

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

* Update API docs

Fix typo.

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

* Update imports formatting

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

* Make state response empty

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

* Raise test coverage

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

* Update API docs

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

* Update readme file

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

* Use uuid as a primary key

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

* Use Mainflux ID

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

* Remove `Created` state.

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

* Move State to separate file

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

* Add Things prefix

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

* Update API and API docs

Be consistent in API naming and add some useful comments.

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

* Refactor repository implementation

Cleanup code, make it more readable. Fix missing drop in migrations.

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

* Use "cfg" insted of "thing"

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

* Fix tests

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

* Update tables names

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2019-01-09 15:42:23 +01:00
Aleksandar Novaković 8dbe2f4066 Add dedicated env vars for event sourcing (#536)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-01-08 22:08:24 +01:00
Drasko DRASKOVIC 72fa9db939 NOISSUE - Fix docs (#535)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2019-01-08 21:15:00 +01:00
Manuel Imperiale 7a3d7fa8ec Add lora doc to getting-started.md (#529)
* Add lora doc to getting-started.md

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix 

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix doc

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add missing components doc to architecture.md (#531)

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix doc

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-01-08 12:25:13 +01:00
Aleksandar Novaković ea1993665d MF-483 - Enable channels and devices corresponding lists in backend (#520)
* Add list channels by thing id endpoint

Add list channels by thing id endpoint to things service. Add
pagination format and logic.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add fetch channels by thing endpoint

Add fetch channels by thing endpoint with pagination.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update list endpoints to contain pagination

Update list endpoints to contain pagination metadata.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add tests for two new endpoints

Add tests for two new endpoints and update existing ones. Also,
remove connected field from channel response.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix tests for SDK

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add SDK methods for new endpoints

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update swagger docs for things service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add error handling to http tests

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix response body in http tests

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Remove unused responses from things service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add test cases to things postgres tests

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add test cases for event sourcing

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-01-08 11:53:24 +01:00
Aleksandar Novaković bd00c5fa13 NOISSUE - Fix event sourcing client on LoRa adapter (#527)
* Fix event sourcing client on LoRa adapter

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix tests for things redis streams

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-01-07 23:54:18 -02:00
Manuel Imperiale c75aaa9d45 Add missing components doc to architecture.md (#531)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-29 22:17:35 +01:00
Aleksandar Novaković cdd2eb4bc7 Fix MQTT adapter scaling issue (#526)
MQTT adapter wasn't scalable because mq emitter wasn't setup. Now
it's working as intended. You can create two different instances
and exchange messages between their clients.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-12-27 10:44:57 +01:00
Aleksandar Novaković 584c8591ad Fix logging level in MQTT adapter (#522)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-12-21 17:45:49 +01:00
Aleksandar Novaković 643dc12408 Remove heartbeat log from MQTT broker (#521)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-12-21 16:14:54 +01:00
Manuel Imperiale 655141e941 MF-433 - Add method for reading messages from readers to SDK. (#511)
* MF-433 - Add method for reading messages from readers to SDK

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add messages read command on CLI

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix review

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-18 22:04:34 +01:00
Manuel Imperiale c8069827bb MF-506 - Fix influx & mongo readers queries to return most recent messages (#510)
* MF-506 - Fix fluxdb-reader query to return recent messages

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* MF-506 - Fix mongodb-reader query to return messages sorted by descendent time

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix readers tests

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-18 15:17:55 +01:00
Aleksandar Novaković 1e017bdbcc Fix data scheme in cassandra writer (#514)
Fix data scheme so that cassandra stores channel and thing id as
text. Support sorting by time per channel partition.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-12-17 20:41:11 +01:00
Manuel Imperiale 5f6bbf4b0a MF-419 - Use JSON for CLI commands output (#504)
* MF-419 - Use JSON for CLI commands output

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* dep ensure

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove accidentaly added CLI binary

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix cast

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix review

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use logCreated for token command

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix review

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-16 14:01:37 -05:00
Michael Finley 49a41d909e MF-448 - Add option to connect to DB with verify-ca and verify-full (#500)
* MF-448 - Add option to connect to DB with verify-ca and verify-full

Adds the option to connect with verify-ca and verify-full
Users can now specify any extra certs and keys they may need.

Signed-off-by: MichaelFinley <Michael.Finley@target.com>

* Passing db config struct rather than seperate parameters

Also updated the tests to use the config

Signed-off-by: MichaelFinley <Michael.Finley@target.com>

* Unexporting fields apart of users config

Also added comments to the newly exported Config in things & users postgres/init.go

Signed-off-by: MichaelFinley <Michael.Finley@target.com>
2018-12-16 00:28:22 +01:00
Manuel Imperiale d1012d14c7 Add name to influx tagset (#501)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-11 08:32:10 -08:00
Drasko DRASKOVIC 8a2734d122 NOISSUE - Housekeeping. Update README. (#497)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-12-09 20:06:20 +01:00
Drasko DRASKOVIC 399cc051b3 NOISSUE - Fix CHANGELOG (#496)
* NOISSUE - Fix CHANGLEONG link

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

* NOISSUE - Fix CHANGELOG

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-12-08 21:47:19 +01:00
Drasko DRASKOVIC 179471d4d7 NOISSUE - Fix CHANGLEONG link (#495)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-12-08 20:58:28 +01:00
Drasko DRASKOVIC 607a0b22e0 Add CHANGELOG. Bump version. (#494)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-12-08 20:53:39 +01:00
Drasko DRASKOVIC f354332fa1 NOISSUE - Add changelog target to Makefile (#493)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-12-08 20:12:24 +01:00
Drasko DRASKOVIC 9725c2723d MF-486 - Add provisioning command to CLI (#487)
* MF-486 - Add provisioning command to CLI

Resolves #486

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

* Add error check on file open

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

* Add provision test to CLI

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

* Update error handling

Update CSV file.

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

* Fix provision for new SDK

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

* Correct structs and sprintfs

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

* Check array length

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

* Correct sprintf. Update dep lock file.

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-12-08 16:59:55 +01:00
Manuel Imperiale 61eed0c72d Fix lora-adapter event store handlers (#492)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 19:57:23 +01:00
Manuel Imperiale 715a662f0d NOISSUE - Add LoRa route map validation and fix LoRa messages URL (#491)
* Add route map validation and fix LoRa messages URL

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>

* Rm private error comments

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix typo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add runlora command in Makefile

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 15:15:15 +01:00
Aleksandar Novaković b9bf63e377 MF-475 - Replace increment ID with UUID (#490)
* Update increment ID to UUID in things service

Update increment ID to UUID for things and channels in things
service and proto files. Also, update ID type from uint to string.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update increment ID to UUID in http adapter

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update increment ID to UUID in ws adapter

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update increment ID to UUID in CoAP adapter

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update increment ID to UUID in normalizer service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update increment ID to UUID in writer services

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update increment ID to UUID in reader services

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update increment ID to UUID in SDK

Update increment ID to UUID in SDK. Update id type to string.
Update tests.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update increment ID to UUID in mqtt adapter

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Remove unnecessary case from influxdb reader

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update tests in order to increase code coverage

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update lora adapter to use string ID instead of unsigned int

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-12-05 13:09:25 +01:00
Manuel Imperiale 21ab52576c MF-166 - Add lora-adapter service (#481)
* MF-166 - Add lora-adapter service (#416)

* MF-166 - Add lora-adapter service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix NATS connexion and use credentials with gRPC

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Forward lora msgs to nats

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add make cmd and docker-compose

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Define lora conf as private

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename funcs fix nats conn

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Update README and fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm NATS sub

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* MF-166 - Add lora-adapter service  (#461)

* MF-166 - Add lora-adapter service

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix NATS connexion and use credentials with gRPC

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Forward lora msgs to nats

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add make cmd and docker-compose

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Define lora conf as private

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename funcs fix nats conn

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Update README and fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm NATS sub

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix lora server topic and logs

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix HTTP port

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* NOISSUE - Add event sourcing client to LoRa adapter (#471)

* Add event sourcing client to LoRa adapter

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

* Update redis version in docker compose and update env vars

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

* Add ES subscription to main LoRa function

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

* Add new env vars to readme file of LoRa adapter

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

* Add message acknowledgement to LoRa adapter

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

* Add handling of empty values to event sourcing client (#474)

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

* Add routemap and handle event sourcing

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix eventStore decoding

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Mv docker-compose in docker/addons

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix routemap and logs

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>

* Update Gopkg.toml

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix route map and typos

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Update README

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 reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix reviews

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-04 20:08:30 +01:00
Drasko DRASKOVIC 7db3b295be NOISSUE - Add Makefile target to clean old imgs (#485)
* NOISSUE - Add Makefile target to clean old imgs

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

* Simplify docker clean commands

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-12-03 16:19:09 +01:00
Aleksandar Novaković 671c32affe MF-473 - Add metadata field to channel (#476)
* Add metadata field to channels and update things metadata

Add metadata field to channels. Update thing metadata field to be
in JSON format. Update tests..

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add metadata to channel events

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add metadata field to channel in go SDK

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-11-28 15:58:48 +01:00
Dušan Borovčanin bcadd7c47b Make CoAP ping period configurable (#469)
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-27 14:02:30 +01:00
Aleksandar Novaković 59c5e350e1 Add nginx ingress config to k8s services (#472)
Update README in accordance to latest changes. Add gRPC load
balancing setup. Add healthcheck to k8s setup.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-11-27 12:56:36 +01:00
Dušan Borovčanin 6cd11536a0 Add CoAP section in getting-started (#468)
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-27 12:46:18 +01:00
Ivan Milošević 4f01c0aa7a NOISSUE - Move CLI documentation from getting started guide to separate page (#470)
* Move CLI documentation from getting started guide to seperate page

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix cli usage examples in readme and docs

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2018-11-27 08:40:56 +01:00
Ivan Milošević 15667120b7 NOISSUE - Update Getting Started doc with CLI usage (#465)
* Update "getting started" docs with CLI usage

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Update CLI description

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Update CLI docs with help flag

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2018-11-26 12:50:32 +01:00
Dušan Borovčanin 9ede8c70b9 Update CoAP docs with URL example (#463)
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-22 18:27:01 +01:00
Aleksandar Novaković a680fa35d2 MF-447 - Add event sourcing to things service (#460)
* Add event sourcing middleware for things service

Add event sourcing for write operations over things and channels.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add tests for event sourcing middleware

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update things in tests to contain metadata field

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-11-20 19:46:33 +01:00
Aleksandar Novaković 8ddd78c818 Add TLS support to CoAP adapter and all readers (#459)
* Add TLS support to CoAP adapter and all readers

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add new env vars to README files

Add tls env vars to README files for CoAP adapter, WS adapter
and all readers.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update all services to exit on invalid TLS env var value

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-11-20 12:52:28 +01:00
Ivan Milošević ee262b9647 MF-417 - Implement SDK tests (#438)
* Add SKD tests for creating channel

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add SDK tests for Channel function

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add list channels over SDK tests

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add SDK tests for updating channel

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add SDK tests for deleting channel

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add users service SDK tests

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* SDK things tests

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add SDK test for connecting and disconnecting things from channel

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* testing SDK sending messages

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* add tests for SDK func SetContentType

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* add all test cases for sending messages

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add handling StatusBadRequest when deleting thing over SDK

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Update error responses when deleting channel and thing

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Removed unused Unauthorized response when creating user

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* update testing CreateChannel, tests if response is some string

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add bad request case in testing CreateToken

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Remove response error conflict from things service

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix definition of sdk.ErrFailedDisconnect and return error in test cases for disconnecting things

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add handling errors and formatting code

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Defined new ErrFailedPublish error in SDK

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add SDK test for version

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Delete unused http response status in sdk.DeleteChannel

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2018-11-19 21:27:01 +01:00
Dušan Borovčanin 0379eb6c0f MF-454 - Use message Time field as a time for InfluxDB points (#455)
* Use message time as Point time in InfluxDB

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

* Use actual message time

Update all Reader and Writer services to use time from the message
instead of time given from the corrseponding Writer service.

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

* Remove message time check

Messages time less than 2**28 represent time relative to the current time so Writer used to convert this to the correct value, i.e. msg.Time += time.Now(). However, this step is optional and should really be a part of the app on top of Mainflux or could be introduced with minor changes in Normalizer, Reader or Writer services, so there is no need for this to be supported out of box.

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

* Use channel and publisher as tag keys

Move all the other Message fields to the field keys.

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-18 16:42:39 +01:00
Dušan Borovčanin bf299a0143 NOISSUE - Add .dockerignore to project root (#457)
* Add .dockerignore file to project root

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

* Cleanup project root

Update run script and remove unused files from project root.

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

* Remove .dockerignore form docker dir

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-13 22:31:13 +01:00
Aleksandar Novaković ba4b166c96 Update docker-compose so that every service has debug log level (#453)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-11-08 21:22:59 +01:00
Aleksandar Novaković c058cf95e4 NOISSUE - Add TLS flag for Mainflux services (#452)
* Add TLS flag that will turn TLS on or off

Add TLS flag to things, http, ws and mqtt service.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update readme files with new env vars

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-11-08 19:29:58 +01:00
Nikola Marčetić bd3c24ed83 Version updated (#450)
* Version updated

Signed-off-by: nmarcetic <n.marcetic86@gmail.com>

* Updated load test version

Signed-off-by: nmarcetic <n.marcetic86@gmail.com>
2018-11-08 10:44:12 +01:00
Michael Finley eb38c36f80 MF-448 - Option for Postgres SSL Mode (#449)
* MF-448 - Option for Postgres SSL Mode

Adds an option to choose the ssl mode when connecting to postgres.
Only supporting disable or require for now with verify-ca and verify-full to come after more discussion.

Signed-off-by: Michael Finley <Michael.Finley@target.com>

* Changing package name back

Accidentally changed the package name so reverting that!

Signed-off-by: Michael Finley <Michael.Finley@target.com>

* Adding section in getting-started for securing pgsql connections

Signed-off-by: Michael Finley <Michael.Finley@target.com>
2018-11-07 21:54:51 +01:00
Dušan Borovčanin ec0a148ad4 MF-443 Update project dependencies (#444)
* Update project dependencies

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

* Update InfluxDB and Cassandra versions

Update InfluxDB and Cassandra versions in docker-compose file as well as
images version in tests.

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

* Update gRPC version

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

* Make name first value of constraints

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-07 10:18:57 +01:00
nwest1 260df3ae40 MF-426 - Add optional MF_CA_CERTS env variable to allow GRPC client to use TLS certs (#430)
* MF-426-Add optional MF_CA_CERTS env variable to allow GRPC client to use TLS certs

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* enable things client to be configured with a ca cert path

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* MF_CA_CERTS docs for http adapter and things service, additional logging and improved error handling when setting up TLS gRPC client

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* refactor things connect to separate function

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* getting-started updates, corrected things env variable

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* clarifying ca certs default functionality

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* configuring tls termination at service endpoint

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* enable TLS configuration for users and things

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* nginx forwarding

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* go imports

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* bad logging change

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* naming specifically to the http adapter component

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* updated tls keys, slightly different grpc configuration

set localhost, users and things as subject alternative names

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* log message consistency

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* readme updates related to server ssl configuration

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* Trying to resolve confilcts

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* removing conflicting lines from docker-compose

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* adding back http-adapter configuration

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* slight readme update

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>

* readme tweaks

Signed-off-by: nwest1 <nwest1@users.noreply.github.com>
2018-11-06 21:09:17 +01:00
Dušan Borovčanin dfa766e013 MF-407 - Values of zero are being omitted (#434)
* Fix empty protobuf values

Update Normalizer service and .proto files. Reader and Writer services
needs to be updated due to message format change.

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

* Update HTTP adapter to use gogo protobuf

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

* Update Reader services API

Update API or Reader services to match Message changes due to switching to gogo/proto.

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

* Update InfluxDB services

Update InfluxDB Reader and Writer services to match new Message format.

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

* Update MongoDB services

Update MongoDB Reader and Writer services to match new message format.

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

* Update Cassandra services

Update Cassandra Reader and Writer service to match new Message format.

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

* Fix InfluxDB Reader test

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

* Update Makefile and docs accordingly

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

* Fix possible data race in InfluxDB writer

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

* Update InfluxDB Writer tests

Raise test coverage.

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

* Fix InfluxDB reader

Fix wrong ValueSum readings. Upadete tests and raise coverage.

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

* Update MongoDB services tests

Raise test coverage for MongoDB Reader and Writer services.

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

* Update Readers API tests

Raise test coverage.

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

* Raise test coverage

Update Cassandra Reader and Writer services tests.

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

* Use gogo/protobuf in CoAP adapter

Add gogo/protobuf to Gopkg.toml and update dependencies.
Update Dockerfile to run `make proto`.

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

* Update Cassandra Reader tests

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

* Refactor code

Improve code style and comments to improve readability.

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

* Rename Sum to SumValue

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

* Rename Values to Value

Since message contains only single value (or possibly no value at all),
`Values` name could be misleading. Rename simple double value from
`Value` to `FloatValue` accordingly.

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

* Fix InfluxDB Reader logging

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

* Replace exclusive if statements with switch-case

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

* Update Cassandra services tests

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-05 19:18:51 +01:00
Jovan Kostovski 8c0c994385 Expose the InfluxDB and Cassandra ports to host (#441)
* Expose the InfluxDB and Cassandra ports to host

Expose the InfluxDB's HTTP API port 8086 and  Cassandra's CQL port 9042 from the containers
to the host machine, in order to enable easier exploration of the data stored in the databases
from the host machine and development of apps which connect and use the data stored in the databases.

Signed-off-by: Jovan Kostovski <chombium@gmail.com>

* Port exposing cleanup in docker-compose.yml files

There were some doubled configurations for port exposing with the expose and ports directives in the docker-compose.yml files which had to be cleaned.

Signed-off-by: Jovan Kostovski <chombium@gmail.com>
2018-11-02 09:58:27 +01:00
hykuan 694d67ada2 fix: add missing ThingsURL back (#440)
Signed-off-by: hykuan <hykuan1126@gmail.com>
2018-11-01 10:20:43 +01:00
Dušan Borovčanin d6755e4a72 MF-374 - Bring back CoAP adapter (#413)
* Bring old CoAP code back

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix channel ID formatting due to type change

Uncomment error handling for authorization.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update CoAP adapter docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add copyright headers

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

* Remove redundant type declaration

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

* Add CoAP adapter to the list of services

Add CoAp adapter in Makefile services list and fix corresponding documentation.

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

* Refactor CoAP code

Merge multipe `const` block int single and declare consts before vars.
Un-export notFound handler since there is no need to export it.

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

* Update http version endpoint

This separates CoAP and HTTP APIs.

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

* Refactor CoAP POST method handling

This PR is a part of CoAP adapter refactoring that will simplify adapter implementation.

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

* Refactor CoAP adapter

Change CoAP message handling to simplify adapter implementation.

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

* Add backoff timeout for server ping to client

Update CoAP adapter to provide subset of necessary features from
protocol specification.

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

* Fix leaking locked goroutine

In case of the stopped ticker, its channel is NOT closed, so pinging might be left stuck waiting for the stopped ticker to send a notification.

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

* Format code

Use more meaningful name for Handlers map.

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

* Use and stop ticker from the same goroutine

Stop handler Ticker from ping goroutine rather than the cancel goroutine.

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

* Check if subscription already exists in put method

Fix potential leak of handlers providing check inside of put method.

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

* Use MessageID as Observe option

Since MessageID satisfies observe option behaviour, use Message ID
instead of local timestamp. Remove Thicker from handler and use it on
transport layer.

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

* Use name Observer insted of Handler

Name `Observer` is used in protocol specification, so this naming makes
code more self-documenting.

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

* Add CoAP adapter to docker-compose.yml

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

* Add copyright headers

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

* Remove unused constants

Fix service name in startup log message.

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

* Add metrics endpoint

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

* Refactor code

Config fields from main.go should not be exported; minor style changes.

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

* Update authorization URI-Query option

Use `authorization` value in URI-Query option instead of `key`. This
mimics Authorization header in some other protocols (e.g. HTTP). Please
note that this value can be replaced with simple `auth` to save space,
due to constrained URI-Query option size.

Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-10-31 18:53:25 +01:00
Drasko DRASKOVIC 9cacf5708b NOISSUE - Add info log-level for development (#427)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-10-24 17:13:29 +02:00
Aleksandar Novaković ad5c66fad2 NOISSUE - Refactor SDK and things service (#420)
* Refactor Mainflux go SDK

Add structures instead of string parameters. Add offset and limit
parameters to things and channels methods. Add better configuration
support.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add new public errors with better error handling

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update SDK to use uint instread of string id

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update cli to use new SDK API

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Remove TLS termination from nginx configuration

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update SDK documentation and structures

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Refactor things service

Decouple HTTP layer from business logic. Remove ID number validation
check. Remove models from HTTP requests and responses.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Reformat tests for things service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Increase test coverage for things service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-10-24 10:21:03 +01:00
Ivan Milošević d89e91143b Fix NATS install instruction (#423)
Signed-off-by: Ivan Milošević <iva@blokovi.com>
2018-10-21 22:47:53 +02:00
Sava R 96bcc4cff4 Update NATS docker image to newer version in docker-compose (#418)
Signed-off-by: Sava Radoš <srados@bitsfactory.com>
2018-10-15 11:05:14 +02:00
Drasko DRASKOVIC a8eb7ae039 MF-354 - Add Go SDK (#357)
* MF-354 - Add Go SDK

This PR adds Go SDK. It also refactors `cli` to use new SDK.

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

* Use http consts. Add doc.

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

* Insline const

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

* Add initial SDK tests

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

* Fix SDK to return values (not HTTP rsp)

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

* Fix CLI and test

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

* fix typos, add header

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

* Fix doc

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

* Fix doc, add comment

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

* Inline error checks

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

* Fix typos

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

* Inline errs

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

* Fix typo

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

* Change fnc parameter name

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

* Rename getters to Go standard

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

* Use struct and interface

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

* Simplify sdk struct

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

* Fix README

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-10-14 16:44:21 +02:00
Ivan Milošević 6eade2c1d0 NOISSUE - Add pull request template (#414)
* Add pull request template

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix formatting in docs

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix link for contributing guidelines

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2018-10-04 10:04:58 +02:00
Dušan Borovčanin 148c1aca0a MF-404 - InfluxDB batch size and timeout zero values (#411)
* Add zero value check for batch size and timeout

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update InfluxDB writer tests

Test creation of InfluxDB writer with invalid (zero) batch size and timeout.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix config load

Loading batch size and timeout from env variables were missing in loadConfigs method.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2018-10-01 17:36:53 +02:00
Aleksandar Novaković 70517bd907 Update mqtt to mqtt communication to support full protocol (#408)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-09-30 19:00:21 +02:00
Ivan Milošević d5f0d7d225 MF-384 - Add test for Redis cache (#405)
* Add test

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add test

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add test

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add test

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add test

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* MF-384 - Add test for Redis cache

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add copyright headers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix copyright header

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix test setup

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* handling errors and put test cases in maps instead of slices

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add test case if thing already exists

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix TestThingSave to use require instead of assert

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add test case for removing non-existing thing from cache

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Use table of test cases for Remove and test Connect for every case

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Use table of test cases for Save

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Test cases in slice instead of map for testing Remove

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Make test-cases independent, use asserts instead of requires

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Use slice and map where appropriate

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2018-09-30 02:03:00 +02:00
Michael Finley b20a846071 Fixing level_test.go (#406)
Signed-off-by: Michael Finley <Michael.Finley@target.com>
2018-09-26 20:22:26 +02:00
Michael Finley 6600d26ef1 MF-379 - Log Level Option (#402)
* Adding an option to select log level

Signed-off-by: Michael Finley <Michael.Finley@target.com>

* making error default log level

Signed-off-by: Michael Finley <Michael.Finley@target.com>

* removing go-kit/levels and expanding levels wrapper

Signed-off-by: Michael Finley <Michael.Finley@target.com>

* refactoring test cases and using log.fatal

Signed-off-by: Michael Finley <Michael.Finley@target.com>

* logger.new no longer accpets enum and now accepts string for level

Signed-off-by: Michael Finley <Michael.Finley@target.com>

* level_test.go refactor to compare error

Signed-off-by: Michael Finley <Michael.Finley@target.com>

* Updating the ws README

Signed-off-by: Michael Finley <Michael.Finley@target.com>

* Adding log level for mqtt Adapter

Signed-off-by: Michael Finley <Michael.Finley@target.com>
2018-09-26 18:58:51 +02:00
Dušan Borovčanin 3de34062db NOISSUE - Influxdb batch add (#394)
* Add batch of streams

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add env variables for batch point setup

Fix InfluxDB reader tests.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update Compose and Kubernetes config

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update env variables

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove unused const

Refactor code and docs.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Handle NewBatchPoints error

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Reduce wait time in  batch save test

Fix typos.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update tests

Use single test with multiple cases to test single point save as well as
a batch of points.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add an explanation for not resetting ticker

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2018-09-23 01:53:03 +02:00
Ivan Milošević 8e9d7b4fdb MF-389 - Add documentation for Writers and Readers (#398)
* MF-389 - Add documentation for Writers and Readers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* MF-389 - Update readme files for readers and writers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* MF-389 - Update mongodb-reader docker-compose.yml

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix links formatting in docs

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Updated reader and writer docs

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Fix formatting

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Update Grafana access

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2018-09-20 15:32:50 +02:00
Dušan Borovčanin 5757380a63 NOISSUE - Dev dockers (#392)
* Add development Docker images build

Add Dockerfile.dev and target in the Makefile to provide much faster image
building for `development purposes`.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Build single service in dev mode

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix Makefile

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix dev-guide

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2018-09-19 20:20:12 +02:00
Jovan Kostovski c944205080 dev guide spelling and formatting fixes (#393)
Signed-off-by: Jovan Kostovski <chombium@gmail.com>
2018-09-17 21:32:13 +02:00
Drasko DRASKOVIC d825174ccb NOISSUE - Separate docker-push into function (#386)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-09-13 15:40:40 +02:00
Aleksandar Novaković 6408b8a9d3 Fix NATS subscription bug in writers (#391)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-09-13 10:06:34 +02:00
Drasko DRASKOVIC 845b69a4ac Bump version to 0.5.1 (#385)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-09-04 23:32:04 +02:00
Aleksandar Novaković 0c77d84176 MF-382 - Improve performance by adding Redis cache for message auth (#383)
* Add redis caching for thing and channel connections

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix authorization caching flow

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update things documentation

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-09-04 22:19:43 +02:00
Sava R 970c1c86ca Fix topic to channel parsing (#381)
Signed-off-by: Sava Radoš <srados@bitsfactory.com>
2018-09-04 14:07:51 +02:00
Aleksandar Novaković 902630fb14 Fix type and name switching in connected things (#376)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-08-29 14:28:56 +02:00
Drasko DRASKOVIC 4ca443038d Update MAINTAINERS 2018-08-28 22:42:47 +02:00
Drasko DRASKOVIC 47c56cbac9 Update MAINTAINERS (#373)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-08-28 22:41:25 +02:00
Sava 0fd0e6a13f Initial user, device, channel provisioning script used to speed up testing on a fresh Mainflux installation. Accepts email, password, device name, channel name as arguments. (#369)
Signed-off-by: Sava Radoš <sava.rados@mainflux.com>
2018-08-27 20:51:17 +02:00
Jovan Kostovski 8a86593dc3 NOISSUE - Makefile test target, CREATE TABLE and dev guide enhancements (#359)
* Fixes #337

Signed-off-by: Jovan Kostovski <chombium@gmail.com>

* added create table if not exists

Signed-off-by: Jovan Kostovski <chombium@gmail.com>

* added test target in sync with Semaphore CI

Signed-off-by: Jovan Kostovski <chombium@gmail.com>

* added warning about the possible data loss

Signed-off-by: Jovan Kostovski <chombium@gmail.com>
2018-08-27 12:17:41 +02:00
Ivan Milošević effade00aa MF-325 - Add SPDX license and copyright headers (#362)
* MF-325 - Add SPDX license and copyright headers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* MF-325 - Add SPDX license and copyright headers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* MF-325 - Add SPDX license and copyright headers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* MF-325 - Add SPDX license and copyright headers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* MF-325 - Change mainflux version from 0.4.0 to 0.5.0

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2018-08-26 13:15:48 +02:00
Sava 8edf6907bc Change project retrieval procedure from git clone to go get (#366)
Signed-off-by: Sava Radoš <sava.rados@mainflux.com>
2018-08-25 14:39:30 +02:00
Dušan Borovčanin 507bd2ee84 MF-311 - Implement basic InfluxDB reader (#365)
* Add InfluxDB reader

Summary:
- Add basic reader features
- Update Makefile

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Raise test coverage

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update README.md and docker composition

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix docker-compose.yml

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove exposed ports

Ports are already exposed by mapping, so no need to explicity expose them.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2018-08-25 12:48:03 +02:00
Sava 86f0d8e0d6 MF-363 - Add compiled .proto files (#364)
* Add compiled .proto files

Signed-off-by: Sava Radoš <sava.rados@mainflux.com>

* Remove proto as prerequisite for build services target

Signed-off-by: Sava Radoš <sava.rados@mainflux.com>
2018-08-24 15:33:40 +02:00
Aleksandar Novaković 6461761985 Add logging middleware to normalizer service (#360)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-08-21 10:15:50 +02:00
Paul RATHGEB ec03d877f0 Declare docker_mainflux-base-net as external and add it to all services (#361)
Signed-off-by: Paul RATHGEB <paul.rathgeb@skynet.be>
2018-08-20 22:00:45 +02:00
Ivan Milošević 4e137a3214 MF-343 - Thing Model: rename the Payload Field to Metadata (#358)
* Rename Payload field to Metadata

Rename Payload field of Thing to Metadata.

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Revert JSON payload rename in docs

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2018-08-17 16:20:35 +02:00
Drasko DRASKOVIC af281da430 NOISSUE - Add insecure param to cli (#356)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-08-17 04:58:09 +02:00
Drasko DRASKOVIC 1683d17830 Add some make command info (#353)
Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-08-16 21:51:49 +02:00
Drasko DRASKOVIC 7e83b2d612 NOISSUE - Add system run script (#350)
* NOISSUE - Add system run script

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

* Add MQTT

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

* Add MQTT module install to Makefile. Fix warnings.

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-08-16 19:52:43 +02:00
Drasko DRASKOVIC 312d30fd69 NOISSUE - Add Development Guide doc (#351)
* NOISSUE - Add Development Guide doc

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

* Add MQTT info

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

* Fix typos

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-08-16 19:44:11 +02:00
Drasko DRASKOVIC 2c988c19b0 NOISSUE - Rename bashflux to cli and fix cert path (#349)
* NOISSUE - rename bashflux to cli and fix cert path

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

* Fix pkg name

Signed-off-by: drasko <drasko.draskovic@gmail.com>
2018-08-16 13:41:27 +02:00
Paul RATHGEB 455fedf075 Fix the influxdb hostname. Fix #346 (#348)
Signed-off-by: Paul RATHGEB <paul.rathgeb@skynet.be>
2018-08-16 04:06:25 +02:00
Aleksandar Novaković 58cdf2cddc MF-312 - Implement basic MongoDB reader (#344)
* Add mongodb reader service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add tests for mongodb reader service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add documentation for mongodb reader service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix test function name

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update comment in docker-compose for mongodb-reader service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-08-08 13:38:34 +02:00
Aleksandar Novaković 6d48446c16 MF-313 - Implement basic Cassandra reader (#331)
* Fix logger message in http service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Inline query and error handling in cassandra writer

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix comments and import statement in writer interface

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add reader common interface and shared HTTP API

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add Cassandra reader implementation

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add tests for cassandra reader

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add swagger doc and readme for readers

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update make file

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add docker-compose configuration for cassandra reader

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add readme file to cassandra reader

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-08-06 17:06:55 +02:00
Ivan Milošević 29d146636a Change favicon on Dashflux (#341)
Signed-off-by: Ivan Milosevic <iva@blokovi.com>
2018-08-01 23:11:40 +02:00
Marco Ferragina f3f14e803d Improved getting started docs (#339)
* Improved getting started docs

Better explaination of how to send messages to a channel using websockets.
Added a basic nodejs example

Signed-off-by: Marco Ferragina <marco.ferragina@gmail.com>

* Added leading slash

Signed-off-by: Marco Ferragina <marco.ferragina@gmail.com>

* added some comments to example code in docs

Signed-off-by: Marco Ferragina <marco.ferragina@gmail.com>
2018-07-25 11:12:31 +02:00
Manuel Imperiale b090aa3e02 MF-216 - Integrate Bashflux into monorepo (#308)
* MF-216 - Integrate Bashflux into monorepo

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename clients -> things

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix FormatResLog

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Initialize Channels commands in channels.go

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Mv bashflux to cmd/ repertory

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Mv API commands files to bashflux repertory

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Initialize Users commands in users.go

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Initialize Version command in version.go

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Initialize Messages command in messages.go

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm bashflux .gitignore and mv commands to root .gitignore

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename API commands vars

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix certificates paths

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm test logs

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove get channels cmd without arguments

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix connect and disconnect commands

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix messages endpoint

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm useless comments and dead code

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use contentTypeSenml var

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename cmdCobra -> cmd

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm else statments

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename SetServerAddr function vars

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename conf parameters

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename main with proper name

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix Update channel comment

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix README

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm .DS_Store from .gitignore

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename hhtp_client.go -> http.go

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm DeleteAllChannels and DeleteAllThings funcs

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix BF users usage log

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Improve bashflux logs

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Share types in funcs

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix BF version cmd

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Set certs paths via env variables

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix package

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm not direct dependencies from Gopkg.toml

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix README

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add def prefix to certificates paths

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* User thiings service for version cmd

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rename GetReqResp -> SendRequest

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix version help

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Return directly the pointer in NewVersionCmd

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Define endpoints names as consts and be consistent with naming

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use Spintf for string concatenation

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* typo fix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix README

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix version endpoint

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix serverAddr

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-07-11 13:53:37 +02:00
Dušan Borovčanin 0b954847fd MF-334 - Correct normalizer k8 port (#335)
* Fix k8s normalizer deployment port

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove targert port

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2018-07-02 14:53:16 +02:00
Dušan Borovčanin 44f5a7241f NOISSUE - Expose SenML subject from Normalizer service (#330)
* Expose SenML subject from Normalizer service

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Export shared NATS subjects

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2018-06-19 00:37:04 +02:00
Dušan Borovčanin b694f08ea2 Inteface implementation files match interface name (#329)
Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2018-06-18 10:51:30 +02:00
Dušan Borovčanin f1537528f9 NOISSUE - Raise test coverage (#324)
* Update WS tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use require in all writer tests

Refactor code.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Ignore Mainflux generated pb.go files

Ignore *.pb.go files generated by Mainflux, but don't ignore vendored generated code.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Return an exported ErrNotFound instead of the unexported one

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update mocks to match the actual behaviour

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update mocks error message

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add auth service unavailable error test

Since this error is caused by gRPC server returning codes.Internal,
this behaviour is simulated using specific token. When that token is
passed as an auth header, the mock gRPC client returns aforementioned error.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Use require package for postgres tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove redundant error checks in tests

Refactor tests.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename error flag token

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2018-06-16 02:30:46 +02:00
Aleksandar Novaković 344eed7976 NOISSUE - Add exported metrics visualization for grafana (#326)
* Add exported metrics visualization in grafana

Add graphics for request count and request latency for users, things,
http adapter and ws adapter services.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Rename grafana export file

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Move metrics configuration to metrics dir

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-06-15 17:08:49 +02:00
Aleksandar Novaković d8357b500c MF-328 - Add message persistence support for MQTT (#327)
* Add redis for message persistence

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add redis to docker composition

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix mqtt publish command in documentation

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update documentation with new environment variables

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-06-15 07:27:23 -07:00
Dušan Borovčanin 993398b8ab NOISSUE - Update Kubernetes setup (#322)
* Add InfluxDB writer services setup to k8s

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove commented NginX config

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2018-06-15 13:04:52 +02:00
Aleksandar Novaković 426f59d392 MF-235 - Add support for storing messages in Cassandra (#321)
* Add Cassandra writer implementation

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add cassandra service with version and metrics endpoints

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add test for cassandra writer

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Exclude api.go files from code coverage

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add readme file for cassandra writer

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add docker compose configuration for cassandra writer

Add README file. Add docker compose configuration.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add gocql as project dependency

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix init script for cassandra in docker-compose

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add testifies require subpackage

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-06-08 14:25:55 +02:00
Darko Draskovic 2b393ad50f MF-237 - Add support for storing messages in MongoDB (#307)
* Add mongodb-writer

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add official mongodb driver

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Move Connect to main.go

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Remove bson.NewDoc and write msg directly in db

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add MongoDB writer tests

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update README.md

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add mongodb services compose to addons dir

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update docs

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update docs and tests

Refactor code.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Expose MetricsMiddleware to align writers with other services

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Add logging middleware

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update load tests version

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2018-06-01 15:50:23 +02:00
Dušan Borovčanin 9d7f4544c7 MF-296 - Create docker-compose with InfluxDB and Grafana (#306)
* Add docker-compose

Update README.md accordingly.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Move writer compose files to root docker dir

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Remove Point from InfluxDB writer config

Update docs.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2018-06-01 11:20:44 +02:00
Aleksandar Novaković 781d358f38 Add app prefix to dashflux (#320)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-05-31 17:24:23 +02:00
Dušan Borovčanin 7b6030d8ad NOISSUE - Rename path veriables in InfluxDB wirter (#315)
* Rename path variables

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update README.md

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix README.md deployment env variables

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename InfluxDB point environment variable

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2018-05-31 12:28:00 +02:00
Aleksandar Novaković 89e69d132a Fix MQTT client id bug (#319)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-05-30 13:48:40 +02:00
Aleksandar Novaković 7590578745 Change clients to things in documentation (#318)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-05-29 16:00:18 +02:00
Aleksandar Novaković 97c2d9c30a NOISSUE - Update dashflux port on kubernetes configuration (#317)
* Update dashflux port on kubernetes configuration

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Remove target port from dashflux config

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-05-29 10:47:27 +02:00
Aleksandar Novaković c38a032fa5 Add version endpoint to nginx configuration (#316)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-05-28 19:20:17 +02:00
Aleksandar Novaković 1d75268ffa NOISSUE - Fix channel closing bug in WebSocket adapter (#309)
* Remove unnecessary error checks in ws adapter

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix WebSocket adapter channel closing bug

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-05-28 12:47:20 +02:00
Aleksandar Novaković ef3627f4ee NOISSUE - Add test suite for WebSocket adapter (#299)
* Add load test for WebSocket adapter

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add new test suite to README file

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-05-25 11:53:45 +02:00
Dušan Borovčanin 808ac50792 MF-282 - Rename clients to things in Dashflux (#305)
* Rename services, stores, environments and models

Rename services, stores and models to match naming change from `clients` to `things`.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Replace all occurrences of clients with things

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update docker-compose and nginx.conf

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename `clients service` to `things service`

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename function and veriable names

Remove other occurences of `clients` word/prefix/sufix and replace it with `things`.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Fix error sending id

Id field must not be sent in POST request in order to create a new thing.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Disable thing type edit

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Export location header

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Update docker config to use port 3000

Update docker-compose.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Replace id check with bool variable

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>

* Rename dialogs

Fix bug when creating channel with no connected things.

Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2018-05-24 15:26:03 +02:00
Aleksandar Novaković 4c8aeb395c Fix WebSocket mock (#300)
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-05-23 23:33:15 +02:00
Aleksandar Novaković 64e71edf95 NOISSUE - Add mutex to WebSocket service mock (#294) 2018-05-21 23:12:21 +02:00
Dušan Borovčanin c5a40aeffa NOISSUE - Remove redundant error check (#292) 2018-05-21 20:11:04 +02:00
Aleksandar Novaković 3d134d52a6 NOISSUE - Add MQTT to kubernetes nginx (#293)
* Fix nginx configuration for kubernetes

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add dashflux to nginx configuration

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update kubernetes documentation

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update soft links paths to relative

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2018-05-21 18:18:13 +02:00
Dušan Borovčanin f0cbc47ee6 MF-236 - Add support for storing messages in InfluxDB (#283) 2018-05-21 16:28:52 +02:00
Dejan Mijić e0e2b2aad0 MF-269 - Replace UUID with BIGSERIAL as primary key (#291) 2018-05-21 12:51:46 +02:00
Aleksandar Novaković bbf2d5560c MF-165 - Add gRPC authorization calls to MQTT adapter (#285) 2018-05-20 09:29:19 +02:00
Dušan Borovčanin 69bfb8668e NOISSUE - Fix potential race in gRPC tests (#290) 2018-05-18 13:27:21 +02:00
Aleksandar Novaković 7043dea81a NOISSUE - Add Identify gRPC method (#288) 2018-05-17 20:17:02 +02:00
Govind KP e04d0aeaff NOISSUE - Drop $PWD from docker-compose (#286) 2018-05-17 14:38:16 +02:00
Dejan Mijić 9c6904d9b3 NOISSUE - Update load tests (#287) 2018-05-17 14:21:08 +02:00
Dejan Mijić 38a107919a MF-268 - Replace JWTs with UUIDs as thing's access keys (#284) 2018-05-16 14:28:41 +02:00
Dejan Mijić 48484210c2 NOISSUE - Rename clients to things (#281) 2018-05-15 17:13:09 +02:00
Aleksandar Novaković ceb630c782 NOISSUE - Emit non-SenML messages (#279) 2018-05-14 22:15:12 +02:00
Dušan Borovčanin 570ebc1c72 NOISSUE - Sync docker compose service ports with k8s settings (#278) 2018-05-14 17:21:06 +02:00
Dušan Borovčanin 50e14f0c65 NOISSUE - Add CoAP adapter version endpoint (#277) 2018-05-14 13:21:49 +02:00
Dušan Borovčanin d2bce84c06 NOISSUE - Update Docker compose (#274) 2018-05-14 13:11:29 +02:00
Aleksandar Novaković 89aa9603ec NOISSUE - Replace manager with users and clients services (#276) 2018-05-14 12:18:01 +02:00
Aleksandar Novaković 2ae581368f NOISSUE - Add WebSocket and CoAP services to kubernetes config (#275) 2018-05-14 12:13:04 +02:00
Aleksandar Novaković 99a3ec5d2d NOISSUE - Fix kubernetes configuration (#273) 2018-05-11 16:41:25 +02:00
Dušan Borovčanin 89a0fa3e9c NOISSUE - Handle authorization errors other than unauthorize (#264) 2018-05-11 16:37:32 +02:00
Dejan Mijić 1bc4dc9575 NOISSUE - Add MQTT build steps into Makefile (#267) 2018-05-11 01:13:33 +02:00
Dejan Mijić bca3d0774f MF-201 - Replace ORM with SQL (#265) 2018-05-11 01:00:10 +02:00
Aleksandar Novaković 816c172823 MF-164 - Split manager service (#266) 2018-05-10 23:53:25 +02:00
Dušan Borovčanin 6a361209c8 NOISSUE - Automate Dashflux container deployment (#261) 2018-05-10 10:39:48 +02:00
Dušan Borovčanin 27e1be23f5 NOISSUE - Integrate MQTT adapter to monorepo (#260) 2018-05-09 14:22:03 +02:00
Dušan Borovčanin c9bf245010 NOISSUE - Update CoAP docs (#257) 2018-05-09 12:56:20 +02:00
Dušan Borovčanin ff30957614 MF-244 - Integrate Dashflux (#258) 2018-05-09 12:32:49 +02:00
Dušan Borovčanin db6165aa6b MF-168 - Refactor CoAP adapter (#186) 2018-05-08 16:00:25 +02:00
Aleksandar Novaković c088e664c3 NOISSUE - Fix run and compile commands in README files (#249) 2018-05-02 09:41:21 +02:00
Dejan Mijić d499068e43 Update protobuf to 1.1.0 (#251) 2018-05-02 08:49:39 +02:00
Dušan Borovčanin 38d4c3fcea MF-136 - Setup staging and test environments (#226) 2018-04-30 13:32:38 +02:00
Aleksandar Novaković aea7db14b7 NOISSUE - Raise code coverage in ws adapter (#242)
* Fix failed subscription handling in ws adapter

Fix unsubscribing bug in ws adapter.

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

* Add subscription fail and publish fail test cases

Update mock implementation to receive publish error in order to
support these test cases.

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

* Update mainflux version to 0.2.3

Update project version and load tests version to 0.2.3.

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

* Update version endpoint response format

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2018-04-24 13:56:13 +02:00
Aleksandar Novaković 58f3c735a0 NOISSUE - Fix Content-Type in examples (#243)
* Update content-type header in load tests

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

* Remove charset from content type header in documentation

Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2018-04-24 13:42:36 +02:00
Dušan Borovčanin 789963447a Add service name to version response (#241)
Signed-off-by: Dušan Borovčanin <borovcanindusan1@gmail.com>
2018-04-24 13:39:15 +02:00
2082 changed files with 221725 additions and 342995 deletions
+9
View File
@@ -0,0 +1,9 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
.git
.github
build
docker
metrics
scripts
+14
View File
@@ -0,0 +1,14 @@
# 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/*"
- "cmd/*"
- "coap/*"
- "*/mocks/*"
- "*/middleware/*"
- "pkg/sid/mock.go"
- "pkg/tracing/utils.go"
- "pkg/prometheus/*"
+1 -1
View File
@@ -1 +1 @@
* @mainflux/maintainers
* @absmach/supermq
-88
View File
@@ -1,88 +0,0 @@
# Contributing to Mainflux
The following is a set of guidelines for contributing to Mainflux and its libraries, which are
hosted in the [Mainflux Organization](https://github.com/mainflux) 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).
## Reporting issues
Reporting issues is a great way to contribute to the project. We always appreciate a well-written,
thorough bug reports.
Prior to raising a new issue, check out [our issue
list](https://github.com/mainflux/mainflux/issues) to determine whether it already include the
problem you are facing.
A good bug report shouldn't leave others needing to chase you up for more information. Please try to
be as detailed as possible. The following questions might serve as a template for writing a detailed
reports:
- What were you trying to achieve?
- What are the expected results?
- What are the received results?
- What are the steps to reproduce the issue?
- In what environment did you encounter the issue?
## Pull requests
Good pull requests (e.g. patches, improvements, new features) are a fantastic help. They should
remain focused in scope and avoid containing unrelated commits.
**Please ask first** before embarking any significant pull request (e.g. implementing new features,
refactoring code etc.), otherwise you risk spending a lot of time working on something that the
maintainers might not want to merge into the project.
Please adhere to the coding conventions used throughout the project. If in doubt, consult the
[Effective Go](https://golang.org/doc/effective_go.html) style guide.
To start contributing to the project, [fork](https://help.github.com/articles/fork-a-repo/) it,
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
```
If you cloned a while ago, get the latest changes from upstream:
```
git checkout master
git pull --rebase upstream master
```
Create a new topic branch from `master` using the naming convention `MF-[issue-number]`
to help us keep track of your contribution scope:
```
git checkout -b MF-[issue-number]
```
Commit your changes in logical chunks. When you are ready to commit, make sure
to write a Good Commit Message™. Consult the [Erlang's contributing guide](https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
if you're not sure what constitutes a Good Commit Message™. Use [interactive rebase](https://help.github.com/articles/about-git-rebase)
to group your commits into logical units of working before making them public.
Note that every commit you make must be signed. By signing off your work you indicate that you
are accepting the [Developer Certificate of Origin](https://developercertificate.org/).
Use your real name (sorry, no pseudonyms or anonymous contributions). If you set your `user.name`
and `user.email` git configs, you can sign your commit automatically with `git commit -s`.
Locally merge (or rebase) the upstream development branch into your topic branch:
```
git pull --rebase upstream master
```
Push your topic branch up to your fork:
```
git push origin MF-[issue-number]
```
[Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title
and detailed description.
-30
View File
@@ -1,30 +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:
+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 SuperMQ community on Google group.
- name: Gitter
url: https://gitter.im/mainflux/mainflux
about: Join the SuperMQ 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
+69
View File
@@ -0,0 +1,69 @@
<!-- Copyright (c) Abstract Machines
SPDX-License-Identifier: Apache-2.0 -->
<!--
Pull request title should be `SMQ-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/supermq/blob/main/CONTRIBUTING.md) file for detailed contributing guidelines.
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.
For a timely review/response, please avoid force-pushing additional commits if your PR already received reviews or comments.
- 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.-->
+33
View File
@@ -0,0 +1,33 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "./.github/workflows"
schedule:
interval: "monthly"
day: "monday"
timezone: "Europe/Paris"
groups:
gh-dependency:
patterns:
- "*"
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
timezone: "Europe/Paris"
- package-ecosystem: "docker"
directory: "./docker"
schedule:
interval: "monthly"
day: "monday"
timezone: "Europe/Paris"
groups:
docker-dependency:
patterns:
- "*"
+183
View File
@@ -0,0 +1,183 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: Property Based Tests
on:
pull_request:
branches:
- main
paths:
- ".github/workflows/api-tests.yaml"
- "api/**"
- "auth/api/http/**"
- "channels/api/http/**"
- "clients/api/http/**"
- "domains/api/http/**"
- "groups/api/http/**"
- "http/api/**"
- "journal/api/**"
- "users/api/**"
env:
TOKENS_URL: http://localhost:9002/users/tokens/issue
CREATE_DOMAINS_URL: http://localhost:9003/domains
USER_IDENTITY: admin@example.com
USER_SECRET: 12345678
DOMAIN_NAME: demo-test
USERS_URL: http://localhost:9002
DOMAIN_URL: http://localhost:9003
CLIENTS_URL: http://localhost:9006
CHANNELS_URL: http://localhost:9005
GROUPS_URL: http://localhost:9004
HTTP_ADAPTER_URL: http://localhost:8008
AUTH_URL: http://localhost:9001
JOURNAL_URL: http://localhost:9021
jobs:
api-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: 1.25.x
cache-dependency-path: "go.sum"
- name: Build images
run: make all -j $(nproc) && make dockers_dev -j $(nproc)
- name: Start containers
run: make run up args="-d" && make run_addons up args="-d"
- name: Set access token
run: |
export USER_TOKEN=$(curl -sSX POST $TOKENS_URL -H "Content-Type: application/json" -d "{\"identity\": \"$USER_IDENTITY\",\"secret\": \"$USER_SECRET\"}" | jq -r .access_token)
export DOMAIN_ID=$(curl -sSX POST $CREATE_DOMAINS_URL -H "Content-Type: application/json" -H "Authorization: Bearer $USER_TOKEN" -d "{\"name\":\"$DOMAIN_NAME\",\"route\":\"$DOMAIN_NAME\"}" | jq -r .id)
echo "USER_TOKEN=$USER_TOKEN" >> $GITHUB_ENV
export CLIENT_SECRET=$(supermq-cli provision test | /usr/bin/grep -Eo '"secret": "[^"]+"' | awk 'NR % 2 == 0' | sed 's/"secret": "\(.*\)"/\1/')
echo "CLIENT_SECRET=$CLIENT_SECRET" >> $GITHUB_ENV
- name: Check for changes in specific paths
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
journal:
- ".github/workflows/api-tests.yaml"
- "apidocs/openapi/journal.yaml"
- "journal/api/**"
auth:
- ".github/workflows/api-tests.yaml"
- "apidocs/openapi/auth.yaml"
- "auth/api/http/**"
domains:
- ".github/workflows/api-tests.yaml"
- "apidocs/openapi/domains.yaml"
- "domains/api/http/**"
http:
- ".github/workflows/api-tests.yaml"
- "apidocs/openapi/http.yaml"
- "http/api/**"
clients:
- ".github/workflows/api-tests.yaml"
- "apidocs/openapi/clients.yaml"
- "clients/api/http/**"
channels:
- ".github/workflows/api-tests.yaml"
- "apidocs/openapi/channels.yaml"
- "channels/api/http/**"
groups:
- ".github/workflows/api-tests.yaml"
- "apidocs/openapi/groups.yaml"
- "groups/api/http/**"
users:
- ".github/workflows/api-tests.yaml"
- "apidocs/openapi/users.yaml"
- "users/api/**"
- name: Run Users API tests
if: steps.changes.outputs.users == 'true'
uses: schemathesis/action@v2.1.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,stateful'
- name: Run Groups API tests
if: steps.changes.outputs.groups == 'true'
uses: schemathesis/action@v2.1.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'
- name: Run Clients API tests
if: steps.changes.outputs.clients == 'true'
uses: schemathesis/action@v2.1.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'
- name: Run Channels API tests
if: steps.changes.outputs.channels == 'true'
uses: schemathesis/action@v2.1.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'
- name: Run HTTP Adapter API tests
if: steps.changes.outputs.http == 'true'
uses: schemathesis/action@v2.1.0
with:
schema: apidocs/openapi/http.yaml
base-url: ${{ env.HTTP_ADAPTER_URL }}
checks: all
args: '--header "Authorization: Client ${{ env.CLIENT_SECRET }}" --suppress-health-check=filter_too_much --exclude-checks=positive_data_acceptance --phases=examples'
- name: Run Auth API tests
if: steps.changes.outputs.auth == 'true'
uses: schemathesis/action@v2.1.0
with:
schema: apidocs/openapi/auth.yaml
base-url: ${{ env.AUTH_URL }}
checks: all
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --suppress-health-check=filter_too_much --exclude-checks=positive_data_acceptance --phases=examples'
- name: Run Domains API tests
if: steps.changes.outputs.domains == 'true'
uses: schemathesis/action@v2.1.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'
- name: Run Journal API tests
if: steps.changes.outputs.journal == 'true'
uses: schemathesis/action@v2.1.0
with:
schema: apidocs/openapi/journal.yaml
base-url: ${{ env.JOURNAL_URL }}
checks: all
args: '--header "Authorization: Bearer ${{ env.USER_TOKEN }}" --suppress-health-check=filter_too_much --exclude-checks=positive_data_acceptance --phases=examples'
- name: Stop containers
if: always()
run: make run down args="-v" && make run_addons down args="-v"
+76
View File
@@ -0,0 +1,76 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: Continuous Delivery
on:
push:
branches:
- main
jobs:
build-and-push:
name: Build and Push
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: 1.25.x
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: Run tests
run: |
make test
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV }}
files: ./coverage/*.out
verbose: true
- name: Set up Docker Build
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Compile check for rabbitmq
run: |
SMQ_MESSAGE_BROKER_TYPE=msg_rabbitmq make mqtt
- name: Compile check for redis
run: |
SMQ_ES_TYPE=es_redis make mqtt
- name: Build and push Docker images
run: |
make latest -j $(nproc)
- name: Trigger Helm Chart Deployment
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peter-evans/repository-dispatch@v4
with:
token: ${{ secrets.REPO_DISPATCH_TOKEN }}
repository: absmach/amdm
event-type: deploy-latest-smq-images
@@ -0,0 +1,141 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: Check the consistency of generated files
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
check-generated-files:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: 1.25.x
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@v3
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:
- ".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"
- "journal/journal.go"
- "consumers/notifier.go"
- name: Set up protoc
if: steps.changes.outputs.proto == 'true'
run: |
PROTOC_VERSION=33.0
PROTOC_GEN_VERSION=v1.36.10
PROTOC_GRPC_VERSION=v1.5.1
# Export the variables so they are available in future steps
echo "PROTOC_VERSION=$PROTOC_VERSION" >> $GITHUB_ENV
echo "PROTOC_GEN_VERSION=$PROTOC_GEN_VERSION" >> $GITHUB_ENV
echo "PROTOC_GRPC_VERSION=$PROTOC_GRPC_VERSION" >> $GITHUB_ENV
# Download and install protoc
PROTOC_ZIP=protoc-$PROTOC_VERSION-linux-x86_64.zip
curl -0L -o $PROTOC_ZIP https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP
unzip -o $PROTOC_ZIP -d protoc3
sudo mv protoc3/bin/* /usr/local/bin/
sudo mv protoc3/include/* /usr/local/include/
rm -rf $PROTOC_ZIP protoc3
# Install protoc-gen-go and protoc-gen-go-grpc
go install google.golang.org/protobuf/cmd/protoc-gen-go@$PROTOC_GEN_VERSION
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@$PROTOC_GRPC_VERSION
# Add protoc to the PATH
export PATH=$PATH:/usr/local/bin/protoc
- 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_VERSION and protoc-gen-go-grpc version $PROTOC_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
+40
View File
@@ -0,0 +1,40 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: Check License Header
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
check-license:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- 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
+31
View File
@@ -0,0 +1,31 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: Deploy GitHub Pages
on:
push:
branches:
- main
jobs:
swagger-ui:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Swagger UI action
id: swagger-ui-action
uses: blokovi/swagger-ui-action@main
with:
dir: "./apidocs/openapi"
pattern: "*.yaml"
debug: "true"
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: swagger-ui
cname: docs.api.supermq.absmach.eu
+365
View File
@@ -0,0 +1,365 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: CI Pipeline
on:
pull_request:
branches:
- main
jobs:
lint-and-build: # Linting and building are combined to save time for setting up Go
name: Lint and Build
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: 1.25.x
cache-dependency-path: "go.sum"
- name: Fetch Certs
run: |
make fetch_certs
if [[ -n $(git status --porcelain docker/addons/certs) ]]; then
echo "Certs docker file is not up to date. Please update it"
git diff docker/addons/certs
exit 1
else
exit 0
fi
- name: Install protolint
run: |
go install github.com/yoheimuta/protolint/cmd/protolint@latest
- name: Lint Protobuf Files
run: |
protolint .
- name: Run linters
uses: golangci/golangci-lint-action@v9
with:
version: v2.4.0
args: --config ./tools/config/.golangci.yaml
- name: Build all Binaries
run: |
make all -j $(nproc)
- name: Compile check for rabbitmq
run: |
SMQ_MESSAGE_BROKER_TYPE=msg_rabbitmq make mqtt
- name: Compile check for redis
run: |
SMQ_ES_TYPE=es_redis make mqtt
run-tests:
name: Run tests
runs-on: ubuntu-latest
needs: lint-and-build
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: 1.25.x
cache-dependency-path: "go.sum"
- name: Check for changes in specific paths
uses: dorny/paths-filter@v3
id: changes
with:
base: main
filters: |
workflow:
- ".github/workflows/tests.yaml"
auth:
- "auth/**"
- "cmd/auth/**"
- "auth.proto"
- "auth.pb.go"
- "auth_grpc.pb.go"
- "pkg/ulid/**"
- "pkg/uuid/**"
channels:
- "channels/**"
- "cmd/channels/**"
- "auth.pb.go"
- "auth_grpc.pb.go"
- "auth/**"
- "pkg/sdk/**"
- "clients/api/grpc/**"
- "groups/api/grpc/**"
- "domains/api/grpc/**"
- "internal/grpc/**"
cli:
- "cli/**"
- "cmd/cli/**"
- "pkg/sdk/**"
clients:
- "clients/**"
- "cmd/clients/**"
- "auth.pb.go"
- "auth_grpc.pb.go"
- "auth/**"
- "pkg/ulid/**"
- "pkg/uuid/**"
- "pkg/events/**"
- "groups/api/grpc/**"
- "channels/api/grpc/**"
- "domains/api/grpc/**"
- "internal/grpc/**"
coap:
- "coap/**"
- "cmd/coap/**"
- "auth.pb.go"
- "auth_grpc.pb.go"
- "clients/**"
- "pkg/messaging/**"
domains:
- "domains/**"
- "cmd/domains/**"
- "auth.pb.go"
- "auth_grpc.pb.go"
- "auth/**"
- "internal/grpc/**"
groups:
- "groups/**"
- "cmd/groups/**"
- "auth.pb.go"
- "auth_grpc.pb.go"
- "auth/**"
- "pkg/ulid/**"
- "pkg/uuid/**"
- "clients/api/grpc/**"
- "channels/api/grpc/**"
- "domains/api/grpc/**"
- "internal/grpc/**"
http:
- "http/**"
- "cmd/http/**"
- "auth.pb.go"
- "auth_grpc.pb.go"
- "clients/**"
- "pkg/messaging/**"
- "logger/**"
internal:
- "internal/**"
journal:
- "journal/**"
- "cmd/journal/**"
- "auth.pb.go"
- "auth_grpc.pb.go"
- "auth/**"
- "pkg/events/**"
logger:
- "logger/**"
mqtt:
- "mqtt/**"
- "cmd/mqtt/**"
- "auth.pb.go"
- "auth_grpc.pb.go"
- "clients/**"
- "pkg/messaging/**"
- "logger/**"
- "pkg/events/**"
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/**"
- "auth/**"
- "http/**"
- "internal/*"
- "clients/**"
- "users/**"
- "channels/**"
- "domains/**"
- "groups/**"
- "journal/**"
- "api/http/**"
pkg-transformers:
- "pkg/transformers/**"
pkg-ulid:
- "pkg/ulid/**"
pkg-uuid:
- "pkg/uuid/**"
users:
- "users/**"
- "cmd/users/**"
- "auth.pb.go"
- "auth_grpc.pb.go"
- "auth/**"
- "pkg/ulid/**"
- "pkg/uuid/**"
- "pkg/events/**"
ws:
- "ws/**"
- "cmd/ws/**"
- "auth.pb.go"
- "auth_grpc.pb.go"
- "clients/**"
- "pkg/messaging/**"
- name: Create coverage directory
run: |
mkdir coverage
- name: Run journal tests
if: steps.changes.outputs.journal == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/journal.out ./journal/...
- name: Run auth tests
if: steps.changes.outputs.auth == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/auth.out ./auth/...
- name: Run domains tests
if: steps.changes.outputs.domains == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/domains.out ./domains/...
- name: Run cli tests
if: steps.changes.outputs.cli == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/cli.out ./cli/...
- name: Run CoAP tests
if: steps.changes.outputs.coap == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/coap.out ./coap/...
- name: Run HTTP tests
if: steps.changes.outputs.http == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/http.out ./http/...
- name: Run internal tests
if: steps.changes.outputs.internal == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/internal.out ./internal/...
- name: Run logger tests
if: steps.changes.outputs.logger == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/logger.out ./logger/...
- name: Run MQTT tests
if: steps.changes.outputs.mqtt == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/mqtt.out ./mqtt/...
- name: Run pkg errors tests
if: steps.changes.outputs.pkg-errors == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/pkg-errors.out ./pkg/errors/...
- name: Run pkg events tests
if: steps.changes.outputs.pkg-events == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/pkg-events.out ./pkg/events/...
- name: Run pkg grpcclient tests
if: steps.changes.outputs.pkg-grpcclient == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/pkg-grpcclient.out ./pkg/grpcclient/...
- name: Run pkg messaging tests
if: steps.changes.outputs.pkg-messaging == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/pkg-messaging.out ./pkg/messaging/...
- name: Run pkg sdk tests
if: steps.changes.outputs.pkg-sdk == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/pkg-sdk.out ./pkg/sdk/...
- name: Run pkg transformers tests
if: steps.changes.outputs.pkg-transformers == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/pkg-transformers.out ./pkg/transformers/...
- name: Run pkg ulid tests
if: steps.changes.outputs.pkg-ulid == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/pkg-ulid.out ./pkg/ulid/...
- name: Run pkg uuid tests
if: steps.changes.outputs.pkg-uuid == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/pkg-uuid.out ./pkg/uuid/...
- name: Run clients tests
if: steps.changes.outputs.clients == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/clients.out ./clients/...
- name: Run channels tests
if: steps.changes.outputs.channels == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/channels.out ./channels/...
- name: Run users tests
if: steps.changes.outputs.users == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/users.out ./users/...
- name: Run groups tests
if: steps.changes.outputs.groups == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/groups.out ./groups/...
- name: Run WebSocket tests
if: steps.changes.outputs.ws == 'true' || steps.changes.outputs.workflow == 'true'
run: |
go test --race -v -count=1 -coverprofile=coverage/ws.out ./ws/...
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV }}
files: ./coverage/*.out
verbose: true
+19 -3
View File
@@ -1,4 +1,20 @@
build
*.pb.go
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
site/
# 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/
+36
View File
@@ -0,0 +1,36 @@
# Adopters
As SuperMQ Community grows, we'd like to keep track of SuperMQ 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 SuperMQ 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 SuperMQ, 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 SuperMQ technology.
**Please send PRs to add or remove organizations/users**
### Format
```
N: Name of user (company or individual)
D: Short Use Case Description (optional)
L: Link with further information (optional)
T: Type of adaptation: Evaluation, Core Technology, Production Usage (optional)
```
## Requirements
* You must represent the user or organization listed. Do NOT add entries on behalf of other organizations or individuals.
Pull request commit must be [signed](https://docs.github.com/en/github/authenticating-to-github/signing-commits) and auto-checked with [ Developer Certificate of Origin (DCO)](https://probot.github.io/apps/dco/)
* 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 SuperMQ:**
**Note**: Several other organizations/users couldn't publicly share their usage details but are active project contributors and SuperMQ 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/absmach/supermq/blob/main/MAINTAINERS) and you will be permanently removed from the list.
+87
View File
@@ -0,0 +1,87 @@
# Contributing to SuperMQ
The following is a set of guidelines to contribute to SuperMQ 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@abstractmachines.fr](mailto:abuse@abstractmachines.fr).
## Reporting issues
Reporting issues are a great way to contribute to the project. We are perpetually grateful about a well-written,
thorough bug report.
Before raising a new issue, check [our issue
list](https://github.com/absmach/supermq/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
report:
- What were you trying to achieve?
- What are the expected results?
- What are the received results?
- What are the steps to reproduce the issue?
- In what environment did you encounter the issue?
## Pull requests
Good pull requests (e.g. patches, improvements, new features) are a fantastic help. They should
remain focused in scope and avoid unrelated commits.
**Please ask first** before embarking on any significant pull request (e.g. implementing new features,
refactoring code etc.), otherwise you risk spending a lot of time working on something that the
maintainers might not want to merge into the project.
Please adhere to the coding conventions used throughout the project. If in doubt, consult the
[Effective Go](https://golang.org/doc/effective_go.html) style guide.
To contribute to the project, [fork](https://help.github.com/articles/fork-a-repo/) it,
clone your fork repository, and configure the remotes:
```
git clone https://github.com/<your-username>/supermq.git
cd supermq
git remote add upstream https://github.com/absmach/supermq.git
```
If your cloned repository is behind the upstream commits, then get the latest changes from upstream:
```
git checkout main
git pull --rebase upstream main
```
Create a new topic branch from `main` using the naming convention `SMQ-[issue-number]`
to help us keep track of your contribution scope:
```
git checkout -b SMQ-[issue-number]
```
Commit your changes in logical chunks. When you are ready to commit, make sure
to write a Good Commit Message™. Consult the [Erlang's contributing guide](https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
if you're unsure of what constitutes a Good Commit Message™. Use [interactive rebase](https://help.github.com/articles/about-git-rebase)
to group your commits into logical units of work before making it public.
Note that every commit you make must be signed. By signing off your work you indicate that you
are accepting the [Developer Certificate of Origin](https://developercertificate.org/).
Use your real name (sorry, no pseudonyms or anonymous contributions). If you set your `user.name`
and `user.email` git configs, you can sign your commit automatically with `git commit -s`.
Locally merge (or rebase) the upstream development branch into your topic branch:
```
git pull --rebase upstream main
```
Push your topic branch up to your fork:
```
git push origin SMQ-[issue-number]
```
[Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title
and detailed description.
Generated
-397
View File
@@ -1,397 +0,0 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "github.com/Azure/go-ansiterm"
packages = [
".",
"winterm"
]
revision = "d6e3b3328b783f23731bc4d058875b0371ff8109"
[[projects]]
name = "github.com/Microsoft/go-winio"
packages = ["."]
revision = "7da180ee92d8bd8bb8c37fc560e673e6557c392f"
version = "v0.4.7"
[[projects]]
branch = "master"
name = "github.com/Nvveen/Gotty"
packages = ["."]
revision = "cd527374f1e5bff4938207604a14f2e38a9cf512"
[[projects]]
name = "github.com/asaskevich/govalidator"
packages = ["."]
revision = "ccb8e960c48f04d6935e72476ae4a51028f9e22f"
version = "v9"
[[projects]]
branch = "master"
name = "github.com/beorn7/perks"
packages = ["quantile"]
revision = "4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9"
[[projects]]
name = "github.com/cenkalti/backoff"
packages = ["."]
revision = "61153c768f31ee5f130071d08fc82b85208528de"
version = "v1.1.0"
[[projects]]
branch = "master"
name = "github.com/cisco/senml"
packages = ["."]
revision = "448c9510575e1dd6f780cb10addbad998cf80418"
[[projects]]
branch = "master"
name = "github.com/containerd/continuity"
packages = ["pathdriver"]
revision = "d8fb8589b0e8e85b8c8bbaa8840226d0dfeb7371"
[[projects]]
name = "github.com/davecgh/go-spew"
packages = ["spew"]
revision = "346938d642f2ec3594ed81d874461961cd0faa76"
version = "v1.1.0"
[[projects]]
branch = "master"
name = "github.com/dereulenspiegel/coap-mux"
packages = ["."]
revision = "e137e310a99955be01d60b2237da89153ea40987"
[[projects]]
name = "github.com/dgrijalva/jwt-go"
packages = ["."]
revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e"
version = "v3.2.0"
[[projects]]
branch = "master"
name = "github.com/docker/docker"
packages = [
"api/types",
"api/types/blkiodev",
"api/types/container",
"api/types/filters",
"api/types/mount",
"api/types/network",
"api/types/registry",
"api/types/strslice",
"api/types/swarm",
"api/types/swarm/runtime",
"api/types/versions",
"opts",
"pkg/archive",
"pkg/fileutils",
"pkg/homedir",
"pkg/idtools",
"pkg/ioutils",
"pkg/jsonmessage",
"pkg/longpath",
"pkg/mount",
"pkg/pools",
"pkg/stdcopy",
"pkg/system",
"pkg/term",
"pkg/term/windows"
]
revision = "72ba7f593fa4dbb628cf5ee83cd7daf955934cf5"
[[projects]]
name = "github.com/docker/go-connections"
packages = ["nat"]
revision = "3ede32e2033de7505e6500d6c868c2b9ed9f169d"
version = "v0.3.0"
[[projects]]
name = "github.com/docker/go-units"
packages = ["."]
revision = "0dadbb0345b35ec7ef35e228dabb8de89a65bf52"
version = "v0.3.2"
[[projects]]
branch = "master"
name = "github.com/dustin/go-coap"
packages = ["."]
revision = "ddcc80675fa42611359d91a6dfa5aa57fb90e72b"
[[projects]]
name = "github.com/fsouza/go-dockerclient"
packages = ["."]
revision = "ca33ff277b527ce11b793e62f9ba244129b01caf"
version = "v1.2.0"
[[projects]]
name = "github.com/go-kit/kit"
packages = [
"endpoint",
"log",
"metrics",
"metrics/internal/lv",
"metrics/prometheus",
"transport/http"
]
revision = "4dc7be5d2d12881735283bcab7352178e190fc71"
version = "v0.6.0"
[[projects]]
name = "github.com/go-logfmt/logfmt"
packages = ["."]
revision = "390ab7935ee28ec6b286364bba9b4dd6410cb3d5"
version = "v0.3.0"
[[projects]]
name = "github.com/go-stack/stack"
packages = ["."]
revision = "259ab82a6cad3992b4e21ff5cac294ccb06474bc"
version = "v1.7.0"
[[projects]]
name = "github.com/go-zoo/bone"
packages = ["."]
revision = "fd0aebc74e908868b09ac140fb5a53cb363884c1"
version = "1.2"
[[projects]]
name = "github.com/gogo/protobuf"
packages = ["proto"]
revision = "1adfc126b41513cc696b209667c8656ea7aac67c"
version = "v1.0.0"
[[projects]]
name = "github.com/golang/protobuf"
packages = ["proto"]
revision = "925541529c1fa6821df4e44ce2723319eb2be768"
version = "v1.0.0"
[[projects]]
name = "github.com/gorilla/websocket"
packages = ["."]
revision = "ea4d1f681babbce9545c9c5f3d5194a789c89f5b"
version = "v1.2.0"
[[projects]]
name = "github.com/jinzhu/gorm"
packages = [
".",
"dialects/postgres"
]
revision = "6ed508ec6a4ecb3531899a69cbc746ccf65a4166"
version = "v1.9.1"
[[projects]]
branch = "master"
name = "github.com/jinzhu/inflection"
packages = ["."]
revision = "04140366298a54a039076d798123ffa108fff46c"
[[projects]]
branch = "master"
name = "github.com/kr/logfmt"
packages = ["."]
revision = "b84e30acd515aadc4b783ad4ff83aff3299bdfe0"
[[projects]]
branch = "master"
name = "github.com/lib/pq"
packages = [
".",
"hstore",
"oid"
]
revision = "88edab0803230a3898347e77b474f8c1820a1f20"
[[projects]]
name = "github.com/matttproud/golang_protobuf_extensions"
packages = ["pbutil"]
revision = "3247c84500bff8d9fb6d579d800f20b3e091582c"
version = "v1.0.0"
[[projects]]
name = "github.com/nats-io/go-nats"
packages = [
".",
"encoders/builtin",
"util"
]
revision = "d66cb54e6b7bdd93f0b28afc8450d84c780dfb68"
version = "v1.4.0"
[[projects]]
name = "github.com/nats-io/nuid"
packages = ["."]
revision = "289cccf02c178dc782430d534e3c1f5b72af807f"
version = "v1.0.0"
[[projects]]
name = "github.com/opencontainers/go-digest"
packages = ["."]
revision = "279bed98673dd5bef374d3b6e4b09e2af76183bf"
version = "v1.0.0-rc1"
[[projects]]
name = "github.com/opencontainers/image-spec"
packages = [
"specs-go",
"specs-go/v1"
]
revision = "d60099175f88c47cd379c4738d158884749ed235"
version = "v1.0.1"
[[projects]]
name = "github.com/opencontainers/runc"
packages = [
"libcontainer/system",
"libcontainer/user"
]
revision = "baf6536d6259209c3edfa2b22237af82942d3dfa"
version = "v0.1.1"
[[projects]]
name = "github.com/pkg/errors"
packages = ["."]
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
version = "v0.8.0"
[[projects]]
name = "github.com/pmezard/go-difflib"
packages = ["difflib"]
revision = "792786c7400a136282c1664665ae0a8db921c6c2"
version = "v1.0.0"
[[projects]]
name = "github.com/prometheus/client_golang"
packages = [
"prometheus",
"prometheus/promhttp"
]
revision = "c5b7fccd204277076155f10851dad72b76a49317"
version = "v0.8.0"
[[projects]]
branch = "master"
name = "github.com/prometheus/client_model"
packages = ["go"]
revision = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c"
[[projects]]
branch = "master"
name = "github.com/prometheus/common"
packages = [
"expfmt",
"internal/bitbucket.org/ww/goautoneg",
"model"
]
revision = "e4aa40a9169a88835b849a6efb71e05dc04b88f0"
[[projects]]
branch = "master"
name = "github.com/prometheus/procfs"
packages = [
".",
"internal/util",
"nfs",
"xfs"
]
revision = "54d17b57dd7d4a3aa092476596b3f8a933bde349"
[[projects]]
name = "github.com/satori/go.uuid"
packages = ["."]
revision = "f58768cc1a7a7e77a3bd49e98cdd21419399b6a3"
version = "v1.2.0"
[[projects]]
name = "github.com/sirupsen/logrus"
packages = ["."]
revision = "c155da19408a8799da419ed3eeb0cb5db0ad5dbc"
version = "v1.0.5"
[[projects]]
name = "github.com/sony/gobreaker"
packages = ["."]
revision = "e9556a45379ef1da12e54847edb2fb3d7d566f36"
version = "0.3.0"
[[projects]]
name = "github.com/stretchr/testify"
packages = ["assert"]
revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71"
version = "v1.2.1"
[[projects]]
name = "github.com/ugorji/go"
packages = ["codec"]
revision = "9831f2c3ac1068a78f50999a30db84270f647af6"
version = "v1.1"
[[projects]]
name = "go.uber.org/atomic"
packages = ["."]
revision = "8474b86a5a6f79c443ce4b2992817ff32cf208b8"
version = "v1.3.1"
[[projects]]
name = "go.uber.org/multierr"
packages = ["."]
revision = "3c4937480c32f4c13a875a1829af76c98ca3d40a"
version = "v1.1.0"
[[projects]]
name = "go.uber.org/zap"
packages = [
".",
"buffer",
"internal/bufferpool",
"internal/color",
"internal/exit",
"zapcore"
]
revision = "35aad584952c3e7020db7b839f6b102de6271f89"
version = "v1.7.1"
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = [
"bcrypt",
"blowfish",
"ssh/terminal"
]
revision = "374053ea96cb300f8671b8d3b07edeeb06e203b4"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = [
"context",
"context/ctxhttp"
]
revision = "24dd3780ca4f75fed9f321890729414a4b5d3f13"
[[projects]]
branch = "master"
name = "golang.org/x/sys"
packages = [
"unix",
"windows"
]
revision = "01acb38716e021ed1fc03a602bdb5838e1358c5e"
[[projects]]
name = "gopkg.in/ory-am/dockertest.v3"
packages = ["."]
revision = "15c8e8835bba04e0d7c2b57958ffe294d5e643dc"
version = "v3.1.6"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "c1b28e90e21e838cec2d16c95d8eb414b5de9bbe9667acb01b5375db047cc6db"
solver-name = "gps-cdcl"
solver-version = 1
-79
View File
@@ -1,79 +0,0 @@
[[constraint]]
name = "github.com/asaskevich/govalidator"
version = "9.0.0"
[[constraint]]
branch = "master"
name = "github.com/cisco/senml"
[[constraint]]
branch = "master"
name = "github.com/dereulenspiegel/coap-mux"
[[constraint]]
name = "github.com/dgrijalva/jwt-go"
version = "3.2.0"
[[constraint]]
branch = "master"
name = "github.com/dustin/go-coap"
[[constraint]]
name = "github.com/go-kit/kit"
version = "0.6.0"
[[constraint]]
name = "github.com/go-zoo/bone"
version = "1.2.0"
[[constraint]]
name = "github.com/golang/protobuf"
version = "1.0.0"
[[constraint]]
name = "github.com/jinzhu/gorm"
version = "1.9.1"
[[constraint]]
branch = "master"
name = "github.com/lib/pq"
[[constraint]]
name = "github.com/nats-io/go-nats"
version = "1.4.0"
[[constraint]]
name = "github.com/prometheus/client_golang"
version = "0.8.0"
[[constraint]]
name = "github.com/satori/go.uuid"
version = "1.2.0"
[[constraint]]
name = "github.com/sony/gobreaker"
version = "0.3.0"
[[constraint]]
name = "github.com/stretchr/testify"
version = "1.2.1"
[[constraint]]
name = "go.uber.org/zap"
version = "1.7.1"
[[constraint]]
branch = "master"
name = "golang.org/x/crypto"
[[constraint]]
name = "gopkg.in/ory-am/dockertest.v3"
version = "3.1.6"
[[constraint]]
name = "github.com/gorilla/websocket"
version = "1.2.0"
[prune]
go-tests = true
unused-packages = true
+1 -1
View File
@@ -176,7 +176,7 @@
END OF TERMS AND CONDITIONS
Copyright 2015-2018 Mainflux
Copyright 2015-2020 SuperMQ
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
+9 -24
View File
@@ -1,4 +1,4 @@
# Mainflux follows the timeless, highly efficient and totally unfair system
# SuperMQ 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.
@@ -6,8 +6,8 @@
[bdfl]
[[drasko]]
Name = "Drasko DRASKOVIC"
Email = "drasko.draskovic@mainflux.com"
Name = "Drasko Draskovic"
Email = "drasko@abstractmachines.fr"
GitHub = "drasko"
# However, this role serves only in dead-lock events, or in a special and very rare cases
@@ -18,28 +18,13 @@
# 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.
# A reference list of all maintainers of the SuperMQ project.
# ADD YOURSELF HERE IN ALPHABETICAL ORDER
[maintainers]
[[manuel]]
Name = "Manuel IMPERIALE"
Email = "manuel.imperiale@gmail.com"
GitHub = "manuIO"
[[janko]]
Name = "Janko ISIDOROVIC"
Email = "janko.isidorovic@mainflux.com"
GitHub = "janko-isidorovic"
[[nikola]]
Name = "Nikola MARCETIC"
Email = "nikola.marcetic@mainflux.com"
GitHub = "nmarcetic"
[[dejan]]
Name = "Dejan MIJIC"
Email = "dejan.mijic@mainflux.com"
GitHub = "mijicd"
[[dusan]]
Name = "Dusan Borovcanin"
Email = "dusan.borovcanin@abstractmachines.fr"
GitHub = "dborovcanin"
+250 -12
View File
@@ -1,41 +1,228 @@
BUILD_DIR = build
SERVICES = manager http normalizer ws
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
SMQ_DOCKER_IMAGE_NAME_PREFIX ?= supermq
BUILD_DIR ?= build
SERVICES = auth users clients groups channels domains http coap ws cli mqtt journal notifications
TEST_API_SERVICES = journal auth certs http 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
GOOS ?= linux
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
GRPC_MTLS_CERT_FILES_EXISTS = 0
MOCKERY = $(GOBIN)/mockery
MOCKERY_VERSION=3.5.5
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 ($(SMQ_MESSAGE_BROKER_TYPE),)
SMQ_MESSAGE_BROKER_TYPE := $(SMQ_MESSAGE_BROKER_TYPE)
else
SMQ_MESSAGE_BROKER_TYPE=msg_nats
endif
ifneq ($(SMQ_ES_TYPE),)
SMQ_ES_TYPE := $(SMQ_ES_TYPE)
else
SMQ_ES_TYPE=es_nats
endif
define compile_service
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) go build -ldflags "-s -w" -o ${BUILD_DIR}/mainflux-$(1) cmd/$(1)/main.go
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) \
go build -tags $(SMQ_MESSAGE_BROKER_TYPE) -tags $(SMQ_ES_TYPE) -ldflags "-s -w \
-X 'github.com/absmach/supermq.BuildTime=$(TIME)' \
-X 'github.com/absmach/supermq.Version=$(VERSION)' \
-X 'github.com/absmach/supermq.Commit=$(COMMIT)'" \
-o ${BUILD_DIR}/$(1) cmd/$(1)/main.go
endef
define make_docker
docker build --build-arg SVC_NAME=$(subst docker_,,$(1)) --tag=mainflux/$(subst docker_,,$(1)) -f docker/Dockerfile .
$(eval svc=$(subst docker_,,$(1)))
docker build \
--no-cache \
--build-arg SVC=$(svc) \
--build-arg GOARCH=$(GOARCH) \
--build-arg GOARM=$(GOARM) \
--build-arg VERSION=$(VERSION) \
--build-arg COMMIT=$(COMMIT) \
--build-arg TIME=$(TIME) \
--tag=$(SMQ_DOCKER_IMAGE_NAME_PREFIX)/$(svc) \
-f docker/Dockerfile .
endef
define make_docker_dev
$(eval svc=$(subst docker_dev_,,$(1)))
docker build \
--no-cache \
--build-arg SVC=$(svc) \
--tag=$(SMQ_DOCKER_IMAGE_NAME_PREFIX)/$(svc) \
-f docker/Dockerfile.dev ./build
endef
ADDON_SERVICES = journal certs
EXTERNAL_SERVICES = prometheus
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))
$(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 latest release
.PHONY: all $(SERVICES) dockers dockers_dev latest release run run_addons grpc_mtls_certs check_mtls check_certs test_api mocks
clean:
rm -rf ${BUILD_DIR}
cleandocker:
# Stops containers and removes containers, networks, volumes, and images created by up
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=$(SMQ_DOCKER_IMAGE_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)/supermq-`basename $$file`; \
done
mocks: $(MOCKERY)
@$(MOCKERY) --config ./tools/config/.mockery.yaml
$(MOCKERY):
@mkdir -p $(GOBIN)
@mkdir -p mockery
@echo ">> downloading mockery $(MOCKERY_VERSION)..."
@curl -sL https://github.com/vektra/mockery/releases/download/v$(MOCKERY_VERSION)/mockery_$(MOCKERY_VERSION)_Linux_x86_64.tar.gz | tar -xz -C mockery
@mv mockery/mockery $(GOBIN)
@rm -r mockery
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
@if [ "$(svc)" = "http" ] && [ -z "$(CLIENT_SECRET)" ]; then \
echo "CLIENT_SECRET is not set"; \
echo "Please set it to a valid secret"; \
exit 1; \
fi
@if [ "$(svc)" = "http" ]; then \
uvx schemathesis run apidocs/openapi/$(svc).yaml \
--checks all \
--url $(2) \
--header "Authorization: Client $(CLIENT_SECRET)" \
--suppress-health-check=filter_too_much \
--exclude-checks=positive_data_acceptance \
--phases=examples,stateful; \
else \
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; \
fi
endef
test_api_users: TEST_API_URL := http://localhost:9002
test_api_clients: TEST_API_URL := http://localhost:9006
test_api_domains: TEST_API_URL := http://localhost:9003
test_api_channels: TEST_API_URL := http://localhost:9005
test_api_groups: TEST_API_URL := http://localhost:9004
test_api_http: TEST_API_URL := http://localhost:8008
test_api_auth: TEST_API_URL := http://localhost:9001
test_api_certs: TEST_API_URL := http://localhost:9019
test_api_journal: TEST_API_URL := http://localhost:9021
$(TEST_API):
$(call test_api_service,$(@),$(TEST_API_URL))
proto:
protoc --go_out=. *.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): proto
$(FILTERED_SERVICES):
$(call compile_service,$(@))
$(DOCKERS):
$(call make_docker,$(@))
$(call make_docker,$(@),$(GOARCH))
$(DOCKERS_DEV):
$(call make_docker_dev,$(@))
dockers: $(DOCKERS)
dockers_dev: $(DOCKERS_DEV)
define docker_push
for svc in $(SERVICES); do \
docker push $(SMQ_DOCKER_IMAGE_NAME_PREFIX)/$$svc:$(1); \
done
endef
changelog:
git log $(shell git describe --tags --abbrev=0)..HEAD --pretty=format:"- %s"
latest: dockers
$(call docker_push,latest)
publish_arch:
$(MAKE) dockers GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM)
for svc in $(SERVICES); do \
docker push mainflux/$$svc; \
docker tag $(SMQ_DOCKER_IMAGE_NAME_PREFIX)/$$svc $(SMQ_DOCKER_IMAGE_NAME_PREFIX)/$$svc:$(VERSION)-$(GOARCH); \
docker tag $(SMQ_DOCKER_IMAGE_NAME_PREFIX)/$$svc $(SMQ_DOCKER_IMAGE_NAME_PREFIX)/$$svc:latest-$(GOARCH); \
docker push $(SMQ_DOCKER_IMAGE_NAME_PREFIX)/$$svc:$(VERSION)-$(GOARCH); \
docker push $(SMQ_DOCKER_IMAGE_NAME_PREFIX)/$$svc:latest-$(GOARCH); \
done
release:
@@ -43,6 +230,57 @@ release:
git checkout $(version)
$(MAKE) dockers
for svc in $(SERVICES); do \
docker tag mainflux/$$svc mainflux/$$svc:$(version); \
docker push mainflux/$$svc:$(version); \
docker tag $(SMQ_DOCKER_IMAGE_NAME_PREFIX)/$$svc $(SMQ_DOCKER_IMAGE_NAME_PREFIX)/$$svc:$(version); \
done
$(call docker_push,$(version))
rundev:
cd scripts && ./run.sh
grpc_mtls_certs:
$(MAKE) -C docker/ssl auth_grpc_certs clients_grpc_certs
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
check_certs: check_mtls check_tls
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 auth_grpc_certs clients_grpc_certs
endif
endif
endif
fetch_certs:
@./scripts/certs.sh
run: check_certs
docker compose -f docker/docker-compose.yaml --env-file docker/.env -p $(DOCKER_PROJECT) $(DOCKER_COMPOSE_COMMAND) $(args)
run_addons: check_certs
$(foreach SVC,$(RUN_ADDON_ARGS),$(if $(filter $(SVC),$(ADDON_SERVICES) $(EXTERNAL_SERVICES)),,$(error Invalid Service $(SVC))))
@docker compose -f docker/docker-compose.yaml --env-file ./docker/.env -p $(DOCKER_PROJECT) up -d auth domains jaeger
@for SVC in $(RUN_ADDON_ARGS); do \
if [ "$$SVC" = "certs" ]; then \
docker compose -f docker/addons/$$SVC/docker-compose.yaml -f docker/certs-docker-compose-override.yaml --env-file ./docker/.env --env-file ./docker/addons/$$SVC/.env -p $(DOCKER_PROJECT) $(DOCKER_COMPOSE_COMMAND) $(args) & \
else \
SMQ_ADDONS_CERTS_PATH_PREFIX="../." docker compose -f docker/addons/$$SVC/docker-compose.yaml -p $(DOCKER_PROJECT) --env-file ./docker/.env $(DOCKER_COMPOSE_COMMAND) $(args) & \
fi; \
done
run_live: check_certs
GOPATH=$(go env GOPATH) docker compose -f docker/docker-compose.yaml -f docker/docker-compose-live.yaml --env-file docker/.env -p $(DOCKER_PROJECT) $(DOCKER_COMPOSE_COMMAND) $(args)
+97 -46
View File
@@ -1,67 +1,118 @@
# 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]
# SuperMQ
**Planetary event-driven infrastructure**
**Made with ❤️ by [Abstract Machines](https://absmach.eu/)**
[![Build Status](https://github.com/absmach/supermq/actions/workflows/build.yaml/badge.svg?branch=main)](https://github.com/absmach/supermq/actions/workflows/build.yaml)
[![Check License Header](https://github.com/absmach/supermq/actions/workflows/check-license.yaml/badge.svg?branch=main)](https://github.com/absmach/supermq/actions/workflows/check-license.yaml)
[![Check Generated Files](https://github.com/absmach/supermq/actions/workflows/check-generated-files.yaml/badge.svg?branch=main)](https://github.com/absmach/supermq/actions/workflows/check-generated-files.yaml)
[![Go Report Card](https://goreportcard.com/badge/github.com/absmach/supermq)](https://goreportcard.com/report/github.com/absmach/supermq)
[![Coverage](https://codecov.io/gh/absmach/supermq/graph/badge.svg?token=nPCEr5nW8S)](https://codecov.io/gh/absmach/supermq)
[![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)
### [Guide](https://docs.supermq.absmach.eu) | [Contributing](CONTRIBUTING.md) | [Website](https://absmach.eu/) | [Chat](https://matrix.to/#/#supermq:matrix.org)
![banner][banner]
</div>
Mainflux is modern, scalable, secure open source and patent-free IoT cloud platform written in Go.
It accepts user, device, and 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.
For more details, check out the [official documentation][docs].
## Introduction 📖
## Features
SuperMQ is a distributed, highly scalable, and secure open-source cloud platform for messaging and event-driven architecture (EDA). It is a planetarily distributed, highly scalable, and secure platform that serves as a robust foundation for building advanced real-time and reactive systems.
- Protocol bridging (i.e. HTTP, MQTT, WebSocket, CoAP)
- Device management and provisioning
- Fine-grained access control
- Platform logging and instrumentation support
- Container-based deployment using [Docker][docker]
## Why SuperMQ Stands Out 🚀
## Quickstart
SuperMQ bridges the gap between various network protocols (HTTP, MQTT, WebSocket, CoAP, and more) to provide a seamless messaging experience. Whether you're working on IoT solutions, real-time data pipelines, or event-driven systems, SuperMQ has you covered. 🌐✨
Before proceeding, install the following prerequisites:
## Key Features 🌟
- [Docker](https://docs.docker.com/install/)
- [Docker compose](https://docs.docker.com/compose/install/)
- **Multi-Protocol Connectivity**: HTTP, MQTT, WebSocket, CoAP, and more! 🌉
- **Secure by Design**: Mutual TLS (mTLS) with X.509 Certificates, JWT support, and multi-protocol authorization. 🔒
- **Fine-Grained Access Control**: Support for ABAC and RBAC policies. 📜
- **Multi-Tenant**: Manage multiple domains seamlessly. 🏢
- **Multi-User**: Unlimited organizational hierarchies for user management. 👥
- **Application Management**: Group and share messaging clients for streamlined operations. 📱
- **Ease of Use**: Simple and powerful communication channel management, grouping, and sharing. ✨
- **Personal Access Tokens (PATs)**: Scoped and revocable tokens for enhanced security. 🔑
- **Observability**: Integrated logging and instrumentation with Prometheus and OpenTelemetry. 📈
- **Event Sourcing**: Build robust and scalable architectures. ⚡
- **Edge and IoT Ready**: Supports MQTT and CoAP protocols for seamless IoT gateway and sensor communication and management. 🌍
- **Developer-Friendly**: SDKs, CLI tools, and comprehensive documentation to get you started. 👩‍💻👨‍💻
- **Production-Ready**: Container-based deployment using Docker and Kubernetes. 🐳☸️
Once everything is installed, execute the following commands from project root:
## Installation 🛠️
Clone the repository and start SuperMQ services:
```bash
docker-compose -f docker/docker-compose.yml up -d
git clone https://github.com/absmach/supermq.git
cd supermq
docker compose -f docker/docker-compose.yaml --env-file docker/.env up
```
## Contributing
Or use the [Makefile](Makefile) for a simpler command:
Thank you for your interest in Mainflux and wish to contribute!
```bash
make run
```
1. Take a look at our [open issues](https://github.com/mainflux/mainflux/issues).
2. Checkout the [contribution guide](.github/CONTRIBUTING.md) to learn more about our style and conventions.
For production deployments, check our [Kubernetes guide](https://docs.supermq.abstractmachines.fr/kubernetes). ⚙️
### Usage 📤📥
#### Using the CLI:
```bash
make cli
./build/supermq-cli status
```
This command retrieves the status of the SuperMQ server and outputs it to the console.
#### Using HTTP with Curl:
```bash
curl -X GET http://localhost:8080/status
```
This request fetches the server status over HTTP and provides a JSON response.
See our [CLI documentation](https://docs.supermq.abstractmachines.fr/cli) for more details.
## Documentation 📚
The official documentation is hosted at [SuperMQ docs page](https://docs.supermq.abstractmachines.fr).
Documentation is auto-generated, check out the instructions in the [docs repository](https://github.com/absmach/supermq-docs).
If you spot an error or a need for corrections, please let us know - or even better: send us a PR! 💌
## Community and Contributing 🤝
Thank you for your interest in SuperMQ and the desire to contribute!
1. Take a look at our [open issues](https://github.com/absmach/supermq/issues). The [good-first-issue](https://github.com/absmach/supermq/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.
## Community
Join our community:
- [Google group][forum]
- [Gitter][gitter]
- [Twitter][twitter]
- [Matrix Room](https://matrix.to/#/#supermq\:matrix.org)
## Professional Support 💼
Need help deploying SuperMQ or integrating it into your system? Reach out to **[Abstract Machines](https://absmach.eu/)** for professional support and guidance.
## License 📜
SuperMQ is open-source software licensed under the [Apache License 2.0](LICENSE). Contributions are welcome!
## Acknowledgments 🙌
Special thanks to the amazing contributors who make SuperMQ possible. Check out the [MAINTAINERS](MAINTAINERS) file to see the team behind the magic.
Ready to build the future of messaging and event-driven systems? Let's get started! 🚀
[banner]: https://github.com/mainflux/mainflux/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]: http://mainflux.readthedocs.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
+16
View File
@@ -0,0 +1,16 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package supermq
// Response contains HTTP response specific methods.
type Response interface {
// Code returns HTTP response code.
Code() int
// Headers returns map of HTTP headers with their values.
Headers() map[string]string
// Empty indicates if HTTP response has content.
Empty() bool
}
+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
+485
View File
@@ -0,0 +1,485 @@
// 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.10
// protoc v6.33.0
// 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"` // token id
UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // user id
UserRole uint32 `protobuf:"varint,3,opt,name=user_role,json=userRole,proto3" json:"user_role,omitempty"` // user role
Verified bool `protobuf:"varint,4,opt,name=verified,proto3" json:"verified,omitempty"` // verified user
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
}
type AuthZReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` // Domain
SubjectType string `protobuf:"bytes,2,opt,name=subject_type,json=subjectType,proto3" json:"subject_type,omitempty"` // Client or User
SubjectKind string `protobuf:"bytes,3,opt,name=subject_kind,json=subjectKind,proto3" json:"subject_kind,omitempty"` // ID or Token
SubjectRelation string `protobuf:"bytes,4,opt,name=subject_relation,json=subjectRelation,proto3" json:"subject_relation,omitempty"` // Subject relation
Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // Subject value (id or token, depending on kind)
Relation string `protobuf:"bytes,6,opt,name=relation,proto3" json:"relation,omitempty"` // Relation to filter
Permission string `protobuf:"bytes,7,opt,name=permission,proto3" json:"permission,omitempty"` // Action
Object string `protobuf:"bytes,8,opt,name=object,proto3" json:"object,omitempty"` // Object ID
ObjectType string `protobuf:"bytes,9,opt,name=object_type,json=objectType,proto3" json:"object_type,omitempty"` // Client, User, Group
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AuthZReq) Reset() {
*x = AuthZReq{}
mi := &file_auth_v1_auth_proto_msgTypes[2]
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[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 AuthZReq.ProtoReflect.Descriptor instead.
func (*AuthZReq) Descriptor() ([]byte, []int) {
return file_auth_v1_auth_proto_rawDescGZIP(), []int{2}
}
func (x *AuthZReq) GetDomain() string {
if x != nil {
return x.Domain
}
return ""
}
func (x *AuthZReq) GetSubjectType() string {
if x != nil {
return x.SubjectType
}
return ""
}
func (x *AuthZReq) GetSubjectKind() string {
if x != nil {
return x.SubjectKind
}
return ""
}
func (x *AuthZReq) GetSubjectRelation() string {
if x != nil {
return x.SubjectRelation
}
return ""
}
func (x *AuthZReq) GetSubject() string {
if x != nil {
return x.Subject
}
return ""
}
func (x *AuthZReq) GetRelation() string {
if x != nil {
return x.Relation
}
return ""
}
func (x *AuthZReq) GetPermission() string {
if x != nil {
return x.Permission
}
return ""
}
func (x *AuthZReq) GetObject() string {
if x != nil {
return x.Object
}
return ""
}
func (x *AuthZReq) GetObjectType() string {
if x != nil {
return x.ObjectType
}
return ""
}
type AuthZPatReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // User id
PatId string `protobuf:"bytes,2,opt,name=pat_id,json=patId,proto3" json:"pat_id,omitempty"` // Pat id
EntityType uint32 `protobuf:"varint,3,opt,name=entity_type,json=entityType,proto3" json:"entity_type,omitempty"` // Entity type
OptionalDomainId string `protobuf:"bytes,4,opt,name=optional_domain_id,json=optionalDomainId,proto3" json:"optional_domain_id,omitempty"` // Optional domain id
Operation uint32 `protobuf:"varint,6,opt,name=operation,proto3" json:"operation,omitempty"` // Operation
EntityId string `protobuf:"bytes,7,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"` // EntityID
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AuthZPatReq) Reset() {
*x = AuthZPatReq{}
mi := &file_auth_v1_auth_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AuthZPatReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthZPatReq) ProtoMessage() {}
func (x *AuthZPatReq) 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 AuthZPatReq.ProtoReflect.Descriptor instead.
func (*AuthZPatReq) Descriptor() ([]byte, []int) {
return file_auth_v1_auth_proto_rawDescGZIP(), []int{3}
}
func (x *AuthZPatReq) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
func (x *AuthZPatReq) GetPatId() string {
if x != nil {
return x.PatId
}
return ""
}
func (x *AuthZPatReq) GetEntityType() uint32 {
if x != nil {
return x.EntityType
}
return 0
}
func (x *AuthZPatReq) GetOptionalDomainId() string {
if x != nil {
return x.OptionalDomainId
}
return ""
}
func (x *AuthZPatReq) GetOperation() uint32 {
if x != nil {
return x.Operation
}
return 0
}
func (x *AuthZPatReq) GetEntityId() string {
if x != nil {
return x.EntityId
}
return ""
}
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[4]
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[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 AuthZRes.ProtoReflect.Descriptor instead.
func (*AuthZRes) Descriptor() ([]byte, []int) {
return file_auth_v1_auth_proto_rawDescGZIP(), []int{4}
}
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\"l\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\"\xa2\x02\n" +
"\bAuthZReq\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\"\xc7\x01\n" +
"\vAuthZPatReq\x12\x17\n" +
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x15\n" +
"\x06pat_id\x18\x02 \x01(\tR\x05patId\x12\x1f\n" +
"\ventity_type\x18\x03 \x01(\rR\n" +
"entityType\x12,\n" +
"\x12optional_domain_id\x18\x04 \x01(\tR\x10optionalDomainId\x12\x1c\n" +
"\toperation\x18\x06 \x01(\rR\toperation\x12\x1b\n" +
"\tentity_id\x18\a \x01(\tR\bentityId\":\n" +
"\bAuthZRes\x12\x1e\n" +
"\n" +
"authorized\x18\x01 \x01(\bR\n" +
"authorized\x12\x0e\n" +
"\x02id\x18\x02 \x01(\tR\x02id2\xf0\x01\n" +
"\vAuthService\x123\n" +
"\tAuthorize\x12\x11.auth.v1.AuthZReq\x1a\x11.auth.v1.AuthZRes\"\x00\x129\n" +
"\fAuthorizePAT\x12\x14.auth.v1.AuthZPatReq\x1a\x11.auth.v1.AuthZRes\"\x00\x126\n" +
"\fAuthenticate\x12\x11.auth.v1.AuthNReq\x1a\x11.auth.v1.AuthNRes\"\x00\x129\n" +
"\x0fAuthenticatePAT\x12\x11.auth.v1.AuthNReq\x1a\x11.auth.v1.AuthNRes\"\x00B-Z+github.com/absmach/supermq/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, 5)
var file_auth_v1_auth_proto_goTypes = []any{
(*AuthNReq)(nil), // 0: auth.v1.AuthNReq
(*AuthNRes)(nil), // 1: auth.v1.AuthNRes
(*AuthZReq)(nil), // 2: auth.v1.AuthZReq
(*AuthZPatReq)(nil), // 3: auth.v1.AuthZPatReq
(*AuthZRes)(nil), // 4: auth.v1.AuthZRes
}
var file_auth_v1_auth_proto_depIdxs = []int32{
2, // 0: auth.v1.AuthService.Authorize:input_type -> auth.v1.AuthZReq
3, // 1: auth.v1.AuthService.AuthorizePAT:input_type -> auth.v1.AuthZPatReq
0, // 2: auth.v1.AuthService.Authenticate:input_type -> auth.v1.AuthNReq
0, // 3: auth.v1.AuthService.AuthenticatePAT:input_type -> auth.v1.AuthNReq
4, // 4: auth.v1.AuthService.Authorize:output_type -> auth.v1.AuthZRes
4, // 5: auth.v1.AuthService.AuthorizePAT:output_type -> auth.v1.AuthZRes
1, // 6: auth.v1.AuthService.Authenticate:output_type -> auth.v1.AuthNRes
1, // 7: auth.v1.AuthService.AuthenticatePAT:output_type -> auth.v1.AuthNRes
4, // [4:8] is the sub-list for method output_type
0, // [0:4] 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_auth_v1_auth_proto_init() }
func file_auth_v1_auth_proto_init() {
if File_auth_v1_auth_proto != nil {
return
}
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: 5,
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
}
+244
View File
@@ -0,0 +1,244 @@
// 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.5.1
// - protoc v6.33.0
// 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_AuthorizePAT_FullMethodName = "/auth.v1.AuthService/AuthorizePAT"
AuthService_Authenticate_FullMethodName = "/auth.v1.AuthService/Authenticate"
AuthService_AuthenticatePAT_FullMethodName = "/auth.v1.AuthService/AuthenticatePAT"
)
// 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 SuperMQ services.
type AuthServiceClient interface {
Authorize(ctx context.Context, in *AuthZReq, opts ...grpc.CallOption) (*AuthZRes, error)
AuthorizePAT(ctx context.Context, in *AuthZPatReq, opts ...grpc.CallOption) (*AuthZRes, error)
Authenticate(ctx context.Context, in *AuthNReq, opts ...grpc.CallOption) (*AuthNRes, error)
AuthenticatePAT(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) AuthorizePAT(ctx context.Context, in *AuthZPatReq, opts ...grpc.CallOption) (*AuthZRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AuthZRes)
err := c.cc.Invoke(ctx, AuthService_AuthorizePAT_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
}
func (c *authServiceClient) AuthenticatePAT(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_AuthenticatePAT_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 SuperMQ services.
type AuthServiceServer interface {
Authorize(context.Context, *AuthZReq) (*AuthZRes, error)
AuthorizePAT(context.Context, *AuthZPatReq) (*AuthZRes, error)
Authenticate(context.Context, *AuthNReq) (*AuthNRes, error)
AuthenticatePAT(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.Errorf(codes.Unimplemented, "method Authorize not implemented")
}
func (UnimplementedAuthServiceServer) AuthorizePAT(context.Context, *AuthZPatReq) (*AuthZRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method AuthorizePAT not implemented")
}
func (UnimplementedAuthServiceServer) Authenticate(context.Context, *AuthNReq) (*AuthNRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented")
}
func (UnimplementedAuthServiceServer) AuthenticatePAT(context.Context, *AuthNReq) (*AuthNRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method AuthenticatePAT 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 pancis, 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_AuthorizePAT_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthZPatReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).AuthorizePAT(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_AuthorizePAT_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).AuthorizePAT(ctx, req.(*AuthZPatReq))
}
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)
}
func _AuthService_AuthenticatePAT_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).AuthenticatePAT(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_AuthenticatePAT_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).AuthenticatePAT(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: "AuthorizePAT",
Handler: _AuthService_AuthorizePAT_Handler,
},
{
MethodName: "Authenticate",
Handler: _AuthService_Authenticate_Handler,
},
{
MethodName: "AuthenticatePAT",
Handler: _AuthService_AuthenticatePAT_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "auth/v1/auth.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.10
// protoc v6.33.0
// source: channels/v1/channels.proto
package v1
import (
v1 "github.com/absmach/supermq/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\"\x00B1Z/github.com/absmach/supermq/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.5.1
// - protoc v6.33.0
// source: channels/v1/channels.proto
package v1
import (
context "context"
v1 "github.com/absmach/supermq/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.Errorf(codes.Unimplemented, "method Authorize not implemented")
}
func (UnimplementedChannelsServiceServer) RemoveClientConnections(context.Context, *RemoveClientConnectionsReq) (*RemoveClientConnectionsRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemoveClientConnections not implemented")
}
func (UnimplementedChannelsServiceServer) UnsetParentGroupFromChannels(context.Context, *UnsetParentGroupFromChannelsReq) (*UnsetParentGroupFromChannelsRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method UnsetParentGroupFromChannels not implemented")
}
func (UnimplementedChannelsServiceServer) RetrieveEntity(context.Context, *v1.RetrieveEntityReq) (*v1.RetrieveEntityRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method RetrieveEntity not implemented")
}
func (UnimplementedChannelsServiceServer) RetrieveIDByRoute(context.Context, *v1.RetrieveIDByRouteReq) (*v1.RetrieveEntityRes, error) {
return nil, status.Errorf(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 pancis, 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.10
// protoc v6.33.0
// source: clients/v1/clients.proto
package v1
import (
v1 "github.com/absmach/supermq/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\"\x00B0Z.github.com/absmach/supermq/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.5.1
// - protoc v6.33.0
// source: clients/v1/clients.proto
package v1
import (
context "context"
v1 "github.com/absmach/supermq/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 SuperMQ 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 SuperMQ 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.Errorf(codes.Unimplemented, "method Authenticate not implemented")
}
func (UnimplementedClientsServiceServer) RetrieveEntity(context.Context, *v1.RetrieveEntityReq) (*v1.RetrieveEntityRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method RetrieveEntity not implemented")
}
func (UnimplementedClientsServiceServer) RetrieveEntities(context.Context, *v1.RetrieveEntitiesReq) (*v1.RetrieveEntitiesRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method RetrieveEntities not implemented")
}
func (UnimplementedClientsServiceServer) AddConnections(context.Context, *v1.AddConnectionsReq) (*v1.AddConnectionsRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddConnections not implemented")
}
func (UnimplementedClientsServiceServer) RemoveConnections(context.Context, *v1.RemoveConnectionsReq) (*v1.RemoveConnectionsRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemoveConnections not implemented")
}
func (UnimplementedClientsServiceServer) RemoveChannelConnections(context.Context, *RemoveChannelConnectionsReq) (*RemoveChannelConnectionsRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemoveChannelConnections not implemented")
}
func (UnimplementedClientsServiceServer) UnsetParentGroupFromClient(context.Context, *UnsetParentGroupFromClientReq) (*UnsetParentGroupFromClientRes, error) {
return nil, status.Errorf(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 pancis, 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.10
// protoc v6.33.0
// 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\bdomainIdB/Z-github.com/absmach/supermq/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.10
// protoc v6.33.0
// source: domains/v1/domains.proto
package v1
import (
v1 "github.com/absmach/supermq/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\"\x00B5Z3github.com/absmach/supermq/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.5.1
// - protoc v6.33.0
// source: domains/v1/domains.proto
package v1
import (
context "context"
v1 "github.com/absmach/supermq/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 SuperMQ 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 SuperMQ 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.Errorf(codes.Unimplemented, "method DeleteUserFromDomains not implemented")
}
func (UnimplementedDomainsServiceServer) RetrieveStatus(context.Context, *v1.RetrieveEntityReq) (*v1.RetrieveEntityRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method RetrieveStatus not implemented")
}
func (UnimplementedDomainsServiceServer) RetrieveIDByRoute(context.Context, *v1.RetrieveIDByRouteReq) (*v1.RetrieveEntityRes, error) {
return nil, status.Errorf(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 pancis, 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.10
// protoc v6.33.0
// source: groups/v1/groups.proto
package v1
import (
v1 "github.com/absmach/supermq/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\"\x00B/Z-github.com/absmach/supermq/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.5.1
// - protoc v6.33.0
// source: groups/v1/groups.proto
package v1
import (
context "context"
v1 "github.com/absmach/supermq/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 SuperMQ 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 SuperMQ 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.Errorf(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 pancis, 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",
}
+287
View File
@@ -0,0 +1,287 @@
// 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.10
// protoc v6.33.0
// 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"`
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
}
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
}
// 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[2]
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[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 Token.ProtoReflect.Descriptor instead.
func (*Token) Descriptor() ([]byte, []int) {
return file_token_v1_token_proto_rawDescGZIP(), []int{2}
}
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 ""
}
var File_token_v1_token_proto protoreflect.FileDescriptor
const file_token_v1_token_proto_rawDesc = "" +
"\n" +
"\x14token/v1/token.proto\x12\btoken.v1\"p\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\"M\n" +
"\n" +
"RefreshReq\x12#\n" +
"\rrefresh_token\x18\x01 \x01(\tR\frefreshToken\x12\x1a\n" +
"\bverified\x18\x02 \x01(\bR\bverified\"\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_token2r\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\"\x00B.Z,github.com/absmach/supermq/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, 3)
var file_token_v1_token_proto_goTypes = []any{
(*IssueReq)(nil), // 0: token.v1.IssueReq
(*RefreshReq)(nil), // 1: token.v1.RefreshReq
(*Token)(nil), // 2: token.v1.Token
}
var file_token_v1_token_proto_depIdxs = []int32{
0, // 0: token.v1.TokenService.Issue:input_type -> token.v1.IssueReq
1, // 1: token.v1.TokenService.Refresh:input_type -> token.v1.RefreshReq
2, // 2: token.v1.TokenService.Issue:output_type -> token.v1.Token
2, // 3: token.v1.TokenService.Refresh:output_type -> token.v1.Token
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_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[2].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: 3,
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
}
+162
View File
@@ -0,0 +1,162 @@
// 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.5.1
// - protoc v6.33.0
// 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"
)
// 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)
}
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
}
// 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)
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.Errorf(codes.Unimplemented, "method Issue not implemented")
}
func (UnimplementedTokenServiceServer) Refresh(context.Context, *RefreshReq) (*Token, error) {
return nil, status.Errorf(codes.Unimplemented, "method Refresh 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 pancis, 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)
}
// 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,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "token/v1/token.proto",
}
+418
View File
@@ -0,0 +1,418 @@
// 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.10
// protoc v6.33.0
// 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"`
Status uint32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"`
Role uint32 `protobuf:"varint,7,opt,name=role,proto3" json:"role,omitempty"`
ProfilePicture string `protobuf:"bytes,8,opt,name=profile_picture,json=profilePicture,proto3" json:"profile_picture,omitempty"`
Username string `protobuf:"bytes,9,opt,name=username,proto3" json:"username,omitempty"`
Email string `protobuf:"bytes,10,opt,name=email,proto3" json:"email,omitempty"`
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
UpdatedBy string `protobuf:"bytes,13,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"`
VerifiedAt *timestamppb.Timestamp `protobuf:"bytes,14,opt,name=verified_at,json=verifiedAt,proto3" json:"verified_at,omitempty"`
AuthProvider string `protobuf:"bytes,15,opt,name=auth_provider,json=authProvider,proto3" json:"auth_provider,omitempty"`
Permissions []string `protobuf:"bytes,16,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) 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\"\xbb\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\x12\x16\n" +
"\x06status\x18\x06 \x01(\rR\x06status\x12\x12\n" +
"\x04role\x18\a \x01(\rR\x04role\x12'\n" +
"\x0fprofile_picture\x18\b \x01(\tR\x0eprofilePicture\x12\x1a\n" +
"\busername\x18\t \x01(\tR\busername\x12\x14\n" +
"\x05email\x18\n" +
" \x01(\tR\x05email\x129\n" +
"\n" +
"created_at\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
"\n" +
"updated_at\x18\f \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x1d\n" +
"\n" +
"updated_by\x18\r \x01(\tR\tupdatedBy\x12;\n" +
"\vverified_at\x18\x0e \x01(\v2\x1a.google.protobuf.TimestampR\n" +
"verifiedAt\x12#\n" +
"\rauth_provider\x18\x0f \x01(\tR\fauthProvider\x12 \n" +
"\vpermissions\x18\x10 \x03(\tR\vpermissions2Y\n" +
"\fUsersService\x12I\n" +
"\rRetrieveUsers\x12\x1a.users.v1.RetrieveUsersReq\x1a\x1a.users.v1.RetrieveUsersRes\"\x00B.Z,github.com/absmach/supermq/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
4, // 2: users.v1.User.created_at:type_name -> google.protobuf.Timestamp
4, // 3: users.v1.User.updated_at:type_name -> google.protobuf.Timestamp
4, // 4: users.v1.User.verified_at:type_name -> google.protobuf.Timestamp
0, // 5: users.v1.UsersService.RetrieveUsers:input_type -> users.v1.RetrieveUsersReq
1, // 6: users.v1.UsersService.RetrieveUsers:output_type -> users.v1.RetrieveUsersRes
6, // [6:7] is the sub-list for method output_type
5, // [5:6] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] 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.5.1
// - protoc v6.33.0
// 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.Errorf(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 pancis, 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",
}
+329
View File
@@ -0,0 +1,329 @@
// 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/supermq"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/clients"
"github.com/absmach/supermq/groups"
"github.com/absmach/supermq/pkg/errors"
svcerr "github.com/absmach/supermq/pkg/errors/service"
"github.com/absmach/supermq/users"
"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"
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 = clients.Enabled
DefUserStatus = users.Enabled
DefGroupStatus = groups.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.(supermq.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
}
var wrapper error
if errors.Contains(err, apiutil.ErrValidation) {
wrapper, err = errors.Unwrap(err)
}
switch {
case errors.Contains(err, errors.ErrTryAgain):
w.WriteHeader(http.StatusUnprocessableEntity)
case errors.Contains(err, errors.ErrEmailAlreadyExists),
errors.Contains(err, errors.ErrUsernameNotAvailable),
errors.Contains(err, errors.ErrRouteNotAvailable),
errors.Contains(err, errors.ErrChannelRouteNotAvailable),
errors.Contains(err, errors.ErrDomainRouteNotAvailable),
errors.Contains(err, svcerr.ErrExternalAuthProviderCouldNotUpdate):
w.WriteHeader(http.StatusBadRequest)
case errors.Contains(err, svcerr.ErrAuthorization),
errors.Contains(err, svcerr.ErrDomainAuthorization),
errors.Contains(err, svcerr.ErrUnauthorizedPAT),
errors.Contains(err, svcerr.ErrSuperAdminAction):
err = unwrap(err)
w.WriteHeader(http.StatusForbidden)
case errors.Contains(err, svcerr.ErrAuthentication),
errors.Contains(err, apiutil.ErrBearerToken),
errors.Contains(err, svcerr.ErrLogin),
errors.Contains(err, apiutil.ErrUnsupportedTokenType):
err = unwrap(err)
w.WriteHeader(http.StatusUnauthorized)
case errors.Contains(err, svcerr.ErrMalformedEntity),
errors.Contains(err, apiutil.ErrMalformedPolicy),
errors.Contains(err, apiutil.ErrMissingSecret),
errors.Contains(err, errors.ErrMalformedEntity),
errors.Contains(err, apiutil.ErrMissingID),
errors.Contains(err, apiutil.ErrInvalidVerification),
errors.Contains(err, apiutil.ErrMissingName),
errors.Contains(err, apiutil.ErrMissingEmail),
errors.Contains(err, apiutil.ErrInvalidEmail),
errors.Contains(err, apiutil.ErrMissingHost),
errors.Contains(err, apiutil.ErrInvalidResetPass),
errors.Contains(err, apiutil.ErrEmptyList),
errors.Contains(err, apiutil.ErrMissingMemberKind),
errors.Contains(err, apiutil.ErrMissingMemberType),
errors.Contains(err, apiutil.ErrLimitSize),
errors.Contains(err, apiutil.ErrBearerKey),
errors.Contains(err, svcerr.ErrInvalidStatus),
errors.Contains(err, apiutil.ErrNameSize),
errors.Contains(err, apiutil.ErrInvalidIDFormat),
errors.Contains(err, apiutil.ErrInvalidQueryParams),
errors.Contains(err, apiutil.ErrMissingRelation),
errors.Contains(err, apiutil.ErrValidation),
errors.Contains(err, apiutil.ErrMissingPass),
errors.Contains(err, apiutil.ErrMissingConfPass),
errors.Contains(err, apiutil.ErrPasswordFormat),
errors.Contains(err, svcerr.ErrInvalidRole),
errors.Contains(err, svcerr.ErrInvalidPolicy),
errors.Contains(err, apiutil.ErrInvitationState),
errors.Contains(err, apiutil.ErrInvalidAPIKey),
errors.Contains(err, svcerr.ErrViewEntity),
errors.Contains(err, apiutil.ErrMissingCertData),
errors.Contains(err, apiutil.ErrInvalidContact),
errors.Contains(err, apiutil.ErrInvalidTopic),
errors.Contains(err, apiutil.ErrInvalidCertData),
errors.Contains(err, apiutil.ErrEmptyMessage),
errors.Contains(err, apiutil.ErrInvalidLevel),
errors.Contains(err, apiutil.ErrInvalidDirection),
errors.Contains(err, apiutil.ErrInvalidEntityType),
errors.Contains(err, apiutil.ErrMissingEntityType),
errors.Contains(err, apiutil.ErrInvalidTimeFormat),
errors.Contains(err, svcerr.ErrSearch),
errors.Contains(err, apiutil.ErrEmptySearchQuery),
errors.Contains(err, apiutil.ErrLenSearchQuery),
errors.Contains(err, apiutil.ErrMissingDomainID),
errors.Contains(err, apiutil.ErrMissingUserID),
errors.Contains(err, apiutil.ErrMissingPATID),
errors.Contains(err, apiutil.ErrMissingUsername),
errors.Contains(err, apiutil.ErrMissingUsernameEmail),
errors.Contains(err, apiutil.ErrMissingFirstName),
errors.Contains(err, apiutil.ErrMissingLastName),
errors.Contains(err, apiutil.ErrInvalidUsername),
errors.Contains(err, apiutil.ErrMissingIdentity),
errors.Contains(err, apiutil.ErrInvalidProfilePictureURL),
errors.Contains(err, apiutil.ErrSelfParentingNotAllowed),
errors.Contains(err, apiutil.ErrMissingChildrenGroupIDs),
errors.Contains(err, apiutil.ErrMissingParentGroupID),
errors.Contains(err, apiutil.ErrMissingConnectionType),
errors.Contains(err, apiutil.ErrMissingRoleName),
errors.Contains(err, apiutil.ErrMissingRoleID),
errors.Contains(err, apiutil.ErrMissingPolicyEntityType),
errors.Contains(err, apiutil.ErrMissingRoleMembers),
errors.Contains(err, apiutil.ErrMissingDescription),
errors.Contains(err, apiutil.ErrMissingEntityID),
errors.Contains(err, apiutil.ErrInvalidRouteFormat),
errors.Contains(err, svcerr.ErrRetainOneMember),
errors.Contains(err, apiutil.ErrMissingRoute):
err = unwrap(err)
w.WriteHeader(http.StatusBadRequest)
case errors.Contains(err, svcerr.ErrCreateEntity),
errors.Contains(err, svcerr.ErrUpdateEntity),
errors.Contains(err, svcerr.ErrRemoveEntity),
errors.Contains(err, svcerr.ErrEnableClient),
errors.Contains(err, svcerr.ErrEnableUser),
errors.Contains(err, svcerr.ErrDisableUser):
err = unwrap(err)
w.WriteHeader(http.StatusUnprocessableEntity)
case errors.Contains(err, svcerr.ErrNotFound):
err = unwrap(err)
w.WriteHeader(http.StatusNotFound)
case errors.Contains(err, errors.ErrStatusAlreadyAssigned),
errors.Contains(err, svcerr.ErrInvitationAlreadyRejected),
errors.Contains(err, svcerr.ErrInvitationAlreadyAccepted),
errors.Contains(err, svcerr.ErrConflict):
err = unwrap(err)
w.WriteHeader(http.StatusConflict)
case errors.Contains(err, apiutil.ErrUnsupportedContentType):
err = unwrap(err)
w.WriteHeader(http.StatusUnsupportedMediaType)
default:
w.WriteHeader(http.StatusInternalServerError)
}
if wrapper != nil {
err = errors.Wrap(wrapper, err)
}
if errorVal, ok := err.(errors.Error); ok {
if err := json.NewEncoder(w).Encode(errorVal); err != nil {
w.WriteHeader(http.StatusInternalServerError)
}
}
}
func unwrap(err error) error {
wrapper, err := errors.Unwrap(err)
if wrapper != nil {
return wrapper
}
return err
}
+338
View File
@@ -0,0 +1,338 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package http_test
import (
"context"
"encoding/json"
"net/http"
"testing"
"time"
"github.com/absmach/supermq"
api "github.com/absmach/supermq/api/http"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/internal/testsutil"
"github.com/absmach/supermq/pkg/errors"
svcerr "github.com/absmach/supermq/pkg/errors/service"
"github.com/stretchr/testify/assert"
)
var _ supermq.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
errs []error
code int
}{
{
desc: "BadRequest",
errs: []error{
apiutil.ErrMissingSecret,
svcerr.ErrMalformedEntity,
errors.ErrMalformedEntity,
apiutil.ErrMissingID,
apiutil.ErrEmptyList,
apiutil.ErrMissingMemberType,
apiutil.ErrMissingMemberKind,
apiutil.ErrLimitSize,
apiutil.ErrNameSize,
svcerr.ErrViewEntity,
},
code: http.StatusBadRequest,
},
{
desc: "BadRequest with validation error",
errs: []error{
errors.Wrap(apiutil.ErrValidation, apiutil.ErrMissingSecret),
errors.Wrap(apiutil.ErrValidation, svcerr.ErrMalformedEntity),
errors.Wrap(apiutil.ErrValidation, errors.ErrMalformedEntity),
errors.Wrap(apiutil.ErrValidation, apiutil.ErrMissingID),
errors.Wrap(apiutil.ErrValidation, apiutil.ErrEmptyList),
errors.Wrap(apiutil.ErrValidation, apiutil.ErrMissingMemberType),
errors.Wrap(apiutil.ErrValidation, apiutil.ErrMissingMemberKind),
errors.Wrap(apiutil.ErrValidation, apiutil.ErrLimitSize),
errors.Wrap(apiutil.ErrValidation, apiutil.ErrNameSize),
},
code: http.StatusBadRequest,
},
{
desc: "Unauthorized",
errs: []error{
svcerr.ErrAuthentication,
svcerr.ErrAuthentication,
apiutil.ErrBearerToken,
},
code: http.StatusUnauthorized,
},
{
desc: "NotFound",
errs: []error{
svcerr.ErrNotFound,
},
code: http.StatusNotFound,
},
{
desc: "Conflict",
errs: []error{
svcerr.ErrConflict,
svcerr.ErrConflict,
},
code: http.StatusConflict,
},
{
desc: "Forbidden",
errs: []error{
svcerr.ErrAuthorization,
svcerr.ErrAuthorization,
svcerr.ErrDomainAuthorization,
},
code: http.StatusForbidden,
},
{
desc: "UnsupportedMediaType",
errs: []error{
apiutil.ErrUnsupportedContentType,
},
code: http.StatusUnsupportedMediaType,
},
{
desc: "StatusUnprocessableEntity",
errs: []error{
svcerr.ErrCreateEntity,
svcerr.ErrUpdateEntity,
svcerr.ErrRemoveEntity,
},
code: http.StatusUnprocessableEntity,
},
{
desc: "InternalServerError",
errs: []error{
errors.New("test"),
},
code: http.StatusInternalServerError,
},
}
for _, c := range cases {
t.Run(c.desc, func(t *testing.T) {
responseWriter := newResponseWriter()
for _, err := range c.errs {
api.EncodeError(context.Background(), err, responseWriter)
assert.Equal(t, c.code, responseWriter.StatusCode())
message := body{}
jerr := json.Unmarshal(responseWriter.Body(), &message)
assert.NoError(t, jerr)
var wrapper error
switch errors.Contains(err, apiutil.ErrValidation) {
case true:
wrapper, err = errors.Unwrap(err)
assert.Equal(t, err.Error(), message.Error)
assert.Equal(t, wrapper.Error(), message.Message)
case false:
assert.Equal(t, err.Error(), 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/supermq"
"github.com/go-chi/chi/v5/middleware"
)
func RequestIDMiddleware(idp supermq.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))
})
}
}
+277
View File
@@ -0,0 +1,277 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package util
import "github.com/absmach/supermq/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.New("something went wrong with the request")
// ErrBearerToken indicates missing or invalid bearer user token.
ErrBearerToken = errors.New("missing or invalid bearer user token")
// ErrBearerKey indicates missing or invalid bearer entity key.
ErrBearerKey = errors.New("missing or invalid bearer entity key")
// ErrMissingID indicates missing entity ID.
ErrMissingID = errors.New("missing entity id")
// ErrMissingEntityID indicates missing entity ID.
ErrMissingEntityID = errors.New("missing entity id")
// ErrMissingClientID indicates missing client ID.
ErrMissingClientID = errors.New("missing cient id")
// ErrMissingChannelID indicates missing client ID.
ErrMissingChannelID = errors.New("missing channel id")
// ErrMissingConnectionType indicates missing connection tpye.
ErrMissingConnectionType = errors.New("missing connection type")
// ErrMissingParentGroupID indicates missing parent group ID.
ErrMissingParentGroupID = errors.New("missing parent group id")
// ErrMissingChildrenGroupIDs indicates missing children group IDs.
ErrMissingChildrenGroupIDs = errors.New("missing children group ids")
// ErrSelfParentingNotAllowed indicates child id is same as parent id.
ErrSelfParentingNotAllowed = errors.New("self parenting not allowed")
// ErrInvalidChildGroupID indicates invalid child group ID.
ErrInvalidChildGroupID = errors.New("invalid child group id")
// ErrInvalidAuthKey indicates invalid auth key.
ErrInvalidAuthKey = errors.New("invalid auth key")
// ErrInvalidIDFormat indicates an invalid ID format.
ErrInvalidIDFormat = errors.New("invalid id format provided")
// ErrNameSize indicates that name size exceeds the max.
ErrNameSize = errors.New("invalid name size")
// ErrEmailSize indicates that email size exceeds the max.
ErrEmailSize = errors.New("invalid email size")
// ErrInvalidRole indicates that an invalid role.
ErrInvalidRole = errors.New("invalid client role")
// ErrLimitSize indicates that an invalid limit.
ErrLimitSize = errors.New("invalid limit size")
// ErrLevel indicates that an invalid level.
ErrLevel = errors.New("invalid level")
// ErrOffsetSize indicates an invalid offset.
ErrOffsetSize = errors.New("invalid offset size")
// ErrInvalidOrder indicates an invalid list order.
ErrInvalidOrder = errors.New("invalid list order provided")
// ErrInvalidDirection indicates an invalid list direction.
ErrInvalidDirection = errors.New("invalid list direction provided")
// ErrInvalidMemberKind indicates an invalid member kind.
ErrInvalidMemberKind = errors.New("invalid member kind")
// ErrEmptyList indicates that entity data is empty.
ErrEmptyList = errors.New("empty list provided")
// ErrMissingRoleName indicates that role name is empty.
ErrMissingRoleName = errors.New("empty role name")
// ErrMissingRoleID indicates that role id is empty.
ErrMissingRoleID = errors.New("empty role id")
// ErrMissingRoleOperations indicates that role operations are empty.
ErrMissingRoleOperations = errors.New("empty role operations")
// ErrMissingRoleMembers indicates that role members are empty.
ErrMissingRoleMembers = errors.New("empty role members")
// ErrMalformedPolicy indicates that policies are malformed.
ErrMalformedPolicy = errors.New("malformed policy")
// ErrMissingPolicySub indicates that policies are subject.
ErrMissingPolicySub = errors.New("malformed policy subject")
// ErrMissingPolicyObj indicates missing policies object.
ErrMissingPolicyObj = errors.New("malformed policy object")
// ErrMalformedPolicyAct indicates missing policies action.
ErrMalformedPolicyAct = errors.New("malformed policy action")
// ErrMissingPolicyEntityType indicates missing policies entity type.
ErrMissingPolicyEntityType = errors.New("missing policy entity type")
// ErrMalformedPolicyPer indicates missing policies relation.
ErrMalformedPolicyPer = errors.New("malformed policy permission")
// ErrMissingCertData indicates missing cert data (ttl).
ErrMissingCertData = errors.New("missing certificate data")
// ErrInvalidCertData indicates invalid cert data (ttl).
ErrInvalidCertData = errors.New("invalid certificate data")
// ErrInvalidTopic indicates an invalid subscription topic.
ErrInvalidTopic = errors.New("invalid Subscription topic")
// ErrInvalidContact indicates an invalid subscription contract.
ErrInvalidContact = errors.New("invalid Subscription contact")
// ErrMissingEmail indicates missing email.
ErrMissingEmail = errors.New("missing email")
// ErrInvalidEmail indicates missing email.
ErrInvalidEmail = errors.New("invalid email")
// ErrMissingHost indicates missing host.
ErrMissingHost = errors.New("missing host")
// ErrMissingPass indicates missing password.
ErrMissingPass = errors.New("missing password")
// ErrMissingConfPass indicates missing conf password.
ErrMissingConfPass = errors.New("missing conf password")
// ErrInvalidResetPass indicates an invalid reset password.
ErrInvalidResetPass = errors.New("invalid reset password")
// ErrInvalidComparator indicates an invalid comparator.
ErrInvalidComparator = errors.New("invalid comparator")
// ErrMissingMemberIDs indicates missing member ids.
ErrMissingMemberIDs = errors.New("missing member ids")
// ErrMissingMemberType indicates missing group member type.
ErrMissingMemberType = errors.New("missing group member type")
// ErrMissingMemberKind indicates missing group member kind.
ErrMissingMemberKind = errors.New("missing group member kind")
// ErrMissingRelation indicates missing relation.
ErrMissingRelation = errors.New("missing relation")
// ErrInvalidRelation indicates an invalid relation.
ErrInvalidRelation = errors.New("invalid relation")
// ErrInvalidAPIKey indicates an invalid API key type.
ErrInvalidAPIKey = errors.New("invalid api key type")
// ErrInvitationState indicates an invalid invitation state.
ErrInvitationState = errors.New("invalid invitation state")
// ErrMissingIdentity indicates missing entity Identity.
ErrMissingIdentity = errors.New("missing entity identity")
// ErrMissingSecret indicates missing secret.
ErrMissingSecret = errors.New("missing secret")
// ErrPasswordFormat indicates weak password.
ErrPasswordFormat = errors.New("password does not meet the requirements")
// ErrMissingName indicates missing identity name.
ErrMissingName = errors.New("missing identity name")
// ErrMissingRoute indicates missing route.
ErrMissingRoute = errors.New("missing route")
// ErrInvalidLevel indicates an invalid group level.
ErrInvalidLevel = errors.New("invalid group level (should be between 0 and 5)")
// ErrNotFoundParam indicates that the parameter was not found in the query.
ErrNotFoundParam = errors.New("parameter not found in the query")
// ErrInvalidQueryParams indicates invalid query parameters.
ErrInvalidQueryParams = errors.New("invalid query parameters")
// ErrInvalidVisibilityType indicates invalid visibility type.
ErrInvalidVisibilityType = errors.New("invalid visibility type")
// ErrUnsupportedContentType indicates unacceptable or lack of Content-Type.
ErrUnsupportedContentType = errors.New("unsupported content type")
// ErrRollbackTx indicates failed to rollback transaction.
ErrRollbackTx = errors.New("failed to rollback transaction")
// ErrInvalidAggregation indicates invalid aggregation value.
ErrInvalidAggregation = errors.New("invalid aggregation value")
// ErrInvalidInterval indicates invalid interval value.
ErrInvalidInterval = errors.New("invalid interval value")
// ErrMissingFrom indicates missing from value.
ErrMissingFrom = errors.New("missing from time value")
// ErrMissingTo indicates missing to value.
ErrMissingTo = errors.New("missing to time value")
// ErrEmptyMessage indicates empty message.
ErrEmptyMessage = errors.New("empty message")
// ErrMissingEntityType indicates missing entity type.
ErrMissingEntityType = errors.New("missing entity type")
// ErrInvalidEntityType indicates invalid entity type.
ErrInvalidEntityType = errors.New("invalid entity type")
// ErrInvalidTimeFormat indicates invalid time format i.e not unix time.
ErrInvalidTimeFormat = errors.New("invalid time format use unix time")
// ErrEmptySearchQuery indicates search query should not be empty.
ErrEmptySearchQuery = errors.New("search query must not be empty")
// ErrLenSearchQuery indicates search query length.
ErrLenSearchQuery = errors.New("search query must be at least 3 characters")
// ErrMissingDomainID indicates missing domainID.
ErrMissingDomainID = errors.New("missing domainID")
// ErrMissingUsername indicates missing user name.
ErrMissingUsername = errors.New("missing username")
// ErrInvalidUsername indicates invalid user name.
ErrInvalidUsername = errors.New("invalid username")
// ErrMissingFirstName indicates missing first name.
ErrMissingFirstName = errors.New("missing first name")
// ErrMissingLastName indicates missing last name.
ErrMissingLastName = errors.New("missing last name")
// ErrInvalidProfilePictureURL indicates that the profile picture url is invalid.
ErrInvalidProfilePictureURL = errors.New("invalid profile picture url")
ErrMultipleEntitiesFilter = errors.New("multiple entities are provided in filter are not supported")
// ErrMissingDescription indicates missing description.
ErrMissingDescription = errors.New("missing description")
// ErrUnsupportedTokenType indicates that this type of token is not supported.
ErrUnsupportedTokenType = errors.New("unsupported content token type")
// ErrMissingUserID indicates missing user ID.
ErrMissingUserID = errors.New("missing user id")
// ErrMissingPATID indicates missing pat ID.
ErrMissingPATID = errors.New("missing pat id")
// ErrInvalidNameFormat indicates invalid name format.
ErrInvalidNameFormat = errors.New("invalid name format")
// ErrInvalidRouteFormat indicates invalid route format.
ErrInvalidRouteFormat = errors.New("invalid route format")
// ErrMissingUsernameEmail indicates missing user name / email.
ErrMissingUsernameEmail = errors.New("missing username / email")
// ErrInvalidVerification indicates invalid email verification.
ErrInvalidVerification = errors.New("invalid verification")
// ErrEmailNotVerified indicates invalid email not verified.
ErrEmailNotVerified = errors.New("email not verified")
)
+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"`
}
+37
View File
@@ -0,0 +1,37 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package util
import (
"net/http"
"strings"
)
// BearerPrefix represents the token prefix for Bearer authentication scheme.
const BearerPrefix = "Bearer "
// ClientPrefix represents the key prefix for Client authentication scheme.
const ClientPrefix = "Client "
// 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/supermq/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/supermq/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/supermq/api/http/util"
smqlog "github.com/absmach/supermq/logger"
"github.com/absmach/supermq/pkg/errors"
svcerr "github.com/absmach/supermq/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(smqlog.NewMock(), encFunc)
errorEncoder(context.Background(), c.err, httptest.NewRecorder())
assert.True(t, encCalled)
})
}
}
+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/supermq/blob/main/api/asyncapi/mqtt.yaml'
info:
title: SuperMQ MQTT Adapter
version: '0.18.0'
contact:
name: SuperMQ Team
url: 'https://github.com/absmach/supermq'
email: info@abstractmachines.fr
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/supermq/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/supermq/blob/main/api/asyncapi/websocket.yaml'
info:
title: SuperMQ 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: SuperMQ Team
url: 'https://github.com/absmach/supermq'
email: info@abstractmachines.fr
license:
name: Apache 2.0
url: 'https://github.com/absmach/supermq/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: SuperMQ WebSocket Adapter port
default: '8186'
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 SuperMQ 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 @@
# SuperMQ OpenAPI Specification
This folder contains an OpenAPI specifications for SuperMQ API.
View specification in Swagger UI at [docs.api.supermq.abstractmachines.fr](https://docs.api.supermq.abstractmachines.fr)
+840
View File
@@ -0,0 +1,840 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
openapi: 3.0.3
info:
title: SuperMQ 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 SuperMQ repository](https://github.com/absmach/supermq)
contact:
email: info@abstractmachines.fr
license:
name: Apache 2.0
url: https://github.com/absmach/supermq/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://docs.supermq.abstractmachines.fr/
- name: PATs
description: Everything about your Personal Access Tokens.
externalDocs:
description: Find out more about Personal Access Tokens
url: https://docs.supermq.abstractmachines.fr/
- name: Health
description: Service health check endpoint.
externalDocs:
description: Find out more about health check
url: https://docs.supermq.abstractmachines.fr/
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.
"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.
"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:
id:
type: string
format: uuid
example: "c5747f2f-2a7c-4fe1-b41a-51a5ae290945"
description: Scope unique identifier
pat_id:
type: string
format: uuid
example: "9118de62-c680-46b7-ad0a-21748a52833a"
description: PAT ID this scope belongs to
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
properties:
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
duration:
type: string
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
properties:
duration:
type: string
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
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
+191
View File
@@ -0,0 +1,191 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
openapi: 3.0.1
info:
title: SuperMQ http adapter
description: |
HTTP API for sending messages through communication channels.
Some useful links:
- [The SuperMQ repository](https://github.com/absmach/supermq)
contact:
email: info@abstractmachines.fr
license:
name: Apache 2.0
url: https://github.com/absmach/supermq/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://docs.supermq.abstractmachines.fr/
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.
"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: []
+426
View File
@@ -0,0 +1,426 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
openapi: 3.0.3
info:
title: SuperMQ Journal Log Service
description: |
This is the Journal Log Server based on the OpenAPI 3.0 specification. It is the HTTP API for viewing journal log history. 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 SuperMQ repository](https://github.com/absmach/supermq)
contact:
email: info@mainflux.com
license:
name: Apache 2.0
url: https://github.com/absmach/supermq/blob/main/LICENSE
version: 0.18.0
servers:
- url: http://localhost:9021
- url: https://localhost:9021
tags:
- name: journal-log
description: Everything about your Journal Log
externalDocs:
description: Find out more about Journal Log
url: http://docs.mainflux.io/
paths:
/journal/user/{userID}:
get:
tags:
- journal-log
summary: List user journal log
description: |
Retrieves a list of journal. Due to performance concerns, data
is retrieved in subsets. The API must ensure that the entire
dataset is consumed either by making subsequent requests, or by
increasing the subset size of the initial request.
parameters:
- $ref: "#/components/parameters/user_id"
- $ref: "#/components/parameters/offset"
- $ref: "#/components/parameters/limit"
- $ref: "#/components/parameters/operation"
- $ref: "#/components/parameters/with_attributes"
- $ref: "#/components/parameters/with_metadata"
- $ref: "#/components/parameters/from"
- $ref: "#/components/parameters/to"
- $ref: "#/components/parameters/dir"
security:
- bearerAuth: []
responses:
"200":
$ref: "#/components/responses/JournalsPageRes"
"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"
/{domainID}/journal/client/{clientID}/telemetry:
get:
tags:
- journal-log
summary: View client telemetry
description: |
Retrieves telemetry data for a specific client within a domain.
This includes connection status, messages sent/received, and other metrics.
parameters:
- $ref: "#/components/parameters/domain_id"
- $ref: '#/components/parameters/client_id'
security:
- bearerAuth: []
responses:
"200":
description: Client telemetry data retrieved successfully
content:
application/json:
schema:
$ref: "#/components/schemas/Telemetry"
"400":
description: Failed due to malformed request parameters.
"401":
description: Missing or invalid access token provided.
"403":
description: Failed to perform authorization over the entity.
"404":
description: Client not found.
"422":
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
/{domainID}/journal/{entityType}/{id}:
get:
tags:
- journal-log
summary: List entity journal log
description: |
Retrieves a list of journal. Due to performance concerns, data
is retrieved in subsets. The API must ensure that the entire
dataset is consumed either by making subsequent requests, or by
increasing the subset size of the initial request.
parameters:
- $ref: "#/components/parameters/domain_id"
- $ref: "#/components/parameters/entity_type"
- $ref: "#/components/parameters/id"
- $ref: "#/components/parameters/offset"
- $ref: "#/components/parameters/limit"
- $ref: "#/components/parameters/operation"
- $ref: "#/components/parameters/with_attributes"
- $ref: "#/components/parameters/with_metadata"
- $ref: "#/components/parameters/from"
- $ref: "#/components/parameters/to"
- $ref: "#/components/parameters/dir"
security:
- bearerAuth: []
responses:
"200":
$ref: "#/components/responses/JournalsPageRes"
"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"
/health:
get:
summary: Retrieves service health check info.
tags:
- health
security: []
responses:
"200":
$ref: "#/components/responses/HealthRes"
"500":
$ref: "#/components/responses/ServiceError"
components:
schemas:
Telemetry:
type: object
properties:
client_id:
type: string
format: uuid
description: Unique identifier of the client
example: "bb7edb32-2eac-4aad-aebe-ed96fe073879"
domain_id:
type: string
format: uuid
description: Unique identifier of the domain
example: "29d425c8-542b-4614-8a4d-a5951945d720"
subscriptions:
type: integer
format: int64
description: Number of active subscriptions for the client
example: 5
inbound_messages:
type: integer
format: int64
description: Number of messages received by the client
example: 1234567
outbound_messages:
type: integer
format: int64
description: Number of messages sent by the client
example: 987654
first_seen:
type: string
format: date-time
description: Timestamp when the client was first seen
example: "2024-01-11T10:00:00.000Z"
last_seen:
type: string
format: date-time
description: Timestamp when the client was last seen
example: "2024-01-11T12:05:07.449053Z"
Journal:
type: object
properties:
operation:
type: string
example: user.create
description: Journal operation.
occurred_at:
type: string
format: date-time
example: "2024-01-11T12:05:07.449053Z"
description: Time when the journal occurred.
attributes:
type: object
description: Journal attributes.
example:
{
"created_at": "2024-06-12T11:34:32.991591Z",
"id": "29d425c8-542b-4614-8a4d-a5951945d720",
"identity": "Gawne-Havlicek@email.com",
"name": "Newgard-Frisina",
"status": "enabled",
"updated_at": "2024-06-12T11:34:33.116795Z",
"updated_by": "ad228f20-4741-47c5-bef7-d871b541c019",
}
metadata:
type: object
description: Journal payload.
example: { "Update": "Calvo-Felkins" }
xml:
name: journal
JournalPage:
type: object
properties:
journals:
type: array
minItems: 0
uniqueItems: true
items:
$ref: "#/components/schemas/Journal"
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:
- journals
- total
- offset
Error:
type: object
properties:
error:
type: string
description: Error message
example: { "error": "malformed entity specification" }
parameters:
domain_id:
name: domainID
description: Unique identifier for a domain.
in: path
schema:
type: string
format: uuid
required: true
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
client_id:
name: clientID
description: Unique identifier for a client
in: path
schema:
type: string
format: uuid
required: true
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
entity_type:
name: entityType
description: Type of entity, e.g. group, client, channel.
in: path
schema:
type: string
enum:
- group
- client
- channel
required: true
example: group
user_id:
name: userID
description: Unique identifier for a user.
in: path
schema:
type: string
format: uuid
required: true
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
id:
name: id
description: Unique identifier for an entity, e.g. group, channel or client. Used together with entity_type.
in: path
schema:
type: string
format: uuid
required: true
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
offset:
name: offset
description: Number of items to skip during retrieval.
in: query
schema:
type: integer
default: 0
minimum: 0
required: false
example: "0"
limit:
name: limit
description: Size of the subset to retrieve.
in: query
schema:
type: integer
default: 10
maximum: 10
minimum: 1
required: false
example: "10"
operation:
name: operation
description: Journal operation.
in: query
schema:
type: string
required: false
example: user.create
with_attributes:
name: with_attributes
description: Include journal attributes.
in: query
schema:
type: boolean
required: false
example: true
with_metadata:
name: with_metadata
description: Include journal metadata.
in: query
schema:
type: boolean
required: false
example: true
from:
name: from
description: Start date in unix time.
in: query
schema:
type: string
format: int64
required: false
example: 1966777289
to:
name: to
description: End date in unix time.
in: query
schema:
type: string
format: int64
required: false
example: 1966777289
dir:
name: dir
description: Sort direction.
in: query
schema:
type: string
enum:
- asc
- desc
required: false
example: desc
responses:
JournalsPageRes:
description: Data retrieved.
content:
application/json:
schema:
$ref: "#/components/schemas/JournalPage"
HealthRes:
description: Service Health Check.
content:
application/health+json:
schema:
$ref: "./schemas/health_info.yaml"
ServiceError:
description: Unexpected server-side error occurred.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* User access: "Authorization: Bearer <user_access_token>"
security:
- bearerAuth: []
+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'
+431
View File
@@ -0,0 +1,431 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
openapi: 3.0.1
info:
title: SuperMQ twins service
description: |
HTTP API for managing digital twins and their states.
Some useful links:
- [The SuperMQ repository](https://github.com/absmach/supermq)
contact:
email: info@abstractmachines.fr
license:
name: Apache 2.0
url: https://github.com/absmach/supermq/blob/main/LICENSE
version: 0.18.0
servers:
- url: http://localhost:9018
- url: https://localhost:9018
tags:
- name: twins
description: Everything about your Twins
externalDocs:
description: Find out more about twins
url: https://docs.supermq.abstractmachines.fr/
paths:
/twins:
post:
operationId: createTwin
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.
"422":
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
get:
operationId: getTwins
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.
"422":
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
/twins/{twinID}:
get:
operationId: getTwin
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.
"422":
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
put:
operationId: updateTwin
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.
"422":
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
delete:
operationId: removeTwin
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.
"415":
description: Missing or invalid content type.
"422":
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"
/states/{twinID}:
get:
operationId: getStates
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.
"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:
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: SuperMQ 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
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 SuperMQ 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
items:
$ref: "#/components/schemas/Definition"
metadata:
type: object
description: Arbitrary, object-encoded twin's data.
TwinsPage:
type: object
properties:
twins:
type: array
minItems: 0
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:
states:
type: array
minItems: 0
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:
- states
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"
links:
update:
operationId: updateTwin
parameters:
twinID: $response.body#/id
delete:
operationId: removeTwin
parameters:
twinID: $response.body#/id
states:
operationId: getStates
parameters:
twinID: $response.body#/id
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/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
+449
View File
@@ -0,0 +1,449 @@
# Auth - Authentication and Authorization service
Auth service provides authentication features as an API for managing authentication keys as well as administering groups of entities - `clients` and `users`.
## 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 SuperMQ 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 four types of authentication keys:
- 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 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 SuperMQ, please check out the [official documentation][doc].
The following actions are supported:
- create (all key types)
- verify (all key types)
- obtain (API keys only)
- revoke (API keys only)
## Domains
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.
| Variable | Description | Default |
| ----------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------ |
| SMQ_AUTH_LOG_LEVEL | Log level for the Auth service (debug, info, warn, error) | info |
| SMQ_AUTH_DB_HOST | Database host address | localhost |
| SMQ_AUTH_DB_PORT | Database host port | 5432 |
| SMQ_AUTH_DB_USER | Database user | supermq |
| SMQ_AUTH_DB_PASSWORD | Database password | supermq |
| SMQ_AUTH_DB_NAME | Name of the database used by the service | auth |
| SMQ_AUTH_DB_SSL_MODE | Database connection SSL mode (disable, require, verify-ca, verify-full) | disable |
| SMQ_AUTH_DB_SSL_CERT | Path to the PEM encoded certificate file | "" |
| SMQ_AUTH_DB_SSL_KEY | Path to the PEM encoded key file | "" |
| SMQ_AUTH_DB_SSL_ROOT_CERT | Path to the PEM encoded root certificate file | "" |
| SMQ_AUTH_HTTP_HOST | Auth service HTTP host | "" |
| SMQ_AUTH_HTTP_PORT | Auth service HTTP port | 8189 |
| SMQ_AUTH_HTTP_SERVER_CERT | Path to the PEM encoded HTTP server certificate file | "" |
| SMQ_AUTH_HTTP_SERVER_KEY | Path to the PEM encoded HTTP server key file | "" |
| SMQ_AUTH_GRPC_HOST | Auth service gRPC host | "" |
| SMQ_AUTH_GRPC_PORT | Auth service gRPC port | 8181 |
| SMQ_AUTH_GRPC_SERVER_CERT | Path to the PEM encoded gRPC server certificate file | "" |
| SMQ_AUTH_GRPC_SERVER_KEY | Path to the PEM encoded gRPC server key file | "" |
| SMQ_AUTH_GRPC_SERVER_CA_CERTS | Path to the PEM encoded gRPC server CA certificate file | "" |
| SMQ_AUTH_GRPC_CLIENT_CA_CERTS | Path to the PEM encoded gRPC client CA certificate file | "" |
| SMQ_AUTH_SECRET_KEY | String used for signing tokens | secret |
| SMQ_AUTH_ACCESS_TOKEN_DURATION | The access token expiration period | 1h |
| SMQ_AUTH_REFRESH_TOKEN_DURATION | The refresh token expiration period | 24h |
| SMQ_AUTH_INVITATION_DURATION | The invitation token expiration period | 168h |
| SMQ_AUTH_CACHE_URL | Redis URL for caching PAT scopes | redis://localhost:6379/0 |
| SMQ_AUTH_CACHE_KEY_DURATION | Duration for which PAT scope cache keys are valid | 10m |
| SMQ_SPICEDB_HOST | SpiceDB host address | localhost |
| SMQ_SPICEDB_PORT | SpiceDB host port | 50051 |
| SMQ_SPICEDB_PRE_SHARED_KEY | SpiceDB pre-shared key | 12345678 |
| SMQ_SPICEDB_SCHEMA_FILE | Path to SpiceDB schema file | ./docker/spicedb/schema.zed |
| SMQ_JAEGER_URL | Jaeger server URL | <http://jaeger:4318/v1/traces> |
| SMQ_JAEGER_TRACE_RATIO | Jaeger sampling ratio | 1.0 |
| SMQ_SEND_TELEMETRY | Send telemetry to supermq call home server | true |
| SMQ_ADAPTER_INSTANCE_ID | Adapter instance ID | "" |
| SMQ_CALLOUT_URLS | Comma-separated list of callout URLs | "" |
| SMQ_CALLOUT_METHOD | Callout method | POST |
| SMQ_CALLOUT_TLS_VERIFICATION | Enable TLS verification for callouts | true |
| SMQ_CALLOUT_TIMEOUT | Callout timeout | 10s |
| SMQ_CALLOUT_CA_CERT | Path to CA certificate file | "" |
| SMQ_CALLOUT_CERT | Path to client certificate file | "" |
| SMQ_CALLOUT_KEY | Path to client key file | "" |
| SMQ_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/absmach/supermq/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
git clone https://github.com/absmach/supermq
cd supermq
# compile the service
make auth
# copy binary to bin
make install
# set the environment variables and run the service
SMQ_AUTH_LOG_LEVEL=info \
SMQ_AUTH_DB_HOST=localhost \
SMQ_AUTH_DB_PORT=5432 \
SMQ_AUTH_DB_USER=supermq \
SMQ_AUTH_DB_PASSWORD=supermq \
SMQ_AUTH_DB_NAME=auth \
SMQ_AUTH_DB_SSL_MODE=disable \
SMQ_AUTH_DB_SSL_CERT="" \
SMQ_AUTH_DB_SSL_KEY="" \
SMQ_AUTH_DB_SSL_ROOT_CERT="" \
SMQ_AUTH_HTTP_HOST=localhost \
SMQ_AUTH_HTTP_PORT=8189 \
SMQ_AUTH_HTTP_SERVER_CERT="" \
SMQ_AUTH_HTTP_SERVER_KEY="" \
SMQ_AUTH_GRPC_HOST=localhost \
SMQ_AUTH_GRPC_PORT=8181 \
SMQ_AUTH_GRPC_SERVER_CERT="" \
SMQ_AUTH_GRPC_SERVER_KEY="" \
SMQ_AUTH_GRPC_SERVER_CA_CERTS="" \
SMQ_AUTH_GRPC_CLIENT_CA_CERTS="" \
SMQ_AUTH_SECRET_KEY=secret \
SMQ_AUTH_ACCESS_TOKEN_DURATION=1h \
SMQ_AUTH_REFRESH_TOKEN_DURATION=24h \
SMQ_AUTH_INVITATION_DURATION=168h \
SMQ_SPICEDB_HOST=localhost \
SMQ_SPICEDB_PORT=50051 \
SMQ_SPICEDB_PRE_SHARED_KEY=12345678 \
SMQ_SPICEDB_SCHEMA_FILE=./docker/spicedb/schema.zed \
SMQ_JAEGER_URL=http://localhost:14268/api/traces \
SMQ_JAEGER_TRACE_RATIO=1.0 \
SMQ_SEND_TELEMETRY=true \
SMQ_AUTH_ADAPTER_INSTANCE_ID="" \
SMQ_CALLOUT_URLS="" \
SMQ_CALLOUT_METHOD="POST" \
SMQ_CALLOUT_TLS_VERIFICATION=true \
$GOBIN/supermq-auth
```
Setting `SMQ_AUTH_HTTP_SERVER_CERT` and `SMQ_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 `SMQ_AUTH_GRPC_SERVER_CERT` and `SMQ_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 `SMQ_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 `SMQ_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 SuperMQ APIs without using your primary credentials. They are particularly useful for automation, CI/CD pipelines, and integrating with third-party services.
### Overview
PATs in SuperMQ 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:
```
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
SuperMQ 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:
```
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://docs.api.supermq.abstractmachines.fr/?urls.primaryName=auth.yaml).
[doc]: https://docs.supermq.abstractmachines.fr
+5
View File
@@ -0,0 +1,5 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Package api contains implementation of Auth service HTTP API.
package api
+179
View File
@@ -0,0 +1,179 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package auth
import (
"context"
"time"
grpcAuthV1 "github.com/absmach/supermq/api/grpc/auth/v1"
"github.com/absmach/supermq/auth"
grpcapi "github.com/absmach/supermq/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
authenticatePAT endpoint.Endpoint
authorize endpoint.Endpoint
authorizePAT 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(),
authenticatePAT: kitgrpc.NewClient(
conn,
authSvcName,
"AuthenticatePAT",
encodeIdentifyRequest,
decodeIdentifyPATResponse,
grpcAuthV1.AuthNRes{},
).Endpoint(),
authorize: kitgrpc.NewClient(
conn,
authSvcName,
"Authorize",
encodeAuthorizeRequest,
decodeAuthorizeResponse,
grpcAuthV1.AuthZRes{},
).Endpoint(),
authorizePAT: kitgrpc.NewClient(
conn,
authSvcName,
"AuthorizePAT",
encodeAuthorizePATRequest,
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}, 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()}, nil
}
func (client authGrpcClient) AuthenticatePAT(ctx context.Context, token *grpcAuthV1.AuthNReq, _ ...grpc.CallOption) (*grpcAuthV1.AuthNRes, error) {
ctx, cancel := context.WithTimeout(ctx, client.timeout)
defer cancel()
res, err := client.authenticatePAT(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)}, nil
}
func decodeIdentifyPATResponse(_ context.Context, grpcRes any) (any, error) {
res := grpcRes.(*grpcAuthV1.AuthNRes)
return authenticateRes{id: res.GetId(), userID: res.GetUserId(), userRole: auth.Role(res.UserRole)}, 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()
res, err := client.authorize(ctx, authReq{
Domain: req.GetDomain(),
SubjectType: req.GetSubjectType(),
Subject: req.GetSubject(),
SubjectKind: req.GetSubjectKind(),
Relation: req.GetRelation(),
Permission: req.GetPermission(),
ObjectType: req.GetObjectType(),
Object: req.GetObject(),
})
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)
return &grpcAuthV1.AuthZReq{
Domain: req.Domain,
SubjectType: req.SubjectType,
Subject: req.Subject,
SubjectKind: req.SubjectKind,
Relation: req.Relation,
Permission: req.Permission,
ObjectType: req.ObjectType,
Object: req.Object,
}, nil
}
func (client authGrpcClient) AuthorizePAT(ctx context.Context, req *grpcAuthV1.AuthZPatReq, _ ...grpc.CallOption) (r *grpcAuthV1.AuthZRes, err error) {
ctx, cancel := context.WithTimeout(ctx, client.timeout)
defer cancel()
res, err := client.authorizePAT(ctx, authPATReq{
userID: req.GetUserId(),
patID: req.GetPatId(),
entityType: auth.EntityType(req.GetEntityType()),
optionalDomainID: req.GetOptionalDomainId(),
operation: auth.Operation(req.GetOperation()),
entityID: req.GetEntityId(),
})
if err != nil {
return &grpcAuthV1.AuthZRes{}, grpcapi.DecodeError(err)
}
ar := res.(authorizeRes)
return &grpcAuthV1.AuthZRes{Authorized: ar.authorized, Id: ar.id}, nil
}
func encodeAuthorizePATRequest(_ context.Context, grpcReq any) (any, error) {
req := grpcReq.(authPATReq)
return &grpcAuthV1.AuthZPatReq{
UserId: req.userID,
PatId: req.patID,
EntityType: uint32(req.entityType),
OptionalDomainId: req.optionalDomainID,
Operation: uint32(req.operation),
EntityId: req.entityID,
}, 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
+83
View File
@@ -0,0 +1,83 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package auth
import (
"context"
"github.com/absmach/supermq/auth"
"github.com/absmach/supermq/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{userID: key.Subject, userRole: key.Role, verified: key.Verified}, nil
}
}
func authenticatePATEndpoint(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
}
pat, err := svc.IdentifyPAT(ctx, req.token)
if err != nil {
return authenticateRes{}, err
}
return authenticateRes{id: pat.ID, userID: pat.User, userRole: pat.Role}, 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
}
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,
})
if err != nil {
return authorizeRes{authorized: false}, err
}
return authorizeRes{authorized: true}, nil
}
}
func authorizePATEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(authPATReq)
if err := req.validate(); err != nil {
return authorizeRes{}, err
}
err := svc.AuthorizePAT(ctx, req.userID, req.patID, req.entityType, req.optionalDomainID, req.operation, req.entityID)
if err != nil {
return authorizeRes{authorized: false}, err
}
return authorizeRes{authorized: true}, nil
}
}
+374
View File
@@ -0,0 +1,374 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package auth_test
import (
"context"
"fmt"
"net"
"testing"
"time"
grpcAuthV1 "github.com/absmach/supermq/api/grpc/auth/v1"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/auth"
grpcapi "github.com/absmach/supermq/auth/api/grpc/auth"
"github.com/absmach/supermq/internal/testsutil"
"github.com/absmach/supermq/pkg/errors"
svcerr "github.com/absmach/supermq/pkg/errors/service"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
const (
port = 8081
secret = "secret"
email = "test@example.com"
id = "testID"
clientsType = "clients"
usersType = "users"
description = "Description"
groupName = "smqx"
adminPermission = "admin"
authoritiesObj = "authorities"
memberRelation = "member"
loginDuration = 30 * time.Minute
refreshDuration = 24 * time.Hour
invalidDuration = 7 * 24 * time.Hour
validToken = "valid"
inValidToken = "invalid"
validPATToken = "valid"
inValidPATToken = "invalid"
validPolicy = "valid"
)
var (
domainID = testsutil.GenerateUUID(&testing.T{})
authAddr = fmt.Sprintf("localhost:%d", port)
clientID = testsutil.GenerateUUID(&testing.T{})
)
func startGRPCServer(svc auth.Service, port int) *grpc.Server {
listener, _ := net.Listen("tcp", fmt.Sprintf(":%d", port))
server := grpc.NewServer()
grpcAuthV1.RegisterAuthServiceServer(server, grpcapi.NewAuthServer(svc))
go func() {
err := server.Serve(listener)
assert.Nil(&testing.T{}, err, fmt.Sprintf(`"Unexpected error creating auth server %s"`, err))
}()
return server
}
func TestIdentify(t *testing.T) {
conn, err := grpc.NewClient(authAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
assert.Nil(t, err, fmt.Sprintf("Unexpected error creating client connection %s", err))
defer conn.Close()
grpcClient := grpcapi.NewAuthClient(conn, time.Second)
cases := []struct {
desc string
token string
idt *grpcAuthV1.AuthNRes
svcErr error
err error
}{
{
desc: "authenticate user with valid user token",
token: validToken,
idt: &grpcAuthV1.AuthNRes{UserId: id, UserRole: uint32(auth.UserRole)},
err: nil,
},
{
desc: "authenticate user with invalid user token",
token: "invalid",
idt: &grpcAuthV1.AuthNRes{},
svcErr: svcerr.ErrAuthentication,
err: svcerr.ErrAuthentication,
},
{
desc: "authenticate user with empty token",
token: "",
idt: &grpcAuthV1.AuthNRes{},
err: apiutil.ErrBearerToken,
},
}
for _, tc := range cases {
t.Run(tc.desc, func(t *testing.T) {
svcCall := svc.On("Identify", mock.Anything, mock.Anything).Return(auth.Key{Subject: id, Role: auth.UserRole}, tc.svcErr)
idt, err := grpcClient.Authenticate(context.Background(), &grpcAuthV1.AuthNReq{Token: tc.token})
if idt != nil {
assert.Equal(t, tc.idt, idt, fmt.Sprintf("%s: expected %v got %v", tc.desc, tc.idt, idt))
}
assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err))
svcCall.Unset()
})
}
}
func TestAuthorize(t *testing.T) {
conn, err := grpc.NewClient(authAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
assert.Nil(t, err, fmt.Sprintf("Unexpected error creating client connection %s", err))
defer conn.Close()
grpcClient := grpcapi.NewAuthClient(conn, time.Second)
cases := []struct {
desc string
token string
authRequest *grpcAuthV1.AuthZReq
authResponse *grpcAuthV1.AuthZRes
err error
}{
{
desc: "authorize user with authorized token",
token: validToken,
authRequest: &grpcAuthV1.AuthZReq{
Subject: id,
SubjectType: usersType,
Object: authoritiesObj,
ObjectType: usersType,
Relation: memberRelation,
Permission: adminPermission,
},
authResponse: &grpcAuthV1.AuthZRes{Authorized: true},
err: nil,
},
{
desc: "authorize user with unauthorized token",
token: inValidToken,
authRequest: &grpcAuthV1.AuthZReq{
Subject: id,
SubjectType: usersType,
Object: authoritiesObj,
ObjectType: usersType,
Relation: memberRelation,
Permission: adminPermission,
},
authResponse: &grpcAuthV1.AuthZRes{Authorized: false},
err: svcerr.ErrAuthorization,
},
{
desc: "authorize user with empty subject",
token: validToken,
authRequest: &grpcAuthV1.AuthZReq{
Subject: "",
SubjectType: usersType,
Object: authoritiesObj,
ObjectType: usersType,
Relation: memberRelation,
Permission: adminPermission,
},
authResponse: &grpcAuthV1.AuthZRes{Authorized: false},
err: apiutil.ErrMissingPolicySub,
},
{
desc: "authorize user with empty subject type",
token: validToken,
authRequest: &grpcAuthV1.AuthZReq{
Subject: id,
SubjectType: "",
Object: authoritiesObj,
ObjectType: usersType,
Relation: memberRelation,
Permission: adminPermission,
},
authResponse: &grpcAuthV1.AuthZRes{Authorized: false},
err: apiutil.ErrMissingPolicySub,
},
{
desc: "authorize user with empty object",
token: validToken,
authRequest: &grpcAuthV1.AuthZReq{
Subject: id,
SubjectType: usersType,
Object: "",
ObjectType: usersType,
Relation: memberRelation,
Permission: adminPermission,
},
authResponse: &grpcAuthV1.AuthZRes{Authorized: false},
err: apiutil.ErrMissingPolicyObj,
},
{
desc: "authorize user with empty object type",
token: validToken,
authRequest: &grpcAuthV1.AuthZReq{
Subject: id,
SubjectType: usersType,
Object: authoritiesObj,
ObjectType: "",
Relation: memberRelation,
Permission: adminPermission,
},
authResponse: &grpcAuthV1.AuthZRes{Authorized: false},
err: apiutil.ErrMissingPolicyObj,
},
{
desc: "authorize user with empty permission",
token: validToken,
authRequest: &grpcAuthV1.AuthZReq{
Subject: id,
SubjectType: usersType,
Object: authoritiesObj,
ObjectType: usersType,
Relation: memberRelation,
Permission: "",
},
authResponse: &grpcAuthV1.AuthZRes{Authorized: false},
err: apiutil.ErrMalformedPolicyPer,
},
}
for _, tc := range cases {
t.Run(tc.desc, func(t *testing.T) {
svcCall := svc.On("Authorize", mock.Anything, mock.Anything).Return(tc.err)
ar, err := grpcClient.Authorize(context.Background(), tc.authRequest)
if ar != nil {
assert.Equal(t, tc.authResponse, ar, fmt.Sprintf("%s: expected %v got %v", tc.desc, tc.authResponse, ar))
}
assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err))
svcCall.Unset()
})
}
}
func TestIdentifyPAT(t *testing.T) {
conn, err := grpc.NewClient(authAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
assert.Nil(t, err, fmt.Sprintf("Unexpected error creating client connection %s", err))
defer conn.Close()
grpcClient := grpcapi.NewAuthClient(conn, time.Second)
cases := []struct {
desc string
token string
idt *grpcAuthV1.AuthNRes
svcErr error
err error
}{
{
desc: "authenticate user with valid user token",
token: validToken,
idt: &grpcAuthV1.AuthNRes{Id: id, UserId: clientID},
err: nil,
},
{
desc: "authenticate user with invalid user token",
token: "invalid",
idt: &grpcAuthV1.AuthNRes{},
svcErr: svcerr.ErrAuthentication,
err: svcerr.ErrAuthentication,
},
{
desc: "authenticate user with empty token",
token: "",
idt: &grpcAuthV1.AuthNRes{},
err: apiutil.ErrBearerToken,
},
}
for _, tc := range cases {
t.Run(tc.desc, func(t *testing.T) {
svcCall := svc.On("IdentifyPAT", mock.Anything, tc.token).Return(auth.PAT{ID: id, User: clientID, IssuedAt: time.Now()}, tc.svcErr)
idt, err := grpcClient.AuthenticatePAT(context.Background(), &grpcAuthV1.AuthNReq{Token: tc.token})
if idt != nil {
assert.Equal(t, tc.idt, idt, fmt.Sprintf("%s: expected %v got %v", tc.desc, tc.idt, idt))
}
assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err))
svcCall.Unset()
})
}
}
func TestAuthorizePAT(t *testing.T) {
conn, err := grpc.NewClient(authAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
assert.Nil(t, err, fmt.Sprintf("Unexpected error creating client connection %s", err))
defer conn.Close()
grpcClient := grpcapi.NewAuthClient(conn, time.Second)
cases := []struct {
desc string
token string
authRequest *grpcAuthV1.AuthZPatReq
authResponse *grpcAuthV1.AuthZRes
err error
}{
{
desc: "authorize user with authorized token",
token: validPATToken,
authRequest: &grpcAuthV1.AuthZPatReq{
UserId: id,
PatId: id,
EntityType: uint32(auth.ClientsType),
OptionalDomainId: domainID,
Operation: uint32(auth.CreateOp),
EntityId: clientID,
},
authResponse: &grpcAuthV1.AuthZRes{Authorized: true},
err: nil,
},
{
desc: "authorize user with unauthorized token",
token: inValidPATToken,
authRequest: &grpcAuthV1.AuthZPatReq{
UserId: id,
PatId: id,
EntityType: uint32(auth.ClientsType),
OptionalDomainId: domainID,
Operation: uint32(auth.CreateOp),
EntityId: clientID,
},
authResponse: &grpcAuthV1.AuthZRes{Authorized: false},
err: svcerr.ErrAuthorization,
},
{
desc: "authorize user with missing user id",
token: validPATToken,
authRequest: &grpcAuthV1.AuthZPatReq{
PatId: id,
EntityType: uint32(auth.ClientsType),
OptionalDomainId: domainID,
Operation: uint32(auth.CreateOp),
EntityId: clientID,
},
authResponse: &grpcAuthV1.AuthZRes{Authorized: false},
err: apiutil.ErrMissingUserID,
},
{
desc: "authorize user with missing pat id",
token: validPATToken,
authRequest: &grpcAuthV1.AuthZPatReq{
UserId: id,
EntityType: uint32(auth.ClientsType),
OptionalDomainId: domainID,
Operation: uint32(auth.CreateOp),
EntityId: clientID,
},
authResponse: &grpcAuthV1.AuthZRes{Authorized: false},
err: apiutil.ErrMissingPATID,
},
}
for _, tc := range cases {
t.Run(tc.desc, func(t *testing.T) {
svcCall := svc.On("AuthorizePAT",
mock.Anything,
tc.authRequest.UserId,
tc.authRequest.PatId,
mock.Anything,
tc.authRequest.OptionalDomainId,
mock.Anything,
mock.Anything,
mock.Anything).Return(tc.err)
ar, err := grpcClient.AuthorizePAT(context.Background(), tc.authRequest)
if ar != nil {
assert.Equal(t, tc.authResponse, ar, fmt.Sprintf("%s: expected %v got %v", tc.desc, tc.authResponse, ar))
}
assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err))
svcCall.Unset()
})
}
}
+71
View File
@@ -0,0 +1,71 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package auth
import (
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/auth"
)
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
}
func (req authReq) validate() error {
if req.Subject == "" || req.SubjectType == "" {
return apiutil.ErrMissingPolicySub
}
if req.Object == "" || req.ObjectType == "" {
return apiutil.ErrMissingPolicyObj
}
if req.Permission == "" {
return apiutil.ErrMalformedPolicyPer
}
return nil
}
type authPATReq struct {
userID string
patID string
entityType auth.EntityType
optionalDomainID string
operation auth.Operation
entityID string
}
func (req authPATReq) validate() error {
if req.userID == "" {
return apiutil.ErrMissingUserID
}
if req.patID == "" {
return apiutil.ErrMissingPATID
}
return nil
}
+18
View File
@@ -0,0 +1,18 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package auth
import smqauth "github.com/absmach/supermq/auth"
type authenticateRes struct {
id string
userID string
userRole smqauth.Role
verified bool
}
type authorizeRes struct {
id string
authorized bool
}
+130
View File
@@ -0,0 +1,130 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package auth
import (
"context"
grpcAuthV1 "github.com/absmach/supermq/api/grpc/auth/v1"
"github.com/absmach/supermq/auth"
grpcapi "github.com/absmach/supermq/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
authenticatePAT kitgrpc.Handler
authorizePAT 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,
),
authenticatePAT: kitgrpc.NewServer(
(authenticatePATEndpoint(svc)),
decodeAuthenticateRequest,
encodeAuthenticatePATResponse,
),
authorizePAT: kitgrpc.NewServer(
(authorizePATEndpoint(svc)),
decodeAuthorizePATRequest,
encodeAuthorizeResponse,
),
}
}
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) AuthenticatePAT(ctx context.Context, req *grpcAuthV1.AuthNReq) (*grpcAuthV1.AuthNRes, error) {
_, res, err := s.authenticatePAT.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}, nil
}
func encodeAuthenticatePATResponse(_ context.Context, grpcRes any) (any, error) {
res := grpcRes.(authenticateRes)
return &grpcAuthV1.AuthNRes{Id: res.id, UserId: res.userID, UserRole: uint32(res.userRole)}, nil
}
func decodeAuthorizeRequest(_ context.Context, grpcReq any) (any, error) {
req := grpcReq.(*grpcAuthV1.AuthZReq)
return authReq{
Domain: req.GetDomain(),
SubjectType: req.GetSubjectType(),
SubjectKind: req.GetSubjectKind(),
Subject: req.GetSubject(),
Relation: req.GetRelation(),
Permission: req.GetPermission(),
ObjectType: req.GetObjectType(),
Object: req.GetObject(),
}, nil
}
func encodeAuthorizeResponse(_ context.Context, grpcRes any) (any, error) {
res := grpcRes.(authorizeRes)
return &grpcAuthV1.AuthZRes{Authorized: res.authorized, Id: res.id}, nil
}
func decodeAuthorizePATRequest(_ context.Context, grpcReq any) (any, error) {
req := grpcReq.(*grpcAuthV1.AuthZPatReq)
return authPATReq{
userID: req.GetUserId(),
patID: req.GetPatId(),
entityType: auth.EntityType(req.GetEntityType()),
optionalDomainID: req.GetOptionalDomainId(),
operation: auth.Operation(req.GetOperation()),
entityID: req.GetEntityId(),
}, nil
}
func (s *authGrpcServer) AuthorizePAT(ctx context.Context, req *grpcAuthV1.AuthZPatReq) (*grpcAuthV1.AuthZRes, error) {
_, res, err := s.authorizePAT.ServeGRPC(ctx, req)
if err != nil {
return nil, grpcapi.EncodeError(err)
}
return res.(*grpcAuthV1.AuthZRes), nil
}
+24
View File
@@ -0,0 +1,24 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package auth_test
import (
"os"
"testing"
"github.com/absmach/supermq/auth/mocks"
)
var svc *mocks.Service
func TestMain(m *testing.M) {
svc = new(mocks.Service)
server := startGRPCServer(svc, port)
code := m.Run()
server.GracefulStop()
os.Exit(code)
}
+99
View File
@@ -0,0 +1,99 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package token
import (
"context"
"time"
grpcTokenV1 "github.com/absmach/supermq/api/grpc/token/v1"
"github.com/absmach/supermq/auth"
grpcapi "github.com/absmach/supermq/auth/api/grpc"
"github.com/go-kit/kit/endpoint"
kitgrpc "github.com/go-kit/kit/transport/grpc"
"google.golang.org/grpc"
)
const tokenSvcName = "token.v1.TokenService"
type tokenGrpcClient struct {
issue endpoint.Endpoint
refresh endpoint.Endpoint
timeout time.Duration
}
var _ grpcTokenV1.TokenServiceClient = (*tokenGrpcClient)(nil)
// NewAuthClient returns new auth gRPC client instance.
func NewTokenClient(conn *grpc.ClientConn, timeout time.Duration) grpcTokenV1.TokenServiceClient {
return &tokenGrpcClient{
issue: kitgrpc.NewClient(
conn,
tokenSvcName,
"Issue",
encodeIssueRequest,
decodeIssueResponse,
grpcTokenV1.Token{},
).Endpoint(),
refresh: kitgrpc.NewClient(
conn,
tokenSvcName,
"Refresh",
encodeRefreshRequest,
decodeRefreshResponse,
grpcTokenV1.Token{},
).Endpoint(),
timeout: timeout,
}
}
func (client tokenGrpcClient) Issue(ctx context.Context, req *grpcTokenV1.IssueReq, _ ...grpc.CallOption) (*grpcTokenV1.Token, error) {
ctx, cancel := context.WithTimeout(ctx, client.timeout)
defer cancel()
res, err := client.issue(ctx, issueReq{
userID: req.GetUserId(),
userRole: auth.Role(req.GetUserRole()),
keyType: auth.KeyType(req.GetType()),
verified: req.GetVerified(),
})
if err != nil {
return &grpcTokenV1.Token{}, grpcapi.DecodeError(err)
}
return res.(*grpcTokenV1.Token), nil
}
func encodeIssueRequest(_ context.Context, grpcReq any) (any, error) {
req := grpcReq.(issueReq)
return &grpcTokenV1.IssueReq{
UserId: req.userID,
UserRole: uint32(req.userRole),
Type: uint32(req.keyType),
Verified: req.verified,
}, nil
}
func decodeIssueResponse(_ context.Context, grpcRes any) (any, error) {
return grpcRes, nil
}
func (client tokenGrpcClient) Refresh(ctx context.Context, req *grpcTokenV1.RefreshReq, _ ...grpc.CallOption) (*grpcTokenV1.Token, error) {
ctx, cancel := context.WithTimeout(ctx, client.timeout)
defer cancel()
res, err := client.refresh(ctx, refreshReq{refreshToken: req.GetRefreshToken(), verified: req.GetVerified()})
if err != nil {
return &grpcTokenV1.Token{}, grpcapi.DecodeError(err)
}
return res.(*grpcTokenV1.Token), nil
}
func encodeRefreshRequest(_ context.Context, grpcReq any) (any, error) {
req := grpcReq.(refreshReq)
return &grpcTokenV1.RefreshReq{RefreshToken: req.refreshToken, Verified: req.verified}, nil
}
func decodeRefreshResponse(_ context.Context, grpcRes any) (any, error) {
return grpcRes, nil
}
+5
View File
@@ -0,0 +1,5 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Package grpc contains implementation of Auth service gRPC API.
package token
+58
View File
@@ -0,0 +1,58 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package token
import (
"context"
"github.com/absmach/supermq/auth"
"github.com/go-kit/kit/endpoint"
)
func issueEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(issueReq)
if err := req.validate(); err != nil {
return issueRes{}, err
}
key := auth.Key{
Type: req.keyType,
Subject: req.userID,
Role: req.userRole,
Verified: req.verified,
}
tkn, err := svc.Issue(ctx, "", key)
if err != nil {
return issueRes{}, err
}
ret := issueRes{
accessToken: tkn.AccessToken,
refreshToken: tkn.RefreshToken,
accessType: tkn.AccessType,
}
return ret, nil
}
}
func refreshEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(refreshReq)
if err := req.validate(); err != nil {
return issueRes{}, err
}
key := auth.Key{Type: auth.RefreshKey, Verified: req.verified}
tkn, err := svc.Issue(ctx, req.refreshToken, key)
if err != nil {
return issueRes{}, err
}
ret := issueRes{
accessToken: tkn.AccessToken,
refreshToken: tkn.RefreshToken,
accessType: tkn.AccessType,
}
return ret, nil
}
}
+169
View File
@@ -0,0 +1,169 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package token_test
import (
"context"
"fmt"
"net"
"testing"
"time"
grpcTokenV1 "github.com/absmach/supermq/api/grpc/token/v1"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/auth"
grpcapi "github.com/absmach/supermq/auth/api/grpc/token"
"github.com/absmach/supermq/internal/testsutil"
"github.com/absmach/supermq/pkg/errors"
svcerr "github.com/absmach/supermq/pkg/errors/service"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
const (
port = 8082
secret = "secret"
email = "test@example.com"
id = "testID"
clientsType = "clients"
usersType = "users"
description = "Description"
groupName = "smqx"
adminPermission = "admin"
authoritiesObj = "authorities"
memberRelation = "member"
loginDuration = 30 * time.Minute
refreshDuration = 24 * time.Hour
invalidDuration = 7 * 24 * time.Hour
validToken = "valid"
inValidToken = "invalid"
validPolicy = "valid"
)
var (
validID = testsutil.GenerateUUID(&testing.T{})
authAddr = fmt.Sprintf("localhost:%d", port)
)
func startGRPCServer(svc auth.Service, port int) *grpc.Server {
listener, _ := net.Listen("tcp", fmt.Sprintf(":%d", port))
server := grpc.NewServer()
grpcTokenV1.RegisterTokenServiceServer(server, grpcapi.NewTokenServer(svc))
go func() {
err := server.Serve(listener)
assert.Nil(&testing.T{}, err, fmt.Sprintf(`"Unexpected error creating auth server %s"`, err))
}()
return server
}
func TestIssue(t *testing.T) {
conn, err := grpc.NewClient(authAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
defer conn.Close()
assert.Nil(t, err, fmt.Sprintf("Unexpected error creating client connection %s", err))
grpcClient := grpcapi.NewTokenClient(conn, time.Second)
cases := []struct {
desc string
userId string
kind auth.KeyType
issueResponse auth.Token
err error
}{
{
desc: "issue for user with valid token",
userId: validID,
kind: auth.AccessKey,
issueResponse: auth.Token{
AccessToken: validToken,
RefreshToken: validToken,
},
err: nil,
},
{
desc: "issue recovery key",
userId: validID,
kind: auth.RecoveryKey,
issueResponse: auth.Token{
AccessToken: validToken,
RefreshToken: validToken,
},
err: nil,
},
{
desc: "issue API key unauthenticated",
userId: validID,
kind: auth.APIKey,
issueResponse: auth.Token{},
err: svcerr.ErrAuthentication,
},
{
desc: "issue for invalid key type",
userId: validID,
kind: 32,
issueResponse: auth.Token{},
err: errors.ErrMalformedEntity,
},
{
desc: "issue for user that does notexist",
userId: "",
kind: auth.APIKey,
issueResponse: auth.Token{},
err: svcerr.ErrAuthentication,
},
}
for _, tc := range cases {
svcCall := svc.On("Issue", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(tc.issueResponse, tc.err)
_, err := grpcClient.Issue(context.Background(), &grpcTokenV1.IssueReq{UserId: tc.userId, Type: uint32(tc.kind)})
assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err))
svcCall.Unset()
}
}
func TestRefresh(t *testing.T) {
conn, err := grpc.NewClient(authAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
defer conn.Close()
assert.Nil(t, err, fmt.Sprintf("Unexpected error creating client connection %s", err))
grpcClient := grpcapi.NewTokenClient(conn, time.Second)
cases := []struct {
desc string
token string
issueResponse auth.Token
err error
}{
{
desc: "refresh token with valid token",
token: validToken,
issueResponse: auth.Token{
AccessToken: validToken,
RefreshToken: validToken,
},
err: nil,
},
{
desc: "refresh token with invalid token",
token: inValidToken,
issueResponse: auth.Token{},
err: svcerr.ErrAuthentication,
},
{
desc: "refresh token with empty token",
token: "",
issueResponse: auth.Token{},
err: apiutil.ErrMissingSecret,
},
}
for _, tc := range cases {
svcCall := svc.On("Issue", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(tc.issueResponse, tc.err)
_, err := grpcClient.Refresh(context.Background(), &grpcTokenV1.RefreshReq{RefreshToken: tc.token})
assert.True(t, errors.Contains(err, tc.err), fmt.Sprintf("%s: expected %s got %s\n", tc.desc, tc.err, err))
svcCall.Unset()
}
}
+40
View File
@@ -0,0 +1,40 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package token
import (
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/auth"
)
type issueReq struct {
userID string
userRole auth.Role
keyType auth.KeyType
verified bool
}
func (req issueReq) validate() error {
if req.keyType != auth.AccessKey &&
req.keyType != auth.APIKey &&
req.keyType != auth.RecoveryKey &&
req.keyType != auth.InvitationKey {
return apiutil.ErrInvalidAuthKey
}
return nil
}
type refreshReq struct {
refreshToken string
verified bool
}
func (req refreshReq) validate() error {
if req.refreshToken == "" {
return apiutil.ErrMissingSecret
}
return nil
}
+10
View File
@@ -0,0 +1,10 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package token
type issueRes struct {
accessToken string
refreshToken string
accessType string
}
+78
View File
@@ -0,0 +1,78 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package token
import (
"context"
grpcTokenV1 "github.com/absmach/supermq/api/grpc/token/v1"
"github.com/absmach/supermq/auth"
grpcapi "github.com/absmach/supermq/auth/api/grpc"
kitgrpc "github.com/go-kit/kit/transport/grpc"
)
var _ grpcTokenV1.TokenServiceServer = (*tokenGrpcServer)(nil)
type tokenGrpcServer struct {
grpcTokenV1.UnimplementedTokenServiceServer
issue kitgrpc.Handler
refresh kitgrpc.Handler
}
// NewAuthServer returns new AuthnServiceServer instance.
func NewTokenServer(svc auth.Service) grpcTokenV1.TokenServiceServer {
return &tokenGrpcServer{
issue: kitgrpc.NewServer(
(issueEndpoint(svc)),
decodeIssueRequest,
encodeIssueResponse,
),
refresh: kitgrpc.NewServer(
(refreshEndpoint(svc)),
decodeRefreshRequest,
encodeIssueResponse,
),
}
}
func (s *tokenGrpcServer) Issue(ctx context.Context, req *grpcTokenV1.IssueReq) (*grpcTokenV1.Token, error) {
_, res, err := s.issue.ServeGRPC(ctx, req)
if err != nil {
return nil, grpcapi.EncodeError(err)
}
return res.(*grpcTokenV1.Token), nil
}
func (s *tokenGrpcServer) Refresh(ctx context.Context, req *grpcTokenV1.RefreshReq) (*grpcTokenV1.Token, error) {
_, res, err := s.refresh.ServeGRPC(ctx, req)
if err != nil {
return nil, grpcapi.EncodeError(err)
}
return res.(*grpcTokenV1.Token), nil
}
func decodeIssueRequest(_ context.Context, grpcReq any) (any, error) {
req := grpcReq.(*grpcTokenV1.IssueReq)
return issueReq{
userID: req.GetUserId(),
userRole: auth.Role(req.GetUserRole()),
keyType: auth.KeyType(req.GetType()),
verified: req.Verified,
}, nil
}
func decodeRefreshRequest(_ context.Context, grpcReq any) (any, error) {
req := grpcReq.(*grpcTokenV1.RefreshReq)
return refreshReq{refreshToken: req.GetRefreshToken(), verified: req.Verified}, nil
}
func encodeIssueResponse(_ context.Context, grpcRes any) (any, error) {
res := grpcRes.(issueRes)
return &grpcTokenV1.Token{
AccessToken: res.accessToken,
RefreshToken: &res.refreshToken,
AccessType: res.accessType,
}, nil
}
+24
View File
@@ -0,0 +1,24 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package token_test
import (
"os"
"testing"
"github.com/absmach/supermq/auth/mocks"
)
var svc *mocks.Service
func TestMain(m *testing.M) {
svc = new(mocks.Service)
server := startGRPCServer(svc, port)
code := m.Run()
server.GracefulStop()
os.Exit(code)
}
+74
View File
@@ -0,0 +1,74 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package grpc
import (
"fmt"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/auth"
"github.com/absmach/supermq/pkg/errors"
svcerr "github.com/absmach/supermq/pkg/errors/service"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
func EncodeError(err error) error {
switch {
case errors.Contains(err, nil):
return nil
case errors.Contains(err, errors.ErrMalformedEntity),
errors.Contains(err, svcerr.ErrInvalidPolicy),
err == apiutil.ErrInvalidAuthKey,
err == apiutil.ErrMissingID,
err == apiutil.ErrMissingMemberType,
err == apiutil.ErrMissingPolicySub,
err == apiutil.ErrMissingPolicyObj,
err == apiutil.ErrMalformedPolicyAct,
err == apiutil.ErrMissingUserID,
err == apiutil.ErrMissingPATID:
return status.Error(codes.InvalidArgument, err.Error())
case errors.Contains(err, svcerr.ErrAuthentication),
errors.Contains(err, auth.ErrKeyExpired),
err == apiutil.ErrMissingEmail,
err == apiutil.ErrBearerToken:
return status.Error(codes.Unauthenticated, err.Error())
case errors.Contains(err, svcerr.ErrAuthorization),
errors.Contains(err, svcerr.ErrDomainAuthorization):
return status.Error(codes.PermissionDenied, err.Error())
case errors.Contains(err, svcerr.ErrNotFound):
return status.Error(codes.NotFound, err.Error())
case errors.Contains(err, svcerr.ErrConflict):
return status.Error(codes.AlreadyExists, err.Error())
default:
return status.Error(codes.Internal, err.Error())
}
}
func DecodeError(err error) error {
if st, ok := status.FromError(err); ok {
switch st.Code() {
case codes.NotFound:
return errors.Wrap(svcerr.ErrNotFound, errors.New(st.Message()))
case codes.InvalidArgument:
return errors.Wrap(errors.ErrMalformedEntity, errors.New(st.Message()))
case codes.AlreadyExists:
return errors.Wrap(svcerr.ErrConflict, errors.New(st.Message()))
case codes.Unauthenticated:
return errors.Wrap(svcerr.ErrAuthentication, errors.New(st.Message()))
case codes.OK:
if msg := st.Message(); msg != "" {
return errors.Wrap(errors.ErrUnidentified, errors.New(msg))
}
return nil
case codes.FailedPrecondition:
return errors.Wrap(errors.ErrMalformedEntity, errors.New(st.Message()))
case codes.PermissionDenied:
return errors.Wrap(svcerr.ErrAuthorization, errors.New(st.Message()))
default:
return errors.Wrap(fmt.Errorf("unexpected gRPC status: %s (status code:%v)", st.Code().String(), st.Code()), errors.New(st.Message()))
}
}
return err
}
+3
View File
@@ -0,0 +1,3 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package http
+87
View File
@@ -0,0 +1,87 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package keys
import (
"context"
"time"
"github.com/absmach/supermq/auth"
"github.com/go-kit/kit/endpoint"
)
func issueEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(issueKeyReq)
if err := req.validate(); err != nil {
return nil, err
}
now := time.Now().UTC()
newKey := auth.Key{
IssuedAt: now,
Type: req.Type,
}
duration := time.Duration(req.Duration * time.Second)
if duration != 0 {
exp := now.Add(duration)
newKey.ExpiresAt = exp
}
tkn, err := svc.Issue(ctx, req.token, newKey)
if err != nil {
return nil, err
}
res := issueKeyRes{
Value: tkn.AccessToken,
}
return res, nil
}
}
func retrieveEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(keyReq)
if err := req.validate(); err != nil {
return nil, err
}
key, err := svc.RetrieveKey(ctx, req.token, req.id)
if err != nil {
return nil, err
}
ret := retrieveKeyRes{
ID: key.ID,
IssuerID: key.Issuer,
Subject: key.Subject,
Type: key.Type,
IssuedAt: key.IssuedAt,
}
if !key.ExpiresAt.IsZero() {
ret.ExpiresAt = &key.ExpiresAt
}
return ret, nil
}
}
func revokeEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(keyReq)
if err := req.validate(); err != nil {
return nil, err
}
if err := svc.Revoke(ctx, req.token, req.id); err != nil {
return nil, err
}
return revokeKeyRes{}, nil
}
}
+354
View File
@@ -0,0 +1,354 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package keys_test
import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/http/httptest"
"strings"
"testing"
"time"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/auth"
httpapi "github.com/absmach/supermq/auth/api/http"
"github.com/absmach/supermq/auth/jwt"
"github.com/absmach/supermq/auth/mocks"
smqlog "github.com/absmach/supermq/logger"
svcerr "github.com/absmach/supermq/pkg/errors/service"
policymocks "github.com/absmach/supermq/pkg/policies/mocks"
"github.com/absmach/supermq/pkg/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
const (
secret = "secret"
contentType = "application/json"
id = "123e4567-e89b-12d3-a456-000000000001"
email = "user@example.com"
loginDuration = 30 * time.Minute
refreshDuration = 24 * time.Hour
invalidDuration = 7 * 24 * time.Hour
)
var (
krepo *mocks.KeyRepository
pEvaluator *policymocks.Evaluator
)
type issueRequest struct {
Duration time.Duration `json:"duration,omitempty"`
Type uint32 `json:"type,omitempty"`
}
type testRequest struct {
client *http.Client
method string
url string
contentType string
token string
body io.Reader
}
func (tr testRequest) make() (*http.Response, error) {
req, err := http.NewRequest(tr.method, tr.url, tr.body)
if err != nil {
return nil, err
}
if tr.token != "" {
req.Header.Set("Authorization", apiutil.BearerPrefix+tr.token)
}
if tr.contentType != "" {
req.Header.Set("Content-Type", tr.contentType)
}
req.Header.Set("Referer", "http://localhost")
return tr.client.Do(req)
}
func newService() auth.Service {
krepo = new(mocks.KeyRepository)
pRepo := new(mocks.PATSRepository)
cache := new(mocks.Cache)
hash := new(mocks.Hasher)
idProvider := uuid.NewMock()
pService := new(policymocks.Service)
pEvaluator = new(policymocks.Evaluator)
t := jwt.New([]byte(secret))
return auth.New(krepo, pRepo, cache, hash, idProvider, t, pEvaluator, pService, loginDuration, refreshDuration, invalidDuration)
}
func newServer(svc auth.Service) *httptest.Server {
mux := httpapi.MakeHandler(svc, smqlog.NewMock(), "")
return httptest.NewServer(mux)
}
func toJSON(data any) string {
jsonData, err := json.Marshal(data)
if err != nil {
return ""
}
return string(jsonData)
}
func TestIssue(t *testing.T) {
svc := newService()
policyCall := pEvaluator.On("CheckPolicy", mock.Anything, mock.Anything).Return(nil)
token, err := svc.Issue(context.Background(), "", auth.Key{Type: auth.AccessKey, Role: auth.UserRole, IssuedAt: time.Now(), Subject: id})
assert.Nil(t, err, fmt.Sprintf("Issuing login key expected to succeed: %s", err))
policyCall.Unset()
ts := newServer(svc)
defer ts.Close()
client := ts.Client()
lk := issueRequest{Type: uint32(auth.AccessKey)}
ak := issueRequest{Type: uint32(auth.APIKey), Duration: time.Hour}
rk := issueRequest{Type: uint32(auth.RecoveryKey)}
cases := []struct {
desc string
req string
ct string
token string
status int
}{
{
desc: "issue login key with empty token",
req: toJSON(lk),
ct: contentType,
token: "",
status: http.StatusUnauthorized,
},
{
desc: "issue API key",
req: toJSON(ak),
ct: contentType,
token: token.AccessToken,
status: http.StatusCreated,
},
{
desc: "issue recovery key",
req: toJSON(rk),
ct: contentType,
token: token.AccessToken,
status: http.StatusCreated,
},
{
desc: "issue login key wrong content type",
req: toJSON(lk),
ct: "",
token: token.AccessToken,
status: http.StatusUnsupportedMediaType,
},
{
desc: "issue recovery key wrong content type",
req: toJSON(rk),
ct: "",
token: token.AccessToken,
status: http.StatusUnsupportedMediaType,
},
{
desc: "issue key with an invalid token",
req: toJSON(ak),
ct: contentType,
token: "wrong",
status: http.StatusUnauthorized,
},
{
desc: "issue recovery key with empty token",
req: toJSON(rk),
ct: contentType,
token: "",
status: http.StatusUnauthorized,
},
{
desc: "issue key with invalid request",
req: "{",
ct: contentType,
token: token.AccessToken,
status: http.StatusBadRequest,
},
{
desc: "issue key with invalid JSON",
req: "{invalid}",
ct: contentType,
token: token.AccessToken,
status: http.StatusBadRequest,
},
{
desc: "issue key with invalid JSON content",
req: `{"Type":{"key":"AccessToken"}}`,
ct: contentType,
token: token.AccessToken,
status: http.StatusBadRequest,
},
}
for _, tc := range cases {
req := testRequest{
client: client,
method: http.MethodPost,
url: fmt.Sprintf("%s/keys", ts.URL),
contentType: tc.ct,
token: tc.token,
body: strings.NewReader(tc.req),
}
repoCall := krepo.On("Save", mock.Anything, mock.Anything).Return("", nil)
policyCall := pEvaluator.On("CheckPolicy", mock.Anything, mock.Anything).Return(nil)
res, err := req.make()
assert.Nil(t, err, fmt.Sprintf("%s: unexpected error %s", tc.desc, err))
assert.Equal(t, tc.status, res.StatusCode, fmt.Sprintf("%s: expected status code %d got %d", tc.desc, tc.status, res.StatusCode))
repoCall.Unset()
policyCall.Unset()
}
}
func TestRetrieve(t *testing.T) {
svc := newService()
policyCall := pEvaluator.On("CheckPolicy", mock.Anything, mock.Anything).Return(nil)
token, err := svc.Issue(context.Background(), "", auth.Key{Type: auth.AccessKey, Role: auth.UserRole, IssuedAt: time.Now(), Subject: id})
assert.Nil(t, err, fmt.Sprintf("Issuing login key expected to succeed: %s", err))
key := auth.Key{Type: auth.APIKey, IssuedAt: time.Now(), Subject: id}
repoCall := krepo.On("Save", mock.Anything, mock.Anything).Return(mock.Anything, nil)
k, err := svc.Issue(context.Background(), token.AccessToken, key)
assert.Nil(t, err, fmt.Sprintf("Issuing login key expected to succeed: %s", err))
repoCall.Unset()
policyCall.Unset()
ts := newServer(svc)
defer ts.Close()
client := ts.Client()
cases := []struct {
desc string
id string
token string
key auth.Key
status int
err error
}{
{
desc: "retrieve an existing key",
id: k.AccessToken,
token: token.AccessToken,
key: auth.Key{
Subject: id,
Type: auth.AccessKey,
IssuedAt: time.Now(),
ExpiresAt: time.Now().Add(refreshDuration),
},
status: http.StatusOK,
err: nil,
},
{
desc: "retrieve a non-existing key",
id: "non-existing",
token: token.AccessToken,
status: http.StatusBadRequest,
err: svcerr.ErrNotFound,
},
{
desc: "retrieve a key with an invalid token",
id: k.AccessToken,
token: "wrong",
status: http.StatusUnauthorized,
err: svcerr.ErrAuthentication,
},
{
desc: "retrieve a key with an empty token",
token: "",
id: k.AccessToken,
status: http.StatusUnauthorized,
err: svcerr.ErrAuthentication,
},
}
for _, tc := range cases {
req := testRequest{
client: client,
method: http.MethodGet,
url: fmt.Sprintf("%s/keys/%s", ts.URL, tc.id),
token: tc.token,
}
policyCall := pEvaluator.On("CheckPolicy", mock.Anything, mock.Anything).Return(nil)
repoCall := krepo.On("Retrieve", mock.Anything, mock.Anything, mock.Anything).Return(tc.key, tc.err)
res, err := req.make()
assert.Nil(t, err, fmt.Sprintf("%s: unexpected error %s", tc.desc, err))
assert.Equal(t, tc.status, res.StatusCode, fmt.Sprintf("%s: expected status code %d got %d", tc.desc, tc.status, res.StatusCode))
repoCall.Unset()
policyCall.Unset()
}
}
func TestRevoke(t *testing.T) {
svc := newService()
policyCall := pEvaluator.On("CheckPolicy", mock.Anything, mock.Anything).Return(nil)
token, err := svc.Issue(context.Background(), "", auth.Key{Type: auth.AccessKey, Role: auth.UserRole, IssuedAt: time.Now(), Subject: id})
assert.Nil(t, err, fmt.Sprintf("Issuing login key expected to succeed: %s", err))
key := auth.Key{Type: auth.APIKey, IssuedAt: time.Now(), Subject: id}
repoCall := krepo.On("Save", mock.Anything, mock.Anything).Return(mock.Anything, nil)
k, err := svc.Issue(context.Background(), token.AccessToken, key)
assert.Nil(t, err, fmt.Sprintf("Issuing login key expected to succeed: %s", err))
repoCall.Unset()
policyCall.Unset()
ts := newServer(svc)
defer ts.Close()
client := ts.Client()
cases := []struct {
desc string
id string
token string
status int
}{
{
desc: "revoke an existing key",
id: k.AccessToken,
token: token.AccessToken,
status: http.StatusNoContent,
},
{
desc: "revoke a non-existing key",
id: "non-existing",
token: token.AccessToken,
status: http.StatusNoContent,
},
{
desc: "revoke key with invalid token",
id: k.AccessToken,
token: "wrong",
status: http.StatusUnauthorized,
},
{
desc: "revoke key with empty token",
id: k.AccessToken,
token: "",
status: http.StatusUnauthorized,
},
}
for _, tc := range cases {
req := testRequest{
client: client,
method: http.MethodDelete,
url: fmt.Sprintf("%s/keys/%s", ts.URL, tc.id),
token: tc.token,
}
repoCall := krepo.On("Remove", mock.Anything, mock.Anything, mock.Anything).Return(nil)
res, err := req.make()
assert.Nil(t, err, fmt.Sprintf("%s: unexpected error %s", tc.desc, err))
assert.Equal(t, tc.status, res.StatusCode, fmt.Sprintf("%s: expected status code %d got %d", tc.desc, tc.status, res.StatusCode))
repoCall.Unset()
}
}
+48
View File
@@ -0,0 +1,48 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package keys
import (
"time"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/auth"
)
type issueKeyReq struct {
token string
Type auth.KeyType `json:"type,omitempty"`
Duration time.Duration `json:"duration,omitempty"`
}
// It is not possible to issue Reset key using HTTP API.
func (req issueKeyReq) validate() error {
if req.token == "" {
return apiutil.ErrBearerToken
}
if req.Type != auth.AccessKey &&
req.Type != auth.RecoveryKey &&
req.Type != auth.APIKey {
return apiutil.ErrInvalidAPIKey
}
return nil
}
type keyReq struct {
token string
id string
}
func (req keyReq) validate() error {
if req.token == "" {
return apiutil.ErrBearerToken
}
if req.id == "" {
return apiutil.ErrMissingID
}
return nil
}
+88
View File
@@ -0,0 +1,88 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package keys
import (
"testing"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/auth"
"github.com/stretchr/testify/assert"
)
var valid = "valid"
func TestIssueKeyReqValidate(t *testing.T) {
cases := []struct {
desc string
req issueKeyReq
err error
}{
{
desc: "valid request",
req: issueKeyReq{
token: valid,
Type: auth.AccessKey,
},
err: nil,
},
{
desc: "empty token",
req: issueKeyReq{
token: "",
Type: auth.AccessKey,
},
err: apiutil.ErrBearerToken,
},
{
desc: "invalid key type",
req: issueKeyReq{
token: valid,
Type: auth.KeyType(100),
},
err: apiutil.ErrInvalidAPIKey,
},
}
for _, tc := range cases {
err := tc.req.validate()
assert.Equal(t, tc.err, err)
}
}
func TestKeyReqValidate(t *testing.T) {
cases := []struct {
desc string
req keyReq
err error
}{
{
desc: "valid request",
req: keyReq{
token: valid,
id: valid,
},
err: nil,
},
{
desc: "empty token",
req: keyReq{
token: "",
id: valid,
},
err: apiutil.ErrBearerToken,
},
{
desc: "empty id",
req: keyReq{
token: valid,
id: "",
},
err: apiutil.ErrMissingID,
},
}
for _, tc := range cases {
err := tc.req.validate()
assert.Equal(t, tc.err, err)
}
}
+71
View File
@@ -0,0 +1,71 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package keys
import (
"net/http"
"time"
"github.com/absmach/supermq"
"github.com/absmach/supermq/auth"
)
var (
_ supermq.Response = (*issueKeyRes)(nil)
_ supermq.Response = (*revokeKeyRes)(nil)
)
type issueKeyRes struct {
ID string `json:"id,omitempty"`
Value string `json:"value,omitempty"`
IssuedAt time.Time `json:"issued_at,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
}
func (res issueKeyRes) Code() int {
return http.StatusCreated
}
func (res issueKeyRes) Headers() map[string]string {
return map[string]string{}
}
func (res issueKeyRes) Empty() bool {
return res.Value == ""
}
type retrieveKeyRes struct {
ID string `json:"id,omitempty"`
IssuerID string `json:"issuer_id,omitempty"`
Subject string `json:"subject,omitempty"`
Type auth.KeyType `json:"type,omitempty"`
IssuedAt time.Time `json:"issued_at,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
}
func (res retrieveKeyRes) Code() int {
return http.StatusOK
}
func (res retrieveKeyRes) Headers() map[string]string {
return map[string]string{}
}
func (res retrieveKeyRes) Empty() bool {
return false
}
type revokeKeyRes struct{}
func (res revokeKeyRes) Code() int {
return http.StatusNoContent
}
func (res revokeKeyRes) Headers() map[string]string {
return map[string]string{}
}
func (res revokeKeyRes) Empty() bool {
return true
}
+72
View File
@@ -0,0 +1,72 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package keys
import (
"context"
"encoding/json"
"log/slog"
"net/http"
"strings"
api "github.com/absmach/supermq/api/http"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/auth"
"github.com/absmach/supermq/pkg/errors"
"github.com/go-chi/chi/v5"
kithttp "github.com/go-kit/kit/transport/http"
)
const contentType = "application/json"
// MakeHandler returns a HTTP handler for API endpoints.
func MakeHandler(svc auth.Service, mux *chi.Mux, logger *slog.Logger) *chi.Mux {
opts := []kithttp.ServerOption{
kithttp.ServerErrorEncoder(apiutil.LoggingErrorEncoder(logger, api.EncodeError)),
}
mux.Route("/keys", func(r chi.Router) {
r.Post("/", kithttp.NewServer(
issueEndpoint(svc),
decodeIssue,
api.EncodeResponse,
opts...,
).ServeHTTP)
r.Get("/{id}", kithttp.NewServer(
(retrieveEndpoint(svc)),
decodeKeyReq,
api.EncodeResponse,
opts...,
).ServeHTTP)
r.Delete("/{id}", kithttp.NewServer(
(revokeEndpoint(svc)),
decodeKeyReq,
api.EncodeResponse,
opts...,
).ServeHTTP)
})
return mux
}
func decodeIssue(_ context.Context, r *http.Request) (any, error) {
if !strings.Contains(r.Header.Get("Content-Type"), contentType) {
return nil, apiutil.ErrUnsupportedContentType
}
req := issueKeyReq{token: apiutil.ExtractBearerToken(r)}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
return nil, errors.Wrap(errors.ErrMalformedEntity, err)
}
return req, nil
}
func decodeKeyReq(_ context.Context, r *http.Request) (any, error) {
req := keyReq{
token: apiutil.ExtractBearerToken(r),
id: chi.URLParam(r, "id"),
}
return req, nil
}
+225
View File
@@ -0,0 +1,225 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package pats
import (
"context"
"github.com/absmach/supermq/auth"
"github.com/go-kit/kit/endpoint"
)
func createPATEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(createPatReq)
if err := req.validate(); err != nil {
return nil, err
}
pat, err := svc.CreatePAT(ctx, req.token, req.Name, req.Description, req.Duration)
if err != nil {
return nil, err
}
return createPatRes{pat}, nil
}
}
func retrievePATEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(retrievePatReq)
if err := req.validate(); err != nil {
return nil, err
}
pat, err := svc.RetrievePAT(ctx, req.token, req.id)
if err != nil {
return nil, err
}
return retrievePatRes{pat}, nil
}
}
func updatePATNameEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(updatePatNameReq)
if err := req.validate(); err != nil {
return nil, err
}
pat, err := svc.UpdatePATName(ctx, req.token, req.id, req.Name)
if err != nil {
return nil, err
}
return updatePatNameRes{pat}, nil
}
}
func updatePATDescriptionEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(updatePatDescriptionReq)
if err := req.validate(); err != nil {
return nil, err
}
pat, err := svc.UpdatePATDescription(ctx, req.token, req.id, req.Description)
if err != nil {
return nil, err
}
return updatePatDescriptionRes{pat}, nil
}
}
func listPATSEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(listPatsReq)
if err := req.validate(); err != nil {
return nil, err
}
pm := auth.PATSPageMeta{
Limit: req.limit,
Offset: req.offset,
Name: req.name,
ID: req.id,
Status: req.status,
}
patsPage, err := svc.ListPATS(ctx, req.token, pm)
if err != nil {
return nil, err
}
return listPatsRes{patsPage}, nil
}
}
func deletePATEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(deletePatReq)
if err := req.validate(); err != nil {
return nil, err
}
if err := svc.DeletePAT(ctx, req.token, req.id); err != nil {
return nil, err
}
return deletePatRes{}, nil
}
}
func resetPATSecretEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(resetPatSecretReq)
if err := req.validate(); err != nil {
return nil, err
}
pat, err := svc.ResetPATSecret(ctx, req.token, req.id, req.Duration)
if err != nil {
return nil, err
}
return resetPatSecretRes{pat}, nil
}
}
func revokePATSecretEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(revokePatSecretReq)
if err := req.validate(); err != nil {
return nil, err
}
if err := svc.RevokePATSecret(ctx, req.token, req.id); err != nil {
return nil, err
}
return revokePatSecretRes{}, nil
}
}
func clearAllPATEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(clearAllPATReq)
if err := req.validate(); err != nil {
return nil, err
}
if err := svc.RemoveAllPAT(ctx, req.token); err != nil {
return nil, err
}
return clearAllRes{}, nil
}
}
func addScopeEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(addScopeReq)
if err := req.validate(); err != nil {
return nil, err
}
err := svc.AddScope(ctx, req.token, req.id, req.Scopes)
if err != nil {
return nil, err
}
return scopeRes{}, nil
}
}
func removeScopeEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(removeScopeReq)
if err := req.validate(); err != nil {
return nil, err
}
err := svc.RemoveScope(ctx, req.token, req.id, req.ScopesID...)
if err != nil {
return nil, err
}
return scopeRes{}, nil
}
}
func clearAllScopeEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(clearAllScopeReq)
if err := req.validate(); err != nil {
return nil, err
}
if err := svc.RemovePATAllScope(ctx, req.token, req.id); err != nil {
return nil, err
}
return clearAllRes{}, nil
}
}
func listScopesEndpoint(svc auth.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (any, error) {
req := request.(listScopesReq)
if err := req.validate(); err != nil {
return nil, err
}
pm := auth.ScopesPageMeta{
Limit: req.limit,
Offset: req.offset,
PatID: req.patID,
}
scopesPage, err := svc.ListScopes(ctx, req.token, pm)
if err != nil {
return nil, err
}
return listScopeRes{scopesPage}, nil
}
}
+287
View File
@@ -0,0 +1,287 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package pats
import (
"encoding/json"
"strings"
"time"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/auth"
"github.com/absmach/supermq/pkg/errors"
)
type createPatReq struct {
token string
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Duration time.Duration `json:"duration,omitempty"`
}
func (cpr *createPatReq) UnmarshalJSON(data []byte) error {
var temp struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Duration string `json:"duration,omitempty"`
}
if err := json.Unmarshal(data, &temp); err != nil {
return err
}
duration, err := time.ParseDuration(temp.Duration)
if err != nil {
return err
}
cpr.Name = temp.Name
cpr.Description = temp.Description
cpr.Duration = duration
return nil
}
func (req createPatReq) validate() (err error) {
if req.token == "" {
return apiutil.ErrBearerToken
}
if strings.TrimSpace(req.Name) == "" {
return apiutil.ErrMissingName
}
return nil
}
type retrievePatReq struct {
token string
id string
}
func (req retrievePatReq) validate() (err error) {
if req.token == "" {
return apiutil.ErrBearerToken
}
if req.id == "" {
return apiutil.ErrMissingPATID
}
return nil
}
type updatePatNameReq struct {
token string
id string
Name string `json:"name,omitempty"`
}
func (req updatePatNameReq) validate() (err error) {
if req.token == "" {
return apiutil.ErrBearerToken
}
if req.id == "" {
return apiutil.ErrMissingPATID
}
if strings.TrimSpace(req.Name) == "" {
return apiutil.ErrMissingName
}
return nil
}
type updatePatDescriptionReq struct {
token string
id string
Description string `json:"description,omitempty"`
}
func (req updatePatDescriptionReq) validate() (err error) {
if req.token == "" {
return apiutil.ErrBearerToken
}
if req.id == "" {
return apiutil.ErrMissingPATID
}
if strings.TrimSpace(req.Description) == "" {
return apiutil.ErrMissingDescription
}
return nil
}
type listPatsReq struct {
token string
offset uint64
limit uint64
name string
id string
status auth.Status
}
func (req listPatsReq) validate() (err error) {
if req.token == "" {
return apiutil.ErrBearerToken
}
return nil
}
type deletePatReq struct {
token string
id string
}
func (req deletePatReq) validate() (err error) {
if req.token == "" {
return apiutil.ErrBearerToken
}
if req.id == "" {
return apiutil.ErrMissingPATID
}
return nil
}
type resetPatSecretReq struct {
token string
id string
Duration time.Duration `json:"duration,omitempty"`
}
func (rspr *resetPatSecretReq) UnmarshalJSON(data []byte) error {
var temp struct {
Duration string `json:"duration,omitempty"`
}
err := json.Unmarshal(data, &temp)
if err != nil {
return err
}
rspr.Duration, err = time.ParseDuration(temp.Duration)
if err != nil {
return err
}
return nil
}
func (req resetPatSecretReq) validate() (err error) {
if req.token == "" {
return apiutil.ErrBearerToken
}
if req.id == "" {
return apiutil.ErrMissingPATID
}
return nil
}
type revokePatSecretReq struct {
token string
id string
}
func (req revokePatSecretReq) validate() (err error) {
if req.token == "" {
return apiutil.ErrBearerToken
}
if req.id == "" {
return apiutil.ErrMissingPATID
}
return nil
}
type clearAllPATReq struct {
token string
}
func (req clearAllPATReq) validate() error {
if req.token == "" {
return apiutil.ErrBearerToken
}
return nil
}
type addScopeReq struct {
token string
id string
Scopes []auth.Scope `json:"scopes,omitempty"`
}
func (req *addScopeReq) UnmarshalJSON(data []byte) error {
type Alias addScopeReq
aux := &struct {
*Alias
}{
Alias: (*Alias)(req),
}
if err := json.Unmarshal(data, aux); err != nil {
return err
}
return nil
}
func (req addScopeReq) validate() (err error) {
if req.token == "" {
return apiutil.ErrBearerToken
}
if req.id == "" {
return apiutil.ErrMissingPATID
}
if len(req.Scopes) == 0 {
return apiutil.ErrValidation
}
for _, scope := range req.Scopes {
if err := scope.Validate(); err != nil {
return errors.Wrap(apiutil.ErrValidation, err)
}
}
return nil
}
type removeScopeReq struct {
token string
id string
ScopesID []string `json:"scopes_id,omitempty"`
}
func (req removeScopeReq) validate() (err error) {
if req.token == "" {
return apiutil.ErrBearerToken
}
if req.id == "" {
return apiutil.ErrMissingPATID
}
if len(req.ScopesID) == 0 {
return apiutil.ErrValidation
}
return nil
}
type clearAllScopeReq struct {
token string
id string
}
func (req clearAllScopeReq) validate() (err error) {
if req.token == "" {
return apiutil.ErrBearerToken
}
if req.id == "" {
return apiutil.ErrMissingPATID
}
return nil
}
type listScopesReq struct {
token string
offset uint64
limit uint64
patID string
}
func (req listScopesReq) validate() (err error) {
if req.token == "" {
return apiutil.ErrBearerToken
}
if req.patID == "" {
return apiutil.ErrMissingPATID
}
return nil
}
+191
View File
@@ -0,0 +1,191 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package pats
import (
"net/http"
"github.com/absmach/supermq"
"github.com/absmach/supermq/auth"
)
var (
_ supermq.Response = (*createPatRes)(nil)
_ supermq.Response = (*retrievePatRes)(nil)
_ supermq.Response = (*updatePatNameRes)(nil)
_ supermq.Response = (*updatePatDescriptionRes)(nil)
_ supermq.Response = (*deletePatRes)(nil)
_ supermq.Response = (*resetPatSecretRes)(nil)
_ supermq.Response = (*revokePatSecretRes)(nil)
_ supermq.Response = (*scopeRes)(nil)
_ supermq.Response = (*clearAllRes)(nil)
)
type createPatRes struct {
auth.PAT `json:",inline"`
}
func (res createPatRes) Code() int {
return http.StatusCreated
}
func (res createPatRes) Headers() map[string]string {
return map[string]string{}
}
func (res createPatRes) Empty() bool {
return false
}
type retrievePatRes struct {
auth.PAT `json:",inline"`
}
func (res retrievePatRes) Code() int {
return http.StatusOK
}
func (res retrievePatRes) Headers() map[string]string {
return map[string]string{}
}
func (res retrievePatRes) Empty() bool {
return false
}
type updatePatNameRes struct {
auth.PAT `json:",inline"`
}
func (res updatePatNameRes) Code() int {
return http.StatusAccepted
}
func (res updatePatNameRes) Headers() map[string]string {
return map[string]string{}
}
func (res updatePatNameRes) Empty() bool {
return false
}
type updatePatDescriptionRes struct {
auth.PAT `json:",inline"`
}
func (res updatePatDescriptionRes) Code() int {
return http.StatusAccepted
}
func (res updatePatDescriptionRes) Headers() map[string]string {
return map[string]string{}
}
func (res updatePatDescriptionRes) Empty() bool {
return false
}
type listPatsRes struct {
auth.PATSPage `json:",inline"`
}
func (res listPatsRes) Code() int {
return http.StatusOK
}
func (res listPatsRes) Headers() map[string]string {
return map[string]string{}
}
func (res listPatsRes) Empty() bool {
return false
}
type deletePatRes struct{}
func (res deletePatRes) Code() int {
return http.StatusNoContent
}
func (res deletePatRes) Headers() map[string]string {
return map[string]string{}
}
func (res deletePatRes) Empty() bool {
return true
}
type resetPatSecretRes struct {
auth.PAT `json:",inline"`
}
func (res resetPatSecretRes) Code() int {
return http.StatusOK
}
func (res resetPatSecretRes) Headers() map[string]string {
return map[string]string{}
}
func (res resetPatSecretRes) Empty() bool {
return false
}
type revokePatSecretRes struct{}
func (res revokePatSecretRes) Code() int {
return http.StatusNoContent
}
func (res revokePatSecretRes) Headers() map[string]string {
return map[string]string{}
}
func (res revokePatSecretRes) Empty() bool {
return true
}
type scopeRes struct{}
func (res scopeRes) Code() int {
return http.StatusOK
}
func (res scopeRes) Headers() map[string]string {
return map[string]string{}
}
func (res scopeRes) Empty() bool {
return true
}
type clearAllRes struct{}
func (res clearAllRes) Code() int {
return http.StatusOK
}
func (res clearAllRes) Headers() map[string]string {
return map[string]string{}
}
func (res clearAllRes) Empty() bool {
return true
}
type listScopeRes struct {
auth.ScopesPage `json:",inline"`
}
func (res listScopeRes) Code() int {
return http.StatusOK
}
func (res listScopeRes) Headers() map[string]string {
return map[string]string{}
}
func (res listScopeRes) Empty() bool {
return false
}
+366
View File
@@ -0,0 +1,366 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package pats
import (
"context"
"encoding/json"
"log/slog"
"net/http"
"strings"
api "github.com/absmach/supermq/api/http"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/auth"
"github.com/absmach/supermq/pkg/errors"
"github.com/go-chi/chi/v5"
kithttp "github.com/go-kit/kit/transport/http"
)
const (
contentType = "application/json"
defInterval = "30d"
patPrefix = "pat_"
)
// MakeHandler returns a HTTP handler for API endpoints.
func MakeHandler(svc auth.Service, mux *chi.Mux, logger *slog.Logger) *chi.Mux {
opts := []kithttp.ServerOption{
kithttp.ServerErrorEncoder(apiutil.LoggingErrorEncoder(logger, api.EncodeError)),
}
mux.Route("/pats", func(r chi.Router) {
r.Post("/", kithttp.NewServer(
createPATEndpoint(svc),
decodeCreatePATRequest,
api.EncodeResponse,
opts...,
).ServeHTTP)
r.Get("/", kithttp.NewServer(
listPATSEndpoint(svc),
decodeListPATSRequest,
api.EncodeResponse,
opts...,
).ServeHTTP)
r.Delete("/", kithttp.NewServer(
clearAllPATEndpoint(svc),
decodeClearAllPATRequest,
api.EncodeResponse,
opts...,
).ServeHTTP)
r.Route("/{id}", func(r chi.Router) {
r.Get("/", kithttp.NewServer(
retrievePATEndpoint(svc),
decodeRetrievePATRequest,
api.EncodeResponse,
opts...,
).ServeHTTP)
r.Patch("/name", kithttp.NewServer(
updatePATNameEndpoint(svc),
decodeUpdatePATNameRequest,
api.EncodeResponse,
opts...,
).ServeHTTP)
r.Patch("/description", kithttp.NewServer(
updatePATDescriptionEndpoint(svc),
decodeUpdatePATDescriptionRequest,
api.EncodeResponse,
opts...,
).ServeHTTP)
r.Delete("/", kithttp.NewServer(
deletePATEndpoint(svc),
decodeDeletePATRequest,
api.EncodeResponse,
opts...,
).ServeHTTP)
r.Route("/secret", func(r chi.Router) {
r.Patch("/reset", kithttp.NewServer(
resetPATSecretEndpoint(svc),
decodeResetPATSecretRequest,
api.EncodeResponse,
opts...,
).ServeHTTP)
r.Patch("/revoke", kithttp.NewServer(
revokePATSecretEndpoint(svc),
decodeRevokePATSecretRequest,
api.EncodeResponse,
opts...,
).ServeHTTP)
})
r.Route("/scope", func(r chi.Router) {
r.Patch("/add", kithttp.NewServer(
addScopeEndpoint(svc),
decodeAddScopeRequest,
api.EncodeResponse,
opts...,
).ServeHTTP)
r.Get("/", kithttp.NewServer(
listScopesEndpoint(svc),
decodeListScopeRequest,
api.EncodeResponse,
opts...,
).ServeHTTP)
r.Patch("/remove", kithttp.NewServer(
removeScopeEndpoint(svc),
decodeRemoveScopeRequest,
api.EncodeResponse,
opts...,
).ServeHTTP)
r.Delete("/", kithttp.NewServer(
clearAllScopeEndpoint(svc),
decodeClearAllScopeRequest,
api.EncodeResponse,
opts...,
).ServeHTTP)
})
})
})
return mux
}
func decodeCreatePATRequest(_ context.Context, r *http.Request) (any, error) {
if !strings.Contains(r.Header.Get("Content-Type"), contentType) {
return nil, apiutil.ErrUnsupportedContentType
}
token := apiutil.ExtractBearerToken(r)
if strings.HasPrefix(token, patPrefix) {
return nil, apiutil.ErrUnsupportedTokenType
}
req := createPatReq{token: token}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
return nil, errors.Wrap(apiutil.ErrValidation, errors.Wrap(err, errors.ErrMalformedEntity))
}
return req, nil
}
func decodeRetrievePATRequest(_ context.Context, r *http.Request) (any, error) {
token := apiutil.ExtractBearerToken(r)
if strings.HasPrefix(token, patPrefix) {
return nil, apiutil.ErrUnsupportedTokenType
}
req := retrievePatReq{
token: token,
id: chi.URLParam(r, "id"),
}
return req, nil
}
func decodeUpdatePATNameRequest(_ context.Context, r *http.Request) (any, error) {
if !strings.Contains(r.Header.Get("Content-Type"), contentType) {
return nil, apiutil.ErrUnsupportedContentType
}
token := apiutil.ExtractBearerToken(r)
if strings.HasPrefix(token, patPrefix) {
return nil, apiutil.ErrUnsupportedTokenType
}
req := updatePatNameReq{
token: token,
id: chi.URLParam(r, "id"),
}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
return nil, errors.Wrap(errors.ErrMalformedEntity, err)
}
return req, nil
}
func decodeUpdatePATDescriptionRequest(_ context.Context, r *http.Request) (any, error) {
if !strings.Contains(r.Header.Get("Content-Type"), contentType) {
return nil, apiutil.ErrUnsupportedContentType
}
token := apiutil.ExtractBearerToken(r)
if strings.HasPrefix(token, patPrefix) {
return nil, apiutil.ErrUnsupportedTokenType
}
req := updatePatDescriptionReq{
token: token,
id: chi.URLParam(r, "id"),
}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
return nil, errors.Wrap(errors.ErrMalformedEntity, err)
}
return req, nil
}
func decodeListPATSRequest(_ context.Context, r *http.Request) (any, error) {
l, err := apiutil.ReadNumQuery[uint64](r, api.LimitKey, api.DefLimit)
if err != nil {
return nil, errors.Wrap(apiutil.ErrValidation, err)
}
o, err := apiutil.ReadNumQuery[uint64](r, api.OffsetKey, api.DefOffset)
if err != nil {
return nil, errors.Wrap(apiutil.ErrValidation, err)
}
n, err := apiutil.ReadStringQuery(r, api.NameKey, "")
if err != nil {
return nil, errors.Wrap(apiutil.ErrValidation, err)
}
i, err := apiutil.ReadStringQuery(r, api.IDOrder, "")
if err != nil {
return nil, errors.Wrap(apiutil.ErrValidation, err)
}
token := apiutil.ExtractBearerToken(r)
if strings.HasPrefix(token, patPrefix) {
return nil, apiutil.ErrUnsupportedTokenType
}
s, err := apiutil.ReadStringQuery(r, api.StatusKey, "")
if err != nil {
return nil, errors.Wrap(apiutil.ErrValidation, err)
}
patStatus, err := auth.ToStatus(s)
if err != nil {
return nil, errors.Wrap(apiutil.ErrValidation, err)
}
req := listPatsReq{
token: token,
limit: l,
offset: o,
name: n,
id: i,
status: patStatus,
}
return req, nil
}
func decodeDeletePATRequest(_ context.Context, r *http.Request) (any, error) {
token := apiutil.ExtractBearerToken(r)
if strings.HasPrefix(token, patPrefix) {
return nil, apiutil.ErrUnsupportedTokenType
}
return deletePatReq{
token: token,
id: chi.URLParam(r, "id"),
}, nil
}
func decodeResetPATSecretRequest(_ context.Context, r *http.Request) (any, error) {
if !strings.Contains(r.Header.Get("Content-Type"), contentType) {
return nil, apiutil.ErrUnsupportedContentType
}
token := apiutil.ExtractBearerToken(r)
if strings.HasPrefix(token, patPrefix) {
return nil, apiutil.ErrUnsupportedTokenType
}
req := resetPatSecretReq{
token: token,
id: chi.URLParam(r, "id"),
}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
return nil, errors.Wrap(errors.ErrMalformedEntity, err)
}
return req, nil
}
func decodeRevokePATSecretRequest(_ context.Context, r *http.Request) (any, error) {
token := apiutil.ExtractBearerToken(r)
if strings.HasPrefix(token, patPrefix) {
return nil, apiutil.ErrUnsupportedTokenType
}
return revokePatSecretReq{
token: token,
id: chi.URLParam(r, "id"),
}, nil
}
func decodeClearAllPATRequest(_ context.Context, r *http.Request) (any, error) {
token := apiutil.ExtractBearerToken(r)
if strings.HasPrefix(token, patPrefix) {
return nil, apiutil.ErrUnsupportedTokenType
}
return clearAllPATReq{
token: token,
}, nil
}
func decodeAddScopeRequest(_ context.Context, r *http.Request) (any, error) {
if !strings.Contains(r.Header.Get("Content-Type"), contentType) {
return nil, apiutil.ErrUnsupportedContentType
}
token := apiutil.ExtractBearerToken(r)
if strings.HasPrefix(token, patPrefix) {
return nil, apiutil.ErrUnsupportedTokenType
}
req := addScopeReq{
token: token,
id: chi.URLParam(r, "id"),
}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
return nil, errors.Wrap(errors.ErrMalformedEntity, err)
}
return req, nil
}
func decodeListScopeRequest(_ context.Context, r *http.Request) (any, error) {
l, err := apiutil.ReadNumQuery[uint64](r, api.LimitKey, api.DefLimit)
if err != nil {
return nil, errors.Wrap(apiutil.ErrValidation, err)
}
o, err := apiutil.ReadNumQuery[uint64](r, api.OffsetKey, api.DefOffset)
if err != nil {
return nil, errors.Wrap(apiutil.ErrValidation, err)
}
token := apiutil.ExtractBearerToken(r)
if strings.HasPrefix(token, patPrefix) {
return nil, apiutil.ErrUnsupportedTokenType
}
req := listScopesReq{
token: token,
limit: l,
offset: o,
patID: chi.URLParam(r, "id"),
}
return req, nil
}
func decodeRemoveScopeRequest(_ context.Context, r *http.Request) (any, error) {
if !strings.Contains(r.Header.Get("Content-Type"), contentType) {
return nil, apiutil.ErrUnsupportedContentType
}
token := apiutil.ExtractBearerToken(r)
if strings.HasPrefix(token, patPrefix) {
return nil, apiutil.ErrUnsupportedTokenType
}
req := removeScopeReq{
token: token,
id: chi.URLParam(r, "id"),
}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
return nil, errors.Wrap(errors.ErrMalformedEntity, err)
}
return req, nil
}
func decodeClearAllScopeRequest(_ context.Context, r *http.Request) (any, error) {
token := apiutil.ExtractBearerToken(r)
if strings.HasPrefix(token, patPrefix) {
return nil, apiutil.ErrUnsupportedTokenType
}
return clearAllScopeReq{
token: token,
id: chi.URLParam(r, "id"),
}, nil
}
+28
View File
@@ -0,0 +1,28 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package http
import (
"log/slog"
"net/http"
"github.com/absmach/supermq"
"github.com/absmach/supermq/auth"
"github.com/absmach/supermq/auth/api/http/keys"
"github.com/absmach/supermq/auth/api/http/pats"
"github.com/go-chi/chi/v5"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
// MakeHandler returns a HTTP handler for API endpoints.
func MakeHandler(svc auth.Service, logger *slog.Logger, instanceID string) http.Handler {
mux := chi.NewRouter()
mux = keys.MakeHandler(svc, mux, logger)
mux = pats.MakeHandler(svc, mux, logger)
mux.Get("/health", supermq.Health("auth", instanceID))
mux.Handle("/metrics", promhttp.Handler())
return mux
}
+4
View File
@@ -0,0 +1,4 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package cache
+120
View File
@@ -0,0 +1,120 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package cache
import (
"context"
"fmt"
"time"
"github.com/absmach/supermq/auth"
"github.com/absmach/supermq/pkg/errors"
repoerr "github.com/absmach/supermq/pkg/errors/repository"
"github.com/redis/go-redis/v9"
)
type patCache struct {
client *redis.Client
duration time.Duration
}
func NewPatsCache(client *redis.Client, duration time.Duration) auth.Cache {
return &patCache{
client: client,
duration: duration,
}
}
func (pc *patCache) Save(ctx context.Context, userID string, scopes []auth.Scope) error {
for _, sc := range scopes {
key := generateKey(userID, sc.PatID, sc.OptionalDomainID, sc.EntityType, sc.Operation, sc.EntityID)
if err := pc.client.Set(ctx, key, sc.ID, pc.duration).Err(); err != nil {
return errors.Wrap(repoerr.ErrCreateEntity, err)
}
}
return nil
}
func (pc *patCache) CheckScope(ctx context.Context, userID, patID, optionalDomainID string, entityType auth.EntityType, operation auth.Operation, entityID string) bool {
exactKey := fmt.Sprintf("pat:%s:%s:%s:%s:%s:%s", userID, patID, entityType, optionalDomainID, operation, entityID)
wildcardKey := fmt.Sprintf("pat:%s:%s:%s:%s:%s:*", userID, patID, entityType, operation, operation)
res, err := pc.client.Exists(ctx, exactKey, wildcardKey).Result()
if err != nil {
return false
}
return res > 0
}
func (pc *patCache) Remove(ctx context.Context, userID string, scopeIDs []string) error {
if len(scopeIDs) == 0 {
return repoerr.ErrRemoveEntity
}
pattern := fmt.Sprintf("pat:%s:*", userID)
iter := pc.client.Scan(ctx, 0, pattern, 0).Iterator()
for iter.Next(ctx) {
key := iter.Val()
val, err := pc.client.Get(ctx, key).Result()
if err != nil {
if err == redis.Nil {
continue
}
return errors.Wrap(repoerr.ErrRemoveEntity, err)
}
for _, scopeID := range scopeIDs {
if val == scopeID {
if err := pc.client.Del(ctx, key).Err(); err != nil {
return errors.Wrap(repoerr.ErrRemoveEntity, err)
}
break
}
}
}
if err := iter.Err(); err != nil {
return errors.Wrap(repoerr.ErrRemoveEntity, err)
}
return nil
}
func (pc *patCache) RemoveUserAllScope(ctx context.Context, userID string) error {
pattern := fmt.Sprintf("pat:%s:*", userID)
iter := pc.client.Scan(ctx, 0, pattern, 0).Iterator()
for iter.Next(ctx) {
if err := pc.client.Del(ctx, iter.Val()).Err(); err != nil {
return errors.Wrap(repoerr.ErrRemoveEntity, err)
}
}
if err := iter.Err(); err != nil {
return errors.Wrap(repoerr.ErrRemoveEntity, err)
}
return nil
}
func (pc *patCache) RemoveAllScope(ctx context.Context, userID, patID string) error {
pattern := fmt.Sprintf("pat:%s:%s", userID, patID)
iter := pc.client.Scan(ctx, 0, pattern, 0).Iterator()
for iter.Next(ctx) {
if err := pc.client.Del(ctx, iter.Val()).Err(); err != nil {
return errors.Wrap(repoerr.ErrRemoveEntity, err)
}
}
if err := iter.Err(); err != nil {
return errors.Wrap(repoerr.ErrRemoveEntity, err)
}
return nil
}
func generateKey(userID, patID, optionalDomainId string, entityType auth.EntityType, operation auth.Operation, entityID string) string {
return fmt.Sprintf("pat:%s:%s:%s:%s:%s:%s", userID, patID, entityType, optionalDomainId, operation, entityID)
}
+15
View File
@@ -0,0 +1,15 @@
// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
package auth
// Hasher specifies an API for generating hashes of an arbitrary textual
// content.
type Hasher interface {
// Hash generates the hashed string from plain-text.
Hash(string) (string, error)
// Compare compares plain-text version to the hashed one. An error should
// indicate failed comparison.
Compare(string, string) error
}

Some files were not shown because too many files have changed in this diff Show More