階層型アクセスとクロスアカウントアクセス¶
DotID では、個別のアカウント単位だけでなく、組織構造に沿ってアクセスを付与できます。これに対応する 2 つの機能は、どちらも identity と organizations の API ファミリーに含まれます。
organization を resolve する¶
以下のすべての org-scoped route では path に {orgId} が必要です。account id だけを知っている場合 (たとえば token 上の account_id claim)、その account が属する organization を解決してください:
GET /identity/v1/accounts/{account_id}/organization
{
"account_id": "9a33e1b6-…",
"organization_id": "7b39dd74-…",
"name": "BROIT Portal",
"role": "management",
"ou_id": "5642e5b0-…",
"ou_name": "Root",
"ou_path": "root",
"mgmt_account_id": "9a33e1b6-…"
}
account は最大 1 つの organization に属し、その中の正確に 1 つの OU に存在するため、結果は曖昧ではありません。response は account が tree のどこにあるかも示します: ou_id、ou_name、ou_path(dotted path としての hierarchy。例: root.city.store-3。management account は org の Root OU に存在します)。この call は self-scoped です。credential が bound されている account の organization のみ resolve できます(accountId は access key の account、または token の account_id claim と一致する必要があります)— そうでなければ 403。どの organization にも属さない account は 404 を返します。返された organization_id を下記の {orgId} routes に渡してください。
OU スコープの権限割り当て¶
単一のアカウントではなく、組織単位 (OU) のグループに権限セットを割り当てます。この付与は、後から追加するアカウントを含め、その OU のサブツリー内にあるすべてのアカウントに適用されるため、各アカウントに手作業で再割り当てする必要はありません。
# Assign permission set PS to group G on an OU; it cascades to accounts under that OU.
POST /identity/v1/organizations/{orgId}/ous/{ouId}/assignments
{ "group_id": "…", "permission_set_id": "…" }
# List / remove OU-scoped assignments
GET /identity/v1/organizations/{orgId}/ous/{ouId}/assignments
DELETE /identity/v1/organizations/{orgId}/ous/{ouId}/assignments/{id}
割り当てられた OU がそのアカウントの祖先のいずれかである場合、そのアカウントは対象になります。そのサブツリー外のアカウントには、この割り当てでは何も付与されません。
推移的なアカウント間委任¶
あるアカウントは、別のアカウントが自分のリソースに対して一連の権限セットを行使することに同意できます。これらの同意エッジは推移的に合成されます。つまり、store → city → area → HQ という委任チェーンにより、上位アカウントのプリンシパルが下位アカウントのリソースに対して操作できます。
# Delegate scope you hold to another account
POST /identity/v1/accounts/{account_id}/delegations
{ "delegatee_account_id": "…", "scope_permission_set_ids": ["…"] }
# List delegations you granted / received; revoke one
GET /identity/v1/accounts/{account_id}/delegations
GET /identity/v1/accounts/{account_id}/delegations/received
DELETE /identity/v1/accounts/{account_id}/delegations/{delegation_id}
委任を安全に保つルール:
スコープは狭まるだけです。 有効なスコープは、すべてのホップにわたる権限セットの積集合です。チェーンが最も制約の強いホップを超える権限を付与することはできません。
保持している権限だけを委任できます。
scope_permission_set_ids内の各権限セットは、委任元アカウントに割り当てられている必要があります。割り当てられていない場合、リクエストは拒否されます (422)。深さには上限があります。 設定された最大値より長いチェーンは拒否されます (
422)。循環も拒否されます (422)。即時の取り消し。 エッジに対する
DELETEは、次回の認可ですぐに有効になります。キャッシュされた付与はありません。Delegating to an account delegates to everyone in it. The edge names the delegatee account, and every principal of that account — Identity Center users, IAM users, service users — inherits the scope. There is no per-principal narrowing on the delegatee side; choose the delegatee account accordingly.
アクセスはリクエストごとに評価されます。有効で、スコープ内にあり、取り消されていないチェーンはアクションを認可します。それ以外は通常の拒否に委ねられます。
These /identity/v1/accounts/{account_id}/delegations calls are reachable over AK/SK, authorized
for the delegating account itself or its organization's management account — any other caller
gets a 403. To make one account a manager for a whole company's accounts (an OU subtree, current
and future), the organization's management account uses the OU → Manager delegation surface — see
Scoped delegation.