You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ service ExampleService {
85
85
86
86
message Empty {}
87
87
message GetExample {
88
-
string userId = 1;
88
+
string ownerField = 1;
89
89
}
90
90
```
91
91
@@ -124,12 +124,12 @@ We know 2 types of annotation: `@Allow` and `@Expose`
124
124
125
125
#### `@Allow`
126
126
*`roles` -> Algorithm used for signing the JWT token. Default: `HmacSHA256`
127
-
*`ownerField` -> Example: `userId`. _Optional field_. Your request will be parsed and if the mentioned field is found, it will compare equality with JWT token subject(e.g.: userId). By this comparison, you can be sure that any operation with that field is made by the owner of the token. If the fields don't match and data are owned by another user, specified roles will be checked after.
127
+
*`ownerField` -> Example: `ownerField`. _Optional field_. Your request will be parsed and if the mentioned field is found, it will compare equality with JWT token subject(e.g.: ownerField). By this comparison, you can be sure that any operation with that field is made by the owner of the token. If the fields don't match and data are owned by another user, specified roles will be checked after.
128
128
129
129
130
130
_**Example use case of `ownerField`**: Imagine, you want to list purchased orders of some user.
131
131
You might want to reuse the exact same API for back-office and also for that particular user who created the orders.
132
-
With `ownerField` you can check for the owner and also for some role if owner userId in JWT token is different._
132
+
With `ownerField` you can check for the owner and also for some role if owner ownerField in JWT token is different._
133
133
134
134
#### `@Exposed`
135
135
*`environments` List of environments (Spring Profiles) where you can access the gRPC without checking for owner or roles.
@@ -139,7 +139,7 @@ Use case: Debug endpoint for the client/front-end development team.
0 commit comments