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

Use POST when service account token name is not present #1961

Conversation

carlosdelest
Copy link
Member

When a service account token is created, and no name is specified, the method to use is POST instead of PUT. PUT returns a 405 message:

curl -u [redacted] -X PUT http://localhost:9200/_security/service/elastic/enterprise-search-server/credential/token
{"error":"Incorrect HTTP method for uri [/_security/service/elastic/enterprise-search-server/credential/token] and method [PUT], allowed: [POST]","status":405} 

While POST creates the service account token:

curl -u [redacted] -X POST http://localhost:9200/_security/service/elastic/enterprise-search-server/credential/token
{"created":true,"token":{"name":"token_bgy1gYQB5WUVQc9_TiIn","value":[redacted]}}

Copy link
Member

@picandocodigo picandocodigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

¡Gracias por el PR Carlos!
This code is automatically generated from the ES REST specification. So I'm going to update the generator to fix the method and add your changes 👍

@picandocodigo
Copy link
Member

Included in #1964

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants