Merge pull request #4388 from Holzhaus/qute-pass-fix
Add support for per-domain secret files in qute-pass
This commit is contained in:
commit
fcd9692066
@ -57,6 +57,8 @@ Changed
|
|||||||
- The JavaScript `console` object is now available in PAC files.
|
- The JavaScript `console` object is now available in PAC files.
|
||||||
- The metainfo file `qutebrowser.appdata.xml` is now renamed to
|
- The metainfo file `qutebrowser.appdata.xml` is now renamed to
|
||||||
`org.qutebrowser.qutebrowser.appdata.xml`.
|
`org.qutebrowser.qutebrowser.appdata.xml`.
|
||||||
|
- The `qute-pass` userscript now understands domains in gpg filenames
|
||||||
|
in addition to directory names.
|
||||||
|
|
||||||
Fixed
|
Fixed
|
||||||
~~~~~
|
~~~~~
|
||||||
@ -71,7 +73,7 @@ Fixed
|
|||||||
`content.cookies.accept = no-3rdparty` from working properly on some pages
|
`content.cookies.accept = no-3rdparty` from working properly on some pages
|
||||||
like GMail. However, the default for `content.cookies.accept` is still `all`
|
like GMail. However, the default for `content.cookies.accept` is still `all`
|
||||||
to be in line with what other browsers do.
|
to be in line with what other browsers do.
|
||||||
- `:navigate` not incrementing in anchors or queries or anchors.
|
- `:navigate` not incrementing in anchors or queries.
|
||||||
- Crash when trying to use a proxy requiring authentication with QtWebKit.
|
- Crash when trying to use a proxy requiring authentication with QtWebKit.
|
||||||
- Slashes in search terms are now percent-escaped.
|
- Slashes in search terms are now percent-escaped.
|
||||||
- When `scrolling.bar = True` was set in versions before v1.5.0, this now
|
- When `scrolling.bar = True` was set in versions before v1.5.0, this now
|
||||||
|
@ -97,13 +97,19 @@ def qute_command(command):
|
|||||||
def find_pass_candidates(domain, password_store_path):
|
def find_pass_candidates(domain, password_store_path):
|
||||||
candidates = []
|
candidates = []
|
||||||
for path, directories, file_names in os.walk(password_store_path, followlinks=True):
|
for path, directories, file_names in os.walk(password_store_path, followlinks=True):
|
||||||
if directories or domain not in path.split(os.path.sep):
|
secrets = fnmatch.filter(file_names, '*.gpg')
|
||||||
|
if not secrets:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Strip password store path prefix to get the relative pass path
|
# Strip password store path prefix to get the relative pass path
|
||||||
pass_path = path[len(password_store_path) + 1:]
|
pass_path = path[len(password_store_path) + 1:]
|
||||||
secrets = fnmatch.filter(file_names, '*.gpg')
|
split_path = pass_path.split(os.path.sep)
|
||||||
candidates.extend(os.path.join(pass_path, os.path.splitext(secret)[0]) for secret in secrets)
|
for secret in secrets:
|
||||||
|
secret_base = os.path.splitext(secret)[0]
|
||||||
|
if domain not in (split_path + [secret_base]):
|
||||||
|
continue
|
||||||
|
|
||||||
|
candidates.append(os.path.join(pass_path, secret_base))
|
||||||
return candidates
|
return candidates
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user