package
0.0.0-20240105124814-767b333ff2fd
Repository: https://github.com/sbstnerhrdt/identity.git
Documentation: pkg.go.dev

# Functions

AcceptTerms accepts the terms and conditions uses a token to find the identity and sets the accept terms and conditions to true.
Activate activates the user.
AddIdentityRelation adds a relation between an identity and an entity.
AdminCreateIdentityAndInvite creates an identity and sends an invitation - create identity - create confirmation - reset password - send invite.
AdminDeleteIdentity deletes an identity - anonymizes the firstname and lastname - anonymizes the email and phone - deletes the account.
AnonymizeIdentity anonymizes the first name, the last NameAndSave an account - gets the identity by uid - checks if the password is correct - anonymizes the identity - saves the identity.
AnonymizeString provides a SHA1 hash of the request body.
AutoBlockUserFn automatically clears a user.
AutoClearUserAfterRegistration automatically clears a user.
Block blocks a user.
ChangePassword changes the user's password given the user object and the new password.
CheckIfEmailIsFree checks if the username is still free.
CheckIfUsernameIsValid check if the username is valid.
CheckUserLogin check if the credentials of a user are correct.
No description provided by the author
No description provided by the author
No description provided by the author
CreateApiToken creates a new api token for an identity.
No description provided by the author
DeleteApiToken deletes an api token from the database.
DeleteIdentity deletes an identity - gets the identity - checks if the password is correct - anonymizes the firstname and lastname - anonymizes the email and phone - deletes the account.
GenerateJWT generates a Json Web Token from the user object.
GetApiTokensByIdentity retrieves the api tokens of an identity from the database.
GetIdentityByEmail retrieves the identity from the database.
GetIdentityByUID retrieves the identity from the database.
No description provided by the author
InitResetPassword inits the password reset process.
InvitationConfirmation confirms an invitation - check if accept terms and conditions is true - reset password - confirm registration - accept terms and conditions.
InviteCSV adds all users in a CSV file to the invite list.
InviteUser invites a user to the system.
IsAdmin checks if the user is an admin.
Lock locks an identity.
Login logs in a user and returns a JWT token.
No description provided by the author
No description provided by the author
NewService inits a new identity service.
ReadAllUsers reads all users.
ReadIdentity reads a specific user.
ReadIdentityLogins reads the identity logins.
ReadIdentityRelation reads a relation between an identity and an entity.
ReadIdentityRelations reads relations between an identity and an entity.
Register registers a new user.
RegistrationConfirmation confirms a registration.
RemoveIdentityRelation removes a relation between an identity and an entity.
ResetPassword resets the password.
SanitizeEmail sanitizes an email address.
SetPasswordOfIdentity set the password of a user by its email.
UnBlock unblocks a user.
Unlock unlocks an identity.
UpdateIdentity updates the identity.
UpdateUser updates a specific user.
VerifyPassword verifies the user's password given the user object and the password.

# Constants

EmailIdentificationType is the type of identification that is used to identify a user by email.
PhoneIdentificationType is the type of identification that is used to identify a user by phone number.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
ErrAcceptTermsAndConditions is returned when the user did not accept the terms and conditions.
ErrCanNotChangePassword is returned when the user can not change the password.
ErrCheckPassword is returned when the password is wrong.
ErrConfirmPassword is returned when the new password and confirmation do not match.
ErrCouldNotCreateToken is thrown when the token could not be created.
ErrEmailAlreadyExists is returned when the email address is already in use.
ErrEmailIsAlreadyRegistered is returned when the email is already registered.
ErrEmailNotVerified is returned when the user email is not verified.
ErrExternalDelete is returned when the email address is already in use.
ErrExternalIsAdmin is returned if the user is an admin.
ErrExternalLoginFailed is returned when the login failed and the reason should not be exposed to the user.
ErrExternalLoginFailedInvalidUserOrPassword is returned when the user or password is invalid.
ErrExternalNoAdmin is returned if the user is not an admin.
No description provided by the author
ErrExternalNoTokensFound is returned when no tokens are found.
ErrExternalUserBlocked is returned when the user is blocked.
ErrExternalUserCleared is returned when the user is not cleared.
ErrExternalUserLoginNotPossible is returned when the user can not log in.
ErrGenericRegistration message.
ErrIdentityNotFound is returned when the identity is not found.
ErrInvalidPassword is returned when the password is invalid.
ErrInvalidUsername is returned when the username is invalid.
ErrLoginTokenExpirationInPast is returned when the login token expiration date is in the past.
No description provided by the author
No description provided by the author
No description provided by the author
ErrNoEmail is returned when no email is provided.
ErrNoIdentity is returned if no identity is found.
ErrNoIdentityIdentification is returned if no identification is provided.
ErrNoPassword is returned when no password is provided.
ErrNoUserFound is returned when no user is found.
ErrOldPasswordIsSame is returned when the new password is the same as the old password.
ErrRegistrationConfirmationExpired is returned when the registration confirmation has expired.
ErrRegistrationIsNotAllowed is returned when the system does not allow registration.
ErrTokenExpirationDateInPast is thrown when the token expiration date is in the past.
ErrTokenExpired is returned when the token is expired.
ErrTokenNameEmpty is thrown when the token name is empty.
ErrTokenNotFound is returned when the token is not in the database.
ErrTokenUsed is returned when the token was used.
ErrUsernameLongerThan is returned when the username is shorter than 3 characters.
ErrWrongPassword is returned when the password is wrong.
6 months.

# Structs

ControllerService is the identity service.

# Interfaces

No description provided by the author

# Type aliases

AllowRegistrationFn checks if users can register.
ClearUserFn clears a user.
IdentificationType is the type of the identification.
ResolveCreationInvitationEmailTemplate resolves the creation invitation email template sends a link to the newly created identity to select a password and confirm the email address and the terms of service.
ResolveInvitationEmailTemplate resolves the invitation email template sends a link to the user to register.
ResolvePasswordResetEmailTemplate resolves the password reset email template.
ResolveRegistrationEmailTemplate resolves the registration email template.
SendMailFn is the function that sends an email.