From ee41245bfbad0564a890aecde78f9b868840b995 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Thu, 30 Jul 2015 21:58:46 +0200 Subject: [PATCH 1/3] Use HTTPS by default for contacts. --- go_http/contacts.py | 4 ++-- go_http/tests/test_contacts.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go_http/contacts.py b/go_http/contacts.py index 68d8906..3159e8d 100644 --- a/go_http/contacts.py +++ b/go_http/contacts.py @@ -25,7 +25,7 @@ class ContactsApiClient(object): :param str api_url: The full URL of the HTTP API. Defaults to - ``http://go.vumi.org/api/v1/go``. + ``https://go.vumi.org/api/v1/go``. :type session: :class:`requests.Session` @@ -36,7 +36,7 @@ class ContactsApiClient(object): def __init__(self, auth_token, api_url=None, session=None): self.auth_token = auth_token if api_url is None: - api_url = "http://go.vumi.org/api/v1/go" + api_url = "https://go.vumi.org/api/v1/go" self.api_url = api_url.rstrip('/') if session is None: session = requests.Session() diff --git a/go_http/tests/test_contacts.py b/go_http/tests/test_contacts.py index 6ad81f7..2b3f4eb 100644 --- a/go_http/tests/test_contacts.py +++ b/go_http/tests/test_contacts.py @@ -156,7 +156,7 @@ def test_default_session(self): def test_default_api_url(self): contacts = ContactsApiClient(self.AUTH_TOKEN) self.assertEqual( - contacts.api_url, "http://go.vumi.org/api/v1/go") + contacts.api_url, "https://go.vumi.org/api/v1/go") def test_auth_failure(self): contacts = self.make_client(auth_token="bogus_token") From bc9234c0f828ae8e7d390062e2477986dbcc0044 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Thu, 30 Jul 2015 21:58:59 +0200 Subject: [PATCH 2/3] Use HTTPS by default for metrics. --- go_http/metrics.py | 4 ++-- go_http/tests/test_metrics.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go_http/metrics.py b/go_http/metrics.py index 1532d87..4110840 100644 --- a/go_http/metrics.py +++ b/go_http/metrics.py @@ -22,7 +22,7 @@ class MetricsApiClient(object): :param str api_url: The full URL of the HTTP API. Defaults to - ``http://go.vumi.org/api/v1/go``. + ``https://go.vumi.org/api/v1/go``. :type session: :class:`requests.Session` @@ -33,7 +33,7 @@ class MetricsApiClient(object): def __init__(self, auth_token, api_url=None, session=None): self.auth_token = auth_token if api_url is None: - api_url = "http://go.vumi.org/api/v1/go" + api_url = "https://go.vumi.org/api/v1/go" self.api_url = api_url.rstrip('/') if session is None: session = requests.Session() diff --git a/go_http/tests/test_metrics.py b/go_http/tests/test_metrics.py index 9ca8978..fe07456 100644 --- a/go_http/tests/test_metrics.py +++ b/go_http/tests/test_metrics.py @@ -41,7 +41,7 @@ def test_default_api_url(self): client = MetricsApiClient( auth_token="auth-token") self.assertEqual(client.api_url, - "http://go.vumi.org/api/v1/go") + "https://go.vumi.org/api/v1/go") def check_request(self, request, method, headers=None): self.assertEqual(request.method, method) From fa9ce5a515c2473e607d0fdbbcee78b914803691 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Thu, 30 Jul 2015 21:59:17 +0200 Subject: [PATCH 3/3] Use HTTPS by default for HTTP API conversations. --- go_http/send.py | 4 ++-- go_http/tests/test_send.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go_http/send.py b/go_http/send.py index b6581bb..2772d4d 100644 --- a/go_http/send.py +++ b/go_http/send.py @@ -29,7 +29,7 @@ class HttpApiSender(object): conversation config. :param str api_url: The full URL of the HTTP API. Defaults to - ``http://go.vumi.org/api/v1/go/http_api_nostream``. + ``https://go.vumi.org/api/v1/go/http_api_nostream``. :type session: :class:`requests.Session` :param session: @@ -43,7 +43,7 @@ def __init__(self, account_key, conversation_key, conversation_token, self.conversation_key = conversation_key self.conversation_token = conversation_token if api_url is None: - api_url = "http://go.vumi.org/api/v1/go/http_api_nostream" + api_url = "https://go.vumi.org/api/v1/go/http_api_nostream" self.api_url = api_url if session is None: session = requests.Session() diff --git a/go_http/tests/test_send.py b/go_http/tests/test_send.py index 22e0654..6b24f62 100644 --- a/go_http/tests/test_send.py +++ b/go_http/tests/test_send.py @@ -42,7 +42,7 @@ def test_default_api_url(self): account_key="acc-key", conversation_key="conv-key", conversation_token="conv-token") self.assertEqual(sender.api_url, - "http://go.vumi.org/api/v1/go/http_api_nostream") + "https://go.vumi.org/api/v1/go/http_api_nostream") def check_request(self, request, method, data=None, headers=None): self.assertEqual(request.method, method)