auth

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2023 License: AGPL-3.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAppIDToCtx

func AddAppIDToCtx(ctx context.Context, value string) context.Context

AddAppIDToCtx store authenticated user id to context

func AddServiceNameToCtx

func AddServiceNameToCtx(ctx context.Context, value string) context.Context

AddServiceNameToCtx store authenticated user id to context

func AddUserIDToCtx

func AddUserIDToCtx(ctx context.Context, userID string) context.Context

AddUserIDToCtx store authenticated user id to context

func GetAppID

func GetAppID(ctx context.Context) string

GetAppID gets authenticated app id from context

func GetServiceName

func GetServiceName(ctx context.Context) string

GetServiceName gets authenticated service name from context

func GetUserID

func GetUserID(ctx context.Context) (string, error)

GetUserID gets authenticated user id from context

func IsAdmin

func IsAdmin(ctx context.Context) bool

IsAdmin returns true if the context has admin privileges

func ToAdminCtx

func ToAdminCtx(ctx context.Context) context.Context

ToAdminCtx upgrades the context with admin privileges

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL