Commit 230e946
authored
Ensure CreateApiKey always creates a new document (#88413)
The OpType of the indexRequest used for creating new API keys does not
have its OpType configured. This means it defaults to OpType.INDEX which
allows it to replace an existing document. This PR fixes it by explicity
set OpType to CREATE so that it always create a new document (or throw
error if ID conflict does happen).
Since API key ID is time-based random base64 UUID, it is unlikely for
this to happen in practice and we are not aware of any related bug
report.1 parent 74a1e3e commit 230e946
File tree
3 files changed
+9
-0
lines changed- docs/changelog
- x-pack/plugin/security/src
- main/java/org/elasticsearch/xpack/security/authc
- test/java/org/elasticsearch/xpack/security/authc
3 files changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| 328 | + | |
328 | 329 | | |
329 | 330 | | |
330 | 331 | | |
| |||
338 | 339 | | |
339 | 340 | | |
340 | 341 | | |
| 342 | + | |
341 | 343 | | |
342 | 344 | | |
343 | 345 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
212 | 214 | | |
213 | 215 | | |
214 | 216 | | |
| |||
0 commit comments