Skip to content

Commit 2e65f87

Browse files
marythoughtclaude
andcommitted
fix(docs): address review feedback in subject mapping guide
- Fix invalid JSON: move comments out of JSON code blocks into surrounding prose - Fix actions format: use `{"name": "read"}` object instead of plain `"read"` string to match actual proto shape - Remove deprecated --action-standard/--action-custom flags from troubleshooting, link to otdfctl actions reference instead - Change top_secret example to confidential Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f9d5f0e commit 2e65f87

1 file changed

Lines changed: 18 additions & 15 deletions

File tree

docs/guides/subject-mapping-guide.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ All attribute values in OpenTDF must be explicitly created before they can be us
379379
```json
380380
{
381381
"attribute_value_id": "attr-owner-alice",
382-
"actions": ["read"],
382+
"actions": [{"name": "read"}],
383383
"subject_condition_set": {
384384
"subject_sets": [{
385385
"condition_groups": [{
@@ -404,7 +404,7 @@ Use `IN_CONTAINS` (operator `3`) to match token claim substrings, covering many
404404
```json
405405
{
406406
"attribute_value_id": "attr-company-employees",
407-
"actions": ["read"],
407+
"actions": [{"name": "read"}],
408408
"subject_condition_set": {
409409
"subject_sets": [{
410410
"condition_groups": [{
@@ -492,11 +492,12 @@ For attribute traversal configuration, see the Policy Service reference.
492492
- User "alice" has Keycloak role: `admin`
493493

494494
**Subject Mapping** (links the condition set to an attribute value):
495+
Attribute value FQN: `https://example.com/attr/clearance/value/confidential`
496+
495497
```json
496-
// attribute value FQN: https://example.com/attr/clearance/value/top_secret
497498
{
498-
"attribute_value_id": "<clearance-top-secret-value-id>",
499-
"actions": ["read"],
499+
"attribute_value_id": "<clearance-confidential-value-id>",
500+
"actions": [{"name": "read"}],
500501
"subject_condition_set": {
501502
"subject_sets": [{
502503
"condition_groups": [{
@@ -705,17 +706,15 @@ otdfctl policy subject-condition-sets list
705706

706707
**Check action format:**
707708
```bash
708-
# Correct: use --action with a standard action name
709+
# Use --action with a named action
709710
--action read
710711

711-
# Also correct: use action ID (UUID)
712+
# Or use action ID (UUID)
712713
--action 891cfe85-b381-4f85-9699-5f7dbfe2a9ab
713-
714-
# Deprecated flags (still accepted but migrate away from these)
715-
# --action-standard DECRYPT → use --action read
716-
# --action-custom "download" → use --action download
717714
```
718715

716+
See the [actions reference](https://github.com/opentdf/otdfctl/blob/main/docs/man/policy/actions/_index.md) for more details.
717+
719718
### Error: Token Claim Not Appearing in Entitlements
720719

721720
**Symptom:** User has claim in JWT, but Subject Mapping doesn't match
@@ -753,22 +752,26 @@ See [Selectors: String vs. Array Claims](#selectors-string-vs-array-claims) for
753752

754753
**3. Check operator type:**
755754

755+
If the claim is an array:
756+
756757
```json
757-
// If claim is an array:
758758
{
759759
"groups": ["admin", "user"]
760760
}
761+
```
761762

762-
// Use .groups[] (not .groups) to match each element:
763+
Use `.groups[]` (not `.groups`) to match each element:
764+
765+
```json
763766
{
764767
"subject_external_selector_value": ".groups[]",
765768
"operator": 1,
766769
"subject_external_values": ["admin"]
767770
}
768-
769-
// .groups (without []) matches NOTHING for an array — it only works for string claims
770771
```
771772

773+
`.groups` (without `[]`) matches NOTHING for an array — it only works for string claims.
774+
772775
**4. Enable debug logging:**
773776

774777
Contact your OpenTDF administrator to enable debug logging for Subject Mapping evaluation.

0 commit comments

Comments
 (0)