#1574 asks for Tencent Cloud Token Plan's usage on the Usage page through
TokenHub's cloud API (api/1823/132270). That API covers the enterprise
plan only (Token Plan 企业版; the previous commit added its regions). The
personal plan (api.lkeap.cloud.tencent.com/plan) has no usage API, only
the console, so it has no card. The API takes the account's API key, a
SecretId and SecretKey signed TC3-HMAC-SHA256, never the plan's sk- key.
provider (tencent_usage.go):
- A provider at /plan on tokenhub.tencentmaas.com (ap-guangzhou) or
tokenhub-intl.tencentmaas.com (ap-singapore) with a SecretId and
SecretKey gets a card per team plan in PlanQuotas
(tencentPlanQuotas), each key and region asked once.
- It asks DescribeTokenPlanList, then DescribeTokenPlan per plan
(version 2026-03-22), all at tokenhub.tencentcloudapi.com. Where a
reply leaves a part out, the list's copy of it is kept.
- The window is TotalUsed of CycleQuota (else TotalQuota), in credits
(专业套餐) or tokens (轻享套餐, enterprise-auto). It resets at
TokenSummary.CycleEndTime. Without that, it counts months from
StartTime and stops at ExpireTime.
- The docs don't say whether TotalUsed is the cycle's or the package's.
This reads it as the cycle's.
- A plan that isn't enable shows its status beside the plan's name.
- An AuthFailure or UnauthorizedOperation reply says to check the key and
its CAM rights. No plan visible to the key says so (a sub-user sees
only the plans it made).
- The SecretId and SecretKey sit in the AccessKeyID and SecretAccessKey
fields Volcengine's access key uses (#1427). They are stored, kept out
of key-less backups and dropped from cached cards the same way.
AccessKeyVendor tells the two vendors apart.
gui:
- The listing tells whose access key a provider or preset takes.
presetAccessKey lists the regions that take one: Tencent Cloud's two
Enterprise regions.
- The editor names the fields SecretId and SecretKey, with Tencent's
hint, and shows them only at those regions (or at an endpoint none of
the regions has).
- A SecretId with no SecretKey is refused only where the fields are
shown. The new strings are in zh, zh-TW, ja and de.
- docs/subsystems/providers-accounts.md and the GUI tests README describe
it.
Run:
- TestTC3SignMatchesDoc pins the signing doc's worked example (payload
hash 35e9c5b0…, Signature 10b1a37a…).
- TestTencentPlanRegion, TestTencentPlanWindow and TestTencentPlanQuotas
use the API docs' own response examples. The last is an httptest fake
that rechecks each TC3 signature and the X-TC-* headers, and fails if
the plan's key is ever sent.
- TestProviderListTellsTencentAccessKey covers the listing, alongside
TestVolc* and TestPlanQuotas.
- Breaking the action's lowercasing in the signature, or dropping
TokenSummary, turns them red.
- GUI: tencent-access-key.test.cjs (new) 12/12 in Chromium and WebKit at
420px, en and zh. It goes red with the region hook or the vendor
labels taken out. volc-access-key, tencent-cloud, i18n-keys, gui-ja
and gui-de pass.
- gofmt; go vet on darwin, linux and windows; the full go test ./...
Not tried against the real API: we have no Tencent Cloud account. What
is read is what the docs show, and the reporter is asked to try it.