Repository navigation
fix(cp): split RDAP remark-joined org names into Name, Long Name and AKA - #330
Merged
Merged
Conversation
PeeringDB's RDAP import (20c/rdap) appends ", " plus the first RIPE or APNIC remark line to the registrant name. When that line is a brand, one org name holds two names: net 44210 / org 45929 (AS50019) is named "<COMPANY> TELEKOM VE BILISIM TEKNOLOJILERI, <BRAND> NET Telekomunikasyon". Update Name now confirms the joined string against the RDAP record and splits it. Changes: - Add extractRdapImportedOrgNameParts, mirroring 20c/rdap's registrant and remark choice, and parseRdapRemarkJoinedIdentity, which splits only an exact (case, whitespace, trailing punctuation) match and keeps notices, banners, legal aliases, URLs, ASNs, handles, long text and remarks that repeat the registrant or its short Name out of AKA. - Add rdapAutnumClient.resolveImportedOrgNamePartsByAsn, resolveRdapRemarkJoinedIdentity and getOrganizationNetworkAsns, and try the split on network pages (net ASN) and organization pages (the org's network ASNs) after the existing identity rules. On network pages the org-name cache is updated so the org PUT verifies. - looksLikeShortPersonalName rejects Turkish sector words, so a short Turkish company name is not split as "<Person>, <Trade name>". - Add stripTurkishSectorDescriptorTail to the short-Name compaction: a name without a legal form loses a trailing Turkish sector descriptor when it holds a Turkish-only word and another word stays. - Bump CP to 2.0.236. Security: - N/A Testing: - New tests for the RDAP parts (RIPE, APNIC, other RIRs), the split and its no-split cases, and the Turkish trim, all on placeholder data. - build_userscripts.py --check and node --check pass. - node --test in user.js: 637 tests, 636 pass, 1 skipped, 0 fail. - The 9 scratch name-normalization harnesses give identical output to master. - Reviewed with agy (gemini-4-argon-high), two rounds; confirmed findings fixed. Backwards Compatibility: - Only RDAP-confirmed joined names split. The short Name changes for Turkish names without a legal form that end in a sector descriptor. Assisted-by: Claude:claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update Name now splits org names that PeeringDB's RDAP import built from two names, after confirming them against the RDAP record.
Why
PeeringDB creates orgs with 20c/rdap, which appends
", "plus the first RIPE or APNIC remark line to the registrant name. When that line is a brand, one org name holds two names. Net 44210 / org 45929 (AS50019, TR) is named<COMPANY> TELEKOM VE BILISIM TEKNOLOJILERI, <BRAND> NET Telekomunikasyon: the registrant ORG-TTVB1-RIPE plus the aut-num remark, which matches the as-name.Change
RDAP-confirmed split.
extractRdapImportedOrgNamePartsrebuilds the registrant name and remark line the way 20c/rdap does.parseRdapRemarkJoinedIdentitysplits only when the stored name is exactly<registrant>, <remark>, ignoring case, whitespace and trailing punctuation.<Person>, <Trade name>and notice cutting keep their results.Turkish descriptor trim.
stripTurkishSectorDescriptorTailtrims trailing sector words such asTELEKOM VE BILISIM TEKNOLOJILERIfrom the short Name.looksLikeShortPersonalNamenow rejects Turkish sector words, so a short Turkish company name is never read as a person.<COMPANY><COMPANY> TELEKOM VE BILISIM TEKNOLOJILERI<BRAND> NET TelekomunikasyonFrom the network page, the org is updated through the API with Name
<COMPANY> TELEKOM VE BILISIM TEKNOLOJILERIand the brand as AKA.Testing
build_userscripts.py --checkandnode --checkpass.node --test: 637 tests, 636 pass, 1 skipped, 0 fail. The new tests use placeholder data.<Person>, <Trade name>rule, AS207858 does not split.Notes
Assisted-by: Claude:claude-opus-5-5