Reorg auth (#15443)

This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2018-07-13 11:43:08 +02:00
1 parent 23f1b49e55
commit b6ca03ce47
23 files changed
+698 -652

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
"""Auth utils."""
import binascii
import os
def generate_secret(entropy: int = 32) -> str:
"""Generate a secret.
Backport of secrets.token_hex from Python 3.6
Event loop friendly.
"""
return binascii.hexlify(os.urandom(entropy)).decode('ascii')