authcontext

package
v0.12.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthnInferredOrgID added in v0.12.1

func GetAuthnInferredOrgID(ctx context.Context) sdktypes.OrgID

Use this function to fill default org id for queries. In such queries we do not need to query for system users, but all users. If the user is not authenticated, it will return InvalidOrgID. If the user is a system user, it will return InvalidOrgID. Otherwise, will return the user's default org id.

func GetAuthnUser

func GetAuthnUser(ctx context.Context) sdktypes.User

Get the authenticated user.

func GetAuthnUserID added in v0.8.6

func GetAuthnUserID(ctx context.Context) sdktypes.UserID

Helper function.

func IsAuthnSystemUser added in v0.12.1

func IsAuthnSystemUser(ctx context.Context) bool

func ObjectWithOrgID added in v0.12.1

func ObjectWithOrgID[O interface {
	OrgID() sdktypes.OrgID
	WithOrgID(sdktypes.OrgID) O
}](ctx context.Context, o O) O

If `o` has an owner, return unmodified. Otherwise, set the owner to the authenticated user.

func SetAuthnSystemUser added in v0.12.1

func SetAuthnSystemUser(ctx context.Context) context.Context

func SetAuthnUser

func SetAuthnUser(ctx context.Context, user sdktypes.User) context.Context

This function is used to set the authenticated user in the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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