Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPassword ¶
Types ¶
type AuthConfig ¶
AuthConfig is used as a reciever for auth-related filters in order to pass in state such as Public Keys that are typically pulled from env vars. In test they will likely be hardcoded.
func (AuthConfig) RequiresSuperAdminFilter ¶
func (authConfig AuthConfig) RequiresSuperAdminFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
RequiresSuperAdminFilter ensures that the logged-in user has SuperAdmin permissions. You should add ValidJwtFilter before this one in the chain.
func (AuthConfig) ValidJwtFilter ¶
func (authConfig AuthConfig) ValidJwtFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
ValidJwtFilter ensures that an API request is made with a valid, signed bearer token
type Claims ¶
func GetRequestJWTClaims ¶
func GetRequestJWTClaims(req *restful.Request) *Claims
type RoleType ¶
type RoleType int
const ( SiteAdmin RoleType = 0 // Administrative permissions for Volunteer-Savvy as a whole OrgAdmin RoleType = 1 // Administrative permissions for a single Organization Volunteer RoleType = 2 // User is able to sign up, log work. SiteManager RoleType = 3 // User is able to sign up as a Site Coordinator for sites, then manage those sites' settings. BackOffice RoleType = 4 // User is able to log work, read and update suggestions, generate reports. Not able to modify Users or Site settings. Mobile RoleType = 5 // User is interested in working at the Mobile sites. Enables the user to opt-in to notifications about mobile sites specifically. )
type User ¶
type User struct { Id uint64 `json:"-" db:"id"` Guid string `json:"user_guid" db:"user_guid"` Email string `json:"email" db:"email"` PasswordHash string `json:"-" db:"password_digest"` Roles map[uint64][]Role `json:"roles"` // the map key is the organization ID }
func FindUser ¶
FindUser queries the database for the user and all other data needed to display their profile.
func GetUserForLogin ¶
func ListUsersInSameOrgs ¶
Click to show internal directories.
Click to hide internal directories.