You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6cbbdaf
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: skills/cloud-api-operations/SKILL.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,11 +46,23 @@ Priority rule: if `@cloudbase/manager-node` has a matching method, use it; drop
46
46
47
47
### 3. Check credentials before the first call
48
48
49
+
**Three identities produce the same error text.** Before reading anything into an `UnauthorizedOperation`, find out which one you are holding:
50
+
51
+
| Identity | How it is reached | CAM / CloudAudit |
52
+
| --- | --- | --- |
53
+
| Account-level login (`federated-user/<id>`) | Device-code / web login, or account-level SecretId + Key | reachable, subject to that identity's CAM policies |
54
+
|`TCB_QcsRole` service role | what CLI / MCP **become** after calling a CloudBase product API | refused (`resource (...) has no permission`) |
55
+
| Environment API Key (`<uin>:TCB-CAPI-Configured-idaas-apikey`) |`--cloudbase-api-key -e <envId>`| refused — the API Key model has no channel to attach arbitrary CAM policies |
56
+
57
+
Confirm the identity with `sts GetCallerIdentity` (`--api-version 2018-08-13`) before concluding anything: the refusal text is identical across all three rows, so it cannot tell you which row you are in.
58
+
59
+
**Order matters.** Calling a CloudBase product API swaps the identity to `TCB_QcsRole` for the rest of the session, so a CAM / CloudAudit call issued *after* any product call is refused even though the login is account-level. Do the CAM / audit work **first**.
60
+
49
61
- Read the current credential scope from `auth` tools: `credential_scope: account` = account-level, reaches control-plane APIs subject to that identity's CAM policies; `env` = API Key, scoped to one environment's data plane plus the fixed TCB policies.
50
62
- Permission comes from a different place per credential identity: the account-level identity's own policies, the API Key model (no channel to attach arbitrary CAM policies), or the TCB service role that CLI / MCP assume. Which cross-product capabilities that role family already covers is not fixed — read the attached policies (`ListAttachedRolePolicies` + `GetPolicy`) instead of assuming, and treat `UnauthorizedOperation` as "this identity lacks this action", never as a broken setup.
51
63
- On `UnauthorizedOperation` / `AuthFailure`, hand the user a **one-click CAM grant link** (role name + policy name + `principal`) instead of telling them to go find the policy in the console, then retry the original call. Role targets, the `principal` values, and which preset policy covers what: `./references/calling-methods.md` §3.
52
64
53
-
**Done when**: the credential identity is known, and every permission error has been converted into a clickable authorization link carrying a concrete policy name before any retry.
65
+
**Done when**: the credential identity has been confirmed with `sts GetCallerIdentity` (not inferred from the error text), and every permission error has been converted into a clickable authorization link carrying a concrete policy name before any retry.
54
66
55
67
### 4. Follow a proven recipe when one exists
56
68
@@ -60,6 +72,7 @@ Recipes encode the exact call sequence, required parameters, and empirically dis
60
72
-**ICP filing readiness and wait-time checks**: `./references/recipes/icp-filing-readiness.md`
61
73
-**PostgreSQL instance spec change and shared-to-dedicated upgrade**: `./references/recipes/pg-instance-spec.md`
62
74
-**Custom domain onboarding for an env (HTTP access domain, certificate, DNS binding)**: `./references/recipes/custom-domain.md`
75
+
-**Operation trace / 操作审计 — who did what, from which IP, with which key**: `./references/recipes/cloud-audit-operation-trace.md`
63
76
64
77
**Done when**: every parameter value in the call sequence traces to a recipe value marked as verified (实测) or to official docs.
0 commit comments