Documentation
¶
Index ¶
- Constants
- type IdentityAndOrgRecord
- type IdentityModel
- type LoginWithEmailAndPasswordRequest
- type LoginWithEmailOTPRequest
- type NewOrgRequest
- type NewOrgResponse
- type OneTimeTokenModel
- type OrganizationMembershipModel
- type OrganizationModel
- type PrincipalClaims
- type SignInResponse
- type VerifyEmailOTPRequest
Constants ¶
View Source
const ( CategoryEmailOTP = "email_otp" CategoryEmailVerification = "email_verification" )
View Source
const (
OrganizationRoleMember = "member"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IdentityAndOrgRecord ¶
type IdentityAndOrgRecord struct {
ID uuid.UUID `bun:"id,pk" json:"id"`
Email string `bun:"email" json:"email"`
Enabled bool `bun:"enabled" json:"enabled"`
EmailVerifiedAt *time.Time `bun:"email_verified_at" json:"-"`
FailedLoginAttempts int `bun:"failed_login_attempts" json:"-"`
LockExpiresAt time.Time `bun:"lock_expires_at" json:"-"`
HashedPassword string `bun:"hashed_password" json:"-"`
LastLoginAt time.Time `bun:"last_login_at" json:"-"`
CreatedAt time.Time `bun:"created_at" json:"-"`
UpdatedAt time.Time `bun:"updated_at" json:"-"`
OrgRoles []string `bun:"org_roles" json:"roles"`
OrgID uuid.UUID `bun:"org_id" json:"org_id"`
OrgName string `bun:"org_name" json:"org_name"`
OrgSlug string `bun:"org_slug" json:"org_slug"`
OrgEnabled bool `bun:"org_enabled" json:"org_enabled"`
}
type IdentityModel ¶
type IdentityModel struct {
bun.BaseModel `bun:"table:identities,alias:ids"`
ID uuid.UUID `bun:"id,pk"`
Email string `bun:"email"`
HashedPassword string `bun:"hashed_password"`
Enabled bool `bun:"enabled"`
EmailVerifiedAt *time.Time `bun:"email_verified_at"`
FailedLoginAttempts int `bun:"failed_login_attempts"`
LockExpiresAt time.Time `bun:"lock_expires_at"`
LastLoginAt time.Time `bun:"last_login_at"`
CreatedAt time.Time `bun:"created_at"`
UpdatedAt time.Time `bun:"updated_at"`
}
type LoginWithEmailOTPRequest ¶
type LoginWithEmailOTPRequest struct {
Email string `json:"email" validate:"required,max=100,email"`
}
type NewOrgRequest ¶
type NewOrgResponse ¶
type OneTimeTokenModel ¶
type OneTimeTokenModel struct {
bun.BaseModel `bun:"table:one_time_tokens,alias:ott"`
ID uuid.UUID `bun:"id,pk"`
HashedCode string `bun:"hashed_code"`
Category string `bun:"category"`
IdentityID uuid.UUID `bun:"identity_id"`
Used bool `bun:"used"`
ExpiresAt time.Time `bun:"expires_at"`
CreatedAt time.Time `bun:"created_at"`
}
type OrganizationMembershipModel ¶
type OrganizationMembershipModel struct {
bun.BaseModel `bun:"table:organization_members,alias:membership"`
OrganizationID uuid.UUID `bun:"organization_id"`
IdentityID uuid.UUID `bun:"identity_id"`
Roles []string `bun:"roles"`
Home bool `bun:"home"`
CreatedAt time.Time `bun:"created_at"`
UpdatedAt time.Time `bun:"updated_at"`
}
type OrganizationModel ¶
type PrincipalClaims ¶
type PrincipalClaims struct {
IdentityID uuid.UUID `json:"identity_id"`
OrgID uuid.UUID `json:"org_id"`
Roles []string `json:"roles"`
}
func (PrincipalClaims) HasRole ¶
func (c PrincipalClaims) HasRole(theRole string) bool
type SignInResponse ¶
type VerifyEmailOTPRequest ¶
Click to show internal directories.
Click to hide internal directories.