From dfa331b7d67b5d89f2fdbe0406374810aaf33b57 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 20 Feb 2018 18:31:17 +0000 Subject: Import py-macaroon-bakery_1.1.2.orig.tar.gz --- macaroonbakery/httpbakery/agent/_agent.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'macaroonbakery/httpbakery') diff --git a/macaroonbakery/httpbakery/agent/_agent.py b/macaroonbakery/httpbakery/agent/_agent.py index b717261..618097c 100644 --- a/macaroonbakery/httpbakery/agent/_agent.py +++ b/macaroonbakery/httpbakery/agent/_agent.py @@ -109,14 +109,15 @@ class AgentInteractor(httpbakery.Interactor, httpbakery.LegacyInteractor): if not location.endswith('/'): location += '/' login_url = urljoin(location, p.login_url) - # TODO use client to make the request. - resp = requests.get(login_url, json={ - 'Username': agent.username, - 'PublicKey': str(self._auth_info.key), - }) + resp = requests.get( + login_url, params={ + 'username': agent.username, + 'public-key': str(self._auth_info.key.public_key)}, + auth=client.auth()) if resp.status_code != 200: raise httpbakery.InteractionError( - 'cannot acquire agent macaroon: {}'.format(resp.status_code) + 'cannot acquire agent macaroon: {} {}'.format( + resp.status_code, resp.text) ) m = resp.json().get('macaroon') if m is None: -- cgit v1.2.3