Ejemplo n.º 1
0
func (h *SecretKeysHandler) GetSecretKeys(_ context.Context, sessionID int) (keybase1.SecretKeys, error) {
	ctx := engine.Context{
		LogUI:    h.getLogUI(sessionID),
		SecretUI: h.getSecretUI(sessionID),
	}
	eng := engine.NewSecretKeysEngine(h.G())
	err := engine.RunEngine(eng, &ctx)
	if err != nil {
		return keybase1.SecretKeys{}, err
	}
	return eng.Result(), nil
}
Ejemplo n.º 2
0
func (h *SecretKeysHandler) GetSecretKeys(_ context.Context, sessionID int) (keybase1.SecretKeys, error) {
	if h.G().Env.GetRunMode() == libkb.ProductionRunMode {
		return keybase1.SecretKeys{}, errors.New("GetSecretKeys is a devel-only RPC")
	}
	ctx := engine.Context{
		LogUI:     h.getLogUI(sessionID),
		SecretUI:  h.getSecretUI(sessionID, h.G()),
		SessionID: sessionID,
	}
	eng := engine.NewSecretKeysEngine(h.G())
	err := engine.RunEngine(eng, &ctx)
	if err != nil {
		return keybase1.SecretKeys{}, err
	}
	return eng.Result(), nil
}