Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,49 @@ paths:
source: |
curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" \
-H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/admin/v4/throttling/policies/subscription"
- lang: Curl (EVENTCOUNTLIMIT)
source: |
curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" \
-H "Content-Type: application/json" \
Comment on lines +530 to +531
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use an access-token placeholder in new curl examples.

Replace the inline bearer value with a placeholder (for example, <ACCESS_TOKEN>) in both new samples to avoid security-scan noise and keep examples clearly non-sensitive.

As per coding guidelines, "Provide concise, actionable feedback focused on correctness and best practices."

Also applies to: 550-551

🧰 Tools
🪛 Betterleaks (1.2.0)

[high] 530-530: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.

(curl-auth-header)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@en/docs/reference/product-apis/admin-apis/admin-v4/admin-v4.yaml` around
lines 530 - 531, Replace the hard-coded bearer token in the curl examples with a
placeholder (e.g., <ACCESS_TOKEN>) so the Authorization header reads
Authorization: Bearer <ACCESS_TOKEN>; update both instances mentioned in the
file (the curl sample around the current diff and the other sample at the
indicated second occurrence) to avoid exposing real tokens and satisfy the
security guideline.

-d '{
"policyName": "AsyncGold",
"displayName": "AsyncGold",
"description": "Allows 50000 events per day",
"defaultLimit": {
"type": "EVENTCOUNTLIMIT",
"eventCount": {
"timeUnit": "day",
"unitTime": 1,
"eventCount": 50000
}
},
"stopOnQuotaReach": true,
"billingPlan": "FREE"
}' \
"https://127.0.0.1:9443/api/am/admin/v4/throttling/policies/subscription"
- lang: Curl (AIAPIQUOTALIMIT)
source: |
curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" \
-H "Content-Type: application/json" \
-d '{
"policyName": "AIGold",
"displayName": "AIGold",
"description": "Allows 50000 total tokens and 500 requests per minute",
"defaultLimit": {
"type": "AIAPIQUOTALIMIT",
"aiApiQuota": {
"timeUnit": "min",
"unitTime": 1,
"requestCount": 500,
"totalTokenCount": 50000,
"promptTokenCount": 0,
"completionTokenCount": 0
}
},
"stopOnQuotaReach": true,
"billingPlan": "FREE"
}' \
"https://127.0.0.1:9443/api/am/admin/v4/throttling/policies/subscription"

######################################################
# The "Individual Subscription Throttling Policy" resource API
Expand Down