carbon-io / carbond

MIT License
2 stars 5 forks source link

Add 405 response and logging if operation is disabled #271

Open tfogo opened 6 years ago

tfogo commented 6 years ago

I think the service should log if an operation is attempted that has been disabled. Probably at the debug level. Currently it looks like nothing is logged.

tfogo commented 6 years ago

Notes from the Carbon meeting:

This is because we only create express routes for operations which are listed as enabled. We don't have much control over logging this because it's handled by the express layer.

We may change the way we create endpoints with express. This would give us more power to do things like this. Greg also said it might be more performant as we wouldn't be duplicating authenticators etc.

tfogo commented 6 years ago

Additionally, we should probably be returning 405 (Method Not Allowed) errors if a method is disabled. Currently we are returning a 404.