feat(terra): Proton Pass picker in the polkit/askpass dialog
A collapsed panel under the dialog lists logins from every vault via pass-cli, one tab per vault with overflow into a dropdown; picking one fetches its password into the field. Listing never touches secrets, and the `darman@<config>` items are `custom`, not `login`, so both types are listed. Adds a show/hide toggle to the password field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -64,6 +64,8 @@ Scope {
|
||||
root.promptText = message === "" ? "Password:" : message;
|
||||
root.fifoPath = fifo;
|
||||
root.failed = false;
|
||||
vault.invalidate();
|
||||
vault.refresh();
|
||||
return "ok";
|
||||
}
|
||||
|
||||
@@ -101,12 +103,22 @@ Scope {
|
||||
if (!root.active)
|
||||
return;
|
||||
|
||||
vault.invalidate();
|
||||
root.pendingSecret = secret + "\n";
|
||||
writer.command = ["sh", "-c", "IFS= read -r line; printf %s \"$line\" > \"$1\"", "sh", root.fifoPath];
|
||||
writer.running = true;
|
||||
root.fifoPath = "";
|
||||
}
|
||||
|
||||
ProtonPass {
|
||||
id: vault
|
||||
|
||||
onFetched: secret => {
|
||||
content.response = secret;
|
||||
content.focusInput();
|
||||
}
|
||||
}
|
||||
|
||||
// Opening a fifo for writing BLOCKS until a reader attaches, which is why
|
||||
// this is a subprocess rather than a FileView: the helper's `cat` is that
|
||||
// reader, and blocking the QML thread on it would freeze the shell.
|
||||
@@ -149,7 +161,7 @@ Scope {
|
||||
id: content
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: Math.max(32, Math.round(parent.height / 3 - height / 2))
|
||||
y: Math.max(32, Math.round(parent.height / 3 - content.dialogHeight / 2))
|
||||
width: 520
|
||||
|
||||
// Deliberately the polkit dialog's own content component: this is a
|
||||
@@ -168,6 +180,17 @@ Scope {
|
||||
responseVisible: false
|
||||
failed: root.failed
|
||||
|
||||
credentialsEnabled: true
|
||||
credentials: vault.entries
|
||||
credentialsStatus: vault.listStatus
|
||||
fetchStatus: vault.fetchStatus
|
||||
|
||||
onCredentialRequested: entry => vault.fetch(entry)
|
||||
onPickerOpened: {
|
||||
if (vault.entries.length === 0)
|
||||
vault.refresh();
|
||||
}
|
||||
|
||||
onSubmitted: value => root.submit(value)
|
||||
onCancelled: root.dismiss()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user