Mainflux.mainflux/readers
b1ackd0t 6bc931eb2a
NOISSUE - Fix Readers Tests (#1933)
* Add things auth and auth

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

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

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

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

* feat(auth): add mock implementation

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

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

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

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

* feat(readers): add user authentication to listMessagesEndpoint

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

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

---------

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
2023-10-23 15:36:42 +02:00
..
api NOISSUE - Fix Readers Tests (#1933) 2023-10-23 15:36:42 +02:00
cassandra NOISSUE - Fix Readers Tests (#1933) 2023-10-23 15:36:42 +02:00
influxdb NOISSUE - Fix Readers Tests (#1933) 2023-10-23 15:36:42 +02:00
mocks NOISSUE - Switch to Google Zanzibar Access control approach (#1919) 2023-10-15 22:02:13 +02:00
mongodb NOISSUE - Fix Readers Tests (#1933) 2023-10-23 15:36:42 +02:00
postgres NOISSUE - Fix Readers Tests (#1933) 2023-10-23 15:36:42 +02:00
timescale NOISSUE - Fix Readers Tests (#1933) 2023-10-23 15:36:42 +02:00
README.md NOISSUE - Use github action for showing OpenAPI spec with Swagger UI (#1427) 2021-06-23 13:31:46 +02:00
doc.go MF-1506 - Group-based Access Control (#1716) 2023-06-14 12:40:37 +02:00
messages.go MF-1506 - Group-based Access Control (#1716) 2023-06-14 12:40:37 +02:00

README.md

Readers

Readers provide an implementation of various message readers. Message readers are services that consume normalized (in SenML format) Mainflux messages from data storage and opens HTTP API for message consumption.

For an in-depth explanation of the usage of reader, as well as thorough understanding of Mainflux, please check out the official documentation.