Skip to content

Commit 63c9309

Browse files
Update README.md
1 parent 042ab7c commit 63c9309

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

README.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -289,28 +289,29 @@ example:
289289

290290
To improve compatibility with other services Secured Signal API provides aliases for the `message` attribute by default:
291291

292-
| Alias | Priority |
293-
| ----------- | -------- |
294-
| msg | 100 |
295-
| content | 99 |
296-
| description | 98 |
297-
| text | 20 |
298-
| body | 15 |
299-
| summary | 10 |
300-
| details | 9 |
301-
| payload | 2 |
302-
| data | 1 |
303-
304-
Secured Signal API will use the highest priority Message Alias to extract the correct message from the Request Body.
305-
306-
Message Aliases can be added by setting `MESSAGE_ALIASES`:
292+
| Alias | Score |
293+
| ----------- | ----- |
294+
| msg | 100 |
295+
| content | 99 |
296+
| description | 98 |
297+
| text | 20 |
298+
| body | 15 |
299+
| summary | 10 |
300+
| details | 9 |
301+
| payload | 2 |
302+
| data | 1 |
303+
304+
Secured Signal API will pick the best scoring Message Alias (if available) to extract the correct message from the Request Body.
305+
306+
Message Aliases can be added by setting `MESSAGE_ALIASES` to a valid json array containing dictionaries of `alias`, the json key to be used for lookup (use `.` dots for using values from a nested dictionary and `[i]` to get values from an array):
307307

308308
```yaml
309309
environment:
310310
MESSAGE_ALIASES: |
311311
[
312-
{ "alias": "note", "priority": 4 },
313-
{ "alias": "test", "priority": 3 }
312+
{ "alias": "msg", "score": 80 },
313+
{ "alias": "data.message", "score": 79 },
314+
{ "alias": "array[0].message", "score": 78 },
314315
]
315316
```
316317

0 commit comments

Comments
 (0)