Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2128,7 +2128,7 @@ You can restrict the key to a list of index names allowed for the secured API ke

```python
# generate a public API key that is restricted to 'index1' and 'index2':
public_key = client.generate_secured_api_key('YourSearchOnlyApiKey', {'restrictIndices': valid_until})
public_key = client.generate_secured_api_key('YourSearchOnlyApiKey', {'restrictIndices': 'index1,index2'})
```

#### Rate Limiting
Expand All @@ -2155,6 +2155,15 @@ even if he shares his `IP` with another user.
public_key = client.generate_secured_api_key('YourSearchOnlyApiKey', {'filters': '_tags:user_42', 'userToken': 'user_42'})
```

#### Network restriction

For more protection against API key leaking and reuse you can restrict the key to be valid only from specific IPv4 networks

```python
# generate a public API key that is restricted to '192.168.1.0/24':
public_key = client.generate_secured_api_key('YourSearchOnlyApiKey', {'restrictSources': '192.168.1.0/24'})
```




Expand Down