Skip to content

Commit dacbf65

Browse files
authored
Merge pull request #715 from addyess/security/https-snapcraft
#715 #### Description This PR switches the charmhub api connection from `http` -> `https` to make sure we're not insisting on `http` when calling charmhub and get blocked by firewalls. #### QA Steps We have tests in place to test the calls to charmhub, so all the tests in `test_charmhub.py` should be passing: ``` tox -e integration -- tests/integration/test_charmhub.py ``` #### Notes & Discussion Note that this is only a temporary patch. There's gonna be a another PR that will fetch the host address from the model configuration dynamically.
2 parents 4c49c1f + f62fece commit dacbf65

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

juju/charmhub.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ def request_charmhub_with_retry(self, url, retries):
2121
def get_charm_id(self, charm_name):
2222
conn, headers, path_prefix = self.model.connection().https_connection()
2323

24-
url = "http://api.snapcraft.io/v2/charms/info/{}".format(charm_name)
24+
url = "https://api.snapcraft.io/v2/charms/info/{}".format(charm_name)
2525
_response = self.request_charmhub_with_retry(url, 5)
2626
response = json.loads(_response.text)
2727
return response['id'], response['name']
2828

2929
def is_subordinate(self, charm_name):
3030
conn, headers, path_prefix = self.model.connection().https_connection()
3131

32-
url = "http://api.snapcraft.io/v2/charms/info/{}?fields=default-release.revision.subordinate".format(charm_name)
32+
url = "https://api.snapcraft.io/v2/charms/info/{}?fields=default-release.revision.subordinate".format(charm_name)
3333
_response = self.request_charmhub_with_retry(url, 5)
3434
response = json.loads(_response.text)
3535
return 'subordinate' in response['default-release']['revision']

0 commit comments

Comments
 (0)