Documentation ¶
Index ¶
- Variables
- type RegisterResult
- type ScanResult
- type Scanner
- func (m *Scanner) GetServerDelegate(ctx context.Context, server string) (delegate string, delegateType string, err error)
- func (m *Scanner) ScanServer(ctx context.Context, server string, badFlows []*set.StringSet) (bool, error)
- func (m *Scanner) ScanServerResult(ctx context.Context, server string) (*ScanResult, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoExist = errors.New("requested resource does not exist") Err404 = errors.New("404 while getting registration") // nolint:errname // It is, you're just bad. )
Errors returned from various bits of machinery
Functions ¶
This section is empty.
Types ¶
type RegisterResult ¶
type RegisterResult struct { Session string `json:"session"` Flows []struct { Stages []string `json:"stages"` } `json:"flows"` Error string `json:"error"` ErrorCode string `json:"errcode"` }
RegisterResult is the json blob returned from the registration endpoint
func (*RegisterResult) AllowsUnverifiedRegistration ¶
func (r *RegisterResult) AllowsUnverifiedRegistration(badflows []*set.StringSet) bool
AllowsUnverifiedRegistration returns whether or not this result allows for unverified registration based on the passed list of bad flow sets
type ScanResult ¶
type ScanResult struct { *RegisterResult Homeserver string Delegate string DelegateType string Remarks []string }
ScanResult represents the result of a scan made using Scanner. Remarks may contain interesting (to a human) messages regarding the process
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner provides a frontend to scan matrix servers for bad behaviour
func NewScanner ¶
NewScanner creates a new matrix scanner with the given logger
func (*Scanner) GetServerDelegate ¶
func (m *Scanner) GetServerDelegate(ctx context.Context, server string) ( delegate string, delegateType string, err error, )
GetServerDelegate returns the "real" host for a given homeserver
func (*Scanner) ScanServer ¶
func (m *Scanner) ScanServer(ctx context.Context, server string, badFlows []*set.StringSet) (bool, error)
ScanServer asks the given server for its available flows, and returns whether or not any flow matched badFlows
func (*Scanner) ScanServerResult ¶
ScanServerResult returns a ScanResult for a given server scan, or an Error