Mastercard / flow

Testing framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MessageHash masking

therealryan opened this issue · comments

For some systems it's necessary to have dynamic fields (e.g.: a request might require a unique ID). If you represent that constraint in your model then you'll have difficulties with the MessageHash check - the dynamic field will produce a new hash every time you build the model.

This can be worked around by having the field be static in the model and overwriting it in the assertion components, but it might be more natural to have the field be dynamic in the model and reduce complexity in the assertion components.

In order to resolve the difficulty with hashing, we could apply masking operations before hashing to elide the dynamic fields. This wouldn't be a huge code change - we already have masking infrastructure - but the docs would need to carefully explain the two approaches.