Documentation
¶
Index ¶
- func AuthMiddleware(userRepo *repository.UserService) func(http.Handler) http.Handler
- type UserContextValue
- func AuthorizedChangePassword(ctx context.Context) *UserContextValue
- func AuthorizedProvider(ctx context.Context) *UserContextValue
- func AuthorizedRequester(ctx context.Context) *UserContextValue
- func AuthorizedServiceToken(ctx context.Context) *UserContextValue
- func AuthorizedUser(ctx context.Context) *UserContextValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(userRepo *repository.UserService) func(http.Handler) http.Handler
Types ¶
type UserContextValue ¶
We distinguish the type of authentication so we can restrict service tokens to only be used for work requests
func AuthorizedChangePassword ¶
func AuthorizedChangePassword(ctx context.Context) *UserContextValue
AuthorizedChangePassword getsuser from context if they are authorized to change their password
func AuthorizedProvider ¶
func AuthorizedProvider(ctx context.Context) *UserContextValue
AuthorizedProvider returns user from context if they are an authorized provider type
func AuthorizedRequester ¶
func AuthorizedRequester(ctx context.Context) *UserContextValue
AuthorizedRequester returns user from context if they are an authorized requester
func AuthorizedServiceToken ¶
func AuthorizedServiceToken(ctx context.Context) *UserContextValue
AuthorizedServiceToken returns user from context if they are an authorized service token
func AuthorizedUser ¶
func AuthorizedUser(ctx context.Context) *UserContextValue
AuthorizedUser returns user from context if they are logged in
Click to show internal directories.
Click to hide internal directories.