irrdnet/irrd

Add support for "::" notation to GraphQL API

Opened this issue · 3 comments

Is your feature request related to a problem? Please describe.

  • We are mirroring multiple IRR DBs using irrd
  • The same AS-SET exists in multiple DBs (e.g. RIPE and RADB)
  • We know that RIPE is the correct DB for this AS-SET (e.g. RIPE AS-SET has members but the RADB AS-SET is empty)
  • I am unable to submit the following query via the GraphQL interface:
query{
  asSetPrefixes(setNames:["RIPE::AS-FOO"]){
    prefixes
  }
}
  • If I specify a source like RIPE using the sources option, this is used no only to get this AS-SET but also for the recursive expansion of all of the members of the AS-SET. There is no way to specify the source for the root object only.

EDIT: Another example is that AS-FOO exists in two or more IRR-DBs, and let's say the one in ARIN is the real one (created by the network operator) and the one in ALTDB is someone trying to hijack the AS-SET name. Or another example, AS-FOO exists in two IRR-DBs but the operator lost access to one and it doesn't have all the information the second one does. So we need a way to specify which IRR-DB should be used.

Describe the solution you'd like

  • Support for the "::" notation, meaning that I can send a query to IRR such as "RIPE::AS-FOO"
  • RIPE will be used to get AS-FOO only
  • Then the specified sources list (if specified, otherwise all sources) will be used to recursively get the members of AS-FOO
  • To be clear; this about setting a source only for getting the innitial AS-SET object, not the recursive expansion of it's members, that is covered by the existing "sources" list option

Describe alternatives you've considered
None.

Additional context
I would be happy to look into the code base to see if this is something I could create a pull request for. I want to check before hand what you think before I spend a load of time on this.

I raised a PR because after a brief look at the code, I discovered this wouldn't be much work 👍

Based on #918 (comment), it seems like the idea is to abandon the :: syntax and make an enhancement to the available graphql queries. Can we rename this issue to reflect the change in direction?

Incidentally, this is something I would definitely use. My preferred source ordering (RPKI, auth RIR, auth NIR, nonauth) chooses empty or incorrect objects in several cases (notably, AS-GOOGLE). In the meantime, my alternative for pinning the root object when doing a recursive AS-SET query is to query for the direct members of the AS-SET with the specific known-correct source I manually set, then recursively resolve prefixes from all returned member objects with my normal selection of sources. Not ideal and not very efficient. The ability to do this in a single query would be much better!

I finally have some time to work on this request again.

I have updated the name of this issue and will look into this soon.