fix: record SDK names on API keys regardless of case - #13940
Conversation
SDKs send display names like Go and Node.js while the allowlist is lowercase and checked strictly, so standard keys never recorded an SDK. Also accept terraform, which the provider now reports instead of Go.
|
🟢 Tier S · Ready to merge
This change normalizes SDK names from request headers before validating and recording them on API keys. It also adds Terraform to the server SDK allowlist and extends the API-key e2e test to cover display-name casing and deduplication.
📂 Walkthrough · 4
Reviewed |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
What does this PR do?
API keys record which SDKs used them in their
sdksattribute, but for standard keys nothing was ever recorded from a real SDK.serversallowlist is lowercased (go,node.js,python, …) and theWhiteListvalidator is strict, butx-sdk-namewas checked as sent. Every generated SDK sends a display name (Go,Node.js,Python), so none matched. The existing e2e test only passed because it sent lowercase names by hand. The header is now lowercased before validation, which also keepsPythonandpythonfrom being recorded twice.x-sdk-name: Terraforminstead of the Go SDK'sGo(feat: identify requests as the Terraform provider, not the Go SDK terraform-provider-appwrite#52, released in v2.2.0). The allowlist only held generated server SDKs fromapp/config/sdks.php, and adding an entry there would also add it to SDK generation. It now also includes a newAPP_SDK_INTEGRATIONSconstant, which currently holdsterraform.Test Plan
ProjectsConsoleClientTestto sendGo,TerraformandPythonas real clients do. It asserts that the key recordsgoandterraformand thatPythondoesn't duplicatepython. The added assertions fail without the lowercasing.Related PRs and Issues
Checklist