mirror of
https://github.com/coredns/coredns.git
synced 2026-08-27 23:27:05 -04:00
plugin/tsig: expose validated TSIG key identity (#8471)
Store the normalized key name in the request context only after successful TSIG verification. This lets downstream plugins distinguish unsigned requests from authenticated requests and authorize by key without relying on the stripped TSIG RR or exposing secret material. Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
This commit is contained in:
@@ -12,6 +12,10 @@ respective plugins sending those requests to sign them using the keys defined by
|
||||
|
||||
The *tsig* plugin can also require that incoming requests be signed for certain query types, refusing requests that do not comply.
|
||||
|
||||
After successfully validating a TSIG record, the plugin adds the normalized key name to the request context. Downstream Go
|
||||
plugins can call `tsig.ValidatedKeyName(ctx)` to retrieve the key name and distinguish validated requests from unsigned
|
||||
requests. The value is not set for requests outside the configured zones because the *tsig* plugin does not validate them.
|
||||
|
||||
## Syntax
|
||||
|
||||
~~~
|
||||
|
||||
Reference in New Issue
Block a user