package
0.6.8
Repository: https://github.com/theopenlane/core.git
Documentation: pkg.go.dev

# Functions

The `AddPostMutationHook` function is used to add a post-mutation hook to the list of runtime hooks.
Decrypt decrypts the secret value.
EmitEventHook emits an event to the event pool when a mutation is performed.
HookCreateAPIToken runs on api token mutations and sets the owner id.
HookCreatePersonalAccessToken runs on access token mutations and sets the owner id.
HookDeleteUser runs on user deletions to clean up personal organizations.
HookEmailVerificationToken runs on email verification mutations and sets expires.
No description provided by the author
HookEntityCreate runs on entity mutations to set default values that are not provided.
HookGroup runs on group mutations to set default values that are not provided.
HookGroupAuthz runs on group mutations to setup or remove relationship tuples.
No description provided by the author
HookHush runs on invite create mutations.
HookInvite runs on invite create mutations.
HookInviteAccepted adds the user to the organization when the status is accepted.
HookObjectOwnedTuples is a hook that adds object owned tuples for the object being created given a set of parent id fields, it will add the user and parent permissions to the object on creation by default, it will always add a user permission to the object.
HookOrganization runs on org mutations to set default values that are not provided.
HookOrganizationDelete runs on org delete mutations to ensure the org can be deleted.
No description provided by the author
HookOrgMembersDelete is a hook that runs during the delete operation of an org membership.
HookOrgOwnedTuples is a hook that adds organization owned tuples for the object being created it will add the user and parent (organization owner_id) permissions to the object on creation by default, it will always add an admin user permission to the object.
HookPasswordResetToken runs on reset token mutations and sets expires.
HookProgramAuthz runs on program mutations to setup or remove relationship tuples.
HookProgramMembers is a hook that ensures that the user is a member of the organization before allowing them to be added to a program TODO (sfunk): can this be generic across all edges with users that are owned by an organization?.
HookRelationTuples is a hook that adds tuples for the object being created the objects input is a map of object id fields to the object type these tuples based are based on the direct relation, e.g.
HookSubcontrolUpdate ensures that there is at least 1 control assigned to the subcontrol.
HookSubscriber runs on subscriber create mutations.
HookTaskAssignee runs on task create and update mutations to add and remove the assignee tuple.
HookTaskCreate runs on task create mutations to set default values that are not provided this will set the assigner to the current user if it is not provided.
HookUpdateAPIToken runs on api token update and redacts the token.
HookUpdatePersonalAccessToken runs on access token update and redacts the token.
HookUser runs on user mutations validate and hash the password and set default values that are not provided.
No description provided by the author
HookUserSetting runs on user settings mutations and validates input on update.
IsUniqueConstraintError reports if the error resulted from a DB uniqueness constraint violation.
NewEventer creates a new Eventer with the provided options.
NewEventerPool initializes a new Eventer and takes a client to be used as the client for the soiree pool.
RegisterGlobalHooks registers global event hooks for the entdb client and expects a pointer to an Eventer.
RegisterListeners is currently used to globally register what listeners get applied on the entdb client.
WithEventerEmitter sets the emitter for the Eventer if there's an existing soiree pool that needs to be passed in.
WithEventerListeners takes a single topic and appends an array of listeners to the Eventer.
WithEventerTopics sets the topics for the Eventer.

# Variables

ErrEmailRequired is returned when an email is required but not provided.
ErrFailedToRegisterListener is returned when a listener fails to register.
ErrInternalServerError is returned when an internal error occurs.
ErrInvalidInput is returned when the input is invalid.
ErrMaxAttempts is returned when a user has reached the max attempts to resend an invitation to an org.
ErrMissingRecipientEmail is returned when an email is required but not provided.
ErrMissingRequiredName is returned when a name is required but not provided.
ErrMissingRole is returned when an update request is made that contains no role.
ErrNoControls is returned when a subcontrol has no controls assigned.
ErrPersonalOrgsNoChildren is returned when personal org attempts to add a child org.
ErrPersonalOrgsNoMembers is returned when personal org attempts to add members.
ErrPersonalOrgsNoUser is returned when personal org has no user associated, so no permissions can be added.
ErrTooManyAvatarFiles is returned when a user attempts to upload more than one avatar file.
ErrTooManySubscriptions is returned when an organization has too many subscriptions.
ErrUnableToCast is returned when a type assertion fails.
ErrUnsupportedFGARole is returned when a role is assigned that is not supported in our fine grained authorization system.
ErrUserAlreadyOrgMember is returned when an user attempts to be invited to an org they are already a member of.
ErrUserAlreadySubscriber is returned when an user attempts to subscribe to an organization but is already a subscriber.
ErrUserNotInOrg is returned when a user is not a member of an organization when trying to add them to a group.
TODO [MKA]: create better methods for constructing object + event topic names; possibly update soiree to make topic management more friendly OrganizationSettingCreate and OrganizationSettingUpdateOne are the topics for the organization setting events.
No description provided by the author

# Structs

Eventer is a wrapper struct for having a soiree as well as a list of listeners.
EventID is used to marshall and unmarshall the ID out of a ent mutation.
OrganizationCreationContextKey is the context key name for the organization creation context.