mirror of
https://github.com/alibaba/higress.git
synced 2026-05-28 22:57:31 +08:00
feat(wasm-plugin): add tests and docs for hmac-auth-apisix (#2842)
This commit is contained in:
@@ -18,12 +18,12 @@ func main() {}
|
||||
func init() {
|
||||
wrapper.SetCtx(
|
||||
"replay-protection",
|
||||
wrapper.ParseConfigBy(config.ParseConfig),
|
||||
wrapper.ProcessRequestHeadersBy(onHttpRequestHeaders),
|
||||
wrapper.ParseConfig(config.ParseConfig),
|
||||
wrapper.ProcessRequestHeaders(onHttpRequestHeaders),
|
||||
)
|
||||
}
|
||||
|
||||
func onHttpRequestHeaders(ctx wrapper.HttpContext, cfg config.ReplayProtectionConfig, log log.Log) types.Action {
|
||||
func onHttpRequestHeaders(ctx wrapper.HttpContext, cfg config.ReplayProtectionConfig) types.Action {
|
||||
nonce, _ := proxywasm.GetHttpRequestHeader(cfg.NonceHeader)
|
||||
if cfg.ForceNonce && nonce == "" {
|
||||
// In force mode, reject the request if a required header is missing.
|
||||
|
||||
Reference in New Issue
Block a user