Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticationToken ¶
type AuthenticationToken struct { Username string `json:"username"` SessionToken string `json:"sessionToken"` }
Representation of an authentication token
type Contact ¶
type Contact struct { ID uuid.UUID `json:"id,omitempty"` Owner string `json:"owner,omitempty"` CipherText string `json:"cipherText,omitempty"` Iv string `json:"iv,omitempty"` }
Contact payload representation
type ContactRepository ¶
type ContactRepository interface { NewContact(Contact) (string, error) FetchAllContacts(id string) ([]*Contact, error) DeleteContact(id string, contactId string) error }
Interface for contact actions
type EncryptedRootKey ¶
type LoginRequest ¶
Representation of a Login request
type RegistrationToken ¶
Representation of an ephemeral registration token
type User ¶
type User struct { Id uuid.UUID `json:"id,omitempty"` Username string `json:"username" validate:"required"` Name string `json:"name,omitempty"` PIN string `json:"pin,omitempty"` RootPasswordSalt string `json:"rootPasswordSalt"` RootPublicKey string `json:"rootPublicKey"` EncryptedRootKey EncryptedRootKey `json:"encryptedRootKey"` Token Token `json:"token,omitempty"` }
Representation of a user for the authentication microservice
type UserRepository ¶
type UserRepository interface { UsernameExists(username string) (bool, error) // Check if a username provided exists CreateRegistrationToken() (*RegistrationToken, error) // Create an ephemeral registration token FindRegistrationToken(string) (*RegistrationToken, error) // Find an ephemeral registration token from its ID InsertAccount(User) (string, error) // Insert a user to the database CreateAuthenticationToken(string) (*AuthenticationToken, error) // Create access token and refresh tokens CreateLoginToken(string) (*RegistrationToken, error) // Create an ephemeral login token FindEncryptedAccount(string) (*User, error) // Find the encrypted account details for a user SearchIdByUsername(username string) (string, error) // Search for account ID by username FindAccountPublicKey(id string) (string, error) // Find the public of an account by its ID VerifyAccountPIN(string, string) (bool, error) // Check a users submitted PIN to make sure it matches the one on record CountUsers() (int, error) // Count amount of users on platform }
Interface for user actions
Click to show internal directories.
Click to hide internal directories.