Merge pull request #2056 from pbiering/sharing-review-6

Sharing review 6
This commit is contained in:
Peter Bieringer
2026-03-29 08:30:09 +02:00
committed by GitHub
3 changed files with 4 additions and 12 deletions

View File

@@ -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*

8
config
View File

@@ -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

View File

@@ -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)