Documentation
¶
Overview ¶
* Copyright 2013–2020 Kullo GmbH * * This source code is licensed under the 3-clause BSD license. See LICENSE.txt * in the root directory of this source tree for details.
* Copyright 2013–2020 Kullo GmbH * * This source code is licensed under the 3-clause BSD license. See LICENSE.txt * in the root directory of this source tree for details.
* Copyright 2013–2020 Kullo GmbH * * This source code is licensed under the 3-clause BSD license. See LICENSE.txt * in the root directory of this source tree for details.
* Copyright 2013–2020 Kullo GmbH * * This source code is licensed under the 3-clause BSD license. See LICENSE.txt * in the root directory of this source tree for details.
* Copyright 2013–2020 Kullo GmbH * * This source code is licensed under the 3-clause BSD license. See LICENSE.txt * in the root directory of this source tree for details.
Index ¶
- Variables
- func CheckChallenge(clientAnswer *ChallengeClientAnswer, userExists bool, isLocalAddress bool) (bool, error)
- type BlockedChallenge
- func (self *BlockedChallenge) ChallengeNecessary(address string) (bool, error)
- func (self *BlockedChallenge) CheckChallenge(clientAnswer *ChallengeClientAnswer, userExists bool, isLocalAddress bool) (bool, error)
- func (self *BlockedChallenge) FillChallenge(challenge *Challenge, address string, userExists bool, isLocalAddress bool) error
- func (self *BlockedChallenge) Name() string
- type Challenge
- type ChallengeClientAnswer
- type ChallengeReply
- type ChallengeType
- type CodeChallenge
- func (self *CodeChallenge) ChallengeNecessary(address string) (bool, error)
- func (self *CodeChallenge) CheckChallenge(clientAnswer *ChallengeClientAnswer, userExists bool, isLocalAddress bool) (bool, error)
- func (self *CodeChallenge) FillChallenge(challenge *Challenge, address string, userExists bool, isLocalAddress bool) error
- func (self *CodeChallenge) Name() string
- type ReservationChallenge
- func (self *ReservationChallenge) ChallengeNecessary(address string) (bool, error)
- func (self *ReservationChallenge) CheckChallenge(clientAnswer *ChallengeClientAnswer, userExists bool, isLocalAddress bool) (bool, error)
- func (self *ReservationChallenge) FillChallenge(challenge *Challenge, address string, userExists bool, isLocalAddress bool) error
- func (self *ReservationChallenge) Name() string
- type ResetChallenge
- func (self *ResetChallenge) ChallengeNecessary(address string) (bool, error)
- func (self *ResetChallenge) CheckChallenge(clientAnswer *ChallengeClientAnswer, userExists bool, isLocalAddress bool) (bool, error)
- func (self *ResetChallenge) FillChallenge(challenge *Challenge, address string, userExists bool, isLocalAddress bool) error
- func (self *ResetChallenge) Name() string
Constants ¶
This section is empty.
Variables ¶
var ErrNoApplicableChallengeTypeFound = errors.New("No applicable challenge type has been found")
var ErrNotApplicable = errors.New("Challenge is not applicable to given user")
var ErrReservationListIntegrity = errors.New("Data integrity error in CSV: code must not be empty.")
var ErrUserExists = errors.New("User already exists")
var ErrWrongOkmLength = errors.New("challenges: wrong OKM length")
Functions ¶
func CheckChallenge ¶
func CheckChallenge(clientAnswer *ChallengeClientAnswer, userExists bool, isLocalAddress bool) (bool, error)
Types ¶
type BlockedChallenge ¶
type BlockedChallenge struct { }
func NewBlockedChallenge ¶
func NewBlockedChallenge() BlockedChallenge
func (*BlockedChallenge) ChallengeNecessary ¶
func (self *BlockedChallenge) ChallengeNecessary(address string) (bool, error)
func (*BlockedChallenge) CheckChallenge ¶
func (self *BlockedChallenge) CheckChallenge(clientAnswer *ChallengeClientAnswer, userExists bool, isLocalAddress bool) (bool, error)
func (*BlockedChallenge) FillChallenge ¶
func (*BlockedChallenge) Name ¶
func (self *BlockedChallenge) Name() string
type ChallengeClientAnswer ¶
type ChallengeReply ¶
type ChallengeReply struct { Challenge Challenge `json:"challenge"` ChallengeAuth string `json:"challengeAuth"` }
func CreateChallenge ¶
func CreateChallenge(address string, userExists bool, isLocalAddress bool) (*ChallengeReply, error)
type ChallengeType ¶
type ChallengeType interface { // Returns the challenge name as used in Challenge.Type Name() string // Is this challenge required under the assumption that the address doesn't // exist and challenges are optional? ChallengeNecessary(address string) (bool, error) // Fill the fields of the challenge being passed in FillChallenge(challenge *Challenge, address string, userExists bool, isLocalAddress bool) error // Check the validity of the ChallengeAnswer field CheckChallenge(clientAnswer *ChallengeClientAnswer, userExists bool, isLocalAddress bool) (bool, error) }
type CodeChallenge ¶
type CodeChallenge struct {
// contains filtered or unexported fields
}
func NewCodeChallenge ¶
func NewCodeChallenge() CodeChallenge
func (*CodeChallenge) ChallengeNecessary ¶
func (self *CodeChallenge) ChallengeNecessary(address string) (bool, error)
func (*CodeChallenge) CheckChallenge ¶
func (self *CodeChallenge) CheckChallenge(clientAnswer *ChallengeClientAnswer, userExists bool, isLocalAddress bool) (bool, error)
func (*CodeChallenge) FillChallenge ¶
func (*CodeChallenge) Name ¶
func (self *CodeChallenge) Name() string
type ReservationChallenge ¶
type ReservationChallenge struct {
// contains filtered or unexported fields
}
func NewReservationChallenge ¶
func NewReservationChallenge() ReservationChallenge
func (*ReservationChallenge) ChallengeNecessary ¶
func (self *ReservationChallenge) ChallengeNecessary(address string) (bool, error)
func (*ReservationChallenge) CheckChallenge ¶
func (self *ReservationChallenge) CheckChallenge(clientAnswer *ChallengeClientAnswer, userExists bool, isLocalAddress bool) (bool, error)
func (*ReservationChallenge) FillChallenge ¶
func (*ReservationChallenge) Name ¶
func (self *ReservationChallenge) Name() string
type ResetChallenge ¶
type ResetChallenge struct {
// contains filtered or unexported fields
}
func NewResetChallenge ¶
func NewResetChallenge() ResetChallenge
func (*ResetChallenge) ChallengeNecessary ¶
func (self *ResetChallenge) ChallengeNecessary(address string) (bool, error)
func (*ResetChallenge) CheckChallenge ¶
func (self *ResetChallenge) CheckChallenge(clientAnswer *ChallengeClientAnswer, userExists bool, isLocalAddress bool) (bool, error)
func (*ResetChallenge) FillChallenge ¶
func (*ResetChallenge) Name ¶
func (self *ResetChallenge) Name() string