Versions in this module Expand all Collapse all v0 v0.9.0 Apr 7, 2020 Changes in this version + const Active + const CollectionSessions + const Issued + const Revoked + const SessionTTL + const StateActive + const StateIssued + const StateRevoked + var ErrRecordNotFound error = gorm.ErrRecordNotFound + func BlacklistAAGUIDs(ctx context.Context, db db.DB) (util.StringSet, error) + func Migrate(db *gorm.DB) error + func WhitelistAAGUIDs(ctx context.Context, db db.DB) (util.StringSet, error) + type AAGUID struct + ID string + Label string + Metadata []byte + State string + func AAGUIDByID(ctx context.Context, db db.DB, id string) (*AAGUID, error) + func AAGUIDs(ctx context.Context, dbConn db.DB, params *util.APIParams) ([]*AAGUID, int64, error) + func (guid *AAGUID) AllowedUpdateFields() map[string]bool + func (guid *AAGUID) ApplyChanges(values map[string]string) (string, error) + func (guid *AAGUID) Update(ctx context.Context, db db.DB, values map[string]string) (string, error) + type AuditEntry struct + Action string + Anomaly string + City string + Country string + CreatedAt time.Time + Data string + FidoAAGUID string + FidoKeyID string + Group string + ID int64 + IPAddr string + Latitude float64 + Longitude float64 + PrincipalID string + PrincipalUsername string + Region string + SessionID string + UserAgent string + func AuditEntries(ctx context.Context, dbConn db.DB, params *util.APIParams) ([]*AuditEntry, int64, error) + func AuditEntryByID(db *gorm.DB, id int64) (*AuditEntry, error) + type CAKey struct + CreatedAt time.Time + FIDOKeyID string + ID string + ModifiedAt time.Time + PrincipalID string + Raw []byte + func (CAKey) TableName() string + type FIDOKey struct + AAGUID string + AttestationType string + CAKey *CAKey + CertCommonName string + CertOrganization string + CertSerial int64 + CreatedAt time.Time + ID string + LastUsed time.Time + ModifiedAt time.Time + Nonce uint32 + NotValidAfter time.Time + NotValidBefore time.Time + PrincipalID string + PrincipalUsername string + PublicKey []byte + State string + func FIDOKeyByID(ctx context.Context, db db.DB, id string) (*FIDOKey, error) + func FIDOKeys(ctx context.Context, dbConn db.DB, params *util.APIParams) ([]*FIDOKey, int64, error) + func (FIDOKey) TableName() string + func (fk *FIDOKey) AllowedUpdateFields() map[string]bool + func (fk *FIDOKey) ApplyChanges(values map[string]string) (string, error) + func (fk *FIDOKey) TouchLastUsed(ctx context.Context, db db.DB) error + func (fk *FIDOKey) Update(ctx context.Context, db db.DB, values map[string]string) (string, error) + type Principal struct + CreatedAt time.Time + DisplayName string + FIDOKeys []*FIDOKey + ID string + Icon string + State string + Username string + func NewPrincipal(id string, username string, state string, displayName string, icon string) *Principal + func PrincipalByID(ctx context.Context, db db.DB, id string, preload bool) (*Principal, error) + func PrincipalByUsername(ctx context.Context, db db.DB, username string, preload bool) (*Principal, error) + func Principals(ctx context.Context, dbConn db.DB, params *util.APIParams) ([]*Principal, int64, error) + func (p *Principal) AddFIDOKey(fk *FIDOKey) error + func (p *Principal) AllowedUpdateFields() map[string]bool + func (p *Principal) ApplyChanges(values map[string]string) (string, error) + func (p *Principal) BeforeCreate(scope *gorm.Scope) error + func (p *Principal) CredentialList() []protocol.CredentialDescriptor + func (p *Principal) Insert(ctx context.Context, db db.DB) error + func (p *Principal) Update(ctx context.Context, db db.DB, values map[string]string) (string, error) + func (p *Principal) WebAuthnCredentials() []webauthn.Credential + func (p *Principal) WebAuthnDisplayName() string + func (p *Principal) WebAuthnID() []byte + func (p *Principal) WebAuthnIcon() string + func (p *Principal) WebAuthnName() string + type Session struct + AAGUID string + AgentSalt string + CreatedAt time.Time + FIDOKeyID string + ID string + IPAddr string + Nonce uint32 + PrincipalID string + PrincipalUsername string + State string + UpdatedAt time.Time + UserAgent string + func NewSession(principalID, fidoKeyID, aaguid, ipaddr, userAgent string) (*Session, error) + func SessionByID(ctx context.Context, manager store.Manager, id string) (*Session, error) + func Sessions(ctx context.Context, manager store.Manager, params *util.APIParams) ([]*Session, int64, error) + func (s *Session) Decode(b []byte) error + func (s *Session) Delete(ctx context.Context, manager store.Manager, sessionID string) error + func (s *Session) Encode() ([]byte, error) + func (s *Session) Put(ctx context.Context, manager store.Manager, ttlSeconds int64) error + type State int + func NewState(state string) (State, error) + func (s State) String() string