Documentation ¶
Index ¶
- Variables
- func EncodeIdentity(identity *SSSIdentity) (identityStr string, err error)
- func EncodeRecipient(policy *SSS) (recipientStr string, err error)
- func EncodeStanza(stanza *SSSStanza) (data []byte, err error)
- func IdentityV1() error
- func InspectFileHeader(filePath string) error
- func RecipientV1() error
- type PrintIdFunction
- type SSS
- type SSSIdentity
- type SSSIdentityItem
- type SSSStanza
Constants ¶
This section is empty.
Variables ¶
View Source
var CUSTOM_IDENITIY_STANZA_MAPPING = map[string]string{
"yubikey": "piv-p256",
"se": "piv-p256",
}
some plugins don't seem to strictly follow the current spec
View Source
var PLUGIN_NAME = "SSS"
View Source
var PluginTerminalUIProxy = &plugin.ClientUI{ DisplayMessage: func(name, message string) error { err := controller.SendCommand("msg", []byte(message), true) if err != nil { return err } return nil }, RequestValue: func(name, message string, _ bool) (s string, err error) { defer func() { if err != nil { msg := fmt.Sprintf("warn: could not read value for age-plugin-%s: %v", name, err) controller.SendCommand("msg", []byte(msg), true) } }() return controller.RequestValue(message, true) }, Confirm: func(name, message, yes, no string) (choseYes bool, err error) { defer func() { if err != nil { msg := fmt.Sprintf("could not read value for age-plugin-%s: %v", name, err) controller.SendCommand("msg", []byte(msg), true) } }() command := "confirm " + b64.EncodeToString([]byte(yes)) if no != "" { command += " " command += b64.EncodeToString([]byte(no)) } controller.SendCommand(command, []byte(message), false) scanner := bufio.NewScanner(os.Stdin) err = controller.ProtocolHandler(scanner, func(command string, args []string, body []byte) (done bool, err error) { switch command { case "ok": if args[0] == b64.EncodeToString([]byte("yes")) { choseYes = true return true, nil } if args[0] == b64.EncodeToString([]byte("no")) { choseYes = false return true, nil } return false, fmt.Errorf("invalid confirmation value %s", args[0]) case "fail": return false, errors.New("controller error") } return false, errors.New("did not receive expected response") }) if err != nil { return false, err } return }, WaitTimer: func(name string) { }, }
this client UI acts as a proxy between the main controller (age process) and the plugin for which age-plugin-sss is the controller.
Functions ¶
func EncodeIdentity ¶
func EncodeIdentity(identity *SSSIdentity) (identityStr string, err error)
func EncodeRecipient ¶
func EncodeStanza ¶
func IdentityV1 ¶
func IdentityV1() error
func InspectFileHeader ¶
func RecipientV1 ¶
func RecipientV1() error
Types ¶
type PrintIdFunction ¶
type SSS ¶
type SSS struct { Threshold int `yaml:"threshold,omitempty" json:"t,omitempty"` Recipient string `yaml:"recipient,omitempty" json:"r,omitempty"` }
func ParsePolicyFromYamlFile ¶
func ParseRecipient ¶
func (*SSS) UnmarshalYAML ¶
type SSSIdentity ¶
type SSSIdentity struct {
Identities []*SSSIdentityItem `yaml:"identities" json:"ids"`
}
func ParseIdentity ¶
func ParseIdentity(identityString string) (identity *SSSIdentity, err error)
func ParseIdentityFromYamlFile ¶
func ParseIdentityFromYamlFile(filePath string) (identity *SSSIdentity, err error)
type SSSIdentityItem ¶
type SSSIdentityItem struct { IdentityStr string `yaml:"identity" json:"i"` Identity age.Identity `yaml:"-" json:"-"` }
func (*SSSIdentityItem) UnmarshalYAML ¶
func (identityItem *SSSIdentityItem) UnmarshalYAML(unmarshal func(interface{}) error) error
Click to show internal directories.
Click to hide internal directories.