Documentation
¶
Index ¶
- func GetOrCreateUserAccount(ctx context.Context, np sqlutils.NamedPreparer, store *storage.Store, ...) (*authentication.UserAccount, error)
- func GetOrCreateUserAccountFullName(ctx context.Context, np sqlutils.NamedPreparer, store *storage.Store, ...) (*authentication.UserAccount, error)
- func GetOrCreateUserAccounts(ctx context.Context, np sqlutils.NamedPreparer, store *storage.Store, ...) ([]*authentication.UserAccount, error)
- func NewUserAccountServiceMiddleware(userFunction authentication.GetUserAccountFromDBFunc) func(http.Handler) http.Handler
- type AccountInfo
- func GetOktaAccountInfoWrapper(ctx context.Context, username string, ...) (*AccountInfo, error)
- func GetUserInfoAccountInfoWrapper(ctx context.Context, username string, getUserInfo GetUserInfoFunc) (*AccountInfo, error)
- func GetUserInfoAccountInfosWrapper(ctx context.Context, usernames []string, getUserInfos GetUserInfosFunc) ([]*AccountInfo, error)
- type GetAccountInfoFunc
- type GetAccountInfosFunc
- type GetOktaAccountInfoFunc
- type GetUserInfoFunc
- type GetUserInfosFunc
- type OktaAccountInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOrCreateUserAccount ¶
func GetOrCreateUserAccount( ctx context.Context, np sqlutils.NamedPreparer, store *storage.Store, username string, hasLoggedIn bool, getAccountInformation GetAccountInfoFunc, ) (*authentication.UserAccount, error)
GetOrCreateUserAccount will return an account if it exists, or create and return a new one if not
func GetOrCreateUserAccountFullName ¶
func GetOrCreateUserAccountFullName( ctx context.Context, np sqlutils.NamedPreparer, store *storage.Store, fullName string, hasLoggedIn bool, getAccountInformationFullName GetAccountInfoFunc) (*authentication.UserAccount, error)
GetOrCreateUserAccountFullName will return an account if it exists after searching by Full Name, or create and return a new one if not
func GetOrCreateUserAccounts ¶
func GetOrCreateUserAccounts( ctx context.Context, np sqlutils.NamedPreparer, store *storage.Store, usernames []string, hasLoggedIn bool, getAccountInformation GetAccountInfosFunc, ) ([]*authentication.UserAccount, error)
GetOrCreateUserAccounts will return accounts if they exist, or create and return them if not
func NewUserAccountServiceMiddleware ¶
func NewUserAccountServiceMiddleware(userFunction authentication.GetUserAccountFromDBFunc) func(http.Handler) http.Handler
NewUserAccountServiceMiddleware creates a new middleware which decorates the context with a authentication.GetUserAccountFromDBFunc
Types ¶
type AccountInfo ¶
type AccountInfo OktaAccountInfo
AccountInfo represents information needed to make a UserAccount, independent of the source of the information
func GetOktaAccountInfoWrapper ¶
func GetOktaAccountInfoWrapper(ctx context.Context, username string, getAccountInformation GetOktaAccountInfoFunc) (*AccountInfo, error)
GetOktaAccountInfoWrapper converts a returns OktaAccountInformation converted to AccountInformation
func GetUserInfoAccountInfoWrapper ¶
func GetUserInfoAccountInfoWrapper(ctx context.Context, username string, getUserInfo GetUserInfoFunc) (*AccountInfo, error)
GetUserInfoAccountInfoWrapper this function appends models.UserInfo with needed account info fields as UNKNOWN
func GetUserInfoAccountInfosWrapper ¶
func GetUserInfoAccountInfosWrapper(ctx context.Context, usernames []string, getUserInfos GetUserInfosFunc) ([]*AccountInfo, error)
GetUserInfoAccountInfosWrapper this function appends models.UserInfo with needed account info fields as UNKNOWN
type GetAccountInfoFunc ¶
type GetAccountInfoFunc func(ctx context.Context, username string) (*AccountInfo, error)
GetAccountInfoFunc represents a type of function which takes a context and username and returns AccountInfo
func GetOktaAccountInfoWrapperFunction ¶
func GetOktaAccountInfoWrapperFunction(getAccountInformation GetOktaAccountInfoFunc) GetAccountInfoFunc
GetOktaAccountInfoWrapperFunction returns a function that returns *AccountInfo with the input of a function that returns OktaAccountInfo
func GetUserInfoAccountInfoWrapperFunc ¶
func GetUserInfoAccountInfoWrapperFunc(getUserInfo GetUserInfoFunc) GetAccountInfoFunc
GetUserInfoAccountInfoWrapperFunc returns a function that returns *AccountInfo with the input of a function that returns UserInfo
type GetAccountInfosFunc ¶
type GetAccountInfosFunc func(ctx context.Context, usernames []string) ([]*AccountInfo, error)
GetAccountInfosFunc represents a type of function which takes a context and username and returns AccountInfo
func GetUserInfoAccountInfosWrapperFunc ¶
func GetUserInfoAccountInfosWrapperFunc(getUserInfos GetUserInfosFunc) GetAccountInfosFunc
GetUserInfoAccountInfosWrapperFunc returns a function that returns []*AccountInfo with the input of a function that returns UserInfos
type GetOktaAccountInfoFunc ¶
type GetOktaAccountInfoFunc func(ctx context.Context, username string) (*OktaAccountInfo, error)
GetOktaAccountInfoFunc represents a type of function which takes a context and username and returns OktaAccountInfo
type GetUserInfoFunc ¶
GetUserInfoFunc represents a type of function which takes a context and username and returns UserInfo
type GetUserInfosFunc ¶
GetUserInfosFunc represents a type of function which takes a context and username and returns UserInfo
type OktaAccountInfo ¶
type OktaAccountInfo struct { Name string `json:"name"` Locale string `json:"locale"` Email string `json:"email"` PreferredUsername string `json:"preferred_username"` GivenName string `json:"given_name"` FamilyName string `json:"family_name"` ZoneInfo string `json:"zoneinfo"` }
OktaAccountInfo represents the information you get if you query an account from Okta TODO Replace this with calls to the Okta API so we can use the same information we use in other places in the application
func GetOktaAccountInfo ¶
func GetOktaAccountInfo(ctx context.Context, _ string) (*OktaAccountInfo, error)
GetOktaAccountInfo uses the Okta endpoint to retun OktaAccountInfo