inputuser

package
v1.12.4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddClientInContext

func AddClientInContext(ctx context.Context, mongoClient Client) context.Context

func ClientInjectorMiddleware

func ClientInjectorMiddleware(client Client) mux.MiddlewareFunc

ClientInjectorMiddleware will inject into request context the mongo collections.

func Get

func Get(ctx context.Context, logger logging.Logger, client Client, user types.User) (core.InputUser, error)

Types

type Client

type Client interface {
	Disconnect() error

	RetrieveUserBindings(ctx context.Context, user types.User) ([]types.Binding, error)
	RetrieveUserRolesByRolesID(ctx context.Context, userRolesId []string) ([]types.Role, error)
}

Client allows to retrieve information to evaluate policy, as bindings and roles

func GetClientFromContext

func GetClientFromContext(ctx context.Context) (Client, error)

GetClientFromContext extracts mongo collections adapter struct from provided context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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