forked from keybase/client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unlock.go
46 lines (37 loc) · 1022 Bytes
/
unlock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package engine
import (
"github.com/keybase/client/go/libkb"
)
// Unlock is an engine.
type Unlock struct {
libkb.Contextified
}
// NewUnlock creates a Unlock engine.
func NewUnlock(g *libkb.GlobalContext) *Unlock {
return &Unlock{
Contextified: libkb.NewContextified(g),
}
}
// Name is the unique engine name.
func (e *Unlock) Name() string {
return "Unlock"
}
// GetPrereqs returns the engine prereqs.
func (e *Unlock) Prereqs() Prereqs {
return Prereqs{Device: true}
}
// RequiredUIs returns the required UIs.
func (e *Unlock) RequiredUIs() []libkb.UIKind {
return []libkb.UIKind{libkb.SecretUIKind}
}
// SubConsumers returns the other UI consumers for this engine.
func (e *Unlock) SubConsumers() []libkb.UIConsumer {
return nil
}
// Run starts the engine.
func (e *Unlock) Run(ctx *Context) error {
_, err := e.G().LoginState().GetPassphraseStream(ctx.SecretUI)
return err
}