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:32:43 +0000 |
commit | f9aaf5dacc906f5e4a51b4ce984078aaa0c84bf4 (patch) | |
tree | 23940ad6af41e336b7ec9a91c1acf66c9d7e111b /macaroonbakery/httpbakery/agent/_agent.py | |
parent | 650d1b77a8729ffb148fc3a22923d7a52678738c (diff) | |
parent | c1850c8a10886894255100fae185c450e800564a (diff) |
New upstream release (1.1.2)
Diffstat (limited to 'macaroonbakery/httpbakery/agent/_agent.py')
-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: |