Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorHandler(next http.Handler) http.Handler
- func OptionDB(db db.DB) func(*Service) error
- func OptionGeoResolver(geo geo.Resolver) func(*Service) error
- func OptionKV(kv store.Manager) func(*Service) error
- func OptionMessageBroker(broker broker.Broker) func(*Service) error
- func OptionParams(params map[string]string) func(*Service) error
- func OptionRP(rpDisplayName, rpID, rpOrigin string) func(*Service) error
- func UpdateFIDOMetadata(db db.DB, id, mdsToken string) error
- type APIError
- type Admin
- type Auth
- type ContextKey
- type Service
Constants ¶
View Source
const ( CollectionPendingFIDORegistration = "fidoPendingReg" CollectionPendingFIDOLogin = "fidoPendingLogin" )
Consts for auth services
Variables ¶
View Source
var (
ErrPrincipalRevoked = errors.New("principal rekoked")
)
Error constants
Functions ¶
func ErrorHandler ¶
ErrorHandler is middleware to log and process HTTP errors.
func OptionGeoResolver ¶
OptionGeoResolver sets a geo resolver.
func OptionMessageBroker ¶
OptionMessageBroker sets a broker client option.
func OptionParams ¶
OptionParams sets a key,value option. Multiple can be set.
Types ¶
type APIError ¶
type APIError struct {
Code int `json:"code"`
Err error `json:"error"`
Detail string `json:"detail,omitempty"`
}
APIError defines a API error.
func NewAPIError ¶
NewAPIError returns a new API error. If `source` is true, source code is also written to stdout.
func (*APIError) BindHTTPRequest ¶
BindHTTPRequest binds an API error to a HTTP Request's context.
type Admin ¶
type Admin interface {
Principal(context.Context, string) (*model.Principal, error)
AddPrincipal(context.Context, map[string]string) (*model.Principal, error)
UpdatePrincipal(context.Context, string, map[string]string) (*model.Principal, string, error)
PrincipalByUsername(context.Context, string) (*model.Principal, error)
Principals(context.Context, *util.APIParams) ([]*model.Principal, int64, error)
FIDOKey(context.Context, string) (*model.FIDOKey, error)
UpdateFIDOKey(context.Context, string, map[string]string) (*model.FIDOKey, string, error)
DeleteFIDOKey(context.Context, string) error
FIDOKeys(context.Context, *util.APIParams) ([]*model.FIDOKey, int64, error)
AAGUID(context.Context, string) (*model.AAGUID, error)
AddAAGUID(context.Context, map[string]string) (*model.AAGUID, error)
UpdateAAGUID(context.Context, string, map[string]string) (*model.AAGUID, string, error)
AAGUIDs(context.Context, *util.APIParams) ([]*model.AAGUID, int64, error)
AAGUIDWhitelist(context.Context) (util.StringSet, error)
AAGUIDBlacklist(context.Context) (util.StringSet, error)
Session(context.Context, string) (*model.Session, error)
Sessions(context.Context, *util.APIParams) ([]*model.Session, int64, error)
KillSession(context.Context, string) (*model.Session, error)
LogByID(context.Context, int64) (*model.AuditEntry, error)
Logs(context.Context, *util.APIParams) ([]*model.AuditEntry, int64, error)
Stop()
}
Admin defines the admin service interface.
type Auth ¶
type Auth interface {
GetOrCreatePrincipal(context.Context, map[string]string) (*model.Principal, *APIError)
StartFIDORegistration(context.Context, string) (*protocol.CredentialCreation, *APIError)
FinishFIDORegistration(context.Context, string, *http.Request) (*model.FIDOKey, *APIError)
StartFIDOLogin(context.Context, string) (*protocol.CredentialAssertion, *APIError)
FinishFIDOLogin(context.Context, string, *http.Request) (*model.Principal, *APIError)
Stop()
}
Auth defines the auth service interface.
type ContextKey ¶
type ContextKey int
ContextKey is a type for context key values.
const ( ContextError ContextKey = iota ContextIPAddr ContextUserAgent )
Consts for context keys
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents a base structure for services.
Click to show internal directories.
Click to hide internal directories.