From 676aa8d5b63b29fe4e34cc4fdc7526068a0a8e33 Mon Sep 17 00:00:00 2001 From: brent s Date: Thu, 14 May 2020 14:23:14 -0400 Subject: [PATCH] this is currently super broken but i'm getting there. --- utils/he_ipv6/TODO | 4 ++++ utils/he_ipv6/config.py | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 utils/he_ipv6/TODO 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