Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for "::" notation to GraphQL API #917

Open
jwbensley opened this issue Mar 7, 2024 · 3 comments
Open

Add support for "::" notation to GraphQL API #917

jwbensley opened this issue Mar 7, 2024 · 3 comments

Comments

@jwbensley
Copy link

jwbensley commented Mar 7, 2024

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.

@jwbensley
Copy link
Author

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

@forkwhilefork
Copy link

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!

@jwbensley jwbensley changed the title Support for "::" notation Add support for "::" notation to GraphQL API Sep 10, 2024
@jwbensley
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants