diff --git a/SHARING.md b/SHARING.md index 01133c38..682e7af6 100644 --- a/SHARING.md +++ b/SHARING.md @@ -672,10 +672,10 @@ Preconditions: curl -u owner:$ownerpw -d "PathOrToken=/owner/bday-of-addressbook/" -d "PathMapped=/owner/addressbook/" -d "User=owner" -d "Conversion=bday" http://localhost:5232/.sharing/v1/map/create ## Enable -curl -u owner:$ownerpw -d "PathOrToken=/owner/bday-of-addressbook/" http://localhost:5232/.sharing/v1/bday/enable +curl -u owner:$ownerpw -d "PathOrToken=/owner/bday-of-addressbook/" http://localhost:5232/.sharing/v1/map/enable ## Unhide -curl -u owner:$ownerpw -d "PathOrToken=/owner/bday-of-addressbook/" http://localhost:5232/.sharing/v1/bday/unhide +curl -u owner:$ownerpw -d "PathOrToken=/owner/bday-of-addressbook/" http://localhost:5232/.sharing/v1/map/unhide ``` * Fetch *map* diff --git a/config b/config index b2bddd5b..b5688225 100644 --- a/config +++ b/config @@ -320,9 +320,6 @@ # Share collection by map #collection_by_map = false -# Share collection by bday (conversion on-the-fly) -#collection_by_bday = false - # Permit create of token-based sharing # If False it can be explicitly granted by permissions: t # If True it can be explicitly forbidden by permissions: T @@ -333,11 +330,6 @@ # If True it can be explicitly forbidden by permissions: M #permit_create_map = false -# Permit create of bday-based sharing -# If False it can be explicitly granted by permissions: b -# If True it can be explicitly forbidden by permissions: B -#permit_create_bday = false - # Permit properties overlay # If False it can be explicitly granted by share permissions: P # If True it can be explicitly forbidden by share permissions: p diff --git a/radicale/sharing/__init__.py b/radicale/sharing/__init__.py index 3ad3d35e..8dd10a0e 100644 --- a/radicale/sharing/__init__.py +++ b/radicale/sharing/__init__.py @@ -953,8 +953,8 @@ class BaseSharing: else: User = user - # v1: create uuid token with 2x 32 bytes = 256 bit with base64 encoding but replace '=' with '0' to avoid any additional encoding issues issues - token = "/.token/v1/" + str(base64.urlsafe_b64encode(uuid.uuid4().bytes + uuid.uuid4().bytes), 'utf-8').replace('=', '0') + "/" + # v1: create uuid token with 2x 16 bytes + separator = 264 bit with base64 encoding resulting in 56 chars without '=' padding + token = "/.token/v1/" + str(base64.urlsafe_b64encode(uuid.uuid4().bytes + b"\0" + uuid.uuid4().bytes), 'utf-8') + "/" if logger.isEnabledFor(logging.DEBUG): logger.debug("TRACE/" + api_info + ": %r (Permissions=%r token=%r)", PathMapped, Permissions, token)