Skip to content

Commit cb2070c

Browse files
committed
cleanup
1 parent b7bc527 commit cb2070c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

protection/jwt-claims/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
This snippet shows how JWT claims can be used for field arguments.
44

5-
This examples demonstrates an number of StepZen capabilities:
5+
This examples demonstrates a number of StepZen capabilities:
66

77
- Authorization using JWT
88
- Field access rules
99
- Field visibility rules
1010
- `@value` directive with access to JWT claims
11+
- https://www.ibm.com/docs/en/api-connect/ace/saas?topic=directives-directive-value
1112
- Reshaping
1213

1314
## Restricting access through JWT claims.
@@ -17,7 +18,7 @@ is used as a customer's identifier. Thus the customer can only view their own in
1718
the backend database includes all customers.
1819

1920
The field `Query.customer` provides an identifier lookup to all customers. This field is restricted
20-
from been executed by an authenticated user by field visibility and access rules.
21+
from being executed by field visibility and access rules.
2122

2223
Instead a field `Query.me` is exposed with no field arguments that invokes `Query.customer`
2324
with the customer identifier pulled from the `sub` claim in the request's JWT.
@@ -27,9 +28,12 @@ This script has access to field arguments of its annotated field (in this case n
2728
Thus it returns the `sub` claim which is then automatically mapped as a scalar value to the sole argument of
2829
the next step in the sequence (`Query.customer(id:)`).
2930

30-
Note these concepts could be combined with field access through RBAC rules (see XXXX)
31+
An alternate version of `Query._myid` exists `Query._my_id_jsonata` showing that scripts can be implemented in JSONata.
32+
The default langauge is ECMAScript.
33+
34+
Note these concepts could be combined with field access through ABAC rules (see `protection/simpleABACSample`)
3135
so that `Query.customer` could be exposed, but only customer service reps could call it
32-
with an arbitary identifier.
36+
with any customer identifier.
3337

3438
## Try it out!
3539

@@ -44,6 +48,7 @@ Run the [sample operations](operations.graphql):
4448
JWT with `sub: 5`.
4549

4650
JWT: https://jwt.io/#debugger-io?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1In0.LE_mbGsS2FbxF41r4wOYKhWdBoYhnIk0-6d6U7ibF-A
51+
4752
Secret Key: development-only
4853

4954
```
@@ -53,6 +58,7 @@ stepzen request -f operations.graphql --operation-name=Customer --header "Author
5358
JWT with `sub: 9`.
5459

5560
JWT: https://jwt.io/#debugger-io?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1In0.LE_mbGsS2FbxF41r4wOYKhWdBoYhnIk0-6d6U7ibF-A
61+
5662
Secret Key: development-only
5763

5864
```

0 commit comments

Comments
 (0)