Opened 11 years ago

Last modified 8 years ago

#4686 enhancement assigned

The implementation of FileAuthority._lookup seems to have almost nothing to do with files

Reported by: Glyph Owned by: Richard Wall
Priority: normal Milestone:
Component: names Keywords:
Cc: Branch: branches/memory-authority-4686
branch-diff, diff-cov, branch-cov, buildbot
Author: rwall


As far as I can tell, FileAuthority is the only class in Twisted that lets you build a resolver out of a list of records. So, if you want an in-memory resolver, you need to subclass FileAuthority, or learn how to implement its _lookup method yourself. (Which, as per #4685, is tricky.)

This logic should be separated out; loading the records from a file should not be the same as having the records in the first place. For that matter, this code could be made substantially more flexible by replacing the two calls to self.records.get with some more abstract API, which allowed the application developer to easily override the way that records are retrieved (say, querying them from a database).

Change History (3)

comment:1 Changed 11 years ago by <automation>

Owner: Jean-Paul Calderone deleted

comment:2 Changed 8 years ago by Richard Wall

Author: rwall
Branch: branches/memory-authority-4686

(In [42716]) Branching to 'memory-authority-4686'

comment:3 Changed 8 years ago by Richard Wall

Owner: set to Richard Wall
Status: newassigned

See ticket:7408#comment:2 for a new reason for fixing this.

Note: See TracTickets for help on using tickets.