Skip to content
Snippets Groups Projects
Commit 6cffadeb authored by Georges Racinet's avatar Georges Racinet
Browse files

User.token_headers()

This is obviously the right place to mutualize the API token logic.
Forfunately, token headers creation is not spread all over the
tests, just in a few helper classes
parent 0c7dfea6
No related branches found
No related tags found
No related merge requests found
......@@ -123,6 +123,11 @@
"""
return self.heptapod.users[self.name].get('token')
def token_headers(self):
"""Return a *new* headers dict suitable for authenticated API acces.
"""
return {'Private-Token': self.token}
@token.setter
def token(self, value):
self.heptapod.users.setdefault(self.name, {})['token'] = value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment