gpt4 book ai didi

clojure - 从 clojure ring 应用程序的日志中过滤敏感参数

转载 作者:行者123 更新时间:2023-12-05 03:11:56 26 4
gpt4 key购买 nike

我在我的应用程序中使用 wrap-with-logger(来自 ring.middleware.logger)和 wrap-params(来自 ring.middleware.params)中间件。有什么简单的方法可以从日志中过滤敏感参数(密码、信用卡号等)?

最佳答案

您也可以考虑迁移到 ring-logger其中包括 feature to redact sensitive information :

By default, ring-logger will redact an authorization header or any param named password (at any nesting level). If you want ring-logger to redact other params you can configure the redact-keys option:

   (wrap-with-logger app {:redact-keys #{:senha :token})

Ring-logger will walk through the params and headers and redact any key whose name is found in that redact-keys set.

还有 ring-logger-onelog这应该使从 ring.middleware.logger 迁移变得非常容易到铃声记录器

关于clojure - 从 clojure ring 应用程序的日志中过滤敏感参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35619946/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com