| Total Complexity | 4 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | #!/usr/bin/env python3 |
||
| 2 | # -*- coding: utf-8 -*- |
||
| 3 | |||
| 4 | # pylint: disable=C0111,C0326,C0103 |
||
| 5 | |||
| 6 | """Tools to manage request authentication.""" |
||
| 7 | |||
| 8 | import base64 |
||
| 9 | |||
| 10 | |||
| 11 | def get_creds(): |
||
| 12 | """Return main authentication.""" |
||
| 13 | creds = { |
||
| 14 | b"YWNjb3VudA==": b"emhlbmdodWEuZ2Fv", |
||
| 15 | b"cGFzc3dvcmQ=": b"cWFydUQ0b2s=", |
||
| 16 | } |
||
| 17 | params = {base64.b64decode(key): base64.b64decode(val) for key, val in creds.items()} |
||
| 18 | return params |
||
| 19 | |||
| 20 | |||
| 21 | def get_creds2(): |
||
| 22 | """Return alternate authentication.""" |
||
| 23 | creds = { |
||
| 24 | b"YWNjb3VudA==": b"VGVsZUV4dFRlc3Q=", |
||
| 25 | b"cGFzc3dvcmQ=": b"dDA1MjM=", |
||
| 26 | } |
||
| 27 | params = {base64.b64decode(key): base64.b64decode(val) for key, val in creds.items()} |
||
| 28 | return params |
||
| 29 |