-
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
Open
jschmid1
wants to merge
4
commits into
main
Choose a base branch
from
feat/externalized-consumers
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+93
−25
Open
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,9 +77,9 @@ For more information about how to configure anonymous access, see [Anonymous Acc | |
### Create a Key | ||
|
||
{:.important} | ||
> **Note**: We recommend letting the API gateway autogenerate the key. Only specify it | ||
yourself if you are migrating an existing system to {{site.base_gateway}}. | ||
You must reuse your keys to make the migration to {{site.base_gateway}} transparent | ||
> **Note**: We recommend letting the API gateway autogenerate the key. Only specify it | ||
yourself if you are migrating an existing system to {{site.base_gateway}}. | ||
You must reuse your keys to make the migration to {{site.base_gateway}} transparent | ||
to your consumers. | ||
|
||
{% navtabs %} | ||
|
@@ -303,3 +303,71 @@ No API key is provided. | No | 401 | |
The API key is not known to {{site.base_gateway}} | No | 401 | ||
A runtime error occurred. | No | 500 | ||
|
||
|
||
### Externalized Consumers | ||
|
||
-- Dummy/Link that points to Konnect Docs when ready. | ||
|
||
With the `pool_id` you obtained from the previous step, you can configure the key-auth plugin to validate API keys against the Identity Service. | ||
|
||
#### Configuring Multiple Pools | ||
|
||
In the key-auth plugin configuration, add the `pools` option as shown below: | ||
|
||
```yaml | ||
pools: | ||
- geo: us | ||
id: <the_pool_id_you_got_in_step_1> | ||
type: remote | ||
- geo: null | ||
id: null | ||
type: local | ||
``` | ||
|
||
The order in which you configure the pools dictates the priority in which the dataplane attempts to authenticate the provided API keys. | ||
|
||
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. | ||
|
||
Alternatively, you can configure the local pool first: | ||
|
||
```yaml | ||
pools: | ||
- geo: null | ||
id: null | ||
type: local | ||
- geo: us | ||
id: <the_pool_id_you_got_in_step_1> | ||
type: remote | ||
``` | ||
|
||
In this configuration, the dataplane will initially check the local pool (LMDB) before querying the remote Identity Service. | ||
|
||
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. | ||
|
||
#### Configuring Single Pools | ||
|
||
It is also possible to configure only a single pool, either local or remote. However, only one of each type can be configured. | ||
|
||
To configure only a remote pool: | ||
|
||
```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 | ||
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.
|
||
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. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@jschmid1 where does the
pool_id
come from? Konnect?