Documentation
¶
Index ¶
- Variables
- func ConfirmSentence(operationID string, params map[string]string) string
- func DefaultApprovalDir() (string, error)
- func WithInput(ctx context.Context, in Input) context.Context
- type Around
- type Builtin
- type CommandNotifier
- type Decision
- type HTTPNotifier
- type Hook
- type Input
- type Notice
- type Notifier
- type PendingConfirmation
- type State
- func (s *State) Approve(id string) (string, error)
- func (s *State) ConsumeConfirmation(approvalID, opID string, params map[string]string) (bool, error)
- func (s *State) ConsumeFor(caller, approvalID, opID string, params map[string]string) (bool, error)
- func (s *State) Pending(id string) *PendingConfirmation
- func (s *State) RequestConfirmation(opID string, params map[string]string) (string, error)
- func (s *State) RequestFor(caller, opID string, params map[string]string) (string, error)
- func (s *State) SetNonceDir(dir string)
- func (s *State) SetSigner(secret []byte, ttl time.Duration) error
- type Wrapped
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownApproval = errors.New("unknown approval")
ErrUnknownApproval is an id approve cannot find, or one that is already consumed or expired.
Functions ¶
func DefaultApprovalDir ¶
Types ¶
type CommandNotifier ¶
type CommandNotifier struct {
// contains filtered or unexported fields
}
type HTTPNotifier ¶
type HTTPNotifier struct {
// contains filtered or unexported fields
}
type PendingConfirmation ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
Consumed nonces are files in the signer directory. Two machines that share the secret and not that directory can each accept the token until expiry.
func (*State) Approve ¶
Approve records a separate decision. The returned id is what a later invoke accepts once.
func (*State) ConsumeConfirmation ¶
func (*State) ConsumeFor ¶
ConsumeFor accepts an approved id once, and only for the caller that received it.
func (*State) Pending ¶
func (s *State) Pending(id string) *PendingConfirmation
func (*State) RequestConfirmation ¶
RequestConfirmation records a pending call. The id it returns does not authorize HTTP. A store error means the file was not written, so there is no pending id to approve.
func (*State) RequestFor ¶
RequestFor records a pending call for one caller. The id it returns does not authorize HTTP. A store error means the file was not written, so there is no pending id to approve.