【发布时间】:2020-05-27 21:45:30
【问题描述】:
将 Stripe 的 PaymentIntent API 的 clientSecret 以纯文本形式存储在客户端 HTML 中是否存在安全问题?我是 Web 开发新手,并按照本教程集成了 Stripe 的 PaymentIntent API:https://stripe.com/docs/payments/accept-a-payment。不幸的是,他们没有专门针对 Django 的指南。该指南适用于烧瓶。我做了最好的即兴创作,但我不想费心为传递 PaymentIntent 的客户端密码而制作一个特定的端点。相反,我定义了一个 clientSecret 变量,我通过 {{ clientsecret}} 在客户端以明文形式存储该变量。为了提供一些背景知识,我将 Django 3.0 与 django-oscar 2 和 python 3.6 一起使用。
Stripe 指南指出,"The client secret should still be handled carefully because it can complete the charge. Do not log it, embed it in URLs, or expose it to anyone but the customer." 我不相信我正在这样做,但我担心通过将其定义为网页由 Django 提供的变量,会有某种日志记录。我使用的是 https,所以我相信对暴露的网页内容有一些限制,而且它绝对不会暴露在 URL 本身中。
让我知道你们的想法,不要试图失去某人的钱!
【问题讨论】:
标签: django security stripe-payments django-oscar