Set metadata on initial request in API key noop test#88507
Set metadata on initial request in API key noop test#88507n1v0lg merged 5 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/es-security (Team:Security) |
|
@elasticmachine run elasticsearch-ci/bwc |
ywangd
left a comment
There was a problem hiding this comment.
I am not sure whether this is the right fix. The failure occurs at line 1805:
The associated updateRequest is prepared to have a non-null metadata and also not the same as the initial metadata at line 1801:
So why forcing a non-null initial metadata would help?
Also, I think the following random logic is incorrect:
We want it the new descriptor to be (1) valid and (2) not contained by the initial descriptors. So I think it should be something like the follows?
randomValueOtherThanMany(
rd -> RoleDescriptorRequestValidator.validate(rd) != null || initialRequest.getRoleDescriptors().contains(rd),
() -> RoleDescriptorTests.randomRoleDescriptor(false)
),
If Suppose: created.metadata = |
Absolutely, De Morgan's law! Thanks for catching will fix. |
Thanks for the explanation. I forgot about there is the initial creation! |
|
@elasticmachine run elasticsearch-ci/part-1 |
* upstream/master: (2974 commits) Reserved cluster state service (elastic#88527) Add transport action immutable state checks (elastic#88491) Remove suggest flag from index stats docs (elastic#85479) Polling cluster formation state for master-is-stable health indicator (elastic#88397) Add test execution guide in yamlRestTest asciidoc (elastic#88490) Add troubleshooting guide for corrupt repository (elastic#88391) [Transform] Finetune Schedule to be less noisy on retry and retry slower (elastic#88531) Updatable API keys - auto-update legacy RDs (elastic#88514) Fix typo in TransportForceMergeAction and TransportClearIndicesCacheA… (elastic#88064) Fixed NullPointerException on bulk request (elastic#88358) Avoid needless index metadata builders during reroute (elastic#88506) Set metadata on request in API key noop test (elastic#88507) Fix passing positional args to ES in Docker (elastic#88502) Improve description for task api detailed param (elastic#88493) Support cartesian shape with doc values (elastic#88487) Promote usage of Subjects in Authentication class (elastic#88494) Add CCx 2.0 feature flag (elastic#88451) Reword the watcher 'always' and 'never' condition docs (elastic#86105) Simplify azure discovery installation docs (elastic#88404) Breakup FIPS CI testing jobs ... # Conflicts: # server/src/main/java/org/elasticsearch/index/mapper/NumberFieldMapper.java # x-pack/plugin/mapper-aggregate-metric/src/main/java/org/elasticsearch/xpack/aggregatemetric/mapper/AggregateDoubleMetricFieldMapper.java
This PR fixes API key integration test setup for noops. In the noop
test, we use the initial update request as a reference to choose
suitable values to force non-noop updates, including metadata. However,
metadata can be
nullon the initial request, meaning that theunderlying API key will retain the metadata it was assigned on
creation. This can lead to test failure when the metadata on the
initial request is
null, and the subsequent metadata update matchesthe metadata chosen at API key creation time.
Closes #88503.