Documentation
¶
Index ¶
- func Connect(cfg shared.DBSettings) (db gorm.DB, err error)
- func CreateDefaults(db gorm.DB) error
- func InitTables(db gorm.DB) error
- func NotFound(err error) bool
- type GroupACLs
- type GroupSecrets
- type Groups
- type MasterSecrets
- type UserACLs
- type UserSecrets
- type Users
- func (u *Users) BeforeCreate() (err error)
- func (u *Users) Get(db gorm.DB, name string) error
- func (u *Users) GetGID() uint
- func (u *Users) GetName() string
- func (u *Users) GetPass() crypto.Binary
- func (u *Users) GetUID() uint
- func (u *Users) IsAdmin() bool
- func (u Users) Lookup(db gorm.DB, uid, gid uint) bool
- func (_ Users) TableName() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDefaults ¶
func InitTables ¶
Types ¶
type GroupACLs ¶
type GroupACLs struct {
Id uint
UID uint `gorm:"column:uid"`
GID uint `gorm:"column:gid"`
TargetID uint `gorm:"column:targetid"`
}
ACL controls for groups
type GroupSecrets ¶
type GroupSecrets struct {
Id uint
GID uint `gorm:"column:gid"`
SID uint `gorm:"column:sid"`
Secret []byte
Path string `sql:"type:varchar(2048)"`
}
func (GroupSecrets) TableName ¶
func (_ GroupSecrets) TableName() string
type Groups ¶
type MasterSecrets ¶
type MasterSecrets struct {
Id uint
Name string `sql:"not null;unique"`
Secret []byte `sql:"type:blob"` // Unlimited size
}
func (MasterSecrets) Lookup ¶
func (m MasterSecrets) Lookup(db gorm.DB, uid, gid uint) bool
Lookup just checks if a user has any form of access to a key. It does not distinguish between user-access and group-access.
func (MasterSecrets) TableName ¶
func (_ MasterSecrets) TableName() string
type UserACLs ¶
type UserACLs struct {
Id uint
UID uint `gorm:"column:uid"`
GID uint `gorm:"column:gid"`
TargetID uint `gorm:"column:targetid"`
}
ACL controls for individual users
type UserSecrets ¶
type UserSecrets struct {
Id uint
SID uint `gorm:"column:sid"`
UID uint `gorm:"column:uid"`
Path string `sql:"type:varchar(2048)"`
Secret []byte
}
func (UserSecrets) TableName ¶
func (_ UserSecrets) TableName() string
Click to show internal directories.
Click to hide internal directories.