-
Notifications
You must be signed in to change notification settings - Fork 603
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
feat: add support for externalized consumers #7657
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
nav_title: | ||
title: How to configure pools | ||
|
||
minimum_version: 3.8.x | ||
--- | ||
|
||
|
||
With `pool_id` you can configure the key-auth plugin to validate API keys against the Identity Service. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change to "realm_id" |
||
|
||
### Configuring Multiple Pools | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change to "Realms" |
||
|
||
In the key-auth plugin configuration, add the `pools` option as shown below: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change to "realms" |
||
|
||
```yaml | ||
pools: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change to "identity_realms" |
||
- geo: us | ||
id: <the_pool_id_you_got_in_step_1> | ||
type: remote | ||
- geo: null | ||
id: null | ||
type: local | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change to "scope: cp" instead of "type: local" |
||
``` | ||
|
||
The order in which you configure the pools dictates the priority in which the dataplane attempts to authenticate the provided API keys. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change to "realms" |
||
|
||
In the example above, if the remote pool is listed first, the dataplane will first reach out to the identity service and, if necessary, subsequently to the local pool. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "region scoped realm" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change "local pool" to "cp scoped consumers" |
||
|
||
Alternatively, you can configure the local pool first: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "to check the cp scoped consumers" |
||
|
||
```yaml | ||
pools: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "identity_realms" |
||
- geo: null | ||
id: null | ||
type: local | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change to "scope: cp" |
||
- geo: us | ||
id: <the_pool_id_you_got_in_step_1> | ||
type: remote | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change to "scope: geo" |
||
``` | ||
|
||
In this configuration, the dataplane will initially check the local pool (LMDB) before querying the remote Identity Service. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cp-scoped consumers first |
||
|
||
If a matching key is found in any of these pools, the request will be authenticated. If the key is not found in any of the configured pools, the request will be blocked. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "realms" |
||
|
||
### Configuring Single Pools | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Single Realm |
||
|
||
It is also possible to configure only a single pool, either local or remote. However, only one of each type can be configured. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change pool to realm |
||
|
||
To configure only a remote pool: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change "remote pool" to "realm" |
||
|
||
```yaml | ||
pools: | ||
- geo: us | ||
id: <the_pool_id_you_got_in_step_1> | ||
type: remote | ||
``` | ||
|
||
In this case, the dataplane will only attempt to authenticate API keys against the remote Identity Service. | ||
|
||
To configure only a local pool: | ||
|
||
```yaml | ||
pools: | ||
- geo: null | ||
id: null | ||
type: local | ||
``` | ||
|
||
In this scenario, the dataplane will only check the local pool (LMDB) for API key authentication. | ||
|
||
In both cases, if the API key is not found in the configured pool, the request will be blocked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to Realms