data

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRootCertificate added in v0.5.9

func AddRootCertificate(db *gorm.DB, cert *models.RootCertificate) error

func AppendProviderUsers

func AppendProviderUsers(db *gorm.DB, provider *models.Provider, user *models.Identity) error

func BindGroupIdentities added in v0.9.0

func BindGroupIdentities(db *gorm.DB, group *models.Group, identities ...models.Identity) error

func BindIdentityGroups added in v0.9.0

func BindIdentityGroups(db *gorm.DB, identity *models.Identity, groups ...models.Group) error

func Count

func Count[T models.Modelable](db *gorm.DB, selectors ...SelectorFunc) (*int64, error)

func CreateAccessKey

func CreateAccessKey(db *gorm.DB, accessKey *models.AccessKey) (body string, err error)

func CreateCredential added in v0.6.0

func CreateCredential(db *gorm.DB, credential *models.Credential) error

func CreateDestination

func CreateDestination(db *gorm.DB, destination *models.Destination) error

func CreateEncryptionKey

func CreateEncryptionKey(db *gorm.DB, key *models.EncryptionKey) (*models.EncryptionKey, error)

func CreateGrant

func CreateGrant(db *gorm.DB, grant *models.Grant) error

func CreateGroup

func CreateGroup(db *gorm.DB, group *models.Group) error

func CreateIdentity added in v0.9.0

func CreateIdentity(db *gorm.DB, identity *models.Identity) error

func CreateIdentityToken added in v0.9.0

func CreateIdentityToken(db *gorm.DB, identityID uid.ID) (token *models.Token, err error)

func CreateProvider

func CreateProvider(db *gorm.DB, provider *models.Provider) error

func CreateProviderToken

func CreateProviderToken(db *gorm.DB, token *models.ProviderToken) error

func DeleteAccessKey

func DeleteAccessKey(db *gorm.DB, id uid.ID) error

func DeleteAccessKeys

func DeleteAccessKeys(db *gorm.DB, selectors ...SelectorFunc) error

func DeleteCredential added in v0.6.0

func DeleteCredential(db *gorm.DB, id uid.ID) error

func DeleteDestinations

func DeleteDestinations(db *gorm.DB, selector SelectorFunc) error

func DeleteGrants

func DeleteGrants(db *gorm.DB, selectors ...SelectorFunc) error

func DeleteGroups

func DeleteGroups(db *gorm.DB, selectors ...SelectorFunc) error

func DeleteIdentities added in v0.9.0

func DeleteIdentities(db *gorm.DB, selectors ...SelectorFunc) error

func DeleteIdentity added in v0.9.0

func DeleteIdentity(db *gorm.DB, id uid.ID) error

func DeleteProviders

func DeleteProviders(db *gorm.DB, selectors ...SelectorFunc) error

func GetAccessKey added in v0.5.12

func GetAccessKey(db *gorm.DB, selectors ...SelectorFunc) (*models.AccessKey, error)

func GetCredential added in v0.6.0

func GetCredential(db *gorm.DB, selectors ...SelectorFunc) (*models.Credential, error)

func GetDestination

func GetDestination(db *gorm.DB, selectors ...SelectorFunc) (*models.Destination, error)

func GetEncryptionKey

func GetEncryptionKey(db *gorm.DB, selector SelectorFunc) (result *models.EncryptionKey, err error)

func GetGrant

func GetGrant(db *gorm.DB, selectors ...SelectorFunc) (*models.Grant, error)

func GetGroup

func GetGroup(db *gorm.DB, selectors ...SelectorFunc) (*models.Group, error)

func GetIdentity added in v0.9.0

func GetIdentity(db *gorm.DB, selectors ...SelectorFunc) (*models.Identity, error)

func GetProvider

func GetProvider(db *gorm.DB, selectors ...SelectorFunc) (*models.Provider, error)

func GetProviderToken

func GetProviderToken(db *gorm.DB, selector SelectorFunc) (*models.ProviderToken, error)

func GetRootCertificate added in v0.5.9

func GetRootCertificate(db *gorm.DB, selectors ...SelectorFunc) (*models.RootCertificate, error)

func GetSettings

func GetSettings(db *gorm.DB) (*models.Settings, error)

func InitializeSettings

func InitializeSettings(db *gorm.DB, setupRequired bool) (*models.Settings, error)

func ListAccessKeys

func ListAccessKeys(db *gorm.DB, selectors ...SelectorFunc) ([]models.AccessKey, error)

func ListDestinations

func ListDestinations(db *gorm.DB, selectors ...SelectorFunc) ([]models.Destination, error)

func ListGrants

func ListGrants(db *gorm.DB, selectors ...SelectorFunc) ([]models.Grant, error)

func ListGroupGrants

