Migration path to v3 when using custom IHttpTransformerFactory with YARP extensions #153
-
BFF v3 removes The PR and the upgrade docs recommend using new features of
What is the migration path from v2 to v3 people using YARP extensions and a custom Use case for the custom implementation is:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi @bamarch, Thanks for your question. If I recall, the IHttpTransformerFactory was only used when doing direct mapping. It's replacement BffYarpTransformBuilder is also only used for direct mapping. If you wish to use yarp directly, you can customize what kind of transforms are added by yarp via the ITransformProvider interface. It allows you to (conditionally) add one or more transforms to the pipeline. If you wish to add headers based on the access token, you may wish to look at these classes:
Hope this helps, Erwin |
Beta Was this translation helpful? Give feedback.
-
Ok will use YARP ITransformProvider, thanks |
Beta Was this translation helpful? Give feedback.
-
Great, please let me know if you run into trouble! |
Beta Was this translation helpful? Give feedback.
Hi @bamarch,
Thanks for your question. If I recall, the IHttpTransformerFactory was only used when doing direct mapping. It's replacement BffYarpTransformBuilder is also only used for direct mapping.
If you wish to use yarp directly, you can customize what kind of transforms are added by yarp via the ITransformProvider interface. It allows you to (conditionally) add one or more transforms to the pipeline.
If you wish to add headers based on the access token, you may wish to look at these classes:
AccessTokenTransformProvider. This class demonstrates how to add transforms to your pipeline. It checks if a specific metadata is present and only then adds the transform.
AccessTokenRequestT…