diff --git a/utils/he_ipv6/TODO b/utils/he_ipv6/TODO new file mode 100644 index 0000000..49b2d62 --- /dev/null +++ b/utils/he_ipv6/TODO @@ -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 diff --git a/utils/he_ipv6/config.py b/utils/he_ipv6/config.py index 7dea709..0eceb9c 100644 --- a/utils/he_ipv6/config.py +++ b/utils/he_ipv6/config.py @@ -373,6 +373,8 @@ class HEConfig(BaseConfig): schema_loc = 'https://tunnelbroker.net/tunnelInfo.php {0}'.format(default_xsd) 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.url = xml_url req = requests.get(self.url, @@ -406,7 +408,14 @@ class HEConfig(BaseConfig): 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): self.xml = tun_xml self.id = None