Commit 03a9ef33 authored by Kirill Smelkov's avatar Kirill Smelkov

X wcfs: Remove credentials from zurl when computing wcfs mountpoint

parent bb40185b
...@@ -74,6 +74,7 @@ from golang.gcompat import qq ...@@ -74,6 +74,7 @@ from golang.gcompat import qq
from persistent import Persistent from persistent import Persistent
from zodbtools.util import ashex as h from zodbtools.util import ashex as h
from six.moves.urllib.parse import urlsplit, urlunsplit
from .client._wcfs import \ from .client._wcfs import \
PyWCFS as _WCFS, \ PyWCFS as _WCFS, \
...@@ -297,6 +298,15 @@ def _wcfs_exe(): ...@@ -297,6 +298,15 @@ def _wcfs_exe():
# #
# it also makes sure the mountpoint exists. # it also makes sure the mountpoint exists.
def _mntpt_4zurl(zurl): def _mntpt_4zurl(zurl):
# remove credentials from zurl.
# The same database can be accessed from different clients with different
# credentials, but we want to map them all to the same single WCFS
# instance.
scheme, netloc, path, query, frag = urlsplit(zurl)
if '@' in netloc:
netloc = netloc[netloc.index('@')+1:]
zurl = urlunsplit((scheme, netloc, path, query, frag))
m = hashlib.sha1() m = hashlib.sha1()
m.update(zurl) m.update(zurl)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment