Repository navigation
Commit f7ec207
[Cosmos Encryption] Encrypt each array element independently for mixed-type arrays (#51247)
* Fix mixed-array client-side encryption
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Report legacy mixed-array decryption failures
Fail array decryption with actionable migration guidance while preserving the original cause. Document the upgrade break and cover legacy scalar representations and authentication failures.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix encryption changelog migration link
Use an absolute URL to satisfy the Verify Links check.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Align encryption changelog PR references
Match azure-cosmos changelog formatting for the mixed-array fix and upgrade guidance.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add mixed-array encryption compatibility opt-out
Support JVM and environment opt-out with a shared client configuration snapshot. Preserve legacy traversal for coordinated migration and identify explicit opt-out in the user agent.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix Cosmos gateway user agent propagation
Resolve the user agent from the shared container when gateway and thin-client requests are serialized so feature flags evaluated after store-model construction reach the wire. Add coverage for database-account and thin-client HTTP headers.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit be7befe)
* Simplify Cosmos gateway default headers
Avoid overridable default-header construction in the gateway base constructor. Keep transport defaults static and resolve only the mutable user-agent value when each request is serialized.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 9b2ee77)
* Refresh Cosmos user agent at serialization boundary
Preserve the existing default-header construction and merge paths. Replace only the serialized User-Agent value immediately before gateway and thin-client HTTP requests are created.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 234ba13)
* Update Cosmos changelog for user agent propagation
Document that Gateway and thin-client request headers now include feature flags evaluated after transport initialization.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 43e221c)
* Refine Cosmos user agent changelog entry
Keep the entry focused on the externally visible header behavior.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 04364a7)
* Harden Cosmos user agent propagation
Publish suffix updates atomically, preserve case-insensitive request overrides, and evaluate configuration-known feature flags before the bootstrap account request.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit aedf49c)
* Remove user agent hot-path locking
Publish complete user-agent snapshots through a volatile reference while retaining a writer lock for compound updates. Avoid scanning request headers by using the merged case-insensitive header value to detect SDK defaults.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 44fe92a)
* Simplify Gateway user agent refresh
Apply the current SDK user agent before request overrides are merged. This removes value-equality inference while preserving explicit overrides through the existing case-insensitive HTTP header handling.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit c7fa98e)
* Test combined Cosmos user agent suffixes
Verify Gateway and thin-client wire headers contain both the CosmosClientBuilder application suffix and feature flags added later by UserAgentContainer.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit b8b6c8f)
* Limit Cosmos user agent refresh scope
Allow the bootstrap DatabaseAccount request to precede feature evaluation and keep coverage focused on normal post-initialization Gateway requests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 5d8cf1c)
* Minimize Cosmos feature suffix publication
Keep the original feature-suffix expression while publishing the complete volatile user-agent value in one assignment.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit c655610)
* Test encryption opt-out marker in Gateway user agents
Verify late user-agent suffix updates reach Gateway and GatewayV2 HTTP headers alongside feature flags.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Encode encryption opt-out as a user-agent feature bit
Replace the textual mixed-array opt-out marker with flag 0x80. Preserve explicit configuration flags across feature refreshes and suffix updates, with Gateway and encryption regression coverage.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Route encryption user-agent updates through wrapped client
Use CosmosAsyncClient internal accessors instead of CosmosBridgeInternal, update forwarding tests, and remove user-agent details from the encryption README.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Separate legacy and corrected encryption array traversal
Route array encryption and decryption through explicit mode-selection helpers, keeping traversal config-free and sharing the existing decryption error guidance.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Shorten mixed-array decryption error guidance
Keep the property/index, migration and opt-out settings, under-encryption warning, and original cause while removing redundant wording.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Keep encryption array traversal close to main
Restore main-style legacy iteration and rebuilding, make corrected recursion explicit, and add empty-array and live opt-in/out coverage across GatewayV1, GatewayV2 and Direct.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove encryption user-agent unit tests and module opening
Retain core user-agent and live E2E coverage without the encryption-side reflection tests or extra test JVM flag.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Keep standalone scalar PATCH behavior unchanged
Restore the scalar helper fallback from main so the mixed-array fix does not include an unrelated behavior change.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>1 parent d3cff40 commit f7ec207
21 files changed
Lines changed: 1115 additions & 221 deletions
File tree
- sdk/cosmos
- azure-cosmos-encryption
- src
- main/java/com/azure/cosmos/encryption
- implementation
- test/java/com/azure/cosmos/encryption
- implementation
- azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation
- azure-cosmos
- src/main/java/com/azure/cosmos
- implementation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
154 | 200 | | |
155 | 201 | | |
156 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
96 | 103 | | |
97 | 104 | | |
98 | 105 | | |
| |||
195 | 202 | | |
196 | 203 | | |
197 | 204 | | |
198 | | - | |
199 | | - | |
200 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
201 | 210 | | |
202 | 211 | | |
203 | 212 | | |
| |||
273 | 282 | | |
274 | 283 | | |
275 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
276 | 290 | | |
277 | 291 | | |
278 | 292 | | |
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| |||
0 commit comments