common

package
v0.0.0-...-319a7bb Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 4 Imported by: 29

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAppSourceFromContext

func GetAppSourceFromContext(ctx context.Context) string

func GetRolesFromContext

func GetRolesFromContext(ctx context.Context) []string

func GetTenantFromContext

func GetTenantFromContext(ctx context.Context) string

func GetUserEmailFromContext

func GetUserEmailFromContext(ctx context.Context) string

func GetUserIdFromContext

func GetUserIdFromContext(ctx context.Context) string

func SetAppSourceInContext

func SetAppSourceInContext(ctx context.Context, appSource string) context.Context

func SetTenantInContext

func SetTenantInContext(ctx context.Context, tenant string) context.Context

func ValidateTenant

func ValidateTenant(ctx context.Context) error

func WithContext

func WithContext(customContext *CustomContext, next http.Handler) http.Handler

func WithCustomContext

func WithCustomContext(ctx context.Context, customContext *CustomContext) context.Context

func WithCustomContextFromGinRequest

func WithCustomContextFromGinRequest(c *gin.Context, appSource string) context.Context

Types

type CustomContext

type CustomContext struct {
	AppSource string
	Tenant    string
	UserId    string
	UserEmail string
	Roles     []string
}

func GetContext

func GetContext(ctx context.Context) *CustomContext

Jump to

Keyboard shortcuts

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