Skip to content

Commit

Permalink
[jwt-claim-check] address PR feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
tkan145 committed Feb 14, 2025
1 parent c06d415 commit 5296f6f
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions gateway/src/apicast/policy/jwt_claim_check/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,13 @@ allow you to do interesting thing such as checking the claim agains the value of
"resource": "/resource",
"resource_type": "plain"
}
]
],
"enable_extended_context": true
}
}
```

NOTE: when `enable_extended_context` is set, JWT claim value is access via `jwt` prefix.
NOTE: when `enable_extended_context` is set and `jwt_claim_type`/`value_type` is set to liquid ,the JWT claim value is accessible using the `jwt` prefix.

```json
{
Expand All @@ -201,7 +202,29 @@ NOTE: when `enable_extended_context` is set, JWT claim value is access via `jwt`
"resource": "/resource",
"resource_type": "plain"
}
]
],
"enable_extended_context": true
}
}
```

```json
{
"name": "apicast.policy.jwt_claim_check",
"configuration": {
"error_message": "Invalid JWT check",
"rules": [
{
"operations": [
{"op": "==", "jwt_claim": "{{jwt.role}}", "jwt_claim_type": "liquid", "value": "{{jwt.role}}", "value_type": "liquid"}
],
"combine_op": "and",
"methods": ["ANY"],
"resource": "/resource",
"resource_type": "plain"
}
],
"enable_extended_context": true
}
}
```

0 comments on commit 5296f6f

Please sign in to comment.