Replaced token password with passphrase

environments/review-docs-devel-1399dq/deployments/6607
Fred Uggla 2020-11-15 21:44:23 +01:00 zatwierdzone przez Agate
rodzic f8d534797f
commit 22f739a297
3 zmienionych plików z 1306 dodań i 3 usunięć

Wyświetl plik

@ -2,6 +2,7 @@
from __future__ import absolute_import, unicode_literals
import datetime
import os
import random
import string
import uuid
@ -29,9 +30,14 @@ from funkwhale_api.federation import models as federation_models
from funkwhale_api.federation import utils as federation_utils
def get_token(length=30):
choices = string.ascii_lowercase + string.ascii_uppercase + "0123456789"
return "".join(random.choice(choices) for i in range(length))
def get_token(length=5):
wordlist_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "wordlist.txt"
)
with open(wordlist_path, "r") as f:
words = f.readlines()
phrase = "".join(random.choice(words) for i in range(length))
return phrase.replace("\n", "-").rstrip("-")
PERMISSIONS_CONFIGURATION = {

Plik diff jest za duży Load Diff

Wyświetl plik

@ -0,0 +1 @@
More user-friendly subsonic tokens (#1269)