Miro
https://miro.com/app/board/uXjVPB0Z1NA=/?share_link_id=96595191908
NodeJS component that takes a string, an return an array of hosts that can be resolved by resolvers.
Parser: (search: string) => host[]
// "bob.d & alice.d" => ["bob.d", "alice.d"]
// "bob.com & alice.d" => throw Error
// "bob.com && alice.d" => throw Error
// "bob.d & alice.d /path/" => throw Error
Example zone file :
{
"origin": "amazon",
"records": [
{ "name": "amazon.com&apple.d", "type": "TXT", "data": "HASH=abddef" },
{ "name": "amazon.com&apple.d", "type": "A", "data": "12.13.14.15" }
]
},
ResolverDappy: (host: string) => [RecordA, RecordTXT];
ResolverBNS: (host: string) => [RecordA, RecordTXT];
ResolverDNS: (host: string) => [RecordA, RecordTXT];
Check if all hosts have resolved to exactly same hash (TXT) record and A record.
Reconciler: ([RecordA, RecordTXT][]) => boolean
Do the request, check hash of whatever is sent back.
// pseudo code
Requester: (junctionhost: string) => {
HTTP.get(
headers: {
host: junctionhost,
},
host: RecordA.data,
path: '/,
).then(resp => {
// resp
/*
<html>hello world</html>
*/
// now check hash
try {
checkHash(RecordTXT.data, resp);
// hash verified
} catch (err) {
// junction error, could not verify hash
}
})
}