Replaced token password with passphrase
This commit is contained in:
parent
f8d534797f
commit
22f739a297
|
@ -2,6 +2,7 @@
|
||||||
from __future__ import absolute_import, unicode_literals
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
import os
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
import uuid
|
import uuid
|
||||||
|
@ -29,9 +30,14 @@ from funkwhale_api.federation import models as federation_models
|
||||||
from funkwhale_api.federation import utils as federation_utils
|
from funkwhale_api.federation import utils as federation_utils
|
||||||
|
|
||||||
|
|
||||||
def get_token(length=30):
|
def get_token(length=5):
|
||||||
choices = string.ascii_lowercase + string.ascii_uppercase + "0123456789"
|
wordlist_path = os.path.join(
|
||||||
return "".join(random.choice(choices) for i in range(length))
|
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 = {
|
PERMISSIONS_CONFIGURATION = {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
||||||
|
More user-friendly subsonic tokens (#1269)
|
Loading…
Reference in New Issue