func ListGroupGrants(db *gorm.DB, groupID uid.ID) (result []models.Grant, err error)

func ListGroups

func ListGroups(db *gorm.DB, selectors ...SelectorFunc) ([]models.Group, error)

func ListIdentities added in v0.9.0

func ListIdentities(db *gorm.DB, selectors ...SelectorFunc) ([]models.Identity, error)

func ListIdentityGrants added in v0.9.0

func ListIdentityGrants(db *gorm.DB, userID uid.ID) (result []models.Grant, err error)

func ListIdentityGroups added in v0.9.0

func ListIdentityGroups(db *gorm.DB, userID uid.ID) (result []models.Group, err error)

func ListProviders

func ListProviders(db *gorm.DB, selectors ...SelectorFunc) ([]models.Provider, error)

func ListRootCertificates added in v0.5.9

func ListRootCertificates(db *gorm.DB) ([]models.RootCertificate, error)

func ListTrustedClientCertificates added in v0.5.9

func ListTrustedClientCertificates(db *gorm.DB) ([]models.TrustedCertificate, error)

func NewDB

func NewDB(connection gorm.Dialector) (*gorm.DB, error)

func NewPostgresDriver

func NewPostgresDriver(connection string) (gorm.Dialector, error)

func NewSQLiteDriver

func NewSQLiteDriver(connection string) (gorm.Dialector, error)

func SaveAccessKey added in v0.5.8

func SaveAccessKey(db *gorm.DB, key *models.AccessKey) error

func SaveCredential added in v0.6.0

func SaveCredential(db *gorm.DB, credential *models.Credential) error

func SaveDestination

func SaveDestination(db *gorm.DB, destination *models.Destination) error

func SaveIdentity added in v0.9.0

func SaveIdentity(db *gorm.DB, identity *models.Identity) error

func SaveProvider

func SaveProvider(db *gorm.DB, provider *models.Provider) error

func SaveSettings added in v0.5.9

func SaveSettings(db *gorm.DB, settings *models.Settings) error

func TrustPublicKey added in v0.5.9

func TrustPublicKey(db *gorm.DB, tc *models.TrustedCertificate) error

TrustPublicKey trusts a public key (in base64 format) from a user or service Callers must have received the key from a mTLS/e2ee (mutually encrypted), trusted source.

func UpdateProviderToken

func UpdateProviderToken(db *gorm.DB, token *models.ProviderToken) error

func ValidateAccessKey added in v0.5.8

func ValidateAccessKey(db *gorm.DB, authnKey string) (*models.AccessKey, error)

func ValidateCredential added in v0.6.0

func ValidateCredential(db *gorm.DB, user *models.Identity, password string) (bool, error)

Types

type SelectorFunc

type SelectorFunc func(db *gorm.DB) *gorm.DB

func ByEncryptionKeyID

func ByEncryptionKeyID(keyID int32) SelectorFunc

func ByID

func ByID(id uid.ID) SelectorFunc

func ByIDs

func ByIDs(ids []uid.ID) SelectorFunc

func ByIdentityID added in v0.9.0

func ByIdentityID(identityID uid.ID) SelectorFunc

func ByIdentityKind added in v0.9.0

func ByIdentityKind(kind models.IdentityKind) SelectorFunc

func ByIssuedFor added in v0.9.0

func ByIssuedFor(id uid.ID) SelectorFunc

func ByKeyID added in v0.8.0

func ByKeyID(key string) SelectorFunc

func ByName

func ByName(name string) SelectorFunc

func ByNotExpired added in v0.5.9

func ByNotExpired() SelectorFunc

func ByNotIDs added in v0.5.9

func ByNotIDs(ids []uid.ID) SelectorFunc

func ByPrivilege

func ByPrivilege(s string) SelectorFunc

func ByProviderID

func ByProviderID(id uid.ID) SelectorFunc

func ByPublicKey added in v0.5.9

func ByPublicKey(key []byte) SelectorFunc

func ByResource

func ByResource(s string) SelectorFunc

func BySubject added in v0.8.0

func BySubject(polymorphicID uid.PolymorphicID) SelectorFunc

func ByURL

func ByURL(url string) SelectorFunc

func ByUniqueID

func ByUniqueID(nodeID string) SelectorFunc

func ByUserID

func ByUserID(userID uid.ID) SelectorFunc

func CreatedBy added in v0.10.0

func CreatedBy(id uid.ID) SelectorFunc

func Limit added in v0.5.9

func Limit(limit int) SelectorFunc

func NotCreatedBy added in v0.5.9

func NotCreatedBy(id uid.ID) SelectorFunc

NotCreatedBy filters out entities not created by the passed in ID

func OrderBy added in v0.5.9

func OrderBy(order string) SelectorFunc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL