mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 22:19:17 +02:00
Replaced token password with passphrase
This commit is contained in:
parent
f8d534797f
commit
22f739a297
3 changed files with 1306 additions and 3 deletions
|
@ -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 = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue