Skip to content

Commit

Permalink
adding-allowlist-api-reference #571 (#7333)
Browse files Browse the repository at this point in the history
* adding-allowlist-api-reference #571

Signed-off-by: AntonEliatra <[email protected]>

* Update api.md

Signed-off-by: AntonEliatra <[email protected]>

* Grammar fixes

Signed-off-by: Naarcha-AWS <[email protected]>

---------

Signed-off-by: AntonEliatra <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>
Co-authored-by: Naarcha-AWS <[email protected]>
  • Loading branch information
AntonEliatra and Naarcha-AWS committed Jun 12, 2024
1 parent 1cbf6be commit f1ef9b4
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions _security/access-control/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,98 @@ PATCH _plugins/_security/api/rolesmapping
}
```

---

## Allowlist

### Get allowlist

Retrieves the current `allowlist` configuration.

#### Request

```json
GET _plugins/_security/api/allowlist
```
{% include copy-curl.html %}

#### Example response

```json
{
"config" : {
"enabled" : true,
"requests" : {
"/_cat/nodes" : [
"GET"
],
"/_cat/indices" : [
"GET"
],
"/_plugins/_security/whoami" : [
"GET"
]
}
}
}
```

### Create allowlist

Creates an `allowlist` configuration.

#### Request

```json
PUT _plugins/_security/api/allowlist
{
"enabled": true,
"requests": {
"/_cat/nodes": ["GET"],
"/_cat/indices": ["GET"],
"/_plugins/_security/whoami": ["GET"]
}
}
```
{% include copy-curl.html %}

#### Example response

```json
{
"status":"OK",
"message":"'config' updated."
}
```

### Update allowlist

Updates an `allowlist` configuration.

#### Request

```json
PATCH _plugins/_security/api/allowlist
[
{
"op": "add",
"path": "/config/requests",
"value": {
"/_cat/nodes": ["POST"]
}
}
]
```
{% include copy-curl.html %}

#### Example response

```json
{
"status":"OK",
"message":"Resource updated."
}
```

---

Expand Down

0 comments on commit f1ef9b4

Please sign in to comment.