Commit Graph

88 Commits

Author SHA1 Message Date
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
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
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 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
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 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
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
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
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 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
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
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
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 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
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
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 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
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
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
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 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 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 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 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
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
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 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
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 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
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 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 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
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
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
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
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
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
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
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