Try to enable more exotic auth methods in httpapi (#43212)

* Try to enable more exotic auth methods in httpapi

* Auth tokens won't always come back.

* Reconcile #43147 with this PR
This commit is contained in:
Nathaniel Case 2018-07-24 13:22:40 -04:00 committed by GitHub
parent ac1f05478e
commit a7097f6735
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 5 deletions

View file

@ -28,6 +28,27 @@ class HttpApiBase(AnsiblePlugin):
"""
pass
def logout(self):
""" Call to implement session logout.
Method to clear session gracefully e.g. tokens granted in login
need to be revoked.
"""
pass
def update_auth(self, response):
"""Return per-request auth token.
The response should be a dictionary that can be plugged into the
headers of a request. The default implementation uses cookie data.
If no authentication data is found, return None
"""
cookie = response.info().get('Set-Cookie')
if cookie:
return {'Cookie': cookie}
return None
@abstractmethod
def send_request(self, data, **message_kwargs):
"""Prepares and sends request(s) to device."""