#31 API basic implementation
* adds new app to project * adds relation between User model and new APIUserToken model * adds first implementation for GET of intervention * adds basic code layout for future extension by having new versions
This commit is contained in:
@@ -13,6 +13,19 @@ import qrcode.image.svg
|
||||
from io import BytesIO
|
||||
|
||||
|
||||
def generate_token() -> str:
|
||||
""" Shortcut for default generating of e.g. API token
|
||||
|
||||
Returns:
|
||||
token (str)
|
||||
"""
|
||||
return generate_random_string(
|
||||
length=64,
|
||||
use_numbers=True,
|
||||
use_letters_lc=True
|
||||
)
|
||||
|
||||
|
||||
def generate_random_string(length: int, use_numbers: bool = False, use_letters_lc: bool = False, use_letters_uc: bool = False) -> str:
|
||||
"""
|
||||
Generates a random string of variable length
|
||||
|
||||
Reference in New Issue
Block a user