pomerium/proxy/portal
Caleb Doxsey 7a6d7c5a3c
config: use stable route ids for authorize matching and order xds responses (#5618)
## Summary
Update the `RouteID` to use the `policy.ID` if it is set. This makes it
so that updated routes use a stable identifier between updates so if the
envoy control plane is updated before the authorize service's internal
definitions (or vice-versa) the authorize service will still be able to
match the route.

The current behavior results in a 404 if envoy passes the old route id.
The new behavior will result in inconsistency, but it should be quickly
remedied. To help with debugging 4 new fields were added to the
authorize check log. The `route-id` and `route-checksum` as the
authorize sees it and the `envoy-route-id` and `envoy-route-checksum` as
envoy sees it.

I also updated the way we send updates to envoy to try and model their
recommended approach:

> In general, to avoid traffic drop, sequencing of updates should follow
a make before break model, wherein:
> 
> - CDS updates (if any) must always be pushed first.
> - EDS updates (if any) must arrive after CDS updates for the
respective clusters.
> - LDS updates must arrive after corresponding CDS/EDS updates.
> - RDS updates related to the newly added listeners must arrive after
CDS/EDS/LDS updates.
> - VHDS updates (if any) related to the newly added RouteConfigurations
must arrive after RDS updates.
> - Stale CDS clusters and related EDS endpoints (ones no longer being
referenced) can then be removed.

This should help avoid 404s when configuration is being updated.

## Related issues
-
[ENG-2386](https://linear.app/pomerium/issue/ENG-2386/large-number-of-routes-leads-to-404s-and-slowness)

## Checklist
- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review
2025-05-19 10:52:15 -06:00
..
logos proxy: well known service icons (#5453) 2025-01-30 08:52:59 -07:00
filter.go proxy: add route portal json (#5428) 2025-01-22 13:45:20 -07:00
filter_test.go proxy: add route portal json (#5428) 2025-01-22 13:45:20 -07:00
logo_provider.go proxy: well known service icons (#5453) 2025-01-30 08:52:59 -07:00
logo_provider_favicon.go proxy: add short timeout for logo discovery (#5506) 2025-02-28 09:59:03 -07:00
logo_provider_test.go proxy: add short timeout for logo discovery (#5506) 2025-02-28 09:59:03 -07:00
logo_provider_well_known.go proxy: well known service icons (#5453) 2025-01-30 08:52:59 -07:00
matchers.go proxy: add route portal json (#5428) 2025-01-22 13:45:20 -07:00
matchers_test.go proxy: add route portal json (#5428) 2025-01-22 13:45:20 -07:00
portal.go config: use stable route ids for authorize matching and order xds responses (#5618) 2025-05-19 10:52:15 -06:00
portal_test.go proxy: fix connect command in routes portal (#5475) 2025-02-13 11:44:18 -07:00