HLRC: Implement get-user-privileges API#36292
Conversation
This adds the _xpack/security/user/_privileges API to the High Level Rest Client. This also makes some changes to the Java model for the Role APIs in order to better accommodate the GetPrivileges API
|
Pinging @elastic/es-core-features |
|
Ping: @elastic/es-security |
client/rest-high-level/src/main/java/org/elasticsearch/client/SecurityClient.java
Outdated
Show resolved
Hide resolved
| private final Request request; | ||
|
|
||
| private GetUserPrivilegesRequest() { | ||
| request = new Request(HttpGet.METHOD_NAME, "/_xpack/security/user/_privileges"); |
There was a problem hiding this comment.
Since you're out tomorrow, #36293 will be merged before hand so /_xpack/security/user/_privileges -> /_security/user/_privileges
There was a problem hiding this comment.
We'll see who merges first :) Probably you, but I can't update this just yet.
...est-high-level/src/main/java/org/elasticsearch/client/security/GetUserPrivilegesRequest.java
Show resolved
Hide resolved
...c/main/java/org/elasticsearch/client/security/user/privileges/AbstractIndicesPrivileges.java
Outdated
Show resolved
Hide resolved
| [id="{upid}-{api}"] | ||
| === Get User Privileges API | ||
|
|
||
| include::../execution-no-req.asciidoc[] |
There was a problem hiding this comment.
Thanks for this. We could/should change to include it in get-certificates.asciidoc and authenticate.asciidoc too.
There was a problem hiding this comment.
Yes - I plan to do so (but that doesn't have to get done by FF, so I haven't tackled it yet)
albertzaharovits
left a comment
There was a problem hiding this comment.
LGTM 👍 (except for minor nits)
|
|
||
| /** | ||
| * Retrieve the set of effective privileges held by the current user. | ||
| * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html"> |
There was a problem hiding this comment.
elastic.co/guide/en/elasticsearch/reference/current/security-api-get -user-privileges.html
There was a problem hiding this comment.
That's a different API.
What happened to my get-user-privileges API docs?
There was a problem hiding this comment.
OK, so git is telling me that I never wrote API docs for get-user-privileges (see #33928). It's weird, I'm sure I did write some...
I'll add it to my To Do, and remove this javadoc link until they exist.
...c/main/java/org/elasticsearch/client/security/user/privileges/AbstractIndicesPrivileges.java
Outdated
Show resolved
Hide resolved
...level/src/main/java/org/elasticsearch/client/security/user/privileges/IndicesPrivileges.java
Outdated
Show resolved
Hide resolved
| private final String name; | ||
| private final Set<String> clusterPrivileges; | ||
| private final @Nullable GlobalPrivileges globalApplicationPrivileges; | ||
| private final @Nullable GlobalPrivileges globalPrivileges; |
This adds the _security/user/_privileges API to the High Level Rest Client. This also makes some changes to the Java model for the Role APIs in order to better accommodate the GetPrivileges API
This adds the _xpack/security/user/_privileges API to the High
Level Rest Client.
This also makes some changes to the Java model for the Role APIs
in order to better accommodate the GetUserPrivileges API