---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
Test basic response with invalid credentials:
- skip:
    features: "headers"
- do:
    headers:
      Authorization: "Basic dGVzdF91c2VyOndyb25nLXBhc3N3b3Jk"
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    info: {}
    catch: "unauthorized"
    allowed_warnings_regex:
    - ".*rollup functionality will be removed in Elasticsearch.*"
    - "Index \\[\\.profiling-.*\\] name begins with a dot.* and will not be allowed\
      \ in a future Elasticsearch version."
    - "Parameter \\[default_metric\\] is deprecated and will be removed in a future\
      \ version"
- match:
    error.root_cause.0.type: "security_exception"
---
Test bulk response with invalid credentials:
- skip:
    features: "headers"
- do:
    headers:
      Authorization: "Basic dGVzdF91c2VyOndyb25nLXBhc3N3b3Jk"
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    bulk:
      body: "{\"index\": {}}\n{}\n"
    catch: "unauthorized"
    allowed_warnings_regex:
    - ".*rollup functionality will be removed in Elasticsearch.*"
    - "Index \\[\\.profiling-.*\\] name begins with a dot.* and will not be allowed\
      \ in a future Elasticsearch version."
    - "Parameter \\[default_metric\\] is deprecated and will be removed in a future\
      \ version"
- match:
    error.root_cause.0.type: "security_exception"
