-
Notifications
You must be signed in to change notification settings - Fork 1
Clarify auth flows #15
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
Changes from all commits
2f0751a
77c0854
d204ba3
6b06adc
323f277
5434dbf
a0e62af
e0c8c74
e2d2182
29f775e
42ae613
cfa5d4a
73dd9e7
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 | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -4976,14 +4976,15 @@ security: | |||||||||||||||||||||||||||||||||||||||||||
- auth0: [] | ||||||||||||||||||||||||||||||||||||||||||||
servers: | ||||||||||||||||||||||||||||||||||||||||||||
- description: Data Plane API | ||||||||||||||||||||||||||||||||||||||||||||
url: 'https://{dataplane_api_url}.cloud.redpanda.com' | ||||||||||||||||||||||||||||||||||||||||||||
url: '{dataplane_api_url}' | ||||||||||||||||||||||||||||||||||||||||||||
variables: | ||||||||||||||||||||||||||||||||||||||||||||
dataplane_api_url: | ||||||||||||||||||||||||||||||||||||||||||||
default: "dataplane_api.url" | ||||||||||||||||||||||||||||||||||||||||||||
default: https://{dataplane_api_url} | ||||||||||||||||||||||||||||||||||||||||||||
description: |- | ||||||||||||||||||||||||||||||||||||||||||||
Find the Data Plane API base URL of a cluster by calling the Get Cluster endpoint of the Control Plane API. The dataplane_api.url field is returned in the response body.<br><br> | ||||||||||||||||||||||||||||||||||||||||||||
Example (Dedicated): "https://api-a4cb21.ck09mi9c4vs17hng9gig.fmc.prd.cloud.redpanda.com"<br> | ||||||||||||||||||||||||||||||||||||||||||||
Find the Data Plane API base URL of a cluster by calling the Get Cluster endpoint of the Control Plane API. The dataplane_api.url field is returned in the response body. | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
Example (BYOC): "https://api-a4cb21.ck09mi9c4vs17hng9gig.byoc.prd.cloud.redpanda.com" | ||||||||||||||||||||||||||||||||||||||||||||
Example (Dedicated): "https://api-a4cb21.ck09mi9c4vs17hng9gig.fmc.prd.cloud.redpanda.com" | ||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+4979
to
+4987
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. 💡 Verification agent 🧩 Analysis chainConfirm overlay compatibility with the base spec. The PR adds an overlay to change server URL templating. Ensure the overlay’s target paths and variable names match this base file to avoid broken API Explorer input fields. 🏁 Script executed: #!/bin/bash
# Inspect the overlay to confirm it updates servers[0].url and variables consistently.
fd -a update-dataplane-server-config.yaml
if [ $? -eq 0 ]; then
cat $(fd -a update-dataplane-server-config.yaml)
else
echo "Overlay file not found. Verify repository path and filename."
fi Length of output: 1223 🏁 Script executed: #!/bin/bash
# Show context around the servers definition to confirm JSON Path applicability
sed -n '4960,5010p' cloud-dataplane/cloud-dataplane.yaml Length of output: 2357 Overlay JSONPaths Verified, But Variable Placeholder Mismatch
🤖 Prompt for AI Agents
Self-referential server variable default breaks URL templating.
Option A (keep full URL variable): servers:
- description: Data Plane API
- url: '{dataplane_api_url}'
+ url: '{dataplane_api_url}'
variables:
dataplane_api_url:
- default: https://{dataplane_api_url}
- description: |-
- Find the Data Plane API base URL of a cluster by calling the Get Cluster endpoint of the Control Plane API. The dataplane_api.url field is returned in the response body.
+ default: https://api-a4cb21.ck09mi9c4vs17hng9gig.fmc.prd.cloud.redpanda.com
+ description: |-
+ Use the full Data Plane API base URL for the target cluster. Retrieve it by calling the Control Plane API “Get Cluster” endpoint and copy the dataplane_api.url value from the response.
- Example (BYOC): "https://api-a4cb21.ck09mi9c4vs17hng9gig.byoc.prd.cloud.redpanda.com"
- Example (Dedicated): "https://api-a4cb21.ck09mi9c4vs17hng9gig.fmc.prd.cloud.redpanda.com"
+ Example (BYOC): https://api-a4cb21.ck09mi9c4vs17hng9gig.byoc.prd.cloud.redpanda.com
+ Example (Dedicated): https://api-a4cb21.ck09mi9c4vs17hng9gig.fmc.prd.cloud.redpanda.com Option B (align with overlay using subdomain variable): - - description: Data Plane API
- url: '{dataplane_api_url}'
- variables:
- dataplane_api_url:
- default: https://{dataplane_api_url}
- description: |-
- Find the Data Plane API base URL of a cluster by calling the Get Cluster endpoint of the Control Plane API. The dataplane_api.url field is returned in the response body.
- Example (BYOC): "https://api-a4cb21.ck09mi9c4vs17hng9gig.byoc.prd.cloud.redpanda.com"
- Example (Dedicated): "https://api-a4cb21.ck09mi9c4vs17hng9gig.fmc.prd.cloud.redpanda.com"
+ - description: Data Plane API
+ url: 'https://{dataplane_api_subdomain}.cloud.redpanda.com'
+ variables:
+ dataplane_api_subdomain:
+ default: api-a4cb21.ck09mi9c4vs17hng9gig.fmc.prd
+ description: |-
+ Extract the subdomain from the Data Plane API URL returned by the Control Plane API (dataplane_api.url) and enter it here.
+ Example (BYOC): api-a4cb21.ck09mi9c4vs17hng9gig.byoc.prd
+ Example (Dedicated): api-a4cb21.ck09mi9c4vs17hng9gig.fmc.prd Pick one approach and ensure the overlay doesn’t conflict. 📝 Committable suggestion
Suggested change
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. The overlay is meant to update 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. @kbatuigas Thank you for the clarification! That makes perfect sense. The Bump API Explorer does indeed require the domain to be defined in the server URL template rather than as a variable placeholder for proper functionality. Your overlay approach is the correct solution - constructing the full URL as However, there's still one small inconsistency in the overlay: the variable name is The overlay implementation is the right approach for your Bump API Explorer compatibility needs!
✏️ Learnings added
|
||||||||||||||||||||||||||||||||||||||||||||
tags: | ||||||||||||||||||||||||||||||||||||||||||||
- description: Manage Redpanda access control lists (ACLs). See [Redpanda Cloud Authorization](https://docs.redpanda.com/redpanda-cloud/security/authorization/cloud-authorization/) for more information. | ||||||||||||||||||||||||||||||||||||||||||||
name: Redpanda ACLs | ||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,20 @@ | ||||
# Overlay to update server configuration for Bump API Explorer compatibility. | ||||
# This updates the server URL, variable description to better match usage in API Explorer. | ||||
|
||||
overlay: 1.0.0 | ||||
info: | ||||
title: Update Server Configuration | ||||
version: 1.0.0 | ||||
actions: | ||||
# Update only the server URL template | ||||
- target: "$.servers[0].url" | ||||
update: "https://{dataplane_api_subdomain}.cloud.redpanda.com" | ||||
# Update only the variables section | ||||
- target: "$.servers[0].variables" | ||||
update: | ||||
dataplane_api_subdomain: | ||||
default: "{dataplane_api_subdomain}" | ||||
description: |- | ||||
From the `dataplane_api.url` value in the Control Plane API response, extract the subdomain (the part between `https://` and `.cloud.redpanda.com`). Enter this value in the Data Plane API URL field. | ||||
|
||||
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. Fix YAML trailing whitespace (linter error). Apply this diff to remove trailing whitespace: -
+ 📝 Committable suggestion
Suggested change
🧰 Tools🪛 YAMLlint (1.37.1)[error] 19-19: trailing spaces (trailing-spaces) 🤖 Prompt for AI Agents
|
||||
Example: If the URL is `https://api-a4cb21.ck09mi9c4vs17hng9gig.fmc.prd.cloud.redpanda.com`, enter `api-a4cb21.ck09mi9c4vs17hng9gig.fmc.prd`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ Example request: | |
|
||
```bash | ||
curl https://<dataplane_api_url>/topics | jq | ||
``` | ||
|
||
Example response: | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,16 +1,30 @@ | ||||||
The Cloud API uses the Client Credentials Flow as defined in [Auth 2.0 RFC 6749, section 4.4](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4O). In Redpanda Cloud, you must first create a **service account** through which you can authenticate requests to the Cloud API. The service account is associated with your Redpanda Cloud organization. The service account acts as an OAuth 2.0 client that provides its credentials (client ID and client secret) to the API authentication server. The authentication server grants an access token in return. You can then include the access token in each request to the API. | ||||||
|
||||||
The access token granted to you is associated with a specific Redpanda Cloud organization. If you want to use the API for a different organization, you must acquire a new token through a service account with that organization. | ||||||
The Redpanda Cloud API uses OAuth 2.0 for authentication. The authentication method depends on whether you access the API in the browser using the API Explorer or programmatically. | ||||||
|
||||||
You only need to authenticate once to the Cloud API. That is, after you obtain an access token, you can use the same token in requests to both Control Plane and Data Plane API endpoints, for as long as the token is valid. | ||||||
|
||||||
## Request an access token | ||||||
## Authenticate in API Explorer | ||||||
|
||||||
When using the API Explorer in your browser, Redpanda Cloud uses the [OAuth 2.0 Implicit Flow](https://datatracker.ietf.org/doc/html/rfc6749#section-4.2): | ||||||
|
||||||
1. Click **Get token** on any API endpoint. | ||||||
2. Log in with your Redpanda Cloud credentials if prompted. After you log in, you are redirected back to the API Explorer. | ||||||
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.
Suggested change
|
||||||
3. The token is automatically applied to your API requests. | ||||||
|
||||||
## Authenticate programmatic requests | ||||||
|
||||||
For programmatic access (using a CLI, SDKs, and applications), the Cloud API uses the Client Credentials Flow, as defined in [OAuth 2.0 RFC 6749, section 4.4](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4). | ||||||
|
||||||
You must first create a **service account** through which you can authenticate requests to the Cloud API. The service account is associated with your Redpanda Cloud organization. The service account acts as an OAuth 2.0 client that provides its credentials (client ID and client secret) to the API authentication server. The authentication server grants an access token in return. You can then include the access token in each request to the API. | ||||||
|
||||||
The access token granted to you is associated with a specific Redpanda Cloud organization. If you want to use the API for a different organization, you must acquire a new token through a service account with that organization. | ||||||
|
||||||
### Request an access token | ||||||
kbatuigas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
Users with administrative privileges in a Redpanda Cloud organization can create a service account. | ||||||
|
||||||
> **Note:** Service accounts have administrative privileges by default. Cloud user roles are not applied for the API. | ||||||
|
||||||
1. On the [Service account](https://cloud.redpanda.com/organization-iam?tab=service-accounts) tab in the Organization IAM page of the Redpanda Cloud UI, click **Create service account**. Enter a name and description. | ||||||
1. In the Redpanda Cloud UI, go to [Organization IAM](https://cloud.redpanda.com/organization-iam), and select the **Service account** tab. Click **Create service account** and enter a name and description. | ||||||
|
||||||
2. Copy and store the Client ID and Client Secret. These credentials cannot be viewed again after you close the dialog. | ||||||
|
||||||
|
@@ -26,7 +40,7 @@ Users with administrative privileges in a Redpanda Cloud organization can create | |||||
|
||||||
The request response provides an access token that remains valid for one hour. | ||||||
|
||||||
## Authenticate API requests | ||||||
### Use the access token in API requests | ||||||
|
||||||
You must pass the access token in the authorization header of each API request: | ||||||
|
||||||
|
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.
Above, add links to Cloud API Overview and Data Plane API Reference.
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.
Also, the link in the quickstart to Redpanda HTTP Proxy doesn't work
Uh oh!
There was an error while loading. Please reload this page.
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.
Link to Serverless trial does not work. You could use https://www.redpanda.com/try-redpanda
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.
Several links in Cloud API Overview not working. Also, we should be consistent with links (See ... vs See also with a bulleted item)
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.
In quickstart/Cloud API Overview, the deprecation lines are not formatting correctly in the Important notes, and seem a little redundant with the Versioning and deprecation section below them.
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.
For the note, I think it might be something to do with how the Markdown is processed. I'll make a note and raise with the Bump team.