americanas-tech / restQL-golang

Microservice query language and platform
http://restql.b2w.io/
MIT License
17 stars 8 forks source link

Add enable flag to middlewares and remove mappings field #50

Closed caiorcferreira closed 3 years ago

caiorcferreira commented 3 years ago

This PR breaks the contract of the YAML configuration file.

It introduces an enable flag to all middlewares. This fix the CORS configuration that, although could be customized via environment variables, could not be activated through env vars. Now, the RESTQL_CORS_ENABLED overwrites the enable flag on the YAML config file for the CORS middleware. In order to prevent this problem with other middlewares we turn this contract the standard and added the enable flag to all of them.

Since this will lead to a major release, this PR also removes the mappings field from the configuration file, which allowed for resource mappings without a binding to a tenant.

Since version v4.4.0 restQL provides the tenants field on its configuration to set tenant binding static resource mappings.