Documentation
¶
Index ¶
- Constants
- type AdminLink
- type AdminLinkService
- type AdminPanelViewModel
- type AdminRenderer
- type AdminSectionLinks
- type AuthToken
- type AuthTokenCookie
- type AuthTokenCookieContextKey
- type AuthTokenCookieManager
- type BaseViewModel
- type CookieContextKey
- type IdentityContextKey
- type LoginViewModel
- type OrganizationFormViewModel
- type OrganizationOverviewViewModel
- type OrganizationsPageViewModel
- type RecentUser
- type RoleFormViewModel
- type RoleOverviewViewModel
- type RolePermissionsViewModel
- type RoleUsersViewModel
- type Route
- type TwoFactorViewModel
- type UserFormViewModel
- type UserIdentity
- type UserOverviewViewModel
- type UserRolesViewModel
- type UsersPageViewModel
Constants ¶
View Source
const AuthTokenCookieContextKeyStr = AuthTokenCookieContextKey("authToken")
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminLinkService ¶
type AdminLinkService interface {
GetLinks(r *http.Request) *AdminSectionLinks
AddLink(link AdminLink)
}
type AdminPanelViewModel ¶
type AdminPanelViewModel struct {
BaseViewModel
OrgCount int64
UserCount int64
RoleCount int64
Recent []RecentUser
}
type AdminRenderer ¶
type AdminSectionLinks ¶
type AdminSectionLinks struct {
// contains filtered or unexported fields
}
func (*AdminSectionLinks) Add ¶
func (asl *AdminSectionLinks) Add(link AdminLink)
type AuthToken ¶
type AuthToken struct {
UserId int64 `json:"userId"`
OrganizationId int64 `json:"organizationId"`
Email string `json:"email"`
TwoFactorRequired bool `json:"twoFactorRequired"`
RequiresVerification bool `json:"requiresVerification"`
SoftExpiry int64 `json:"softExpiry"`
HardExpiry int64 `json:"hardExpiry"`
}
func (*AuthToken) ToUserIdentity ¶
func (t *AuthToken) ToUserIdentity() UserIdentity
type AuthTokenCookie ¶
type AuthTokenCookie interface {
ToUserIdentity() UserIdentity
IsExpired() bool
Touch(unixSec int64)
}
type AuthTokenCookieContextKey ¶
type AuthTokenCookieContextKey string
type AuthTokenCookieManager ¶
type AuthTokenCookieManager interface {
ClearAuthTokenCookie(w http.ResponseWriter)
ReadAuthTokenCookie(r *http.Request) (bool, AuthToken, error)
WriteAuthTokenCookie(w http.ResponseWriter, token AuthToken) error
Middleware(handler http.Handler) http.Handler
MiddlewareFunc(handler http.HandlerFunc) http.HandlerFunc
TokenFromContext(ctx context.Context) (AuthToken, bool)
IdentityFromContext(ctx context.Context) (UserIdentity, bool)
}
type BaseViewModel ¶
type BaseViewModel struct {
Fragment bool
Links *AdminSectionLinks
}
type CookieContextKey ¶
type CookieContextKey string
type IdentityContextKey ¶
type IdentityContextKey string
type LoginViewModel ¶
type LoginViewModel struct {
BaseViewModel
Error string
}
type OrganizationFormViewModel ¶
type OrganizationFormViewModel struct {
BaseViewModel
IsEdit bool
Organization *ubdata.Organization
Error string
FieldErrors map[string][]string
}
type OrganizationOverviewViewModel ¶
type OrganizationOverviewViewModel struct {
BaseViewModel
ID int64
Name string
SystemName string
Roles []ubdata.ListRolesWithUserCountsRow
}
type OrganizationsPageViewModel ¶
type OrganizationsPageViewModel struct {
BaseViewModel
Organizations []ubdata.Organization
Query string
}
type RecentUser ¶
type RoleFormViewModel ¶
type RoleFormViewModel struct {
BaseViewModel
IsEdit bool
Role *ubdata.RoleRow
Organizations []ubdata.Organization
SelectedOrg int64
Error string
FieldErrors map[string][]string
}
type RoleOverviewViewModel ¶
type RoleOverviewViewModel struct {
BaseViewModel
ID int64
Name string
SystemName string
OrganizationID int64
}
type RolePermissionsViewModel ¶
type RolePermissionsViewModel struct {
BaseViewModel
RoleID int64
Permissions []string
MemberSet map[string]bool
}
type RoleUsersViewModel ¶
type TwoFactorViewModel ¶
type TwoFactorViewModel struct {
BaseViewModel
UserID int64
Error string
}
type UserFormViewModel ¶
type UserIdentity ¶
func (*UserIdentity) ToAgent ¶
func (u *UserIdentity) ToAgent() string
type UserOverviewViewModel ¶
type UserRolesViewModel ¶
type UsersPageViewModel ¶
type UsersPageViewModel struct {
BaseViewModel
Users []ubdata.User
Query string
}
Click to show internal directories.
Click to hide internal directories.