ExpressGateway / express-gateway

A microservices API Gateway built on top of Express.js
https://www.express-gateway.io
Apache License 2.0
2.98k stars 348 forks source link

[Bug] Policy display in case of missing #923

Closed celian-garcia closed 5 years ago

celian-garcia commented 5 years ago

Description

Hello guys, this is a really minor bug, but, in the field policies of the gateway.config.yml file, if you use a policy that does not exist, it displays a message that does not contain the missing policy.

Reproduce

gateway.config.yml

http:
  port: 8000
admin:
  port: 9876
  host: localhost
apiEndpoints:
  # see: http://www.express-gateway.io/docs/configuration/gateway.config.yml/apiEndpoints
serviceEndpoints:
  # see: http://www.express-gateway.io/docs/configuration/gateway.config.yml/serviceEndpoints
policies:
  - name: toto
pipelines:
  # see: https://www.express-gateway.io/docs/configuration/gateway.config.yml/pipelines

What we see

npm start

...
2019-06-23T07:31:29.739Z [EG:policy] error: Could not find policy [object Object], Please make sure the plugins providing such policy
     is correctly configured in system.config file.
...

What we should see

npm start

...
2019-06-23T07:31:29.739Z [EG:policy] error: Could not find policy 'toto', Please make sure the plugins providing such policy
     is correctly configured in system.config file.
...
XVincentX commented 5 years ago

Your configuration is indeed invalid — that's why you're seeing an incorrect error message. It should be

- name: toto
+ toto

In any case, the schema should have catch that. 1f29dca fixes this.

Thanks!

celian-garcia commented 5 years ago

Ah yeah thanks, maybe you could consider to modify this part of documentation ? https://www.express-gateway.io/docs/configuration/gateway.config.yml/policies/

XVincentX commented 5 years ago

Done!

On 23 Jun 2019, at 12:10, Célian GARCIA notifications@github.com wrote:

Ah yeah thanks, maybe you could consider to modify this part of documentation ? https://www.express-gateway.io/docs/configuration/gateway.config.yml/policies/ https://www.express-gateway.io/docs/configuration/gateway.config.yml/policies/ — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/ExpressGateway/express-gateway/issues/923?email_source=notifications&email_token=AAKZYIDUUQFPVSFH2XM2JQTP35DZHA5CNFSM4H2YJKZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYK26WA#issuecomment-504737624, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKZYIDU3GRE3VKPQ5V2SMLP35DZHANCNFSM4H2YJKZA.