You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/12/07 13:12:39 UTC
[GitHub] [apisix] juzhiyuan commented on a change in pull request #5727: feat: add CSRF plugin
juzhiyuan commented on a change in pull request #5727:
URL: https://github.com/apache/apisix/pull/5727#discussion_r763978097
##########
File path: apisix/plugins/csrf.lua
##########
@@ -0,0 +1,150 @@
+local core = require("apisix.core")
+local ngx = ngx
+local plugin_name = "csrf"
+local ngx_encode_base64 = ngx.encode_base64
+local ngx_decode_base64 = ngx.decode_base64
+local ck = require "resty.cookie"
+local math = math
+
+local lrucache = core.lrucache.new({
+ type = "plugin",
+})
+
+local schema = {
+ type = "object",
+ properties = {
+ key = {
+ description = "use to generate csrf token",
+ type = "string",
+ },
+ expires = {
+ description = "expires time for csrf token",
+ type = "integer",
+ default = 7200
+ },
+ name = {
Review comment:
Format your codes?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org