-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance API Key Querying #103192
Enhance API Key Querying #103192
Changes from all commits
55d6476
ebc82c7
e5f1853
edc8323
de5dd07
b60a8cc
d040dd1
2bf8469
ce8ac62
d017e0f
3fee898
0f3e2e0
75fc478
781537e
153375f
cebabda
e38b78d
f64dd3c
098dc4e
b0fbbec
1065962
7dafdff
bedfa34
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 103192 | ||
summary: Query api key api improvements | ||
area: Security | ||
type: enhancement | ||
issues: [] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ public abstract class FiltersAggregator extends BucketsAggregator { | |
|
||
public static class KeyedFilter implements Writeable, ToXContentFragment { | ||
private final String key; | ||
private final QueryBuilder filter; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, I had to make the filter here mutable, because the query for API Key aggs has to be modified to go only over API Key docs, and also optionally of a single user. |
||
private QueryBuilder filter; | ||
|
||
public KeyedFilter(String key, QueryBuilder filter) { | ||
if (key == null) { | ||
|
@@ -92,6 +92,10 @@ public String key() { | |
return key; | ||
} | ||
|
||
public void filter(QueryBuilder filter) { | ||
this.filter = filter; | ||
} | ||
|
||
public QueryBuilder filter() { | ||
return filter; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,7 +192,6 @@ public Set<String> metricNames() { | |
private String format = null; | ||
private Object missing = null; | ||
private ZoneId timeZone = null; | ||
protected ValuesSourceConfig config; | ||
|
||
protected ValuesSourceAggregationBuilder(String name) { | ||
super(name); | ||
|
@@ -209,7 +208,6 @@ protected ValuesSourceAggregationBuilder( | |
this.format = clone.format; | ||
this.missing = clone.missing; | ||
this.timeZone = clone.timeZone; | ||
this.config = clone.config; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed this unused bit, as it looked like one way to change the value source for the agg, and the point of this PR is to restrict that for API Keys aggs. |
||
this.script = clone.script; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as https://github.com/elastic/elasticsearch/pull/103192/files#r1425310212.