mirror of https://github.com/hashicorp/consul
agent: dns uses the configured token during queries
parent
b1c04e7660
commit
fb3938d88e
|
@ -185,8 +185,11 @@ func (d *DNSServer) handlePtr(resp dns.ResponseWriter, req *dns.Msg) {
|
||||||
qName := strings.ToLower(dns.Fqdn(req.Question[0].Name))
|
qName := strings.ToLower(dns.Fqdn(req.Question[0].Name))
|
||||||
|
|
||||||
args := structs.DCSpecificRequest{
|
args := structs.DCSpecificRequest{
|
||||||
Datacenter: datacenter,
|
Datacenter: datacenter,
|
||||||
QueryOptions: structs.QueryOptions{AllowStale: d.config.AllowStale},
|
QueryOptions: structs.QueryOptions{
|
||||||
|
Token: d.agent.config.ACLToken,
|
||||||
|
AllowStale: d.config.AllowStale,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
var out structs.IndexedNodes
|
var out structs.IndexedNodes
|
||||||
|
|
||||||
|
@ -346,9 +349,12 @@ func (d *DNSServer) nodeLookup(network, datacenter, node string, req, resp *dns.
|
||||||
|
|
||||||
// Make an RPC request
|
// Make an RPC request
|
||||||
args := structs.NodeSpecificRequest{
|
args := structs.NodeSpecificRequest{
|
||||||
Datacenter: datacenter,
|
Datacenter: datacenter,
|
||||||
Node: node,
|
Node: node,
|
||||||
QueryOptions: structs.QueryOptions{AllowStale: d.config.AllowStale},
|
QueryOptions: structs.QueryOptions{
|
||||||
|
Token: d.agent.config.ACLToken,
|
||||||
|
AllowStale: d.config.AllowStale,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
var out structs.IndexedNodeServices
|
var out structs.IndexedNodeServices
|
||||||
RPC:
|
RPC:
|
||||||
|
@ -446,11 +452,14 @@ func (d *DNSServer) formatNodeRecord(node *structs.Node, addr, qName string, qTy
|
||||||
func (d *DNSServer) serviceLookup(network, datacenter, service, tag string, req, resp *dns.Msg) {
|
func (d *DNSServer) serviceLookup(network, datacenter, service, tag string, req, resp *dns.Msg) {
|
||||||
// Make an RPC request
|
// Make an RPC request
|
||||||
args := structs.ServiceSpecificRequest{
|
args := structs.ServiceSpecificRequest{
|
||||||
Datacenter: datacenter,
|
Datacenter: datacenter,
|
||||||
ServiceName: service,
|
ServiceName: service,
|
||||||
ServiceTag: tag,
|
ServiceTag: tag,
|
||||||
TagFilter: tag != "",
|
TagFilter: tag != "",
|
||||||
QueryOptions: structs.QueryOptions{AllowStale: d.config.AllowStale},
|
QueryOptions: structs.QueryOptions{
|
||||||
|
Token: d.agent.config.ACLToken,
|
||||||
|
AllowStale: d.config.AllowStale,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
var out structs.IndexedCheckServiceNodes
|
var out structs.IndexedCheckServiceNodes
|
||||||
RPC:
|
RPC:
|
||||||
|
|
Loading…
Reference in New Issue