Users
The Users feature provides core user management functionality in the Voedger system. It handles user registration, profile management, and password operations.
Architecture
Principles
🏡 Login table keeps hashes of logins to avoid potential personal data compliance issues
Core tables
ALTERABLE WORKSPACE UserProfileWS INHERITS sys.ProfileWS (
DESCRIPTOR UserProfile (
DisplayName varchar,
);
...
ALTER WORKSPACE sys.AppWorkspaceWS (
TABLE Login INHERITS sys.CDoc (
ProfileCluster int32 NOT NULL,
PwdHash bytes NOT NULL,
AppName varchar NOT NULL,
SubjectKind int32,
LoginHash varchar NOT NULL,
WSID int64, -- to be written after workspace init
WSError varchar(1024), -- to be written after workspace init
WSKindInitializationData varchar(1024) NOT NULL
);
Related tables, invites
TABLE Invite INHERITS sys.CDoc (
SubjectKind int32,
Login varchar NOT NULL,
Email varchar NOT NULL,
Roles varchar(1024),
ExpireDatetime int64,
VerificationCode varchar,
State int32 NOT NULL,
Created int64,
Updated int64 NOT NULL,
SubjectID ref,
InviteeProfileWSID int64,
ActualLogin varchar,
UNIQUEFIELD Email
) WITH Tags=(WorkspaceOwnerTableTag);
TABLE Subject INHERITS sys.CDoc (
Login varchar NOT NULL, <--
SubjectKind int32 NOT NULL,
Roles varchar(1024) NOT NULL,
ProfileWSID int64 NOT NULL,
UNIQUEFIELD Login
) WITH Tags=(WorkspaceOwnerTableTag);
VIEW ViewSubjectsIdx (
LoginHash int64 NOT NULL,
Login text NOT NULL,
SubjectID ref NOT NULL,
PRIMARY KEY ((LoginHash), Login)
) AS RESULT OF ApplyViewSubjectsIdx WITH Tags=(WorkspaceOwnerTableTag);
Background
Email Sending:
The
impl_applyinvitation.go
file contains code to send invitation emails using SMTP configuration: impl_applyinvitation.go.The
impl.go
file in theverifier
package sends email verification codes: impl.go.
SMTP Configuration:
The
smtp
package defines the SMTP configuration intypes.go
: types.go.Functions related to SMTP configuration are in
impl.go
: impl.go.
Email Verification Tokens:
The
userprofile.vsql
file includes commands for sending email verification codes: userprofile.vsql.
The implementation of Storage_SendMail
:
Can be found in the
pkg/sys/storages/impl_send_mail_storage.go
file. You can view the implementation.
Last updated
Was this helpful?