Documentation
¶
Index ¶
- Constants
- type AddLogRequest
- type AddLogResponse
- type CheckDeviceRequest
- type CheckDeviceResponse
- type DeviceInfo
- type GetLastLoginRequest
- type GetLastLoginResponse
- type GetUnusedAccountsRequest
- type GetUnusedAccountsResponse
- type GetUserDevicesRequest
- type GetUserDevicesResponse
- type GetUserLogsRequest
- type GetUserLogsResponse
- type LastLoginEntry
- type LogEntry
- type MetaDeviceInfo
- type SetLastLoginRequest
- type SetLastLoginResponse
Constants ¶
View Source
const ( LogTypeLogin = "login" LogTypeLogout = "logout" LogTypePasswordReset = "password_reset" LogTypePasswordChange = "password_change" LogTypeOTPEnabled = "otp_enabled" LogTypeOTPDisabled = "otp_disabled" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddLogResponse ¶
type AddLogResponse struct{}
type CheckDeviceRequest ¶
type CheckDeviceRequest struct { Username string `json:"username"` DeviceInfo *DeviceInfo `json:"device_info"` }
type DeviceInfo ¶
type DeviceInfo struct { ID string `json:"id"` RemoteAddr string `json:"remote_addr"` RemoteZone string `json:"remote_zone"` UserAgent string `json:"user_agent"` Browser string `json:"browser"` OS string `json:"os"` Mobile bool `json:"mobile"` }
DeviceInfo holds information about the client device. We use a simple persistent cookie to track the same client device across multiple session.
func DecodeDeviceInfoFromMap ¶
func DecodeDeviceInfoFromMap(m map[string]string, prefix string) *DeviceInfo
func (*DeviceInfo) EncodeToMap ¶
func (d *DeviceInfo) EncodeToMap(m map[string]string, prefix string)
type GetLastLoginRequest ¶
type GetLastLoginResponse ¶
type GetLastLoginResponse struct {
Results []*LastLoginEntry `json:"result"`
}
type GetUnusedAccountsRequest ¶
type GetUnusedAccountsResponse ¶
type GetUnusedAccountsResponse struct {
UnusedUsernames []string `json:"unused_usernames"`
}
type GetUserDevicesRequest ¶
type GetUserDevicesRequest struct {
Username string `json:"username"`
}
type GetUserDevicesResponse ¶
type GetUserDevicesResponse struct {
Devices []*MetaDeviceInfo `json:"devices"`
}
type GetUserLogsRequest ¶
type LastLoginEntry ¶
type LastLoginEntry struct { Timestamp time.Time `json:"timestamp"` Username string `json:"username"` Service string `json:"service"` }
func (*LastLoginEntry) Validate ¶
func (e *LastLoginEntry) Validate() error
type LogEntry ¶
type LogEntry struct { Timestamp time.Time `json:"timestamp"` Username string `json:"username"` Type string `json:"log_type"` Message string `json:"message,omitempty"` Service string `json:"service,omitempty"` LoginMethod string `json:"login_method,omitempty"` LoginAuthenticatorID string `json:"login_authenticator_id,omitempty"` DeviceInfo *DeviceInfo `json:"device_info,omitempty"` }
LogEntry represents an authentication event in the user-specific log.
type MetaDeviceInfo ¶
type SetLastLoginRequest ¶
type SetLastLoginRequest struct {
LastLogin *LastLoginEntry `json:"last_login"`
}
type SetLastLoginResponse ¶
type SetLastLoginResponse struct{}
Click to show internal directories.
Click to hide internal directories.