Commit b199560
authored
Add support for SDS (#6597)
Motivation:
#6610 should be reviewed/merged
before this PR
This changeset is part of an ongoing effort to support per-request TLS
configurations by making xDS TLS resources first‑class. It adds minimal
`Secret` (SDS) support so TLS certificates and validation contexts can
be resolved (static or dynamic) and observed, including file-backed
updates.
Modifications:
- Added `Secret` (SDS) resource parsing and registered the `Secret` type
in discovery (`XdsType`, parser registry, and SOTW stubs).
- Introduced TLS/transport socket snapshots and streaming resolution for
secrets and TLS config.
- Wired bootstrap static secrets into the subscription context.
- Integrated file-backed `DataSource` watching via
`DirectoryWatchService` and `PathWatcher`.
- Extended cluster snapshots to include default `transport_socket` and
`transport_socket_matches`.
- New classes grouped by role:
- Secrets/resources:
- `BootstrapSecrets`: stores static bootstrap `Secret` resources for
name lookup.
- `SecretResourceParser`: parses `Secret` resources for the xDS
pipeline.
- `SecretXdsResource`: xDS resource wrapper for `Secret`s.
- `SecretStream`: resolves `Secret`s via ADS/SDS or bootstrap lookup.
- TLS snapshots:
- `TlsCertificateSnapshot`: snapshot of TLS certificate plus parsed
`TlsKeyPair`.
- `CertificateValidationContextSnapshot`: snapshot of validation context
plus parsed CA certs.
- `TransportSocketSnapshot`: snapshot of transport socket with TLS
material.
- `TransportSocketMatchSnapshot`: snapshot for conditional transport
socket matches.
- TLS/data streams:
- `TlsCertificateStream`: resolves TLS certificates from `Secret` +
`DataSource`.
- `CertificateValidationContextStream`: resolves validation contexts
from `Secret` + `DataSource`.
- `TransportSocketStream`: resolves transport socket TLS settings into
snapshots.
- `DataSourceStream`: resolves inline/env/file `DataSource` bytes and
watches files.
- Stream utilities:
- `CombineLatest2Stream`: combines two snapshot streams and emits latest
pairs.
- `CombineLatest3Stream`: combines three snapshot streams and emits
latest triples.
Result:
- Users can configure TLS via static or SDS-provided secrets and observe
updated transport socket snapshots; file-backed cert/CA updates are
propagated to snapshots.1 parent c3d7df6 commit b199560
File tree
33 files changed
+4475
-74
lines changed- it/xds-client/src/test/java/com/linecorp/armeria/xds/it
- xds/src/main/java/com/linecorp/armeria/xds
33 files changed
+4475
-74
lines changedLines changed: 153 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
0 commit comments