Documentation
¶
Index ¶
- Constants
- Variables
- func BootstrapStaticCodeHandler(zone string, scrambleAlg lhash.Algorithm) (h *SaticCodeHandler, accessCode *Code, scrambledCode *Code, ...)
- func Check(code *Code) (granted terminal.Permission, err error)
- func EnableTestMode()
- func Import(code *Code) error
- func RegisterZone(zone string, handler CodeHandler, grants terminal.Permission)
- type AuthorizeOp
- type Code
- type CodeHandler
- type SaticCodeHandler
- type Zone
Constants ¶
View Source
const (
OpTypeAccessCodeAuth = "auth"
)
Variables ¶
View Source
var (
MainZone = "alpha2"
)
Functions ¶
func BootstrapStaticCodeHandler ¶ added in v0.3.0
func BootstrapStaticCodeHandler(zone string, scrambleAlg lhash.Algorithm) ( h *SaticCodeHandler, accessCode *Code, scrambledCode *Code, verificationHash *lhash.LabeledHash, err error, )
func Check ¶
func Check(code *Code) (granted terminal.Permission, err error)
Check checks if the given code is valid.
func EnableTestMode ¶ added in v0.3.0
func EnableTestMode()
func RegisterZone ¶
func RegisterZone(zone string, handler CodeHandler, grants terminal.Permission)
RegisterZone registers a handler with the given zone name.
Types ¶
type AuthorizeOp ¶ added in v0.3.0
type AuthorizeOp struct {
terminal.OpBaseRequest
}
func AuthorizeToTerminal ¶ added in v0.3.0
func AuthorizeToTerminal(t terminal.OpTerminal) (*AuthorizeOp, *terminal.Error)
func (*AuthorizeOp) Type ¶ added in v0.3.0
func (op *AuthorizeOp) Type() string
type CodeHandler ¶
type SaticCodeHandler ¶
type SaticCodeHandler struct {
// contains filtered or unexported fields
}
func NewSaticCodeHandler ¶
func NewSaticCodeHandler(verificationHash string, scrambleAlg lhash.Algorithm) (*SaticCodeHandler, error)
func (*SaticCodeHandler) Check ¶
func (h *SaticCodeHandler) Check(code *Code) error
func (*SaticCodeHandler) Generate ¶
func (h *SaticCodeHandler) Generate() (*Code, error)
func (*SaticCodeHandler) Get ¶
func (h *SaticCodeHandler) Get() (*Code, error)
func (*SaticCodeHandler) Import ¶
func (h *SaticCodeHandler) Import(code *Code) error
Click to show internal directories.
Click to hide internal directories.