sources/saml: rewrite Processors and Views to directly build XML without templates

This commit is contained in:
Jens Langhammer
2020-07-11 01:02:55 +02:00
parent 1e31cd03ed
commit 92a09be8c0
13 changed files with 193 additions and 138 deletions

View File

@ -12,9 +12,9 @@ def decode_base64_and_inflate(encoded: str, encoding="utf-8") -> str:
return decoded_data.decode(encoding)
def deflate_and_base64_encode(inflated: bytes, encoding="utf-8"):
def deflate_and_base64_encode(inflated: str, encoding="utf-8"):
"""Base64 and ZLib Compress b64string"""
zlibbed_str = zlib.compress(inflated)
zlibbed_str = zlib.compress(inflated.encode())
compressed_string = zlibbed_str[2:-4]
return base64.b64encode(compressed_string).decode(encoding)