New implementation of API Gateway using golang http server and in-memory cache.
A function to generate private key & self-signed certificate. Used when HTTPS is enabled but no certificate or key is set.
Fixed
Make API Manager's controller actually use Gateway.AddAPI() when creating new API instead of reusing UpdateAPI().
Fix e2e run_with_retry which would not work correctly with empty strings on certain bash versions.
Fix minor issues.
Note: Local API gateway does a best effort to match Kong's behavior and currently passes e2e tests:
➜ export API_GATEWAY_HTTP_HOST="http://127.0.0.1:8081"
➜ export API_GATEWAY_HTTPS_HOST="https://127.0.0.1:8444"
➜ INSTALL_DISPATCH=0 e2e/scripts/run-e2e.sh e2e/tests/apis.bats
=> running clean first
✓ Clean all
1 test, 0 failures
=> e2e/tests/apis.bats
✓ Create Images for test
✓ Create Functions for test
✓ Test APIs with HTTP(S)
✓ Test APIs with HTTPS ONLY
✓ Test APIs with Kong Plugins
✓ Test APIs with CORS
✓ Test API Updates
✓ Cleanup
8 tests, 0 failures
finished
When executed like this:
➜ dispatch-server local --enable-tls
INFO[0000] API Gateway: serving HTTP traffic at http://127.0.0.1:8081
WARN[0000] HTTPS requested but key and cert paths are empty. using self-generated PKI
INFO[0000] API Gateway: serving HTTPS traffic at https://127.0.0.1:8444
WARN[0000] Tracer endpoint not provided, OpenTracing is disabled
INFO[0000] Dispatch HTTP server: serving HTTP traffic at http://127.0.0.1:8080
WARN[0000] HTTPS requested but key and cert paths are empty. using self-generated PKI
INFO[0000] Dispatch HTTP server: serving HTTPS traffic at https://127.0.0.1:8443
Part of https://github.com/vmware/dispatch/issues/518
Added
Fixed
Note: Local API gateway does a best effort to match Kong's behavior and currently passes e2e tests:
When executed like this: