Documentation ¶
Index ¶
- func AddAppIDToCtx(ctx context.Context, value string) context.Context
- func AddServiceNameToCtx(ctx context.Context, value string) context.Context
- func AddUserIDToCtx(ctx context.Context, userID string) context.Context
- func AddUserRoleToCtx(ctx context.Context, value string) context.Context
- func GetAppID(ctx context.Context) string
- func GetIdentity(ctx context.Context) (string, string, error)
- func GetServiceName(ctx context.Context) string
- func GetUserID(ctx context.Context) (string, error)
- func GetUserRole(ctx context.Context) (string, error)
- func IsAdmin(ctx context.Context) bool
- func IsBanned(ctx context.Context) bool
- func ToAdminCtx(ctx context.Context) context.Context
- func ToBannedCtx(ctx context.Context) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAppIDToCtx ¶
AddAppIDToCtx store authenticated user id to context
func AddServiceNameToCtx ¶
AddServiceNameToCtx store authenticated user id to context
func AddUserIDToCtx ¶
AddUserIDToCtx store authenticated user id to context
func AddUserRoleToCtx ¶ added in v0.6.5
AddUserRoleToCtx adds user role to context
func GetIdentity ¶ added in v0.6.6
GetIdentity returns the app and user IDs and an error in case both are empty
func GetServiceName ¶
GetServiceName gets authenticated service name from context
func GetUserRole ¶ added in v0.6.5
GetUserRole gets user role from context
func ToAdminCtx ¶
ToAdminCtx upgrades the context with admin privileges
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.