# Role And Claim Catalog

> Catalog the roles and claims your test identities actually carry, so privilege tests target real system state rather than documentation. Use when roles, scopes or tenant claims drive access decisions and you need ground truth for each test identity

- Skill: `wsh7ash/role-and-claim-catalog` (Agent Skill)
- Install (CLI): `npx get-skill add wsh7ash/role-and-claim-catalog`
- Raw SKILL.md: https://api.skillmd.com/api/skills/wsh7ash/role-and-claim-catalog/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: Wsh7Ash (https://skillmd.com/u/wsh7ash)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/wsh7ash/role-and-claim-catalog

---


# Role and Claim Catalog

> Catalog the roles and claims your test identities actually carry, so privilege tests target real system state rather than documentation

**Use when:** roles, scopes or tenant claims drive access decisions and you need ground truth for each test identity

**Avoid when:** authorization is checked against a single fixed role with no variation between accounts

## Procedure

1. Capture the token or session for each of your test identities and decode it locally without verifying signatures you do not need to check.
2. Record every claim the system actually issues: subject, roles, scopes, tenant, elevation flags and expiry.
3. Compare issued claims against the product's documented role model and note every divergence.
4. Identify which claims the server appears to trust for authorization decisions, by varying them only within your own test accounts.
5. Document how a role or scope changes: self-service, administrative grant or time-limited elevation.
6. Keep the catalog current, since claim shapes change with releases and silently invalidate older tests.

## Signals

- The token carries a privilege claim that no documented role corresponds to.
- A scope string is accepted by endpoints that never check it, which is a finding waiting to be confirmed.
- Tenant membership is expressed as a mutable claim rather than a server-side lookup.
- Expiry differs between the access token and the server-side session, creating a mismatched window.

## Patterns

**1. Claim record**

```text
identity=alice-test claims={sub, role:member, tenant:acme, elev:false} exp=3600s
captured=2026-10-27 source=session-cookie
```

**2. Divergence list**

```text
documented roles: member, admin
issued roles:     member, admin, billing-viewer, legacy-elevated
-> billing-viewer undocumented, legacy-elevated unused by docs
```

**3. Change path**

```text
role change route: admin grant only, expires=none, revocation=session-restart
```

## Pitfalls

- Decoding a token and assuming the server reads the same claims; only observed behaviour proves trust.
- Testing with your own elevated account without a peer account, so you can never show what a lower role sees.
- Letting the catalog go stale after a release that reshapes claims, which invalidates conclusions drawn earlier.

## Done when

- Every test identity has a decoded claim set captured with a date, and divergences from documentation are listed.
- Claim-based trust is stated per claim with the observation that supports it.

## References

- [RFC 7519 - JSON web token](https://www.rfc-editor.org/rfc/rfc7519)
- [OWASP API Security Top 10](https://owasp.org/www-project-api-security/)

