bbrf-client icon indicating copy to clipboard operation
bbrf-client copied to clipboard

Improve ips/domains view to also include properties of domains/ips respectively

Open honoki opened this issue 4 years ago • 0 comments

At the moment bbrf ips pulls a list of all documents of the type "ip" that belong to a program. However, the CouchDB currently stores IPs in two ways:

  1. As individual documents, e.g. a document with identifier 1.1.1.1 and type ip;
  2. As properties of a domain, e.g. a document with identifier one.example.com and type domain that has property: "ips":["1.1.1.1"]

BBRF does not enforce any kind of synchronization between these representations of IP addresses, which means there is a possibility that an IP may exist as a property of a domain, but not as a unique document in the database (and vice-versa).

It may be a useful addition to ensure both types of IP addresses get returned when running the bbrf ips command, to make abstraction of the way IPs are stored in the database. This would allow you to run e.g.:

bbrf domain add one.example.com:1.1.1.1
bbrf ips # includes 1.1.1.1

# whereas at the moment, this requires `bbrf ip add 1.1.1.1` first

The same would apply for bbrf domains.

Will keep this issue open while I contemplate the impact of this change further. Input welcome!

honoki avatar Jun 10 '21 18:06 honoki