【问题标题】:Can I sanitize user input in Aws AppSync resolver mapping template?我可以清理 Aws AppSync 解析器映射模板中的用户输入吗?
【发布时间】:2020-04-20 00:01:09
【问题描述】:

我让我的用户编写 cmets。有人可能会写一篇恶意帖子,其中可能包含一些脚本。

我是否可以在将用户输入保存到数据库之前对其进行清理,或者该请求是否应该在执行清理的 Lambda 之后?

谢谢。

【问题讨论】:

    标签: amazon-web-services aws-lambda aws-appsync


    【解决方案1】:

    请参阅https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference-programming-guide.html 上的文档。

    您可以在映射模板中使用 VTL 代码来执行您需要的卫生处理。

    【讨论】:

      猜你喜欢
      • 2020-10-19
      • 2020-05-29
      • 2021-12-12
      • 2022-01-23
      • 2019-09-01
      • 2019-10-14
      • 2019-02-03
      • 2020-05-15
      • 2019-07-19
      相关资源
      最近更新 更多