I have a set of API’s that are created using the Dashboard API, I am using JWT authentication, and I seem to have the entire situation working properly.
However, when I was building and testing the configs, I would run into a problem that would result in the following log entry from the gateway:
time="Mar 27 13:46:48" level=info msg="Attempted access to unauthorised API." api_found=false key="<hidden>" origin=172.20.0.7 path="/log/activity"
and also this response:
"error": "Access to this API has been disallowed"
By going to the Dashboard and “updating” the API, the api would register and the traffic would pass through. I tracked all of this down to configuration issues in the JSON, and I got everything working fine on my machine…
When handing this all over to another person on the team, they are having issues that I was seeing previously while using the same config that I have working. Updating in the dashboard seems to solve the problem.
We think this may be due to machine speed. We also had to add a “rest” in the build process between when the mongo container was launched, and when the gateway container was started. While the gateway container does have a retry, it was not long enough and the gateway container would fail as a result.
We were wondering if there is also some kind of latency or race condition that could prevent the registration of an API from becoming available. There doesn’t seem to be any config issues, as we pull the JSON before “updating” and after using the dashboard API, and there is no difference between the output. But the update is doing something that perhaps we should be doing during our build process (which, for the record is a custom system, but not unlike the docker compose process). A reload of everything, perhaps?