pomerium/config
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
..
envoyconfig config: use stable route ids for authorize matching and order xds responses (#5618) 2025-05-19 10:52:15 -06:00
otelconfig Refactor trace config to match supported otel options (#5447) 2025-01-30 11:59:19 -05:00
testdata
autocert.go core/ci: update linting (#4844) 2023-12-14 09:07:54 -08:00
autocert_test.go upgrade to go v1.24 (#5562) 2025-04-02 15:53:09 -06:00
bearer_token_format.go authorize: support authenticating with idp tokens (#5484) 2025-02-18 13:02:06 -07:00
codec_type.go HTTP/3 Support (#5349) 2024-11-19 08:48:30 -07:00
codec_type_test.go config: default to http2 (#3660) 2022-10-12 14:46:06 -06:00
config.go config: minor cleanup in GenerateCatchAllCertificate (#5397) 2024-12-18 13:21:48 -08:00
config_source.go logging: standardize on hyphens in attribute names (#5577) 2025-04-22 10:57:19 -07:00
config_source_test.go fileutil: reimplement file watcher (#5498) 2025-02-26 09:21:06 -07:00
config_test.go upgrade to go v1.24 (#5562) 2025-04-02 15:53:09 -06:00
constants.go authorize: support authenticating with idp tokens (#5484) 2025-02-18 13:02:06 -07:00
custom.go mcp: pass access token to the upstream (#5593) 2025-04-29 12:13:18 -04:00
custom_test.go core/lint: upgrade golangci-lint, replace interface{} with any (#5099) 2024-05-02 14:33:52 -06:00
doc.go
from.go core/config: add support for stripping the port for matching routes (#5085) 2024-04-26 08:24:46 -06:00
from_test.go change Policy.Matches to accept a URL pointer (#5360) 2024-11-07 14:55:44 -05:00
helpers.go core/redis: remove redis (#4768) 2023-11-28 13:14:36 -07:00
helpers_test.go
http.go core/logging: change log.Error function (#5251) 2024-09-05 15:42:46 -06:00
http_test.go core/lint: upgrade golangci-lint, replace interface{} with any (#5099) 2024-05-02 14:33:52 -06:00
identity.go authorize: support authenticating with idp tokens (#5484) 2025-02-18 13:02:06 -07:00
layered.go core/logging: change log.Error function (#5251) 2024-09-05 15:42:46 -06:00
layered_test.go core/lint: upgrade golangci-lint, replace interface{} with any (#5099) 2024-05-02 14:33:52 -06:00
log.go New tracing system (#5388) 2025-01-21 13:26:32 -05:00
log_level.go config: validate log levels (#4367) 2023-07-17 16:41:48 -06:00
metrics.go cleanup logs (#5571) 2025-04-14 08:20:10 -06:00
metrics_test.go core/lint: upgrade golangci-lint, replace interface{} with any (#5099) 2024-05-02 14:33:52 -06:00
mtls.go Core-Zero Import (#5288) 2024-10-09 18:51:56 -04:00
mtls_test.go add mTLS UserPrincipalName SAN match (#5177) 2024-07-26 10:23:19 -07:00
options.go mcp: pass access token to the upstream (#5593) 2025-04-29 12:13:18 -04:00
options_check.go Refactor trace config to match supported otel options (#5447) 2025-01-30 11:59:19 -05:00
options_test.go mcp: add upstream oauth2 config types (#5592) 2025-04-28 19:18:44 -04:00
policy.go config: use stable route ids for authorize matching and order xds responses (#5618) 2025-05-19 10:52:15 -06:00
policy_ppl.go ppl: fix empty/no-op allow block added in some cases to converted PPL policies (#5289) 2024-09-16 18:52:54 -04:00
policy_ppl_test.go policy: support emails from directory user (#5504) 2025-02-27 13:39:28 -07:00
policy_test.go config: use stable route ids for authorize matching and order xds responses (#5618) 2025-05-19 10:52:15 -06:00
runtime_flags.go mcp: add global runtime flag (#5604) 2025-05-02 16:33:42 -04:00
session.go only support loading idp tokens via bearer tokens (#5545) 2025-03-26 09:47:40 -06:00
session_test.go only support loading idp tokens via bearer tokens (#5545) 2025-03-26 09:47:40 -06:00
validate.go config: add cookie_same_site option (#4148) 2023-05-03 14:36:42 -06:00