33 строки
967 B
Go
33 строки
967 B
Go
// Package authidentity provides the AuthIdentity and Basic types for QOR-style
|
|
// authentication identity management. Vendored from github.com/glebtv/auth/auth_identity
|
|
// to eliminate the rsgit.ru/rs/sessionmanager transitive dependency.
|
|
package authidentity
|
|
|
|
import "time"
|
|
|
|
// AuthIdentity combines Basic provider info with SignLogs for a full identity record.
|
|
type AuthIdentity struct {
|
|
Basic
|
|
SignLogs
|
|
}
|
|
|
|
// TableName returns the database table name for AuthIdentity.
|
|
func (AuthIdentity) TableName() string {
|
|
return "identities"
|
|
}
|
|
|
|
// Basic represents the core identity fields (provider, UID, encrypted password).
|
|
type Basic struct {
|
|
ID int64 `gorm:"primary_key" json:"id"`
|
|
Provider string
|
|
UID string `gorm:"column:uid"`
|
|
EncryptedPassword string
|
|
UserID *int64
|
|
ConfirmedAt *time.Time
|
|
}
|
|
|
|
// TableName returns the database table name for Basic.
|
|
func (Basic) TableName() string {
|
|
return "identities"
|
|
}
|