trustauth

package
v0.83.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentUserRole

func GetCurrentUserRole(ctx context.Context, accessor ContextAccessor) types.Role

func MustBeAuthenticatedDirective

func MustBeAuthenticatedDirective(accessor ContextAccessor) func(ctx context.Context, obj any, next graphql.Resolver, role *types.Role) (any, error)

func ValidateTenantAccess

func ValidateTenantAccess(ctx context.Context, accessor ContextAccessor, userTenantContextKey interface{}, resourceTenantID gid.TenantID) error

Types

type ContextAccessor

type ContextAccessor interface {
	UserFromContext(ctx context.Context) *coredata.User
	TokenAccessFromContext(ctx context.Context) *TokenAccessData
}

type TokenAccessData

type TokenAccessData struct {
	TrustCenterID gid.GID
	Email         string
	TenantID      gid.TenantID
	Scope         string
}

func (*TokenAccessData) GetEmail

func (t *TokenAccessData) GetEmail() string

Jump to

Keyboard shortcuts

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