Mainflux.mainflux/coap/README.md

77 lines
4.6 KiB
Markdown
Raw Normal View History

MF-374 - Bring back CoAP adapter (#413) * Bring old CoAP code back Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix channel ID formatting due to type change Uncomment error handling for authorization. Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update CoAP adapter docs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove redundant type declaration Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to the list of services Add CoAp adapter in Makefile services list and fix corresponding documentation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP code Merge multipe `const` block int single and declare consts before vars. Un-export notFound handler since there is no need to export it. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update http version endpoint This separates CoAP and HTTP APIs. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP POST method handling This PR is a part of CoAP adapter refactoring that will simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP adapter Change CoAP message handling to simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add backoff timeout for server ping to client Update CoAP adapter to provide subset of necessary features from protocol specification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix leaking locked goroutine In case of the stopped ticker, its channel is NOT closed, so pinging might be left stuck waiting for the stopped ticker to send a notification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Format code Use more meaningful name for Handlers map. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use and stop ticker from the same goroutine Stop handler Ticker from ping goroutine rather than the cancel goroutine. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Check if subscription already exists in put method Fix potential leak of handlers providing check inside of put method. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use MessageID as Observe option Since MessageID satisfies observe option behaviour, use Message ID instead of local timestamp. Remove Thicker from handler and use it on transport layer. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use name Observer insted of Handler Name `Observer` is used in protocol specification, so this naming makes code more self-documenting. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to docker-compose.yml Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove unused constants Fix service name in startup log message. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add metrics endpoint Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor code Config fields from main.go should not be exported; minor style changes. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update authorization URI-Query option Use `authorization` value in URI-Query option instead of `key`. This mimics Authorization header in some other protocols (e.g. HTTP). Please note that this value can be replaced with simple `auth` to save space, due to constrained URI-Query option size. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-01 01:53:25 +08:00
# Mainflux CoAP Adapter
Mainflux CoAP adapter provides an [CoAP](http://coap.technology/) API for sending messages through the
platform.
## Configuration
The service is configured using the environment variables presented in the
following table. Note that any unset variables will be replaced with their
default values.
| Variable | Description | Default |
| -------------------------------- | --------------------------------------------------- | ------------------------------ |
| MF_COAP_ADAPTER_LOG_LEVEL | Service log level | info |
| MF_COAP_ADAPTER_HOST | CoAP service listening host | |
| MF_COAP_ADAPTER_PORT | CoAP service listening port | 5683 |
| MF_COAP_ADAPTER_SERVER_CERT | CoAP service server certificate | |
| MF_COAP_ADAPTER_SERVER_KEY | CoAP service server key | |
| MF_COAP_ADAPTER_HTTP_HOST | Service HTTP listening host | |
| MF_COAP_ADAPTER_HTTP_PORT | Service listening port | 5683 |
| MF_COAP_ADAPTER_HTTP_SERVER_CERT | Service server certificate | |
| MF_COAP_ADAPTER_HTTP_SERVER_KEY | Service server key | |
| MF_THINGS_AUTH_GRPC_URL | Things service Auth gRPC URL | localhost:7000 |
| MF_THINGS_AUTH_GRPC_TIMEOUT | Things service Auth gRPC request timeout in seconds | 1s |
| MF_THINGS_AUTH_GRPC_CLIENT_TLS | Flag that indicates if TLS should be turned on | false |
| MF_THINGS_AUTH_GRPC_CA_CERTS | Path to trusted CAs in PEM format | |
NOISSUE - Make MQTT Broker Configurable (#1904) * Minor changes on mqtt publisher using nats Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Remove vernemq dependencies Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Restore VerneMQ config files Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Makefile to support custom Docker profiles The Makefile has been updated to support custom Docker profiles. Previously, the Makefile only supported the default profiles for the message broker and MQTT broker. Now, the Makefile allows for custom profiles to be specified using environment variables. If the MF_BROKER_TYPE or MF_MQTT_BROKER_TYPE variables are not set, the default values "nats" and "nats" will be used, respectively. This change enables more flexibility in configuring the Docker environment for the project. The `run` target has also been modified to use the correct broker configuration file based on the MF_BROKER_TYPE variable. The sed command in the `run` target now replaces the placeholder in the docker/docker-compose.yml file with the appropriate broker configuration file. This commit improves the Makefile to support custom Docker profiles and ensures the correct broker configuration file is used when running the project. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix queue binding issue in RabbitMQ pubsub The commit fixes an issue in the RabbitMQ pubsub implementation where the queue binding was not correctly set up. Instead of using the topic as the queue name, the commit now uses a unique client ID generated by combining the topic and subscriber ID. This ensures that each subscriber has its own dedicated queue. The commit also updates the queue binding to use the correct queue name. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor Docker config editing in Makefile The commit refactors the `edit_docker_config` function in the Makefile to improve readability and maintainability. The changes include: - Removing unnecessary conditionals related to the `rabbitmq` broker These changes ensure that the Docker configuration is correctly updated based on the specified MQTT broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix failing tests on RabbitMQ Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor MQTT_BROKER comment in docker-compose.yml The MQTT_BROKER comment in the docker-compose.yml file has been updated to provide a more accurate description of its functionality. The comment now states that the MQTT_BROKER handles MQTT communication between MQTT adapters and the message broker, instead of Mainflux services. This change improves clarity and aligns with the actual purpose of the MQTT_BROKER. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename `MF_BROKER` to `MF_MESSAGE_BROKER` The Makefile and Semaphore configuration files have been refactored to update the variable names related to the message broker type. These changes ensure consistency and clarity in the codebase by using more descriptive variable names related to the message broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Docker profile configuration for nats_rabbitmq Update the Docker profile configuration for nats_rabbitmq by replacing the NATS URL in the .env file with the correct value. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename MF_BROKER_URL to MF_MESSAGE_BROKER_URL Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix MQTT QoS level in pubsub.go The MQTT QoS level in the pubsub.go file was set to 1, which is the default level. However, since NATS supports up to QoS 1, I updated the QoS level comment to reflect this. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor NewPublisher to accept QoS parameter The NewPublisher function in the pkg/messaging/mqtt/publisher.go file has been refactored to accept a new parameter, qos, which represents the Quality of Service level for MQTT message publishing. This change allows for more flexibility in configuring the MQTT publisher. The NewPublisher function now has the following signature: ```go func NewPublisher(address string, qos uint8, timeout time.Duration) (messaging.Publisher, error) ``` This change ensures that the MQTT publisher can be created with the desired QoS level, enhancing the reliability and delivery guarantees of the published messages. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix test assertions in pubsub_test.go The test assertions in the pubsub_test.go file were incorrect. This commit fixes the assertions to properly compare the expected and received message values. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Test configurable MQTT broker Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-10-20 03:01:09 +08:00
| MF_MESSAGE_BROKER_URL | Message broker instance URL | nats://localhost:4222 |
| MF_JAEGER_URL | Jaeger server URL | http://jaeger:14268/api/traces |
| MF_SEND_TELEMETRY | Send telemetry to mainflux call home server | true |
| MF_COAP_ADAPTER_INSTANCE_ID | CoAP adapter instance ID | |
MF-374 - Bring back CoAP adapter (#413) * Bring old CoAP code back Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix channel ID formatting due to type change Uncomment error handling for authorization. Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update CoAP adapter docs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove redundant type declaration Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to the list of services Add CoAp adapter in Makefile services list and fix corresponding documentation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP code Merge multipe `const` block int single and declare consts before vars. Un-export notFound handler since there is no need to export it. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update http version endpoint This separates CoAP and HTTP APIs. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP POST method handling This PR is a part of CoAP adapter refactoring that will simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP adapter Change CoAP message handling to simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add backoff timeout for server ping to client Update CoAP adapter to provide subset of necessary features from protocol specification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix leaking locked goroutine In case of the stopped ticker, its channel is NOT closed, so pinging might be left stuck waiting for the stopped ticker to send a notification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Format code Use more meaningful name for Handlers map. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use and stop ticker from the same goroutine Stop handler Ticker from ping goroutine rather than the cancel goroutine. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Check if subscription already exists in put method Fix potential leak of handlers providing check inside of put method. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use MessageID as Observe option Since MessageID satisfies observe option behaviour, use Message ID instead of local timestamp. Remove Thicker from handler and use it on transport layer. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use name Observer insted of Handler Name `Observer` is used in protocol specification, so this naming makes code more self-documenting. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to docker-compose.yml Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove unused constants Fix service name in startup log message. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add metrics endpoint Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor code Config fields from main.go should not be exported; minor style changes. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update authorization URI-Query option Use `authorization` value in URI-Query option instead of `key`. This mimics Authorization header in some other protocols (e.g. HTTP). Please note that this value can be replaced with simple `auth` to save space, due to constrained URI-Query option size. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-01 01:53:25 +08:00
## Deployment
The service itself is distributed as Docker container. Check the [`coap-adapter`](https://github.com/mainflux/mainflux/blob/master/docker/docker-compose.yml#L273-L291) service section in
docker-compose to see how service is deployed.
MF-374 - Bring back CoAP adapter (#413) * Bring old CoAP code back Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix channel ID formatting due to type change Uncomment error handling for authorization. Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update CoAP adapter docs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove redundant type declaration Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to the list of services Add CoAp adapter in Makefile services list and fix corresponding documentation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP code Merge multipe `const` block int single and declare consts before vars. Un-export notFound handler since there is no need to export it. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update http version endpoint This separates CoAP and HTTP APIs. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP POST method handling This PR is a part of CoAP adapter refactoring that will simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP adapter Change CoAP message handling to simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add backoff timeout for server ping to client Update CoAP adapter to provide subset of necessary features from protocol specification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix leaking locked goroutine In case of the stopped ticker, its channel is NOT closed, so pinging might be left stuck waiting for the stopped ticker to send a notification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Format code Use more meaningful name for Handlers map. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use and stop ticker from the same goroutine Stop handler Ticker from ping goroutine rather than the cancel goroutine. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Check if subscription already exists in put method Fix potential leak of handlers providing check inside of put method. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use MessageID as Observe option Since MessageID satisfies observe option behaviour, use Message ID instead of local timestamp. Remove Thicker from handler and use it on transport layer. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use name Observer insted of Handler Name `Observer` is used in protocol specification, so this naming makes code more self-documenting. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to docker-compose.yml Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove unused constants Fix service name in startup log message. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add metrics endpoint Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor code Config fields from main.go should not be exported; minor style changes. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update authorization URI-Query option Use `authorization` value in URI-Query option instead of `key`. This mimics Authorization header in some other protocols (e.g. HTTP). Please note that this value can be replaced with simple `auth` to save space, due to constrained URI-Query option size. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-01 01:53:25 +08:00
NOISSUE - RabbitMQ build and deployment (#1570) * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit for tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Bump up tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add more tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add go routines Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit for tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Bump up tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add more tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add go routines Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix with wait groups Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * unsubscribe to stop delivering messages Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove exclusivity Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Implement cancel mechanisms Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Queuename as parameter Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Queuename as parameter Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove broker type Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Configure broker with makefile Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Check if we have changed MESSAGE_BROKER_FILE~ Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Set nats automatically Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Catching null and invalid broker type Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove unused fmt Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Nats Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * unexport constants Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change routingkey Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove wait groups Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * protecting map Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add publisher to pubsub Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change proto library Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix typos Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Reduce pubsub tests based on implementation Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove channel cancel Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Export constant Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Embedding publisher into pubsub Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Naming publisher Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Update rabbitmq subscriber interface Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * using publisher composition Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change contenttype Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * rename topic for publish and subscribe Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change errors to lower case Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change errors to lower case Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * export errors Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * queue per subscription Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * queue per subscription Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Merge branch 'master' into RabbitMQ-deployment Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * rename nats to broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change routing method Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Direct method with one exchange to many queues, one consumer per queue Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1263 - Move repeating errors to the separate package (#1540) * MF-1263 - Mv duplicated errors to pkg/errors Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert test build flags Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix merge Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix comment Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Fix auth members list response (#1555) * NOISSUE - Fix auth members list response Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Move group type next to page details Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm membersRes Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1261 - Use StatusUnauthorized for authn and StatusForbidden for authz (#1538) * MF-1261 - Use StatusUnauthorized for authn and StatusForbidden for authz Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * ErrExternalKey typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename ErrUnauthorizedAcces -> ErrAuthentication Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix bootstrap error Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix status code in openapi Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix test description Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix test description Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix test description Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add errors cases Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix status codes Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add gRPC stutus code Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix tests description Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix openapi and encodeError Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix grpc message Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix test descriptions Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert sdk error Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1059 - Add TLS support for email (#1560) * Use gomail package for sending emails Signed-off-by: Ivan Milosevic <iva@blokovi.com> * remove print err Signed-off-by: Ivan Milosevic <iva@blokovi.com> * Add vendor Signed-off-by: Ivan Milosevic <iva@blokovi.com> * Rename email structure remove logger Signed-off-by: Ivan Milosevic <iva@blokovi.com> * typo in var name Signed-off-by: Ivan Milosevic <iva@blokovi.com> * rename var Signed-off-by: Ivan Milosevic <iva@blokovi.com> * remove MF_EMAIL_SECRET Signed-off-by: Ivan Milosevic <iva@blokovi.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Refactor MQTT subscriber (#1561) * correct suscriber interface validator + refactore token error handling Signed-off-by: tzzed <zerouali.t@gmail.com> * apply review suggestion Signed-off-by: tzzed <zerouali.t@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1257 - Access messages from readers endpoint with user access token (#1470) * remove owner id Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add user auth for db reader Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * add user auth for db reader Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * enable mongodb reader for user token reading Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * use uuid check for auth switch between thing key and user tok Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * enable user token reading Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * revert to correct version Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix endpoint test, add additional tests Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove logs,dead code Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix logging messages Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove auth interface, add authorization header type Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * update api doc Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove unused package Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * some refactor of cases for authorization switch Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * correct description in openapi Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix endpoint test to match auth service change Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * some rename Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * initialize auth url Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * add env variables for auth service Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix spelling Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * Things prefix and no prefix for Thing authorization, Bearer for user Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * update readme file Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix default things grpc port Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * enable user reading for timescaledb Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove not used error Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * improve errors Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * refactor authorize Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * add chanID check Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * inline some error checking Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fixing errors Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fixing errors Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * improve test case description Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove test code Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * dont inline Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * refactor a bit encodeError Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove unused error Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * remove unused error Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * fix things auth grpc url Signed-off-by: mteodor <mirko.teodorovic@gmail.com> * rename variables for header prefix Signed-off-by: mteodor <mirko.teodorovic@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit for tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Bump up tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add more tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add go routines Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit of adding rabbitmq broker Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Initial commit for tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Bump up tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add more tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add go routines Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix with wait groups Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * unsubscribe to stop delivering messages Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove exclusivity Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1551 - Fix Cobra usage commands and clean unnecessary struct types (#1558) * MF-1551 - Fix Cobra usage commands and clean unnecessary struct types Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use linux syntax for cmd usage description Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix cmd.Use Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Separate Keto hosts for read and write (#1563) * Separate keto hosts for read and write Signed-off-by: Ivan Milosevic <iva@blokovi.com> * update readme with new envars Signed-off-by: Ivan Milosevic <iva@blokovi.com> * rename read connection name Signed-off-by: Ivan Milosevic <iva@blokovi.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Update dependencies (#1564) Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1240 - Return to service transport layer only service errors (#1559) * MF-1240 - Return to service transport layer only service errors Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Remove unecessary errors Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm duplicated errors and fix transport Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert http endpoint_test Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix conflict Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Implement cancel mechanisms Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Queuename as parameter Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Queuename as parameter Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1469 - Indicate proper authentication scheme in Authorization header (#1523) * MF-1469 - Indicate proper authentication scheme in Authorization header Signed-off-by: Stefan Kovacevic <jen2tri@gmail.com> * Fixing the remarks on the last push Signed-off-by: Stefan Kovacevic <jen2tri@gmail.com> * Remove Bearer prefix in all services and fix tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix remarks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Add nats wrapper for COAP (#1569) * Add nats wrapper for COAP Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Pass pubsub as argument Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Defer close connection Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Defer close connection Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Rename endpoint to topic Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1348 - Add transport errors logging (#1544) * MF-1348 - Add go-kit transport level logging Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix merge Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix remark Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix go test flags Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use httputil errors in things and http service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix SDK tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use httputil errors in certs and provision service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use httputil errors in consumers service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * General renaming and add ErrMissingToken Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename httputil -> apiutil and use errors in users servive Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use apiutil errors in auth, bootstrap, readers, things and twins Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Replace errors.Contain by comparison Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix remarks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify validateID Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify validateID Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify and rename ExtractAuthToken -> ExtractBearerToken Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix readers Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix auth key test and remarks Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Improve comment Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Simplify validateUUID check Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1567 - Use Bearer, Thing or Basic scheme in Authorization header (#1568) Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1565 - Document Bearer, Thing and Basic Authorization header (#1566) * MF-1565 - Document Bearer Authorization header Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix auth, bootstrap, http and readers openapi Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix openapi Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add enc key for bootstrap Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use global security Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix bearer formats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Polish descriptions Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix boostrap and typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1575 Add 'Name' field to ListMembers response in things svc (#1576) Signed-off-by: Ivan Balboteo <ivan@submer.com> Co-authored-by: Ivan Balboteo <ivan@submer.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1580 - Influxdb Writer changes format of update-time to string (#1581) * - MF-1580 - Modified consumers/writers/influxdb/fields.go - influxdb-writer used to update data type of update-time to string - Commented line 12 of consumers/writers/influxdb/fields.go to resolve uneccessary data type conversion issue Signed-off-by: Hasan Tariq <hasantariqashraf@gmail.com> * - MF-1580 - Removed strconv package from consumers/writers/influxdb/fields.go since it is no longer needed - Removed line 12 from consumers/writers/influxdb/fields.go - Replaced retrun value of updateTime with msg.UpdateTime (line 16 in fields.go) Signed-off-by: Hasan Tariq <hasantariqashraf@gmail.com> * Fix InflxuDB readers Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Co-authored-by: Hasan Tariq <hasant@plcgroup.com> Co-authored-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Unify MF_INFLUX_READER_DB_HOST and MF_INFLUX_WRITER_DB_HOST envars (#1585) Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Fix CoAP adapter (#1572) * Revert "NOISSUE - Add nats wrapper for COAP (#1569)" This reverts commit cc5d5195ab27fa94270ada616487b7053fd9c7bd. Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix CoAP adapter Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Update CoAP observation cancel Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix observe Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix GET handling Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Revert authorization Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Use constants instead of magic numbers Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Remove an empty line Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Extract special observe value to constant Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1582 - Fix lora-adapter MQTT client (#1583) * MF-1582 - Fix lora-adapter MQTT clien Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add timeout config to the mqtt subscriber Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm comment Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add sub timeout Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Update changelog and readme for release 0.13.0 (#1592) * Update release example Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Update changelog and examples for 0.13.0 release Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Update VerneMQ release (#1593) Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Update changelog for release 0.13.0 (#1595) Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * unexport constants Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change routingkey Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove wait groups Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * protecting map Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add publisher to pubsub Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change proto library Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix typos Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Reduce pubsub tests based on implementation Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Remove channel cancel Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Export constant Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Move invariant statements out of loop for cassandra-writer (#1596) Signed-off-by: fuzhy <fuzhy1997@outlook.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Embedding publisher into pubsub Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Naming publisher Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Fix Nginx entrypoint script (#1597) * Fix Nginx entrypoint script Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Update dependencies Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix NginX entrypoint Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Revert Makefile changes Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1525 - Add graceful stop for HTTP and GRPC servers (#1548) * Add : errgroup to cmd/auth Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : Handle graceful stop for auth service Remove : errgroups from auth service Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : Wait till server shutdown Signed-off-by: Arvindh <arvindh91@gmail.com> * Change : instead of waitgroup changed to errgroups Signed-off-by: Arvindh <arvindh91@gmail.com> * change : KillSignalHandler return type to error Signed-off-by: Arvindh <arvindh91@gmail.com> * Empty Commit Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : Context to http server shutdown Rename : varaible from proto to protocol Signed-off-by: Arvindh <arvindh91@gmail.com> * change : to default log level Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : Sign-off Signed-off-by: Arvindh <arvindh91@gmail.com> * Add: graceful stop of http and grpc server Signed-off-by: Arvindh <arvindh91@gmail.com> * Fix: typos and caps Signed-off-by: Arvindh <arvindh91@gmail.com> * Add: Signed-off Signed-off-by: Arvindh <arvindh91@gmail.com> * Rename: Func KillSignalHandler to SignalHandler Add: SIGABRT Signed-off-by: Arvindh <arvindh91@gmail.com> * Fix: auth service Signed-off-by: Arvindh <arvindh91@gmail.com> * Add: timeout for grpc gracefulstop Fix: typos Signed-off-by: Arvindh <arvindh91@gmail.com> * Add: .vscode folder to git ignore Signed-off-by: Arvindh <arvindh91@gmail.com> * change: variable name to stopWaitTime Signed-off-by: Arvindh <arvindh91@gmail.com> * remove: .vscode folder Signed-off-by: Arvindh <arvindh91@gmail.com> * remove: .vscode from .gitignore Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : logger to handlers Signed-off-by: Arvindh <arvindh91@gmail.com> * Add : New line at end of .gitignore file Signed-off-by: Arvindh <arvindh91@gmail.com> * Fix : variable naming Add : graceful stop for timescale Signed-off-by: Arvindh <arvindh91@gmail.com> * Remove : unsued NATS library from import Signed-off-by: Arvindh <arvindh91@gmail.com> * Move: "https" and "https" to moved to const var Signed-off-by: Arvindh <arvindh91@gmail.com> * Move: "http" and "https" to moved to const var Signed-off-by: Arvindh <arvindh91@gmail.com> * update: branch with master Signed-off-by: Arvindh <arvindh91@gmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF-1588 - Update Subscriber interface (#1598) * Initial commit Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Update subscriber interface Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * check subscription map Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Check topic id after topic Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * reword description Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Setup empty queue Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change mqtt implementation Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Switch statements Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Simplify Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change mqtt subscriber Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Protect subscription map Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix subscription Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Set client id Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Format Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change delete method Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Update rabbitmq subscriber interface Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * using publisher composition Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change contenttype Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * rename topic for publish and subscribe Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change errors to lower case Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change errors to lower case Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * export errors Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * MF - 1590 - Fix fetching list of users with a zero limit (#1594) * Add max and min limit size Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Format Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Format Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * NOISSUE - Retrieve client key on cert issuing (#1607) Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * fix bug (#1604) Signed-off-by: zhangchuanfeng <654300242@qq.com> Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * queue per subscription Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * queue per subscription Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change routing method Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Direct method with one exchange to many queues, one consumer per queue Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :recycle: Not casting data Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :pencil2: Fix typo Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :recycle: remove passed queue name Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :fire: removing echange kind Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Combine tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Refactor unsubscribe method Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix merge conflict Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :white_check_mark: sub and unsub to dummy topic Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * generate client id from topic and ID Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Rename topicID to clientID Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * update tests Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * merge changes Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :recycle: rename constant and variable declaration Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * rename to brokers Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * :recycle: Rename brokers Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change mqtt implementation Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Rename broker to brokers Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * include nats port Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * move to build tags Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * move to build tags Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * add nats build tag to test Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * \n at the end of file Signed-off-by: GitHub <noreply@github.com> * Add init function Signed-off-by: GitHub <noreply@github.com> * Add init function Signed-off-by: GitHub <noreply@github.com> * broker url automatically Signed-off-by: GitHub <noreply@github.com> * make nats as the default broker Signed-off-by: GitHub <noreply@github.com> * Updated publisher and subscriber interface Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Add error to close Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Change image version and let user define URI Signed-off-by: GitHub <noreply@github.com> * make broker url configurable Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * add compile check Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * rabbitmq check Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * default broker to nats Signed-off-by: GitHub <noreply@github.com> * change broker url in docker compose Signed-off-by: GitHub <noreply@github.com> * Fix ci Signed-off-by: GitHub <noreply@github.com> * fix makefile Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix env var and ci Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix ci Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> * Fix consts Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> Co-authored-by: Manuel Imperiale <manuel.Imperiale@gmail.com> Co-authored-by: Ivan Milošević <iva@blokovi.com> Co-authored-by: __touk__ <zerouali.t@gmail.com> Co-authored-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com> Co-authored-by: stefankovacevic123 <jen2tri@gmail.com> Co-authored-by: ibalboteo <ivanbalboteo@gmail.com> Co-authored-by: Ivan Balboteo <ivan@submer.com> Co-authored-by: Hasan98-git <67228396+Hasan98-git@users.noreply.github.com> Co-authored-by: Hasan Tariq <hasant@plcgroup.com> Co-authored-by: fuzhy <fuzhy1997@outlook.com> Co-authored-by: Arvindh <30824765+arvindh123@users.noreply.github.com> Co-authored-by: 张传峰 <59160162+zhang-chuanfeng@users.noreply.github.com>
2022-06-21 23:40:20 +08:00
Running this service outside of container requires working instance of the message broker service.
MF-374 - Bring back CoAP adapter (#413) * Bring old CoAP code back Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix channel ID formatting due to type change Uncomment error handling for authorization. Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update CoAP adapter docs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove redundant type declaration Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to the list of services Add CoAp adapter in Makefile services list and fix corresponding documentation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP code Merge multipe `const` block int single and declare consts before vars. Un-export notFound handler since there is no need to export it. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update http version endpoint This separates CoAP and HTTP APIs. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP POST method handling This PR is a part of CoAP adapter refactoring that will simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP adapter Change CoAP message handling to simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add backoff timeout for server ping to client Update CoAP adapter to provide subset of necessary features from protocol specification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix leaking locked goroutine In case of the stopped ticker, its channel is NOT closed, so pinging might be left stuck waiting for the stopped ticker to send a notification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Format code Use more meaningful name for Handlers map. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use and stop ticker from the same goroutine Stop handler Ticker from ping goroutine rather than the cancel goroutine. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Check if subscription already exists in put method Fix potential leak of handlers providing check inside of put method. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use MessageID as Observe option Since MessageID satisfies observe option behaviour, use Message ID instead of local timestamp. Remove Thicker from handler and use it on transport layer. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use name Observer insted of Handler Name `Observer` is used in protocol specification, so this naming makes code more self-documenting. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to docker-compose.yml Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove unused constants Fix service name in startup log message. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add metrics endpoint Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor code Config fields from main.go should not be exported; minor style changes. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update authorization URI-Query option Use `authorization` value in URI-Query option instead of `key`. This mimics Authorization header in some other protocols (e.g. HTTP). Please note that this value can be replaced with simple `auth` to save space, due to constrained URI-Query option size. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-01 01:53:25 +08:00
To start the service outside of the container, execute the following shell script:
```bash
# download the latest version of the service
git clone https://github.com/mainflux/mainflux
MF-374 - Bring back CoAP adapter (#413) * Bring old CoAP code back Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix channel ID formatting due to type change Uncomment error handling for authorization. Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update CoAP adapter docs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove redundant type declaration Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to the list of services Add CoAp adapter in Makefile services list and fix corresponding documentation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP code Merge multipe `const` block int single and declare consts before vars. Un-export notFound handler since there is no need to export it. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update http version endpoint This separates CoAP and HTTP APIs. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP POST method handling This PR is a part of CoAP adapter refactoring that will simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP adapter Change CoAP message handling to simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add backoff timeout for server ping to client Update CoAP adapter to provide subset of necessary features from protocol specification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix leaking locked goroutine In case of the stopped ticker, its channel is NOT closed, so pinging might be left stuck waiting for the stopped ticker to send a notification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Format code Use more meaningful name for Handlers map. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use and stop ticker from the same goroutine Stop handler Ticker from ping goroutine rather than the cancel goroutine. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Check if subscription already exists in put method Fix potential leak of handlers providing check inside of put method. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use MessageID as Observe option Since MessageID satisfies observe option behaviour, use Message ID instead of local timestamp. Remove Thicker from handler and use it on transport layer. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use name Observer insted of Handler Name `Observer` is used in protocol specification, so this naming makes code more self-documenting. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to docker-compose.yml Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove unused constants Fix service name in startup log message. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add metrics endpoint Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor code Config fields from main.go should not be exported; minor style changes. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update authorization URI-Query option Use `authorization` value in URI-Query option instead of `key`. This mimics Authorization header in some other protocols (e.g. HTTP). Please note that this value can be replaced with simple `auth` to save space, due to constrained URI-Query option size. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-01 01:53:25 +08:00
cd mainflux
MF-374 - Bring back CoAP adapter (#413) * Bring old CoAP code back Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix channel ID formatting due to type change Uncomment error handling for authorization. Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update CoAP adapter docs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove redundant type declaration Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to the list of services Add CoAp adapter in Makefile services list and fix corresponding documentation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP code Merge multipe `const` block int single and declare consts before vars. Un-export notFound handler since there is no need to export it. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update http version endpoint This separates CoAP and HTTP APIs. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP POST method handling This PR is a part of CoAP adapter refactoring that will simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP adapter Change CoAP message handling to simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add backoff timeout for server ping to client Update CoAP adapter to provide subset of necessary features from protocol specification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix leaking locked goroutine In case of the stopped ticker, its channel is NOT closed, so pinging might be left stuck waiting for the stopped ticker to send a notification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Format code Use more meaningful name for Handlers map. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use and stop ticker from the same goroutine Stop handler Ticker from ping goroutine rather than the cancel goroutine. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Check if subscription already exists in put method Fix potential leak of handlers providing check inside of put method. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use MessageID as Observe option Since MessageID satisfies observe option behaviour, use Message ID instead of local timestamp. Remove Thicker from handler and use it on transport layer. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use name Observer insted of Handler Name `Observer` is used in protocol specification, so this naming makes code more self-documenting. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to docker-compose.yml Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove unused constants Fix service name in startup log message. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add metrics endpoint Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor code Config fields from main.go should not be exported; minor style changes. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update authorization URI-Query option Use `authorization` value in URI-Query option instead of `key`. This mimics Authorization header in some other protocols (e.g. HTTP). Please note that this value can be replaced with simple `auth` to save space, due to constrained URI-Query option size. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-01 01:53:25 +08:00
# compile the http
make coap
# copy binary to bin
make install
# set the environment variables and run the service
MF-1096 - Fix AuthN and Things Auth ENVARS (#1066) * NOISSUE - Fix AuthN and Things Auth ENVARS Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add DB envars to env.go Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix envars Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add DefLogLLevelError Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix DB names Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix DB names Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix DB names and HTTP ports Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix .env Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert writers DB names Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm unused Twins envars Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Remove definitions from env.go Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert HTTP gRPC ports Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use default NATS URL as string Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert default ports Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix cassandra ENVARS Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix cassandra reader ENVARS Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix readers and writers envars Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix readers and writers .env Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-07 18:02:17 +08:00
MF_COAP_ADAPTER_LOG_LEVEL=[Service log level] \
MF_COAP_ADAPTER_HOST=[CoAP service host] \
MF_COAP_ADAPTER_PORT=[CoAP service port] \
MF_COAP_ADAPTER_SERVER_CERT=[Path to CoAP server certificate] \
MF_COAP_ADAPTER_SERVER_KEY=[Path to CoAP server key] \
MF_COAP_ADAPTER_HTTP_HOST=[CoAP HTTP service host] \
MF_COAP_ADAPTER_HTTP_PORT=[CoAP HTTP service port] \
MF_COAP_ADAPTER_HTTP_SERVER_CERT=[Path to HTTP server certificate] \
MF_COAP_ADAPTER_HTTP_SERVER_KEY=[Path to HTTP server key] \
MF-1096 - Fix AuthN and Things Auth ENVARS (#1066) * NOISSUE - Fix AuthN and Things Auth ENVARS Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add DB envars to env.go Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix envars Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add DefLogLLevelError Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix DB names Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix DB names Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix DB names and HTTP ports Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix .env Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert writers DB names Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm unused Twins envars Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Remove definitions from env.go Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert HTTP gRPC ports Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use default NATS URL as string Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert default ports Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix cassandra ENVARS Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix cassandra reader ENVARS Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix readers and writers envars Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix readers and writers .env Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-07 18:02:17 +08:00
MF_THINGS_AUTH_GRPC_URL=[Things service Auth gRPC URL] \
MF_THINGS_AUTH_GRPC_TIMEOUT=[Things service Auth gRPC request timeout in seconds] \
MF_THINGS_AUTH_GRPC_CLIENT_TLS=[Flag that indicates if TLS should be turned on] \
MF_THINGS_AUTH_GRPC_CA_CERTS=[Path to trusted CAs in PEM format] \
NOISSUE - Make MQTT Broker Configurable (#1904) * Minor changes on mqtt publisher using nats Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Remove vernemq dependencies Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Restore VerneMQ config files Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Makefile to support custom Docker profiles The Makefile has been updated to support custom Docker profiles. Previously, the Makefile only supported the default profiles for the message broker and MQTT broker. Now, the Makefile allows for custom profiles to be specified using environment variables. If the MF_BROKER_TYPE or MF_MQTT_BROKER_TYPE variables are not set, the default values "nats" and "nats" will be used, respectively. This change enables more flexibility in configuring the Docker environment for the project. The `run` target has also been modified to use the correct broker configuration file based on the MF_BROKER_TYPE variable. The sed command in the `run` target now replaces the placeholder in the docker/docker-compose.yml file with the appropriate broker configuration file. This commit improves the Makefile to support custom Docker profiles and ensures the correct broker configuration file is used when running the project. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix queue binding issue in RabbitMQ pubsub The commit fixes an issue in the RabbitMQ pubsub implementation where the queue binding was not correctly set up. Instead of using the topic as the queue name, the commit now uses a unique client ID generated by combining the topic and subscriber ID. This ensures that each subscriber has its own dedicated queue. The commit also updates the queue binding to use the correct queue name. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor Docker config editing in Makefile The commit refactors the `edit_docker_config` function in the Makefile to improve readability and maintainability. The changes include: - Removing unnecessary conditionals related to the `rabbitmq` broker These changes ensure that the Docker configuration is correctly updated based on the specified MQTT broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix failing tests on RabbitMQ Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor MQTT_BROKER comment in docker-compose.yml The MQTT_BROKER comment in the docker-compose.yml file has been updated to provide a more accurate description of its functionality. The comment now states that the MQTT_BROKER handles MQTT communication between MQTT adapters and the message broker, instead of Mainflux services. This change improves clarity and aligns with the actual purpose of the MQTT_BROKER. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename `MF_BROKER` to `MF_MESSAGE_BROKER` The Makefile and Semaphore configuration files have been refactored to update the variable names related to the message broker type. These changes ensure consistency and clarity in the codebase by using more descriptive variable names related to the message broker type. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix Docker profile configuration for nats_rabbitmq Update the Docker profile configuration for nats_rabbitmq by replacing the NATS URL in the .env file with the correct value. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Rename MF_BROKER_URL to MF_MESSAGE_BROKER_URL Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix MQTT QoS level in pubsub.go The MQTT QoS level in the pubsub.go file was set to 1, which is the default level. However, since NATS supports up to QoS 1, I updated the QoS level comment to reflect this. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Refactor NewPublisher to accept QoS parameter The NewPublisher function in the pkg/messaging/mqtt/publisher.go file has been refactored to accept a new parameter, qos, which represents the Quality of Service level for MQTT message publishing. This change allows for more flexibility in configuring the MQTT publisher. The NewPublisher function now has the following signature: ```go func NewPublisher(address string, qos uint8, timeout time.Duration) (messaging.Publisher, error) ``` This change ensures that the MQTT publisher can be created with the desired QoS level, enhancing the reliability and delivery guarantees of the published messages. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Fix test assertions in pubsub_test.go The test assertions in the pubsub_test.go file were incorrect. This commit fixes the assertions to properly compare the expected and received message values. Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * Test configurable MQTT broker Signed-off-by: rodneyosodo <blackd0t@protonmail.com> --------- Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Signed-off-by: rodneyosodo <blackd0t@protonmail.com>
2023-10-20 03:01:09 +08:00
MF_MESSAGE_BROKER_URL=[Message broker instance URL] \
MF_JAEGER_URL=[Jaeger server URL] \
MF_SEND_TELEMETRY=[Send telemetry to mainflux call home server] \
MF_COAP_ADAPTER_INSTANCE_ID=[CoAP adapter instance ID] \
MF-1096 - Fix AuthN and Things Auth ENVARS (#1066) * NOISSUE - Fix AuthN and Things Auth ENVARS Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add DB envars to env.go Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix envars Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add DefLogLLevelError Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix DB names Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix DB names Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix DB names and HTTP ports Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix .env Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert writers DB names Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm unused Twins envars Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Remove definitions from env.go Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert HTTP gRPC ports Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use default NATS URL as string Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert default ports Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix cassandra ENVARS Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix cassandra reader ENVARS Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix readers and writers envars Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix readers and writers .env Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2020-04-07 18:02:17 +08:00
$GOBIN/mainflux-coap
MF-374 - Bring back CoAP adapter (#413) * Bring old CoAP code back Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix channel ID formatting due to type change Uncomment error handling for authorization. Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update CoAP adapter docs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove redundant type declaration Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to the list of services Add CoAp adapter in Makefile services list and fix corresponding documentation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP code Merge multipe `const` block int single and declare consts before vars. Un-export notFound handler since there is no need to export it. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update http version endpoint This separates CoAP and HTTP APIs. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP POST method handling This PR is a part of CoAP adapter refactoring that will simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP adapter Change CoAP message handling to simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add backoff timeout for server ping to client Update CoAP adapter to provide subset of necessary features from protocol specification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix leaking locked goroutine In case of the stopped ticker, its channel is NOT closed, so pinging might be left stuck waiting for the stopped ticker to send a notification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Format code Use more meaningful name for Handlers map. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use and stop ticker from the same goroutine Stop handler Ticker from ping goroutine rather than the cancel goroutine. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Check if subscription already exists in put method Fix potential leak of handlers providing check inside of put method. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use MessageID as Observe option Since MessageID satisfies observe option behaviour, use Message ID instead of local timestamp. Remove Thicker from handler and use it on transport layer. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use name Observer insted of Handler Name `Observer` is used in protocol specification, so this naming makes code more self-documenting. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to docker-compose.yml Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove unused constants Fix service name in startup log message. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add metrics endpoint Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor code Config fields from main.go should not be exported; minor style changes. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update authorization URI-Query option Use `authorization` value in URI-Query option instead of `key`. This mimics Authorization header in some other protocols (e.g. HTTP). Please note that this value can be replaced with simple `auth` to save space, due to constrained URI-Query option size. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
2018-11-01 01:53:25 +08:00
```
## Usage
If CoAP adapter is running locally (on default 5683 port), a valid URL would be: `coap://localhost/channels/<channel_id>/messages?auth=<thing_auth_key>`.
Since CoAP protocol does not support `Authorization` header (option) and options have limited size, in order to send CoAP messages, valid `auth` value (a valid Thing key) must be present in `Uri-Query` option.