-
-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/vijay-kesanakurthi/gopass
- Loading branch information
Showing
22 changed files
with
671 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package age | ||
|
||
import ( | ||
"context" | ||
|
||
"filippo.io/age/plugin" | ||
"github.com/gopasspw/gopass/internal/cui" | ||
"github.com/gopasspw/gopass/internal/out" | ||
"github.com/gopasspw/gopass/pkg/termio" | ||
) | ||
|
||
var pluginTerminalUI = &plugin.ClientUI{ | ||
DisplayMessage: func(name, message string) error { | ||
out.Printf(context.Background(), "%s plugin: %s", name, message) | ||
|
||
return nil | ||
}, | ||
RequestValue: func(name, message string, _ bool) (string, error) { | ||
var err error | ||
defer func() { | ||
if err != nil { | ||
out.Warningf(context.Background(), "could not read value for age-plugin-%s: %v", name, err) | ||
} | ||
}() | ||
secret, err := termio.AskForPassword(context.Background(), "secret", false) | ||
if err != nil { | ||
return "", err | ||
} | ||
|
||
return secret, nil | ||
}, | ||
Confirm: func(name, message, yes, no string) (bool, error) { | ||
rep, _ := cui.GetSelection(context.Background(), message, []string{yes, no}) | ||
if rep == yes { | ||
return true, nil | ||
} | ||
|
||
return false, nil | ||
}, | ||
|
||
WaitTimer: func(name string) { | ||
out.Printf(context.Background(), "waiting on %s plugin...", name) | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.