Skip to content

Commit

Permalink
secure urls (e.g., 'abcd-efgh-ijkl')
Browse files Browse the repository at this point in the history
  • Loading branch information
samj committed Sep 13, 2024
1 parent 572b471 commit 86ddfa0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/managers/SharesManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from backend.schemas import ShareCreateSchema, ShareSchema
from typing import List, Tuple, Optional, Dict, Any

def generate_share_id():
# SHARE_ID_REGEX = '[a-z]{3}-[a-z]{3}-[a-z]{3}'
return '-'.join(''.join(secrets.choice(string.ascii_lowercase) for _ in range(3)) for _ in range(3))
def generate_share_id(num_blocks = 3, block_size = 4):
# `abcd-efgh-ijkl` format by default
return '-'.join(''.join(secrets.choice(string.ascii_lowercase) for _ in range(block_size)) for _ in range(num_blocks))

class SharesManager:
_instance = None
Expand Down

0 comments on commit 86ddfa0

Please sign in to comment.