From 4a46723219e5284bec21b9dccd6589a670babc63 Mon Sep 17 00:00:00 2001 From: kali Date: Mon, 27 Aug 2012 23:21:43 +0900 Subject: add test_dump_default_eipconfig to eip.test_checks plus a little bit of cleaning around (created constants file). added some notes about inminent deprecation *work in progress* --- src/leap/eip/constants.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/leap/eip/constants.py (limited to 'src/leap/eip/constants.py') diff --git a/src/leap/eip/constants.py b/src/leap/eip/constants.py new file mode 100644 index 00000000..7124ca57 --- /dev/null +++ b/src/leap/eip/constants.py @@ -0,0 +1,20 @@ +EIP_CONFIG = "eip.json" + +EIP_SAMPLE_JSON = { + "provider": "testprovider.example.org", + "transport": "openvpn", + "openvpn_protocol": "tcp", + "openvpn_port": "80", + "openvpn_ca_certificate": "~/.config/leap/providers/" + "testprovider.example.org/" + "keys/ca/testprovider-ca-cert-" + "2013-01-01.pem", + "openvpn_client_certificate": "~/.config/leap/providers/" + "testprovider.example.org/" + "keys/client/openvpn-2012-09-31.pem", + "connect_on_login": True, + "block_cleartext_traffic": True, + "primary_gateway": "usa_west", + "secondary_gateway": "france", + "management_password": "oph7Que1othahwiech6J" +} -- cgit v1.2.3 From c469e396bde67db15e486a320b254de0fa6f69df Mon Sep 17 00:00:00 2001 From: kali Date: Tue, 28 Aug 2012 06:08:58 +0900 Subject: checki complete eip_config tests. completed first version of EIPChecks --- src/leap/eip/constants.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/leap/eip/constants.py') diff --git a/src/leap/eip/constants.py b/src/leap/eip/constants.py index 7124ca57..6161d744 100644 --- a/src/leap/eip/constants.py +++ b/src/leap/eip/constants.py @@ -18,3 +18,31 @@ EIP_SAMPLE_JSON = { "secondary_gateway": "france", "management_password": "oph7Que1othahwiech6J" } + +EIP_SERVICE_EXPECTED_PATH = "eip-service.json" + +EIP_SAMPLE_SERVICE = { + "serial": 1, + "version": "0.1.0", + "capabilities": { + "transport": ["openvpn"], + "ports": ["80", "53"], + "protocols": ["udp", "tcp"], + "static_ips": True, + "adblock": True + }, + "gateways": [ + {"country_code": "us", + "label": {"en":"west"}, + "capabilities": {}, + "hosts": ["1.2.3.4", "1.2.3.5"]}, + {"country_code": "us", + "label": {"en":"east"}, + "capabilities": {}, + "hosts": ["1.2.3.4", "1.2.3.5"]}, + {"country_code": "fr", + "label": {}, + "capabilities": {}, + "hosts": ["1.2.3.4", "1.2.3.5"]} + ] +} -- cgit v1.2.3 From ed4ad3a392caf0211e51a48d2d7b6c5a2f7bb17a Mon Sep 17 00:00:00 2001 From: kali Date: Wed, 29 Aug 2012 23:05:38 +0900 Subject: add eipconfig spec and config object --- src/leap/eip/constants.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/leap/eip/constants.py') diff --git a/src/leap/eip/constants.py b/src/leap/eip/constants.py index 6161d744..31974926 100644 --- a/src/leap/eip/constants.py +++ b/src/leap/eip/constants.py @@ -1,5 +1,8 @@ EIP_CONFIG = "eip.json" +# XXX deprecate. EIPConfig used instead +# can move for testing purposes. + EIP_SAMPLE_JSON = { "provider": "testprovider.example.org", "transport": "openvpn", -- cgit v1.2.3 From 1263cd7a3cfca81ae3e6976a489e2d3d4013d64b Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 30 Aug 2012 00:36:50 +0900 Subject: add lazy evaluation to config specs now callables are allowed in specs *only at one level depth* to allow for last-minute evaluation on context-sensitive data, like paths affected by os.environ also some minor modifications to make check tests pass after putting the new jsonconfig-based eipconfig in place. aaaaaall green again :) --- src/leap/eip/constants.py | 50 +---------------------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) (limited to 'src/leap/eip/constants.py') diff --git a/src/leap/eip/constants.py b/src/leap/eip/constants.py index 31974926..ce50f5e0 100644 --- a/src/leap/eip/constants.py +++ b/src/leap/eip/constants.py @@ -1,51 +1,3 @@ +# not used anymore with the new JSONConfig.slug EIP_CONFIG = "eip.json" - -# XXX deprecate. EIPConfig used instead -# can move for testing purposes. - -EIP_SAMPLE_JSON = { - "provider": "testprovider.example.org", - "transport": "openvpn", - "openvpn_protocol": "tcp", - "openvpn_port": "80", - "openvpn_ca_certificate": "~/.config/leap/providers/" - "testprovider.example.org/" - "keys/ca/testprovider-ca-cert-" - "2013-01-01.pem", - "openvpn_client_certificate": "~/.config/leap/providers/" - "testprovider.example.org/" - "keys/client/openvpn-2012-09-31.pem", - "connect_on_login": True, - "block_cleartext_traffic": True, - "primary_gateway": "usa_west", - "secondary_gateway": "france", - "management_password": "oph7Que1othahwiech6J" -} - EIP_SERVICE_EXPECTED_PATH = "eip-service.json" - -EIP_SAMPLE_SERVICE = { - "serial": 1, - "version": "0.1.0", - "capabilities": { - "transport": ["openvpn"], - "ports": ["80", "53"], - "protocols": ["udp", "tcp"], - "static_ips": True, - "adblock": True - }, - "gateways": [ - {"country_code": "us", - "label": {"en":"west"}, - "capabilities": {}, - "hosts": ["1.2.3.4", "1.2.3.5"]}, - {"country_code": "us", - "label": {"en":"east"}, - "capabilities": {}, - "hosts": ["1.2.3.4", "1.2.3.5"]}, - {"country_code": "fr", - "label": {}, - "capabilities": {}, - "hosts": ["1.2.3.4", "1.2.3.5"]} - ] -} -- cgit v1.2.3 From 79db1d90f617d90cda61a790c92a54afcf30ff16 Mon Sep 17 00:00:00 2001 From: kali Date: Wed, 19 Sep 2012 05:02:30 +0900 Subject: checks for certificate --- src/leap/eip/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/leap/eip/constants.py') diff --git a/src/leap/eip/constants.py b/src/leap/eip/constants.py index ce50f5e0..9af5a947 100644 --- a/src/leap/eip/constants.py +++ b/src/leap/eip/constants.py @@ -1,3 +1,3 @@ # not used anymore with the new JSONConfig.slug EIP_CONFIG = "eip.json" -EIP_SERVICE_EXPECTED_PATH = "eip-service.json" +EIP_SERVICE_EXPECTED_PATH = "1/config/eip-service.json" -- cgit v1.2.3