this is currently super broken but i'm getting there.

This commit is contained in:
brent s. 2020-05-14 14:23:14 -04:00
parent 8a5d484883
commit 676aa8d5b6
Signed by: bts
GPG Key ID: 8C004C2F93481F6B
2 changed files with 14 additions and 1 deletions

4
utils/he_ipv6/TODO Normal file
View File

@ -0,0 +1,4 @@
* fix creds
** needs user/password, and the updateKey is unique per-tunnel so move it into an element in there.
** need to get user/password into HEConf somehow. if i can get ?tid= working for the URL, that'd be perfect.
^ need to use updateKey for tunnel-specific xml

View File

@ -373,6 +373,8 @@ class HEConfig(BaseConfig):
schema_loc = 'https://tunnelbroker.net/tunnelInfo.php {0}'.format(default_xsd) schema_loc = 'https://tunnelbroker.net/tunnelInfo.php {0}'.format(default_xsd)


def __init__(self, creds, xml_url = 'https://tunnelbroker.net/tunnelInfo.php', *args, **kwargs): def __init__(self, creds, xml_url = 'https://tunnelbroker.net/tunnelInfo.php', *args, **kwargs):
# Creds are unique per tunnel... but we don't know the ID yet so we don't know which creds to use.
# TODO.
self.creds = creds self.creds = creds
self.url = xml_url self.url = xml_url
req = requests.get(self.url, req = requests.get(self.url,
@ -406,7 +408,14 @@ class HEConfig(BaseConfig):
with_comments = True)) with_comments = True))




class HETunnel(object): class HETunnelConfig(BaseConfig):
# TODO: RESTRUCTURE THIS and create an HETunnel() object
default_xsd = 'http://schema.xml.r00t2.io/projects/tunnelbroker.tun.xsd'
nsmap = {None: 'https://tunelbroker.net/tunnelInfo.php?tid',
'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}
attr_qname = etree.QName('http://www.w3.org/2001/XMLSchema-instance', 'schemaLocation')
schema_loc = 'https://tunnelbroker.net/tunnelInfo.php?tid {0}'.format(default_xsd)

def __init__(self, tun_xml): def __init__(self, tun_xml):
self.xml = tun_xml self.xml = tun_xml
self.id = None self.id = None