Documentation
¶
Overview ¶
Package hooks is middleware to alter the graphql mutation
Index ¶
- Variables
- func Decrypt(ctx context.Context, k *secrets.Keeper, u *generated.Hush) error
- func HookCreateAPIToken() ent.Hook
- func HookCreatePersonalAccessToken() ent.Hook
- func HookDeleteUser() ent.Hook
- func HookEmailVerificationToken() ent.Hook
- func HookEnableTFA() ent.Hook
- func HookGroup() ent.Hook
- func HookGroupAuthz() ent.Hook
- func HookGroupMembers() ent.Hook
- func HookHush() ent.Hook
- func HookInvite() ent.Hook
- func HookInviteAccepted() ent.Hook
- func HookOrgMembers() ent.Hook
- func HookOrganization() ent.Hook
- func HookPasswordResetToken() ent.Hook
- func HookSubscriber() ent.Hook
- func HookUpdateAPIToken() ent.Hook
- func HookUpdatePersonalAccessToken() ent.Hook
- func HookUser() ent.Hook
- func HookUserSetting() ent.Hook
- func IsUniqueConstraintError(err error) bool
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInternalServerError is returned when an internal error occurs. ErrInternalServerError = errors.New("internal server error") // 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 central-server but is already a subscriber ErrUserAlreadySubscriber = errors.New("user already a central-server subscriber") // 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") )
Functions ¶
func HookCreateAPIToken ¶
HookCreateAPIToken runs on api token mutations and sets expires and owner id
func HookCreatePersonalAccessToken ¶
HookCreatePersonalAccessToken runs on accesstoken mutations and sets expires and owner id
func HookDeleteUser ¶
HookDeleteUser runs on user deletions to clean up personal organizations
func HookEmailVerificationToken ¶
HookEmailVerificationToken runs on email verification mutations and sets expires
func HookEnableTFA ¶
func HookGroupAuthz ¶
HookGroupAuthz runs on group mutations to setup or remove relationship tuples
func HookGroupMembers ¶
func HookInviteAccepted ¶
HookInviteAccepted adds the user to the organization when the status is accepted
func HookOrgMembers ¶
func HookOrganization ¶
HookOrganization runs on org mutations to set default values that are not provided
func HookPasswordResetToken ¶
HookPasswordResetToken runs on reset token mutations and sets expires
func HookSubscriber ¶
HookSubscriber runs on subscriber mutations and ensures uniqueness of email for root subscribers
func HookUpdateAPIToken ¶
HookUpdateAPIToken runs on api token update and redacts the token
func HookUpdatePersonalAccessToken ¶
HookUpdatePersonalAccessToken runs on accesstoken update and redacts the token
func HookUser ¶
HookUser runs on user mutations validate and hash the password and set default values that are not provided
func HookUserSetting ¶
HookUserSetting runs on user settings mutations and validates input on update
func IsUniqueConstraintError ¶
IsUniqueConstraintError reports if the error resulted from a DB uniqueness constraint violation. e.g. duplicate value in unique index.
Types ¶
This section is empty.