diff options
author | Colin Watson <cjwatson@debian.org> | 2018-02-20 18:31:17 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2018-02-20 18:31:17 +0000 |
commit | dfa331b7d67b5d89f2fdbe0406374810aaf33b57 (patch) | |
tree | 102717b2061f4514f4df6e0cb65b1a0cd706e007 /macaroonbakery/httpbakery | |
parent | 9e4403035a9953c99117083e6373ae3c441a76b5 (diff) |
Import py-macaroon-bakery_1.1.2.orig.tar.gz
Diffstat (limited to 'macaroonbakery/httpbakery')
-rw-r--r-- | macaroonbakery/httpbakery/agent/_agent.py | 13 |
1 files changed, 7 insertions, 6 deletions
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: |