-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
developmentStandard developmentStandard developmentr&d:polykey:core activity 4End to End Networking behind Consumer NAT DevicesEnd to End Networking behind Consumer NAT Devices
Description
Specification
parseSeedNodes
currently assumes that the provided address of the seed node is a hostname, and does not provide support for a seed node with an IP address as a host address:
// src/bin/utils/parsers.ts - parseSeedNodes()
if (!networkUtils.isHostname(idHostPort[1])) {
throw new commander.InvalidOptionArgumentError(
`${idHostPort[1]} is not a valid hostname`,
);
}
Furthermore, it should also provide support for IPv6 addresses - as such, we can no longer rely on a colon/semi-colon split
usage. It's been suggested to use new URL
to construct a URL from the nodeId@host:port
format (will require a prepended pk://
'protocol') such that we can acquire the different components of the seed nodes.
Additional context
- discussed in sprint meeting https://vimeo.com/674273240 approx 23:00
- original comment here General Data Validation - Boundary IO locations should be doing data validation and marshalling (and the decommissioning of GenericIdTypes for all IDs) #321 (comment) and General Data Validation - Boundary IO locations should be doing data validation and marshalling (and the decommissioning of GenericIdTypes for all IDs) #321 (comment)
Tasks
- Utilise
new URL
to generate thenodeId@host:port
- Include the appropriate exception handling for invalid formats
- can we specify the particular component of the
nodeId@host:port
that's invalid if an exception is raised (it's currently done this way through the use ofsplit
)? Look into this.
- can we specify the particular component of the
- Move function to validation utils
- Add test for IP address in seed node
Metadata
Metadata
Assignees
Labels
developmentStandard developmentStandard developmentr&d:polykey:core activity 4End to End Networking behind Consumer NAT DevicesEnd to End Networking behind Consumer NAT Devices