Skip to content
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

New Java client does not have all fields for CreateApiKeyRequest.RoleDescriptor #106

Closed
synox opened this issue Jan 12, 2022 · 4 comments · Fixed by #292
Closed

New Java client does not have all fields for CreateApiKeyRequest.RoleDescriptor #106

synox opened this issue Jan 12, 2022 · 4 comments · Fixed by #292
Labels
Area: Specification Related to the API spec used to generate client code

Comments

@synox
Copy link

synox commented Jan 12, 2022

Elasticsearch version (bin/elasticsearch --version):
7.16.2

Plugins installed: []

JVM version (java -version):
openjdk 17

OS version (uname -a if on a Unix-like system):
not relevant

Description of the problem including expected versus actual behavior:
The description in https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html mentions fields like indices, global and run_as which are not defined in the Java client

They are also not defined in the service specification.

However, the are defined in the elasticsearch-rest-high-level-client.

I am using the wrong Java API to create an api key? Or should the spec and/or docs be updated?

Steps to reproduce:

Provide logs (if relevant):

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@synox
Copy link
Author

synox commented Jan 13, 2022

I think this is actually a documentation error. The page https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html describes the field role_descriptors with

The structure of role descriptor is the same as the request for create role API. For more details, see create or update roles API.

According to service specification the structure of those role descriptor are not the same. Also the example on the same page uses index and not indices.

@jakelandis jakelandis transferred this issue from elastic/elasticsearch Jan 13, 2022
@swallez swallez added the Area: Specification Related to the API spec used to generate client code label Jan 25, 2022
@swallez
Copy link
Member

swallez commented Mar 21, 2022

The API specification is actually wrong, and these are the same structure. Elasticsearch accepts both index and indices, which led to this confusion.

elastic/elasticsearch-specification#1555 has been opened to solve this, and the Java client will be updated once it's fixed.

@swallez
Copy link
Member

swallez commented May 24, 2022

This has been fixed in PR #292, backported to version 8.2 in PR #293 and to version 7.17 in PR #294.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Specification Related to the API spec used to generate client code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants