Crazy-xyr commented on issue #12559:
URL: https://github.com/apache/apisix/issues/12559#issuecomment-3240702979
@TheCukitoDev If you are just using it locally, you can copy
`apisix\plugins\request-id.lua` and then modify it
``` patch
--- request-id_original.lua 2025-09-01 10:24:10.434072609 +0800
+++ request-id.lua 2025-09-01 10:23:37.297247325 +0800
@@ -18,6 +18,7 @@
local ngx = ngx
local core = require("apisix.core")
local uuid = require("resty.jit-uuid")
+local ksuid = require("resty.ksuid")
local nanoid = require("nanoid")
local math_random = math.random
local str_byte = string.byte
@@ -32,7 +33,7 @@
include_in_response = {type = "boolean", default = true},
algorithm = {
type = "string",
- enum = {"uuid", "nanoid", "range_id"},
+ enum = {"uuid", "nanoid", "range_id","ksuid"},
default = "uuid"
},
range_id = {
@@ -86,6 +87,10 @@
if conf.algorithm == "range_id" then
return get_range_id(conf.range_id)
end
+
+ if conf.algorithm == "ksuid" then
+ return ksuid.generate()
+ end
return uuid()
end
```
put it in `/somepath/apisix/plugins/request-id.lua` and use `config.yml`
to overwrite the original file
``` yml
extra_lua_path: /somepath/?.lua
```
use request-id plugin
``` yml
"plugins": {
"request-id": {
"algorithm": "ksuid"
}
},
```
If you need the official download, may need to submit pr
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]