Skip to content

feat(gateway): Datakit and principals - #7099

Open
juliamrch wants to merge 8 commits into
release/gateway-3.16from
iss6792
Open

feat(gateway): Datakit and principals#7099
juliamrch wants to merge 8 commits into
release/gateway-3.16from
iss6792

Conversation

@juliamrch

@juliamrch juliamrch commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #6792

Preview Links

Testing instructions

Kong Konnect

Run:

export KONNECT_DOMAIN=konghq.tech
curl -Ls https://get.konghq.com/quickstart | bash -s -- -k $KONNECT_TOKEN \
     --deck-output \
     -i kong-gateway-dev -t 3.16.0.0-rc.1

Required entities

echo '
_format_version: "3.0"
services:
  - name: example-service
    url: http://httpbin.konghq.com/anything
routes:
  - name: example-route
    paths:
    - "/anything"
    service:
      name: example-service
    protocols:
    - http
    - https
' | deck gateway apply --konnect-addr $KONNECT_CONTROL_PLANE_URL -

For every decK command, add --konnect-addr $KONNECT_CONTROL_PLANE_URL - at the end of the command.

Checklist

  • Tested how-to docs. If not, note why here.
  • All pages contain metadata.
  • Any new docs link to existing docs.
  • All autogenerated instructions render correctly (API, decK, Konnect, Kong Manager).
  • Style guide (capitalized gateway entities, placeholder URLs) implemented correctly.
  • Every page has a description entry in frontmatter.
  • Add new pages to the product documentation index (if applicable).

@juliamrch juliamrch self-assigned this Sep 2, 2026
@juliamrch juliamrch linked an issue Sep 2, 2026 that may be closed by this pull request
@netlify

netlify Bot commented Sep 2, 2026

Copy link
Copy Markdown

Deploy Preview for kongdeveloper ready!

Name Link
🔨 Latest commit b435b4a
🔍 Latest deploy log https://app.netlify.com/projects/kongdeveloper/deploys/6aa18fcdca74af00088e67f2
😎 Deploy Preview https://deploy-preview-7099--kongdeveloper.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@juliamrch juliamrch changed the title add configuration example feat(gateway); Datakit and principals Sep 2, 2026
@juliamrch juliamrch changed the title feat(gateway); Datakit and principals feat(gateway): Datakit and principals Sep 8, 2026
@juliamrch
juliamrch marked this pull request as ready for review September 9, 2026 16:57
@juliamrch
juliamrch requested a review from a team as a code owner September 9, 2026 16:57

@cloudjumpercat cloudjumpercat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left suggestions! Everything seemed to be working until the end validate steps. Things were missing from the response, like display_name, everything was coming from httpbin.konghq.com as host, and the unauthenticated request gave me a 200 instead of being rejected.


extended_description: |
Sign an outgoing JWT in a request header using the authenticated Principal's ID as the subject.
This example assumes a Consumer has already been authenticated before Datakit runs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This example assumes a Consumer has already been authenticated before Datakit runs.
This example assumes a Consumer is already authenticated before Datakit runs.

Sign an outgoing JWT in a request header using the authenticated Principal's ID as the subject.

extended_description: |
Sign an outgoing JWT in a request header using the authenticated Principal's ID as the subject.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Sign an outgoing JWT in a request header using the authenticated Principal's ID as the subject.
Sign an outgoing JWT in a request header using the authenticated [Principal's](/identity/principals/) ID as the subject.


## Create an authorization server in {{site.identity}}

An authorization server in {{site.identity}} issues the OAuth tokens that callers present to authenticate to your service.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
An authorization server in {{site.identity}} issues the OAuth tokens that callers present to authenticate to your service.
An [authorization server](/identity/auth-servers/) in {{site.identity}} issues the OAuth tokens that callers present to authenticate to your service.

## Create an authorization server in {{site.identity}}

An authorization server in {{site.identity}} issues the OAuth tokens that callers present to authenticate to your service.
It's recommended that you create different authorization servers for different environments. The authorization server name is unique per each organization and each {{site.konnect_short_name}} region.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It's recommended that you create different authorization servers for different environments. The authorization server name is unique per each organization and each {{site.konnect_short_name}} region.
We recommend that you create different authorization servers for different environments. The authorization server name is unique per each organization and each {{site.konnect_short_name}} region.

## Create the clients

Create one client per caller. Each client is the machine-to-machine credential that a caller uses to fetch a token.
{{site.konnect_short_name}} autogenerates the client ID and secret.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{site.konnect_short_name}} autogenerates the client ID and secret.
In this example, {{site.konnect_short_name}} autogenerates the client ID and secret, but you can also specify them yourself instead.

feel free to adjust wording, just wanted users to know that autogeneration isn't the only option

{% endentity_examples %}

In this configuration:
* `GET_PRINCIPAL`: Reads the `kong.client.principal` object that the OpenID Connect plugin populates. No input is connected because this is a read-only (get) operation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `GET_PRINCIPAL`: Reads the `kong.client.principal` object that the OpenID Connect plugin populates. No input is connected because this is a read-only (get) operation.
* `GET_PRINCIPAL`: Reads the `kong.client.principal` object that the OpenID Connect plugin populates. No input is connected because this is a read-only operation.


The response comes from `httpbin.konghq.com`.
In the response body, find the `complete` event for each node and check:
* `GET_PRINCIPAL`: `value.value.display_name` is `orders-caller`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see display_name in my output, but I do see the response came from httpbin.konghq.com, so I know it did work.

-H "X-Datakit-Debug-Trace: true"
```

The response comes from `httpbun.com`, confirming the request was routed to a different backend.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, the response for this one was also coming from httpbin.konghq.com.

This was also in my logs: vault.lua:1411 could not retrieve value for reference {vault://env/JWT_HMAC_SECRET} (could not get value from external vault (no value found))


{% validation unauthorized-check %}
url: /anything
{% endvalidation %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one gave me a 200.

<!--vale on-->

Send a request as `orders-caller` again. Once the OpenID Connect plugin's token cache expires, the response comes from `httpbun.com` with no change to your gateway configuration:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is still coming from httpbin.konghq.com as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API GW 3.16] Principals in Datakit

2 participants