2018-02-03 20:40:17 +00:00
|
|
|
#!/usr/bin/env python3
|
2018-02-03 00:36:08 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2018-02-03 20:40:17 +00:00
|
|
|
# pylint: disable=C0111,C0326,C0103
|
|
|
|
|
2018-02-03 21:25:26 +00:00
|
|
|
"""Tools to manage request authentication."""
|
|
|
|
|
2018-02-03 00:36:08 +00:00
|
|
|
import base64
|
|
|
|
|
2018-02-03 20:24:36 +00:00
|
|
|
|
2018-02-05 15:38:15 +00:00
|
|
|
def get_creds():
|
|
|
|
"""Return main authentication."""
|
|
|
|
creds = {
|
|
|
|
b"YWNjb3VudA==": b"emhlbmdodWEuZ2Fv",
|
|
|
|
b"cGFzc3dvcmQ=": b"cWFydUQ0b2s=",
|
|
|
|
}
|
|
|
|
params = {base64.b64decode(key): base64.b64decode(val) for key, val in creds.items()}
|
|
|
|
return params
|
2018-02-03 00:36:08 +00:00
|
|
|
|
2018-02-06 18:27:36 +00:00
|
|
|
|
2018-02-05 15:38:15 +00:00
|
|
|
def get_creds2():
|
|
|
|
"""Return alternate authentication."""
|
|
|
|
creds = {
|
|
|
|
b"YWNjb3VudA==": b"VGVsZUV4dFRlc3Q=",
|
|
|
|
b"cGFzc3dvcmQ=": b"dDA1MjM=",
|
|
|
|
}
|
|
|
|
params = {base64.b64decode(key): base64.b64decode(val) for key, val in creds.items()}
|
|
|
|
return params
|