hooks

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Overview

Package hooks is middleware to alter the graphql mutation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInternalServerError is returned when an internal error occurs.
	ErrInternalServerError = errors.New("internal server error")

	// ErrInvalidInput is returned when the input is invalid.
	ErrInvalidInput = errors.New("invalid input")

	// ErrPersonalOrgsNoChildren is returned when personal org attempts to add a child org
	ErrPersonalOrgsNoChildren = errors.New("personal organizations are not allowed to have child organizations")

	// ErrPersonalOrgsNoMembers is returned when personal org attempts to add members
	ErrPersonalOrgsNoMembers = errors.New("personal organizations are not allowed to have members other than the owner")

	// ErrPersonalOrgsNoUser is returned when personal org has no user associated, so no permissions can be added
	ErrPersonalOrgsNoUser = errors.New("personal organizations missing user association")

	// ErrUserNotInOrg is returned when a user is not a member of an organization when trying to add them to a group
	ErrUserNotInOrg = errors.New("user not in organization")

	// ErrUnsupportedFGARole is returned when a role is assigned that is not supported in our fine grained authorization system
	ErrUnsupportedFGARole = errors.New("unsupported role")

	// ErrMissingRole is returned when an update request is made that contains no role
	ErrMissingRole = errors.New("missing role in update")

	// ErrUserAlreadyOrgMember is returned when an user attempts to be invited to an org they are already a member of
	ErrUserAlreadyOrgMember = errors.New("user already member of organization")

	// ErrUserAlreadySubscriber is returned when an user attempts to subscribe to datum but is already a subscriber
	ErrUserAlreadySubscriber = errors.New("user already a datum subscriber")

	// ErrEmailRequired is returned when an email is required but not provided
	ErrEmailRequired = errors.New("email is required but not provided")

	// ErrMaxAttempts is returned when a user has reached the max attempts to resend an invitation to an org
	ErrMaxAttempts = errors.New("too many attempts to resend org invitation")

	// ErrMissingRecipientEmail is returned when an email is required but not provided
	ErrMissingRecipientEmail = errors.New("recipient email is required but not provided")

	// ErrMissingRequiredName is returned when a name is required but not provided
	ErrMissingRequiredName = errors.New("name or display name is required but not provided")
)

Functions

func Decrypt added in v0.5.0

func Decrypt(ctx context.Context, k *secrets.Keeper, u *generated.Hush) error

func HookCreateAPIToken added in v0.5.0

func HookCreateAPIToken() ent.Hook

HookCreateAPIToken runs on api token mutations and sets the owner id

func HookCreatePersonalAccessToken added in v0.3.3

func HookCreatePersonalAccessToken() ent.Hook

HookCreatePersonalAccessToken runs on access token mutations and sets the owner id

func HookDeleteUser added in v0.2.5

func HookDeleteUser() ent.Hook

HookDeleteUser runs on user deletions to clean up personal organizations

func HookEmailVerificationToken added in v0.2.2

func HookEmailVerificationToken() ent.Hook

HookEmailVerificationToken runs on email verification mutations and sets expires

func HookEnableTFA added in v0.3.6

func HookEnableTFA() ent.Hook

func HookEntitlement added in v0.7.0

func HookEntitlement() ent.Hook

func HookEntitlementPlan added in v0.7.0

func HookEntitlementPlan() ent.Hook

func HookEntityCreate added in v0.7.4

func HookEntityCreate() ent.Hook

HookEntityCreate runs on entity mutations to set default values that are not provided

func HookFeature added in v0.7.0

func HookFeature() ent.Hook

func HookGroup

func HookGroup() ent.Hook

HookGroup runs on group mutations to set default values that are not provided

func HookGroupAuthz

func HookGroupAuthz() ent.Hook

HookGroupAuthz runs on group mutations to setup or remove relationship tuples

func HookGroupMembers added in v0.3.2

func HookGroupMembers() ent.Hook

func HookHush added in v0.5.0

func HookHush() ent.Hook

HookHush runs on invite create mutations

func HookInvite added in v0.2.6

func HookInvite() ent.Hook

HookInvite runs on invite create mutations

func HookInviteAccepted added in v0.2.6

func HookInviteAccepted() ent.Hook

HookInviteAccepted adds the user to the organization when the status is accepted

func HookOrgMembers added in v0.2.5

func HookOrgMembers() ent.Hook

func HookOrgMembersDelete added in v0.7.1

func HookOrgMembersDelete() ent.Hook

HookOrgMembersDelete is a hook that runs during the delete operation of an org membership

func HookOrganization

func HookOrganization() ent.Hook

HookOrganization runs on org mutations to set default values that are not provided

func HookOrganizationDelete added in v0.6.8

func HookOrganizationDelete() ent.Hook

HookOrganizationDelete runs on org delete mutations to ensure the org can be deleted

func HookPasswordResetToken added in v0.2.3

func HookPasswordResetToken() ent.Hook

HookPasswordResetToken runs on reset token mutations and sets expires

func HookSubscriber added in v0.3.6

func HookSubscriber() ent.Hook

HookSubscriber runs on subscriber create mutations

func HookUpdateAPIToken added in v0.5.0

func HookUpdateAPIToken() ent.Hook

HookUpdateAPIToken runs on api token update and redacts the token

func HookUpdatePersonalAccessToken added in v0.3.3

func HookUpdatePersonalAccessToken() ent.Hook

HookUpdatePersonalAccessToken runs on access token update and redacts the token

func HookUser

func HookUser() ent.Hook

HookUser runs on user mutations validate and hash the password and set default values that are not provided

func HookUserSetting added in v0.3.4

func HookUserSetting() ent.Hook

HookUserSetting runs on user settings mutations and validates input on update

func IsUniqueConstraintError added in v0.2.6

func IsUniqueConstraintError(err error) bool

IsUniqueConstraintError reports if the error resulted from a DB uniqueness constraint violation. e.g. duplicate value in unique index.

Types

This section is empty.

Jump to

Keyboard shortcuts

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