Skip to content

Commit

Permalink
Lock content adapted to the ref implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Dec 10, 2021
1 parent 039a8ed commit f8e69f8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/commoniface.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@
def genrevalock(appname, value):
'''Return a base64-encoded lock compatible with the Reva implementation of the CS3 Lock API'''
return urlsafe_b64encode(json.dumps(
{'h': appname if appname else 'wopi', 't': int(time.time()), 'md': value}
).encode()).decode()
{'type': 'LOCK_TYPE_SHARED',
'h': appname if appname else 'wopi',
'md': value,
'mtime': int(time.time()),
}).encode()).decode()

def retrieverevalock(rawlock):
'''Restores the JSON payload from a base64-encoded Reva lock'''
Expand Down

0 comments on commit f8e69f8

Please sign in to comment.