solo-io / gloo-portal-issues

Public tracker for issues related to Gloo Portal
https://docs.solo.io/gloo-portal/latest/
1 stars 3 forks source link

Newly generated api-keys in Portal are not respected until Environment is deleted/recreated for Istio Integration #119

Closed ably77 closed 2 years ago

ably77 commented 2 years ago

Describe the bug When using Gloo Portal + Istio following the istio setup and Getting Started using the UI docs a newly generated api-key is not respected and results in a 401 Unauthorized

% curl "http://api.example.com:${INGRESS_PORT}/api/pets" -H  "accept: application/json" -H 'api-key: NDBhMTFjNWQtN2IyZS1mNmM3LWQ4YTQtMTBkOWMzZGZhMTVk' -v
*   Trying 34.74.233.33...
* TCP_NODELAY set
* Connected to api.example.com (34.74.233.33) port 80 (#0)
> GET /api/pets HTTP/1.1
> Host: api.example.com
> User-Agent: curl/7.64.1
> accept: application/json
> api-key: NDBhMTFjNWQtN2IyZS1mNmM3LWQ4YTQtMTBkOWMzZGZhMTVk
> 
< HTTP/1.1 401 Unauthorized
< www-authenticate: API key is missing or invalid
< date: Thu, 30 Sep 2021 18:21:56 GMT
< server: istio-envoy
< content-length: 0
< 
* Connection #0 to host api.example.com left intact
* Closing connection 0

If you delete/recreate the environment through the UI, or CLI the existing api-key will then be valid

% curl "http://api.example.com:${INGRESS_PORT}/api/pets" -H  "accept: application/json" -H 'api-key: NDBhMTFjNWQtN2IyZS1mNmM3LWQ4YTQtMTBkOWMzZGZhMTVk' -v
*   Trying 34.74.233.33...
* TCP_NODELAY set
* Connected to api.example.com (34.74.233.33) port 80 (#0)
> GET /api/pets HTTP/1.1
> Host: api.example.com
> User-Agent: curl/7.64.1
> accept: application/json
> api-key: NDBhMTFjNWQtN2IyZS1mNmM3LWQ4YTQtMTBkOWMzZGZhMTVk
> 
< HTTP/1.1 200 OK
< content-type: application/json
< date: Thu, 30 Sep 2021 18:26:51 GMT
< content-length: 86
< x-envoy-upstream-service-time: 0
< server: istio-envoy
< 
[{"id":1,"name":"Dog","status":"available"},{"id":2,"name":"Cat","status":"pending"}]
* Connection #0 to host api.example.com left intact
* Closing connection 0

To Reproduce Steps to reproduce the behavior: Follow the instructions.md in this .zip CORS.zip

Alternatively, just walk through the doc examples: Setup - Istio All of the Admin Console Guides

Expected behavior A newly generated api-key should just work without recreation of Environment

Additional context Add any other context about the problem here, e.g.