APIM - 响应数据屏蔽

APIM - response data masking

我们需要向供应商公开内部 API,但是为了开发,我们需要屏蔽内部 API 回复的数据,寻找与 apigee 类似的功能 (https://docs.apigee.com/api-platform/security/data-masking ), 这可以通过 APIM 实现吗?

一般来说,Azure APIM 允许灵活处理请求和响应,主要是 policies 的概念。简而言之,这些是可以在传入、传出或执行请求期间定义的操作。

这允许更改 requests/responses(例如,添加或删除 headers),这可能是您想要的。 here in Azure's own GitHub, as well as in APIM itself, as shown here 描述了一些典型的 examples/snippets 政策。

这两个演练也可能有帮助:Setting Policies and Transforming APIs

如果您知道要屏蔽或删除的 header(s) 的名称,例如您的订阅密钥,您可以在 APIM 策略中轻松地这样做:

<set-header name="Ocp-Apim-Subscription-Key" exists-action="delete" />