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:
@@ -71,6 +71,7 @@ func (t *TSIGServer) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.
|
||||
}
|
||||
|
||||
tsigRR.Error = dns.RcodeSuccess
|
||||
ctx = withValidatedKeyName(ctx, plugin.Name(tsigRR.Hdr.Name).Normalize())
|
||||
rcode, err := plugin.NextOrFailure(t.Name(), t.Next, ctx, w, r)
|
||||
if err != nil {
|
||||
log.Errorf("request handler returned an error: %v\n", err)
|
||||
|
||||
Reference in New Issue
Block a user