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

Cannot use method PATCH in Kibana Dev Tools Console #51

Closed
DJSundog opened this issue Jul 23, 2019 · 5 comments
Closed

Cannot use method PATCH in Kibana Dev Tools Console #51

DJSundog opened this issue Jul 23, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@DJSundog
Copy link

Not sure if this is the right repo for this issue or not, but figure it's a good place to start.

According to the docs at https://opendistro.github.io/for-elasticsearch-docs/docs/security-access-control/api/#patch-user, to update individual attributes of an internal user one should submit a request using HTTP PATCH method.

However, the dev tools console in Kibana rejects PATCH as an allowed method:

{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "child \"method\" fails because [\"method\" must be one of [HEAD, GET, POST, PUT, DELETE]]",
  "validation": {
    "source": "query",
    "keys": [
      "method"
    ]
  }
}

I have confirmed that using curl -XPATCH with the appropriate request body does update the internal user properly.

It would be useful if either:

(a) Kibana were updated to accept PATCH method in dev tools console

or

(b) The API were updated to accept POST method for endpoints currently using PATCH.

@francisco-hoo
Copy link

Hi @DJSundog,

Can you tell me the curl command? Which flags and headers did you pass over the request to patch multiple Tentants?

@seraphjiang seraphjiang added the bug Something isn't working label May 19, 2020
@mbchris
Copy link

mbchris commented Jan 5, 2021

Hi,

although this is an older one, I'd like to confirm this.

In Kibana:

PATCH _opendistro/_security/api/rolesmapping/kibana_user
{
  [
  {
    "op": "add", "path": "/backend_roles", "value": ["mybackendrole"]
  }
]
}

ends up with:

{"statusCode":400,"error":"Bad Request","message":"[request query.method]: Method must be one of, case insensitive ['HEAD', 'GET', 'POST', 'PUT', 'DELETE']. Received 'PATCH'."}

Using curl, it works:

curl -k -u user:pwd -X PATCH "https://opendistroelastichost:9200/_opendistro/_security/api/rolesmapping/kibana_user" -H 'Content-Type: application/json' -d'
[
  {
    "op": "add", "path": "/backend_roles", "value": ["mybackendrole"]
  }
]'

{" status":"OK","message":"'kibana_user' updated."}

Kibana also shows an syntax error when using PATCH verb.

@farvour
Copy link

farvour commented Feb 27, 2021

I can confirm this is happening to me as well. For those using AWS's Elasticsearch it means their documentation doesn't work either and I had to turn the single PATCH into individual PUTs if I wanted to use the built-in console.

Step 14:
https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/saml.html#saml-enable

@abdalians
Copy link

abdalians commented Mar 2, 2021

exact same issue here. curl -X patch worked for me and dev tools didnt.

@davidlago
Copy link

We are doing some "spring cleaning in the fall", and to make sure we focus our energies on the right issues and we get a better picture of the state of the repo, we are closing all issues that we are carrying over from the ODFE era (ODFE is no longer supported/maintained, see post here).

If you believe this issue should still be considered for current versions of OpenSearch, apologies! Please let us know by re-opening it.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants