Documentation
¶
Overview ¶
Package memory provides an in-process implementation of theauth.Storage backed by Go maps protected by a sync.RWMutex.
The store is intended for tests, examples, and local development; it retains state only for the lifetime of the process and offers no persistence guarantees. Production deployments should use storage/postgres or another durable backend.
Index ¶
- type Store
- func (s *Store) APITokenByHash(_ context.Context, hash []byte) (*theauth.APIToken, error)
- func (s *Store) APITokenByID(_ context.Context, id theauth.ULID) (*theauth.APIToken, error)
- func (s *Store) APITokensByAgentID(_ context.Context, agentID theauth.ULID) ([]theauth.APIToken, error)
- func (s *Store) APITokensByOwner(_ context.Context, ownerID theauth.ULID) ([]theauth.APIToken, error)
- func (s *Store) AccountStateByUserID(_ context.Context, userID theauth.ULID) (theauth.AccountState, error)
- func (s *Store) AddGroupMembers(_ context.Context, groupID theauth.ULID, userIDs []theauth.ULID) error
- func (s *Store) AddSessionFamilyToken(_ context.Context, t theauth.SessionFamilyToken) error
- func (s *Store) AdvanceAppAttestCounter(_ context.Context, id theauth.ULID, counter uint32) (bool, error)
- func (s *Store) AdvanceSessionFamily(_ context.Context, in theauth.SessionFamilyAdvance) (bool, error)
- func (s *Store) AdvanceTOTPStep(_ context.Context, userID theauth.ULID, step int64) (bool, error)
- func (s *Store) AgentByClientID(_ context.Context, clientID string) (*theauth.Agent, error)
- func (s *Store) AgentByID(_ context.Context, id theauth.ULID) (*theauth.Agent, error)
- func (s *Store) AgentCredentialsByAgentID(_ context.Context, agentID theauth.ULID) ([]theauth.AgentCredential, error)
- func (s *Store) AgentsByOwner(_ context.Context, owner theauth.AgentOwner) ([]theauth.Agent, error)
- func (s *Store) AppendSessionAuthMethods(_ context.Context, id theauth.ULID, methods []string, at time.Time) ([]string, time.Time, error)
- func (s *Store) ApplyEmailChange(_ context.Context, tokenHash []byte, at time.Time, ...) (*theauth.EmailChangeRecord, error)
- func (s *Store) ApproveToolApproval(_ context.Context, id, approver string, now time.Time) (bool, error)
- func (s *Store) AuditOrderSupported() bool
- func (s *Store) AuditProvenanceSupported() bool
- func (s *Store) BackchannelRequestByID(_ context.Context, authReqID string) (theauth.BackchannelRequest, error)
- func (s *Store) CancelEmailChangeUndos(_ context.Context, userID theauth.ULID, newEmail string, at time.Time) ([]theauth.EmailChangeRecord, error)
- func (s *Store) ChainSupported() bool
- func (s *Store) ClaimDeviceCode(_ context.Context, hash []byte, now time.Time) (*theauth.DeviceCode, error)
- func (s *Store) ClaimSSODomainRecheck(_ context.Context, id theauth.ULID, checkedBefore, at time.Time) (bool, error)
- func (s *Store) ConfirmTOTPSecret(_ context.Context, userID theauth.ULID, at time.Time) error
- func (s *Store) ConsumeAuthorizationCode(_ context.Context, code string) (*theauth.AuthorizationCode, error)
- func (s *Store) ConsumeDeviceAuthorization(_ context.Context, id theauth.ULID, now time.Time) (bool, error)
- func (s *Store) ConsumeMagicLink(_ context.Context, hash []byte) (*theauth.MagicLink, error)
- func (s *Store) ConsumePasswordResetToken(_ context.Context, hash []byte) (*theauth.PasswordResetToken, error)
- func (s *Store) ConsumePushedRequest(_ context.Context, requestURI string) ([]byte, error)
- func (s *Store) ConsumeRecoveryCode(_ context.Context, userID theauth.ULID, code string, at time.Time) error
- func (s *Store) ConsumeSessionLink(_ context.Context, tokenHash []byte, now time.Time) (*theauth.SessionLink, error)
- func (s *Store) ConsumeSigninReport(_ context.Context, tokenHash []byte, at time.Time) (*theauth.SigninReportRecord, error)
- func (s *Store) ConsumeToolApproval(_ context.Context, id, agentID, action, resource string, now time.Time) (bool, error)
- func (s *Store) CountUnusedRecoveryCodes(_ context.Context, userID theauth.ULID) (int, error)
- func (s *Store) CountUsers(_ context.Context) (int, error)
- func (s *Store) CountUsersWithPermissionInOrg(_ context.Context, orgID theauth.ULID, perm string) (int, error)
- func (s *Store) CreateEmailChange(_ context.Context, r theauth.EmailChangeRecord) error
- func (s *Store) CreateMagicLink(_ context.Context, ml theauth.MagicLink) error
- func (s *Store) CreatePasswordResetToken(_ context.Context, t theauth.PasswordResetToken) error
- func (s *Store) CreateSSODomain(_ context.Context, d theauth.SSODomain) error
- func (s *Store) CreateSession(_ context.Context, sess theauth.Session) (theauth.Session, error)
- func (s *Store) CreateSessionFamily(_ context.Context, f theauth.SessionFamilyRecord) error
- func (s *Store) CreateSessionLink(_ context.Context, l theauth.SessionLink) error
- func (s *Store) CreateSessionWithAuthLevel(_ context.Context, sess theauth.Session) (theauth.Session, error)
- func (s *Store) CreateSigninReport(_ context.Context, r theauth.SigninReportRecord) error
- func (s *Store) CreateUser(_ context.Context, u theauth.User) (theauth.User, error)
- func (s *Store) DecideDeviceAuthorization(_ context.Context, id theauth.ULID, status string, userID theauth.ULID, ...) (bool, error)
- func (s *Store) DecideDeviceCode(_ context.Context, userCode string, dec theauth.DeviceDecision, now time.Time) error
- func (s *Store) DelegationGrantByID(_ context.Context, id theauth.ULID) (*theauth.DelegationGrant, error)
- func (s *Store) DelegationGrantByUserAgentResource(_ context.Context, userID, agentID theauth.ULID, resource string) (*theauth.DelegationGrant, error)
- func (s *Store) DelegationGrantsByAgentID(_ context.Context, agentID theauth.ULID) ([]theauth.DelegationGrant, error)
- func (s *Store) DelegationGrantsByUserID(_ context.Context, userID theauth.ULID) ([]theauth.DelegationGrant, error)
- func (s *Store) DeleteBackchannelRequest(_ context.Context, authReqID string) error
- func (s *Store) DeleteExpiredDeviceAuthorizations(_ context.Context, before time.Time) (int64, error)
- func (s *Store) DeleteExpiredDeviceCodes(_ context.Context, before time.Time) (int, error)
- func (s *Store) DeleteExpiredEmailChanges(_ context.Context, before time.Time) (int64, error)
- func (s *Store) DeleteExpiredSigninReports(_ context.Context, before time.Time) (int64, error)
- func (s *Store) DeleteGroup(_ context.Context, id theauth.ULID) error
- func (s *Store) DeleteOAuthAccountByProvider(_ context.Context, userID theauth.ULID, provider string) error
- func (s *Store) DeleteOAuthClient(_ context.Context, clientID string) error
- func (s *Store) DeleteOrganization(_ context.Context, id theauth.ULID) error
- func (s *Store) DeleteOrganizationMember(_ context.Context, orgID, userID theauth.ULID) error
- func (s *Store) DeletePendingEmailChanges(_ context.Context, userID theauth.ULID) (int64, error)
- func (s *Store) DeleteRole(_ context.Context, id theauth.ULID) error
- func (s *Store) DeleteSAMLConnection(_ context.Context, id theauth.ULID) error
- func (s *Store) DeleteSSODomain(_ context.Context, id theauth.ULID) error
- func (s *Store) DeleteStaleKnownDevices(_ context.Context, lastSeenBefore time.Time) (int64, error)
- func (s *Store) DeleteTOTPSecret(_ context.Context, userID theauth.ULID) error
- func (s *Store) DeleteUserCascade(_ context.Context, userID theauth.ULID) error
- func (s *Store) DeleteUserClientAuthorizationCodes(_ context.Context, userID theauth.ULID, clientID string) (int, error)
- func (s *Store) DeleteVaultCredential(_ context.Context, userID, provider string) error
- func (s *Store) DeleteWebAuthnCredential(_ context.Context, id theauth.ULID, userID theauth.ULID) error
- func (s *Store) DenyAccessToken(_ context.Context, jti string, expiresAt time.Time) error
- func (s *Store) DenyToolApproval(_ context.Context, id, denier string, now time.Time) (bool, error)
- func (s *Store) DeviceAuthorizationByDeviceCodeHash(_ context.Context, hash []byte) (*theauth.DeviceAuthorization, error)
- func (s *Store) DeviceAuthorizationByUserCodeHash(_ context.Context, hash []byte) (*theauth.DeviceAuthorization, error)
- func (s *Store) DeviceByID(_ context.Context, id theauth.ULID) (*theauth.Device, error)
- func (s *Store) DeviceByKeyThumbprint(_ context.Context, thumbprint string) (*theauth.Device, error)
- func (s *Store) DeviceBySPIFFEID(_ context.Context, spiffeID string) (*theauth.Device, error)
- func (s *Store) DeviceCodeByHash(_ context.Context, hash []byte) (*theauth.DeviceCode, error)
- func (s *Store) DeviceCodeByUserCode(_ context.Context, userCode string) (*theauth.DeviceCode, error)
- func (s *Store) DeviceJoinTokenByHash(_ context.Context, hash []byte) (*theauth.DeviceJoinToken, error)
- func (s *Store) DeviceJoinTokenByID(_ context.Context, id theauth.ULID) (*theauth.DeviceJoinToken, error)
- func (s *Store) EmailChangeByTokenHash(_ context.Context, tokenHash []byte) (*theauth.EmailChangeRecord, error)
- func (s *Store) EmailChangeIdentityManaged(_ context.Context, userID theauth.ULID) (bool, error)
- func (s *Store) EmailReservedForUndo(_ context.Context, email string, except theauth.ULID, at time.Time) (bool, error)
- func (s *Store) ExpireToolApproval(_ context.Context, id string, now time.Time) (bool, error)
- func (s *Store) ForgetKnownDevice(_ context.Context, userID theauth.ULID, deviceHash []byte) error
- func (s *Store) ForgetSessionFamily(_ context.Context, id theauth.ULID, at time.Time) (bool, error)
- func (s *Store) GetToolApproval(_ context.Context, id string) (theauth.ToolApproval, bool, error)
- func (s *Store) GrantUserRole(_ context.Context, ur theauth.UserRole) error
- func (s *Store) GroupByExternalIDInOrg(_ context.Context, orgID theauth.ULID, externalID string) (*theauth.Group, error)
- func (s *Store) GroupByID(_ context.Context, id theauth.ULID) (*theauth.Group, error)
- func (s *Store) GroupMembers(_ context.Context, groupID theauth.ULID) ([]theauth.ULID, error)
- func (s *Store) InsertAPIToken(_ context.Context, t theauth.APIToken) (theauth.APIToken, error)
- func (s *Store) InsertAgent(_ context.Context, a theauth.Agent) (theauth.Agent, error)
- func (s *Store) InsertAgentCredential(_ context.Context, c theauth.AgentCredential) error
- func (s *Store) InsertAuditEvents(_ context.Context, events []theauth.AuditEvent) error
- func (s *Store) InsertAuthorizationCode(_ context.Context, c theauth.AuthorizationCode) error
- func (s *Store) InsertBackchannelRequest(_ context.Context, req theauth.BackchannelRequest) error
- func (s *Store) InsertDelegationGrant(_ context.Context, g theauth.DelegationGrant) (theauth.DelegationGrant, error)
- func (s *Store) InsertDevice(_ context.Context, d theauth.Device) error
- func (s *Store) InsertDeviceAuthorization(_ context.Context, in theauth.DeviceAuthorization) error
- func (s *Store) InsertDeviceCode(_ context.Context, d theauth.DeviceCode) error
- func (s *Store) InsertDeviceJoinToken(_ context.Context, t theauth.DeviceJoinToken) error
- func (s *Store) InsertGroup(_ context.Context, g theauth.Group) (theauth.Group, error)
- func (s *Store) InsertJTI(_ context.Context, jti string, expiresAt time.Time) error
- func (s *Store) InsertJWKSKey(_ context.Context, k theauth.JWKSKey) error
- func (s *Store) InsertOAuthClient(_ context.Context, c theauth.OAuthClient) (theauth.OAuthClient, error)
- func (s *Store) InsertOpaqueAccessToken(_ context.Context, t theauth.OpaqueAccessToken) error
- func (s *Store) InsertOrganization(_ context.Context, o theauth.Organization) (theauth.Organization, error)
- func (s *Store) InsertPermission(_ context.Context, p theauth.Permission) (theauth.Permission, error)
- func (s *Store) InsertPushedRequest(_ context.Context, requestURI string, payload []byte, expiresAt time.Time) error
- func (s *Store) InsertRecoveryCodes(_ context.Context, codes []theauth.RecoveryCode) error
- func (s *Store) InsertRefreshToken(_ context.Context, t theauth.RefreshToken) error
- func (s *Store) InsertRegistrationToken(_ context.Context, t theauth.RegistrationToken) error
- func (s *Store) InsertRole(_ context.Context, r theauth.Role) (theauth.Role, error)
- func (s *Store) InsertSAMLConnection(_ context.Context, c theauth.SAMLConnection) (theauth.SAMLConnection, error)
- func (s *Store) InsertSCIMToken(_ context.Context, t theauth.SCIMToken) (theauth.SCIMToken, error)
- func (s *Store) InsertTrustedDevice(_ context.Context, d theauth.TrustedDevice) error
- func (s *Store) InsertWebAuthnCredential(_ context.Context, c theauth.WebAuthnCredential) (theauth.WebAuthnCredential, error)
- func (s *Store) IsAccessTokenDenied(_ context.Context, jti string) (bool, error)
- func (s *Store) JWKSKeyByKID(_ context.Context, kid string) (*theauth.JWKSKey, error)
- func (s *Store) JWKSKeysAll(_ context.Context) ([]theauth.JWKSKey, error)
- func (s *Store) ListAPITokens(_ context.Context) ([]theauth.APIToken, error)
- func (s *Store) ListDevices(_ context.Context, orgID *theauth.ULID) ([]theauth.Device, error)
- func (s *Store) ListGroupsByOrganization(_ context.Context, orgID theauth.ULID, offset, limit int, ...) ([]theauth.Group, int, error)
- func (s *Store) ListKnownDevices(_ context.Context, userID theauth.ULID) ([]theauth.KnownDeviceRecord, error)
- func (s *Store) ListOverdueToolApprovals(_ context.Context, now time.Time, limit int) ([]theauth.ToolApproval, error)
- func (s *Store) ListPendingDeviceCodes(_ context.Context, f theauth.DevicePendingFilter) ([]theauth.DeviceCode, error)
- func (s *Store) ListPendingEmailChanges(_ context.Context, userID theauth.ULID, at time.Time) ([]theauth.EmailChangeRecord, error)
- func (s *Store) ListPermissions(_ context.Context) ([]theauth.Permission, error)
- func (s *Store) ListRegistrationTokens(_ context.Context, orgID *theauth.ULID) ([]theauth.RegistrationToken, error)
- func (s *Store) ListSigninReports(_ context.Context, userID theauth.ULID) ([]theauth.SigninReportRecord, error)
- func (s *Store) ListToolApprovals(_ context.Context, limit int) ([]theauth.ToolApproval, error)
- func (s *Store) ListTrustedDevices(_ context.Context, userID theauth.ULID) ([]theauth.TrustedDevice, error)
- func (s *Store) ListUserOAuthGrants(_ context.Context, userID theauth.ULID, now time.Time) ([]theauth.OAuthGrantRow, error)
- func (s *Store) ListUserSessionFamilies(_ context.Context, userID theauth.ULID) ([]theauth.SessionFamilyRecord, error)
- func (s *Store) ListUserSessions(_ context.Context, userID theauth.ULID) ([]theauth.Session, error)
- func (s *Store) ListUsersByOrganization(_ context.Context, orgID theauth.ULID, offset, limit int, ...) ([]theauth.User, int, error)
- func (s *Store) ListVaultCredentials(_ context.Context, userID string) ([]theauth.VaultCredential, error)
- func (s *Store) MarkEmailVerified(_ context.Context, userID theauth.ULID) error
- func (s *Store) MarkSSODomainVerified(_ context.Context, id theauth.ULID, at time.Time) (theauth.SSODomain, error)
- func (s *Store) MarkSessionFamilyUsed(_ context.Context, sessionID theauth.ULID, at time.Time) error
- func (s *Store) MoveOAuthAccount(_ context.Context, provider, providerUserID string, newUserID theauth.ULID) error
- func (s *Store) MovePasswordHash(_ context.Context, primaryID, secondaryID theauth.ULID) error
- func (s *Store) MoveTOTPSecret(_ context.Context, primaryID, secondaryID theauth.ULID) error
- func (s *Store) MoveWebAuthnCredentials(_ context.Context, primaryID, secondaryID theauth.ULID) error
- func (s *Store) OAuthAccountByProviderUserID(_ context.Context, provider, providerUserID string) (*theauth.OAuthAccount, error)
- func (s *Store) OAuthAccountsByUserID(_ context.Context, userID theauth.ULID) ([]theauth.OAuthAccount, error)
- func (s *Store) OAuthClientByClientID(_ context.Context, clientID string) (*theauth.OAuthClient, error)
- func (s *Store) OAuthGrantRevocationByUserClient(_ context.Context, userID theauth.ULID, clientID string) (*theauth.OAuthGrantRevocation, error)
- func (s *Store) OpaqueAccessTokenByHash(_ context.Context, hash []byte) (*theauth.OpaqueAccessToken, error)
- func (s *Store) OpenToolApproval(_ context.Context, a theauth.ToolApproval) error
- func (s *Store) OrganizationByID(_ context.Context, id theauth.ULID) (*theauth.Organization, error)
- func (s *Store) OrganizationBySlug(_ context.Context, slug string) (*theauth.Organization, error)
- func (s *Store) OrganizationMemberRole(_ context.Context, orgID, userID theauth.ULID) (string, error)
- func (s *Store) OrganizationMembersByOrg(_ context.Context, orgID theauth.ULID) ([]theauth.OrganizationMember, error)
- func (s *Store) OrganizationsByUser(_ context.Context, userID theauth.ULID) ([]theauth.Organization, error)
- func (s *Store) PermissionByName(_ context.Context, name string) (*theauth.Permission, error)
- func (s *Store) PermissionsByRole(_ context.Context, roleID theauth.ULID) ([]string, error)
- func (s *Store) PermissionsForUser(_ context.Context, userID theauth.ULID, orgID *theauth.ULID) ([]string, error)
- func (s *Store) PutOAuthGrantRevocation(_ context.Context, r theauth.OAuthGrantRevocation) error
- func (s *Store) PutVaultCredential(_ context.Context, c theauth.VaultCredential) (theauth.VaultCredential, error)
- func (s *Store) QueryAuditEvents(_ context.Context, q theauth.AuditQuery) ([]theauth.AuditEvent, string, error)
- func (s *Store) RebindSessionFamily(_ context.Context, familyID, from, to theauth.ULID) (bool, error)
- func (s *Store) RecordDeviceAuthorizationPoll(_ context.Context, id theauth.ULID, polledAt time.Time, intervalSeconds int) error
- func (s *Store) RecordDevicePoll(_ context.Context, hash []byte, at time.Time, intervalSeconds int) error
- func (s *Store) RecordKnownDevice(_ context.Context, userID theauth.ULID, deviceHash []byte, at time.Time) error
- func (s *Store) RecordSSODomainFailure(_ context.Context, id theauth.ULID, grace int) (theauth.SSODomain, bool, error)
- func (s *Store) RedeemBackchannelRequest(_ context.Context, authReqID string, now time.Time) (theauth.BackchannelRequest, bool, error)
- func (s *Store) RedeemDeviceJoinToken(_ context.Context, id, deviceID theauth.ULID, now time.Time) (bool, error)
- func (s *Store) RedeemRegistrationToken(_ context.Context, id theauth.ULID, now time.Time) (bool, error)
- func (s *Store) RefreshTokenByHash(_ context.Context, hash []byte) (*theauth.RefreshToken, error)
- func (s *Store) RefundDeviceJoinToken(_ context.Context, id theauth.ULID) error
- func (s *Store) RefundRegistrationToken(_ context.Context, id theauth.ULID) error
- func (s *Store) RegistrationTokenByHash(_ context.Context, hash []byte) (*theauth.RegistrationToken, error)
- func (s *Store) RegistrationTokenByID(_ context.Context, id theauth.ULID) (*theauth.RegistrationToken, error)
- func (s *Store) RemoveGroupMembers(_ context.Context, groupID theauth.ULID, userIDs []theauth.ULID) error
- func (s *Store) RenameSessionFamily(_ context.Context, id theauth.ULID, label string) error
- func (s *Store) RenameWebAuthnCredential(_ context.Context, id, userID theauth.ULID, name string) error
- func (s *Store) ReplaceRecoveryCodes(_ context.Context, userID theauth.ULID, codes []theauth.RecoveryCode) error
- func (s *Store) ResumeDevice(_ context.Context, id theauth.ULID) (bool, error)
- func (s *Store) RevertEmailChange(_ context.Context, tokenHash []byte, at time.Time) (*theauth.EmailChangeRecord, string, error)
- func (s *Store) RevokeAPIToken(_ context.Context, id theauth.ULID, at time.Time) error
- func (s *Store) RevokeAPITokensByOwner(_ context.Context, ownerID theauth.ULID, at time.Time) (int, error)
- func (s *Store) RevokeAgentCredential(_ context.Context, id theauth.ULID, at time.Time) error
- func (s *Store) RevokeDelegationGrant(_ context.Context, id theauth.ULID, at time.Time, reason string) error
- func (s *Store) RevokeDevice(_ context.Context, id theauth.ULID, at time.Time) (bool, error)
- func (s *Store) RevokeDeviceJoinToken(_ context.Context, id theauth.ULID, at time.Time) (bool, error)
- func (s *Store) RevokeOpaqueAccessToken(_ context.Context, hash []byte) error
- func (s *Store) RevokeOpaqueAccessTokensByJTI(_ context.Context, clientID string, jtis []string, at time.Time) (int, error)
- func (s *Store) RevokeOtherUserSessions(_ context.Context, userID, keep theauth.ULID) (int, error)
- func (s *Store) RevokeRefreshToken(_ context.Context, hash []byte, reason string) error
- func (s *Store) RevokeRefreshTokenFamily(_ context.Context, familyID theauth.ULID, reason string) error
- func (s *Store) RevokeRefreshTokensByAuthCode(_ context.Context, codeHash, reason string) ([]string, error)
- func (s *Store) RevokeRegistrationToken(_ context.Context, id theauth.ULID, at time.Time) (bool, error)
- func (s *Store) RevokeSCIMTokenByID(_ context.Context, id theauth.ULID, at time.Time) error
- func (s *Store) RevokeSession(_ context.Context, id theauth.ULID) error
- func (s *Store) RevokeSessionFamily(_ context.Context, id theauth.ULID, reason string, at time.Time) (*theauth.SessionFamilyRecord, error)
- func (s *Store) RevokeSessionsByCredential(_ context.Context, credentialID string) (int, error)
- func (s *Store) RevokeTrustedDevice(_ context.Context, userID, id theauth.ULID) error
- func (s *Store) RevokeUserClientRefreshTokens(_ context.Context, userID theauth.ULID, clientID, reason string, at time.Time) (int, error)
- func (s *Store) RevokeUserRole(_ context.Context, userID, roleID theauth.ULID) error
- func (s *Store) RevokeUserSessionFamilies(_ context.Context, userID, keepSession theauth.ULID, reason string, ...) ([]theauth.SessionFamilyRecord, error)
- func (s *Store) RevokeUserSessions(_ context.Context, userID theauth.ULID) error
- func (s *Store) RevokeUserTrustedDevices(_ context.Context, userID theauth.ULID) (int, error)
- func (s *Store) RoleByID(_ context.Context, id theauth.ULID) (*theauth.Role, error)
- func (s *Store) RoleByOrgAndName(_ context.Context, orgID *theauth.ULID, name string) (*theauth.Role, error)
- func (s *Store) RolesByOrganization(_ context.Context, orgID *theauth.ULID) ([]theauth.Role, error)
- func (s *Store) RolesForUser(_ context.Context, userID theauth.ULID, orgID *theauth.ULID) ([]theauth.Role, error)
- func (s *Store) SAMLConnectionByID(_ context.Context, id theauth.ULID) (*theauth.SAMLConnection, error)
- func (s *Store) SAMLConnectionsByOrg(_ context.Context, orgID theauth.ULID) ([]theauth.SAMLConnection, error)
- func (s *Store) SAMLIdentitiesByUserID(_ context.Context, userID theauth.ULID) ([]theauth.SAMLIdentity, error)
- func (s *Store) SAMLIdentityByConnectionAndNameID(_ context.Context, connectionID theauth.ULID, nameID string) (*theauth.SAMLIdentity, error)
- func (s *Store) SCIMTokenByHash(_ context.Context, hash []byte) (*theauth.SCIMToken, error)
- func (s *Store) SCIMTokensByOrg(_ context.Context, orgID theauth.ULID) ([]theauth.SCIMToken, error)
- func (s *Store) SSODomainByID(_ context.Context, id theauth.ULID) (*theauth.SSODomain, error)
- func (s *Store) SSODomainsByConnection(_ context.Context, connectionID theauth.ULID) ([]theauth.SSODomain, error)
- func (s *Store) SSODomainsByName(_ context.Context, domain string) ([]theauth.SSODomain, error)
- func (s *Store) SSODomainsDueForRecheck(_ context.Context, checkedBefore time.Time) ([]theauth.SSODomain, error)
- func (s *Store) ScanVaultCredentials(_ context.Context, afterID string, limit int) ([]theauth.VaultCredential, error)
- func (s *Store) SessionByID(_ context.Context, id theauth.ULID) (*theauth.Session, error)
- func (s *Store) SessionByTokenHash(_ context.Context, hash []byte) (*theauth.Session, error)
- func (s *Store) SessionFamilyByID(_ context.Context, id theauth.ULID) (*theauth.SessionFamilyRecord, error)
- func (s *Store) SessionFamilyBySessionID(_ context.Context, sessionID theauth.ULID) (*theauth.SessionFamilyRecord, error)
- func (s *Store) SessionFamilyTokenGeneration(_ context.Context, familyID theauth.ULID, hash []byte) (int64, error)
- func (s *Store) SetAuditPseudonymRotation(r audit.Rotation) error
- func (s *Store) SetGroupMembers(_ context.Context, groupID theauth.ULID, userIDs []theauth.ULID) error
- func (s *Store) SetMustChangePassword(_ context.Context, userID theauth.ULID, required bool) error
- func (s *Store) SetRolePermissions(_ context.Context, roleID theauth.ULID, permissionIDs []theauth.ULID) error
- func (s *Store) SetSessionActiveOrganization(_ context.Context, sessionID theauth.ULID, orgID *theauth.ULID) error
- func (s *Store) SetSessionElevatedUntil(_ context.Context, id theauth.ULID, until *time.Time) error
- func (s *Store) SetUserDisabledAt(_ context.Context, userID theauth.ULID, at *time.Time) error
- func (s *Store) SetUserPassword(_ context.Context, userID theauth.ULID, passwordHash string) error
- func (s *Store) ShredAuditPseudonyms(ctx context.Context) ([]int64, error)
- func (s *Store) SigninReportByTokenHash(_ context.Context, tokenHash []byte) (*theauth.SigninReportRecord, error)
- func (s *Store) SuspendDevice(_ context.Context, id theauth.ULID) (bool, error)
- func (s *Store) SwapVaultCredential(_ context.Context, c theauth.VaultCredential, expectedVersion int64) (bool, error)
- func (s *Store) SweepExpiredJTIs(_ context.Context, before time.Time) error
- func (s *Store) TOTPSecretByUserID(_ context.Context, userID theauth.ULID) (*theauth.TOTPSecret, error)
- func (s *Store) TouchAPITokenLastUsed(_ context.Context, id theauth.ULID, at time.Time) error
- func (s *Store) TouchBackchannelPoll(_ context.Context, authReqID string, now time.Time, newInterval int) (theauth.BackchannelRequest, error)
- func (s *Store) TouchDevice(_ context.Context, id theauth.ULID, at time.Time) error
- func (s *Store) TouchKnownDevice(_ context.Context, userID theauth.ULID, deviceHash []byte, at time.Time) (bool, error)
- func (s *Store) TouchSAMLIdentityLastLogin(_ context.Context, id theauth.ULID, at time.Time) error
- func (s *Store) TouchSCIMTokenLastUsed(_ context.Context, id theauth.ULID, at time.Time) error
- func (s *Store) TouchSession(_ context.Context, id theauth.ULID, at time.Time) error
- func (s *Store) TouchTrustedDevice(_ context.Context, id theauth.ULID, at time.Time) error
- func (s *Store) TrustedDeviceByTokenHash(_ context.Context, userID theauth.ULID, hash []byte) (*theauth.TrustedDevice, error)
- func (s *Store) UpdateAgentCredentialLastUsed(_ context.Context, id theauth.ULID, at time.Time) error
- func (s *Store) UpdateAgentExpiry(_ context.Context, id theauth.ULID, expiresAt *time.Time) error
- func (s *Store) UpdateAgentLastActive(_ context.Context, id theauth.ULID, at time.Time) error
- func (s *Store) UpdateAgentStatus(_ context.Context, id theauth.ULID, status string, _ time.Time) error
- func (s *Store) UpdateBackchannelRequest(_ context.Context, req theauth.BackchannelRequest) error
- func (s *Store) UpdateGroup(_ context.Context, g theauth.Group) error
- func (s *Store) UpdateJWKSKeyState(_ context.Context, kid, state string, at time.Time) error
- func (s *Store) UpdateOAuthClient(_ context.Context, c theauth.OAuthClient) (theauth.OAuthClient, error)
- func (s *Store) UpdateOrganization(_ context.Context, o theauth.Organization) error
- func (s *Store) UpdateRoleRow(_ context.Context, r theauth.Role) (theauth.Role, error)
- func (s *Store) UpdateSAMLConnectionRow(_ context.Context, c theauth.SAMLConnection) error
- func (s *Store) UpdateSessionAuthLevel(_ context.Context, id theauth.ULID, level string) error
- func (s *Store) UpdateUserSCIM(_ context.Context, u theauth.User) error
- func (s *Store) UpdateWebAuthnBackupFlags(_ context.Context, credentialID []byte, backupEligible, backupState bool) error
- func (s *Store) UpdateWebAuthnSignCount(_ context.Context, credentialID []byte, newCount uint32, usedAt time.Time) error
- func (s *Store) UpsertOAuthAccount(_ context.Context, a theauth.OAuthAccount) (theauth.OAuthAccount, error)
- func (s *Store) UpsertOrganizationMember(_ context.Context, m theauth.OrganizationMember) error
- func (s *Store) UpsertPendingTOTPSecret(_ context.Context, sec theauth.TOTPSecret) error
- func (s *Store) UpsertSAMLIdentity(_ context.Context, i theauth.SAMLIdentity) (theauth.SAMLIdentity, error)
- func (s *Store) UserByEmail(_ context.Context, email string) (*theauth.User, error)
- func (s *Store) UserByEmailWithPassword(_ context.Context, email string) (*theauth.User, string, error)
- func (s *Store) UserByExternalIDInOrg(_ context.Context, orgID theauth.ULID, externalID string) (*theauth.User, error)
- func (s *Store) UserByID(_ context.Context, id theauth.ULID) (*theauth.User, error)
- func (s *Store) UserClientTokenRefs(_ context.Context, userID theauth.ULID, clientID string, ...) ([]theauth.OAuthTokenRef, error)
- func (s *Store) UserOAuthGrantEvidence(_ context.Context, userID theauth.ULID, now, issuedAfter time.Time) ([]theauth.OAuthGrantEvidence, error)
- func (s *Store) UserPasswordHashByID(_ context.Context, userID theauth.ULID) (string, error)
- func (s *Store) VaultCredentialByUserProvider(_ context.Context, userID, provider string) (*theauth.VaultCredential, error)
- func (s *Store) VerifyAuditChain(_ context.Context) (theauth.AuditChainResult, error)
- func (s *Store) VoteToolApproval(_ context.Context, id, approver string, now time.Time) (theauth.ToolApprovalVote, error)
- func (s *Store) WebAuthnCredentialByCredentialID(_ context.Context, credentialID []byte) (*theauth.WebAuthnCredential, error)
- func (s *Store) WebAuthnCredentialsByUserID(_ context.Context, userID theauth.ULID) ([]theauth.WebAuthnCredential, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) APITokenByHash ¶
func (*Store) APITokenByID ¶
func (*Store) APITokensByAgentID ¶ added in v2.11.0
func (s *Store) APITokensByAgentID(_ context.Context, agentID theauth.ULID) ([]theauth.APIToken, error)
APITokensByAgentID returns every token minted for the agent, newest first.
func (*Store) APITokensByOwner ¶
func (*Store) AccountStateByUserID ¶ added in v2.10.0
func (*Store) AddGroupMembers ¶
func (*Store) AddSessionFamilyToken ¶ added in v2.14.0
AddSessionFamilyToken implements theauth.PersistentSessionStorage.
func (*Store) AdvanceAppAttestCounter ¶ added in v2.14.0
func (s *Store) AdvanceAppAttestCounter(_ context.Context, id theauth.ULID, counter uint32) (bool, error)
AdvanceAppAttestCounter raises the App Attest counter while it is lower.
func (*Store) AdvanceSessionFamily ¶ added in v2.14.0
func (s *Store) AdvanceSessionFamily(_ context.Context, in theauth.SessionFamilyAdvance) (bool, error)
AdvanceSessionFamily implements theauth.PersistentSessionStorage.
func (*Store) AdvanceTOTPStep ¶
func (*Store) AgentByClientID ¶
func (*Store) AgentCredentialsByAgentID ¶
func (*Store) AgentsByOwner ¶
func (*Store) AppendSessionAuthMethods ¶ added in v2.11.0
func (*Store) ApplyEmailChange ¶ added in v2.14.0
func (s *Store) ApplyEmailChange(_ context.Context, tokenHash []byte, at time.Time, undo *theauth.EmailChangeRecord) (*theauth.EmailChangeRecord, error)
ApplyEmailChange implements theauth.EmailChangeStorage.
func (*Store) ApproveToolApproval ¶ added in v2.11.0
func (*Store) AuditOrderSupported ¶ added in v2.12.0
AuditOrderSupported declares theauth write order support (storagetest.AuditOrderCapable).
func (*Store) AuditProvenanceSupported ¶ added in v2.14.0
AuditProvenanceSupported declares that AuditQuery.Provenance is served.
func (*Store) BackchannelRequestByID ¶
func (*Store) CancelEmailChangeUndos ¶ added in v2.14.0
func (s *Store) CancelEmailChangeUndos(_ context.Context, userID theauth.ULID, newEmail string, at time.Time) ([]theauth.EmailChangeRecord, error)
CancelEmailChangeUndos implements theauth.EmailChangeStorage.
func (*Store) ChainSupported ¶ added in v2.11.0
ChainSupported reports that this backend keeps the tamper-evident audit hash chain, with the same row format and verifier as sqlite, postgres and mysql. The audit log is a ring buffer of 10000 rows, so the oldest rows are evicted on a busy process. Verification anchors on the first retained row of each chain, and a signed head checkpoint (audit/checkpoint) catches tail loss.
func (*Store) ClaimDeviceCode ¶
func (*Store) ClaimSSODomainRecheck ¶ added in v2.14.0
func (s *Store) ClaimSSODomainRecheck(_ context.Context, id theauth.ULID, checkedBefore, at time.Time) (bool, error)
ClaimSSODomainRecheck implements theauth.SSODomainStorage.
func (*Store) ConfirmTOTPSecret ¶
func (*Store) ConsumeAuthorizationCode ¶
func (s *Store) ConsumeAuthorizationCode(_ context.Context, code string) (*theauth.AuthorizationCode, error)
ConsumeAuthorizationCode is atomic per code, so exactly one concurrent caller succeeds.
func (*Store) ConsumeDeviceAuthorization ¶ added in v2.8.0
func (*Store) ConsumeMagicLink ¶
func (*Store) ConsumePasswordResetToken ¶
func (*Store) ConsumePushedRequest ¶
ConsumePushedRequest implements as.PARStorage: atomically fetches and deletes, returning ErrNotFound when missing or expired.
func (*Store) ConsumeRecoveryCode ¶
func (s *Store) ConsumeRecoveryCode(_ context.Context, userID theauth.ULID, code string, at time.Time) error
ConsumeRecoveryCode marks the first unused code that matches in constant time as used, returning ErrNotFound when none match.
func (*Store) ConsumeSessionLink ¶
func (*Store) ConsumeSigninReport ¶ added in v2.14.0
func (s *Store) ConsumeSigninReport(_ context.Context, tokenHash []byte, at time.Time) (*theauth.SigninReportRecord, error)
ConsumeSigninReport implements theauth.KnownDeviceStorage.
func (*Store) ConsumeToolApproval ¶ added in v2.11.0
func (*Store) CountUnusedRecoveryCodes ¶
func (*Store) CountUsersWithPermissionInOrg ¶
func (*Store) CreateEmailChange ¶ added in v2.14.0
CreateEmailChange implements theauth.EmailChangeStorage.
func (*Store) CreateMagicLink ¶
func (*Store) CreatePasswordResetToken ¶
func (*Store) CreateSSODomain ¶ added in v2.14.0
CreateSSODomain implements theauth.SSODomainStorage.
func (*Store) CreateSession ¶
func (*Store) CreateSessionFamily ¶ added in v2.14.0
CreateSessionFamily implements theauth.PersistentSessionStorage.
func (*Store) CreateSessionLink ¶
func (*Store) CreateSessionWithAuthLevel ¶
func (s *Store) CreateSessionWithAuthLevel(_ context.Context, sess theauth.Session) (theauth.Session, error)
CreateSessionWithAuthLevel is CreateSession with an explicit AuthLevel (blank defaults to full).
func (*Store) CreateSigninReport ¶ added in v2.14.0
CreateSigninReport implements theauth.KnownDeviceStorage.
func (*Store) CreateUser ¶
func (*Store) DecideDeviceAuthorization ¶ added in v2.8.0
func (*Store) DecideDeviceCode ¶
func (*Store) DelegationGrantByID ¶
func (*Store) DelegationGrantByUserAgentResource ¶
func (*Store) DelegationGrantsByAgentID ¶
func (*Store) DelegationGrantsByUserID ¶
func (*Store) DeleteBackchannelRequest ¶
func (*Store) DeleteExpiredDeviceAuthorizations ¶ added in v2.8.0
func (*Store) DeleteExpiredDeviceCodes ¶
func (*Store) DeleteExpiredEmailChanges ¶ added in v2.14.0
DeleteExpiredEmailChanges implements theauth.EmailChangeStorage.
func (*Store) DeleteExpiredSigninReports ¶ added in v2.14.0
DeleteExpiredSigninReports implements theauth.KnownDeviceStorage.
func (*Store) DeleteOAuthAccountByProvider ¶
func (s *Store) DeleteOAuthAccountByProvider(_ context.Context, userID theauth.ULID, provider string) error
DeleteOAuthAccountByProvider removes the row for (userID, provider).
func (*Store) DeleteOAuthClient ¶
func (*Store) DeleteOrganization ¶
func (*Store) DeleteOrganizationMember ¶
func (*Store) DeletePendingEmailChanges ¶ added in v2.14.0
DeletePendingEmailChanges implements theauth.EmailChangeStorage.
func (*Store) DeleteSAMLConnection ¶
func (*Store) DeleteSSODomain ¶ added in v2.14.0
DeleteSSODomain implements theauth.SSODomainStorage.
func (*Store) DeleteStaleKnownDevices ¶ added in v2.14.0
DeleteStaleKnownDevices implements theauth.KnownDeviceStorage.
func (*Store) DeleteTOTPSecret ¶
func (*Store) DeleteUserCascade ¶ added in v2.10.0
func (*Store) DeleteUserClientAuthorizationCodes ¶ added in v2.14.0
func (*Store) DeleteVaultCredential ¶ added in v2.11.0
func (*Store) DeleteWebAuthnCredential ¶
func (*Store) DenyAccessToken ¶ added in v2.8.0
DenyAccessToken records jti as revoked until expiresAt. Expired entries are purged on each call to bound the map.
func (*Store) DenyToolApproval ¶ added in v2.11.0
func (*Store) DeviceAuthorizationByDeviceCodeHash ¶ added in v2.8.0
func (*Store) DeviceAuthorizationByUserCodeHash ¶ added in v2.8.0
func (s *Store) DeviceAuthorizationByUserCodeHash(_ context.Context, hash []byte) (*theauth.DeviceAuthorization, error)
DeviceAuthorizationByUserCodeHash satisfies DeviceAuthorizationStorage. When an expired and a live record share a hash the live one wins.
func (*Store) DeviceByID ¶ added in v2.10.0
func (*Store) DeviceByKeyThumbprint ¶ added in v2.14.0
func (*Store) DeviceBySPIFFEID ¶ added in v2.14.0
func (*Store) DeviceCodeByHash ¶
func (*Store) DeviceCodeByUserCode ¶
func (*Store) DeviceJoinTokenByHash ¶ added in v2.10.0
func (*Store) DeviceJoinTokenByID ¶ added in v2.10.0
func (*Store) EmailChangeByTokenHash ¶ added in v2.14.0
func (s *Store) EmailChangeByTokenHash(_ context.Context, tokenHash []byte) (*theauth.EmailChangeRecord, error)
EmailChangeByTokenHash implements theauth.EmailChangeStorage.
func (*Store) EmailChangeIdentityManaged ¶ added in v2.14.0
EmailChangeIdentityManaged implements theauth.EmailChangeStorage.
func (*Store) EmailReservedForUndo ¶ added in v2.14.0
func (s *Store) EmailReservedForUndo(_ context.Context, email string, except theauth.ULID, at time.Time) (bool, error)
EmailReservedForUndo implements theauth.EmailChangeStorage.
func (*Store) ExpireToolApproval ¶ added in v2.14.0
func (*Store) ForgetKnownDevice ¶ added in v2.14.0
ForgetKnownDevice implements theauth.KnownDeviceStorage.
func (*Store) ForgetSessionFamily ¶ added in v2.14.0
ForgetSessionFamily implements theauth.PersistentSessionStorage.
func (*Store) GetToolApproval ¶ added in v2.11.0
func (*Store) GrantUserRole ¶
func (*Store) GroupByExternalIDInOrg ¶
func (*Store) GroupMembers ¶
func (*Store) InsertAPIToken ¶
func (*Store) InsertAgent ¶
func (*Store) InsertAgentCredential ¶
func (*Store) InsertAuditEvents ¶
func (*Store) InsertAuthorizationCode ¶
func (*Store) InsertBackchannelRequest ¶
func (*Store) InsertDelegationGrant ¶
func (s *Store) InsertDelegationGrant(_ context.Context, g theauth.DelegationGrant) (theauth.DelegationGrant, error)
func (*Store) InsertDevice ¶ added in v2.10.0
func (*Store) InsertDeviceAuthorization ¶ added in v2.8.0
func (*Store) InsertDeviceCode ¶
func (*Store) InsertDeviceJoinToken ¶ added in v2.10.0
func (*Store) InsertGroup ¶
func (*Store) InsertJTI ¶
InsertJTI records a new JTI. Returns storage.ErrNotFound when the JTI already exists within its expiry window (reusing the "not found" sentinel as the "duplicate detected" signal per the JWTBearerStorage contract).
func (*Store) InsertJWKSKey ¶
func (*Store) InsertOAuthClient ¶
func (s *Store) InsertOAuthClient(_ context.Context, c theauth.OAuthClient) (theauth.OAuthClient, error)
func (*Store) InsertOpaqueAccessToken ¶ added in v2.8.0
func (*Store) InsertOrganization ¶
func (s *Store) InsertOrganization(_ context.Context, o theauth.Organization) (theauth.Organization, error)
func (*Store) InsertPermission ¶
func (s *Store) InsertPermission(_ context.Context, p theauth.Permission) (theauth.Permission, error)
func (*Store) InsertPushedRequest ¶
func (*Store) InsertRecoveryCodes ¶
func (*Store) InsertRefreshToken ¶
func (*Store) InsertRegistrationToken ¶ added in v2.8.0
func (*Store) InsertRole ¶
func (*Store) InsertSAMLConnection ¶
func (s *Store) InsertSAMLConnection(_ context.Context, c theauth.SAMLConnection) (theauth.SAMLConnection, error)
func (*Store) InsertSCIMToken ¶
func (*Store) InsertTrustedDevice ¶ added in v2.10.0
func (*Store) InsertWebAuthnCredential ¶
func (s *Store) InsertWebAuthnCredential(_ context.Context, c theauth.WebAuthnCredential) (theauth.WebAuthnCredential, error)
func (*Store) IsAccessTokenDenied ¶ added in v2.8.0
IsAccessTokenDenied reports whether jti is on the denylist and unexpired.
func (*Store) JWKSKeyByKID ¶
func (*Store) JWKSKeysAll ¶
func (*Store) ListAPITokens ¶
func (*Store) ListDevices ¶ added in v2.10.0
func (*Store) ListGroupsByOrganization ¶
func (*Store) ListKnownDevices ¶ added in v2.14.0
func (s *Store) ListKnownDevices(_ context.Context, userID theauth.ULID) ([]theauth.KnownDeviceRecord, error)
ListKnownDevices implements theauth.KnownDeviceListStorage.
func (*Store) ListOverdueToolApprovals ¶ added in v2.14.0
func (*Store) ListPendingDeviceCodes ¶
func (s *Store) ListPendingDeviceCodes(_ context.Context, f theauth.DevicePendingFilter) ([]theauth.DeviceCode, error)
ListPendingDeviceCodes returns pending, unexpired requests newest first without device code hashes.
func (*Store) ListPendingEmailChanges ¶ added in v2.14.0
func (s *Store) ListPendingEmailChanges(_ context.Context, userID theauth.ULID, at time.Time) ([]theauth.EmailChangeRecord, error)
ListPendingEmailChanges implements theauth.EmailChangeListStorage.
func (*Store) ListPermissions ¶
func (*Store) ListRegistrationTokens ¶ added in v2.8.0
func (*Store) ListSigninReports ¶ added in v2.14.0
func (s *Store) ListSigninReports(_ context.Context, userID theauth.ULID) ([]theauth.SigninReportRecord, error)
ListSigninReports implements theauth.KnownDeviceListStorage.
func (*Store) ListToolApprovals ¶ added in v2.11.0
func (*Store) ListTrustedDevices ¶ added in v2.10.0
func (*Store) ListUserOAuthGrants ¶ added in v2.14.0
func (*Store) ListUserSessionFamilies ¶ added in v2.14.0
func (s *Store) ListUserSessionFamilies(_ context.Context, userID theauth.ULID) ([]theauth.SessionFamilyRecord, error)
ListUserSessionFamilies implements theauth.PersistentSessionStorage.
func (*Store) ListUserSessions ¶
func (*Store) ListUsersByOrganization ¶
func (*Store) ListVaultCredentials ¶ added in v2.11.0
func (*Store) MarkEmailVerified ¶
func (*Store) MarkSSODomainVerified ¶ added in v2.14.0
func (s *Store) MarkSSODomainVerified(_ context.Context, id theauth.ULID, at time.Time) (theauth.SSODomain, error)
MarkSSODomainVerified implements theauth.SSODomainStorage.
func (*Store) MarkSessionFamilyUsed ¶ added in v2.14.0
func (s *Store) MarkSessionFamilyUsed(_ context.Context, sessionID theauth.ULID, at time.Time) error
MarkSessionFamilyUsed implements theauth.PersistentSessionStorage.
func (*Store) MoveOAuthAccount ¶
func (s *Store) MoveOAuthAccount(_ context.Context, provider, providerUserID string, newUserID theauth.ULID) error
MoveOAuthAccount reassigns a row identified by (provider, providerUserID) to newUserID.
func (*Store) MovePasswordHash ¶
MovePasswordHash copies the Argon2id hash from secondaryID to primaryID (overwriting any existing primary hash) then clears secondaryID's hash.
func (*Store) MoveTOTPSecret ¶
MoveTOTPSecret reassigns the TOTP secret. A confirmed primary secret wins, so the secondary is dropped rather than clobbering an active factor.
func (*Store) MoveWebAuthnCredentials ¶
func (s *Store) MoveWebAuthnCredentials(_ context.Context, primaryID, secondaryID theauth.ULID) error
MoveWebAuthnCredentials reassigns every WebAuthn credential from secondaryID to primaryID.
func (*Store) OAuthAccountByProviderUserID ¶
func (*Store) OAuthAccountsByUserID ¶
func (s *Store) OAuthAccountsByUserID(_ context.Context, userID theauth.ULID) ([]theauth.OAuthAccount, error)
OAuthAccountsByUserID returns every OAuth account row linked to userID.
func (*Store) OAuthClientByClientID ¶
func (*Store) OAuthGrantRevocationByUserClient ¶ added in v2.14.0
func (*Store) OpaqueAccessTokenByHash ¶ added in v2.8.0
func (*Store) OpenToolApproval ¶ added in v2.11.0
func (*Store) OrganizationByID ¶
func (*Store) OrganizationBySlug ¶
func (*Store) OrganizationMemberRole ¶
func (*Store) OrganizationMembersByOrg ¶
func (*Store) OrganizationsByUser ¶
func (*Store) PermissionByName ¶
func (*Store) PermissionsByRole ¶
func (*Store) PermissionsForUser ¶
func (*Store) PutOAuthGrantRevocation ¶ added in v2.14.0
func (*Store) PutVaultCredential ¶ added in v2.11.0
func (s *Store) PutVaultCredential(_ context.Context, c theauth.VaultCredential) (theauth.VaultCredential, error)
func (*Store) QueryAuditEvents ¶
func (s *Store) QueryAuditEvents(_ context.Context, q theauth.AuditQuery) ([]theauth.AuditEvent, string, error)
QueryAuditEvents reads the audit ring. Without a cursor, or with a "c1." cursor, rows are ordered by (RecordedAtUs, ID) in q.Order (default desc) and paged with a "c1." cursor. A cursor from before write order existed keeps the old created_at ordering for descending reads.
func (*Store) RebindSessionFamily ¶ added in v2.14.0
func (s *Store) RebindSessionFamily(_ context.Context, familyID, from, to theauth.ULID) (bool, error)
RebindSessionFamily implements theauth.PersistentSessionStorage.
func (*Store) RecordDeviceAuthorizationPoll ¶ added in v2.8.0
func (*Store) RecordDevicePoll ¶
func (*Store) RecordKnownDevice ¶ added in v2.14.0
func (s *Store) RecordKnownDevice(_ context.Context, userID theauth.ULID, deviceHash []byte, at time.Time) error
RecordKnownDevice implements theauth.KnownDeviceStorage.
func (*Store) RecordSSODomainFailure ¶ added in v2.14.0
func (s *Store) RecordSSODomainFailure(_ context.Context, id theauth.ULID, grace int) (theauth.SSODomain, bool, error)
RecordSSODomainFailure implements theauth.SSODomainStorage.
func (*Store) RedeemBackchannelRequest ¶ added in v2.11.0
func (s *Store) RedeemBackchannelRequest(_ context.Context, authReqID string, now time.Time) (theauth.BackchannelRequest, bool, error)
RedeemBackchannelRequest implements theauth.BackchannelRedeemer. It moves an approved, unexpired request to consumed under the store lock, so exactly one concurrent caller wins. Any other state returns ok == false.
func (*Store) RedeemDeviceJoinToken ¶ added in v2.10.0
func (*Store) RedeemRegistrationToken ¶ added in v2.8.0
func (*Store) RefreshTokenByHash ¶
func (*Store) RefundDeviceJoinToken ¶ added in v2.10.0
func (*Store) RefundRegistrationToken ¶ added in v2.8.0
func (*Store) RegistrationTokenByHash ¶ added in v2.8.0
func (*Store) RegistrationTokenByID ¶ added in v2.8.0
func (*Store) RemoveGroupMembers ¶
func (*Store) RenameSessionFamily ¶ added in v2.14.0
RenameSessionFamily implements theauth.PersistentSessionStorage.
func (*Store) RenameWebAuthnCredential ¶
func (*Store) ReplaceRecoveryCodes ¶
func (*Store) ResumeDevice ¶ added in v2.14.0
func (*Store) RevertEmailChange ¶ added in v2.14.0
func (s *Store) RevertEmailChange(_ context.Context, tokenHash []byte, at time.Time) (*theauth.EmailChangeRecord, string, error)
RevertEmailChange implements theauth.EmailChangeStorage.
func (*Store) RevokeAPIToken ¶
func (*Store) RevokeAPITokensByOwner ¶
func (*Store) RevokeAgentCredential ¶
func (*Store) RevokeDelegationGrant ¶
func (*Store) RevokeDevice ¶ added in v2.10.0
func (*Store) RevokeDeviceJoinToken ¶ added in v2.10.0
func (*Store) RevokeOpaqueAccessToken ¶ added in v2.8.0
func (*Store) RevokeOpaqueAccessTokensByJTI ¶ added in v2.14.0
func (*Store) RevokeOtherUserSessions ¶
func (*Store) RevokeRefreshToken ¶
func (*Store) RevokeRefreshTokenFamily ¶
func (*Store) RevokeRefreshTokensByAuthCode ¶ added in v2.8.0
func (s *Store) RevokeRefreshTokensByAuthCode(_ context.Context, codeHash, reason string) ([]string, error)
RevokeRefreshTokensByAuthCode revokes every live token of the code's rotation families and returns their access-token jtis.
func (*Store) RevokeRegistrationToken ¶ added in v2.8.0
func (*Store) RevokeSCIMTokenByID ¶
func (*Store) RevokeSession ¶
func (*Store) RevokeSessionFamily ¶ added in v2.14.0
func (s *Store) RevokeSessionFamily(_ context.Context, id theauth.ULID, reason string, at time.Time) (*theauth.SessionFamilyRecord, error)
RevokeSessionFamily implements theauth.PersistentSessionStorage.
func (*Store) RevokeSessionsByCredential ¶
func (*Store) RevokeTrustedDevice ¶ added in v2.10.0
func (*Store) RevokeUserClientRefreshTokens ¶ added in v2.14.0
func (*Store) RevokeUserRole ¶
func (*Store) RevokeUserSessionFamilies ¶ added in v2.14.0
func (s *Store) RevokeUserSessionFamilies(_ context.Context, userID, keepSession theauth.ULID, reason string, at time.Time) ([]theauth.SessionFamilyRecord, error)
RevokeUserSessionFamilies implements theauth.PersistentSessionStorage.
func (*Store) RevokeUserSessions ¶
func (*Store) RevokeUserTrustedDevices ¶ added in v2.10.0
func (*Store) RoleByOrgAndName ¶
func (*Store) RolesByOrganization ¶
func (*Store) RolesForUser ¶
func (*Store) SAMLConnectionByID ¶
func (*Store) SAMLConnectionsByOrg ¶
func (*Store) SAMLIdentitiesByUserID ¶ added in v2.14.0
func (s *Store) SAMLIdentitiesByUserID(_ context.Context, userID theauth.ULID) ([]theauth.SAMLIdentity, error)
SAMLIdentitiesByUserID implements theauth.SAMLIdentityListStorage.
func (*Store) SAMLIdentityByConnectionAndNameID ¶
func (*Store) SCIMTokenByHash ¶
func (*Store) SCIMTokensByOrg ¶
func (*Store) SSODomainByID ¶ added in v2.14.0
SSODomainByID implements theauth.SSODomainStorage.
func (*Store) SSODomainsByConnection ¶ added in v2.14.0
func (s *Store) SSODomainsByConnection(_ context.Context, connectionID theauth.ULID) ([]theauth.SSODomain, error)
SSODomainsByConnection implements theauth.SSODomainStorage.
func (*Store) SSODomainsByName ¶ added in v2.14.0
SSODomainsByName implements theauth.SSODomainStorage.
func (*Store) SSODomainsDueForRecheck ¶ added in v2.14.0
func (s *Store) SSODomainsDueForRecheck(_ context.Context, checkedBefore time.Time) ([]theauth.SSODomain, error)
SSODomainsDueForRecheck implements theauth.SSODomainStorage.
func (*Store) ScanVaultCredentials ¶ added in v2.11.0
func (*Store) SessionByID ¶
func (*Store) SessionByTokenHash ¶
func (*Store) SessionFamilyByID ¶ added in v2.14.0
func (s *Store) SessionFamilyByID(_ context.Context, id theauth.ULID) (*theauth.SessionFamilyRecord, error)
SessionFamilyByID implements theauth.PersistentSessionStorage.
func (*Store) SessionFamilyBySessionID ¶ added in v2.14.0
func (s *Store) SessionFamilyBySessionID(_ context.Context, sessionID theauth.ULID) (*theauth.SessionFamilyRecord, error)
SessionFamilyBySessionID implements theauth.PersistentSessionStorage.
func (*Store) SessionFamilyTokenGeneration ¶ added in v2.14.0
func (s *Store) SessionFamilyTokenGeneration(_ context.Context, familyID theauth.ULID, hash []byte) (int64, error)
SessionFamilyTokenGeneration implements theauth.PersistentSessionStorage.
func (*Store) SetAuditPseudonymRotation ¶ added in v2.14.0
SetAuditPseudonymRotation turns on rotating audit pseudonyms (theauth.AuditPseudonymRotator). Rows already in the ring keep their stable pseudonym.
func (*Store) SetGroupMembers ¶
func (*Store) SetMustChangePassword ¶ added in v2.10.0
func (*Store) SetRolePermissions ¶
func (*Store) SetSessionActiveOrganization ¶
func (*Store) SetSessionElevatedUntil ¶
func (*Store) SetUserDisabledAt ¶ added in v2.10.0
func (*Store) SetUserPassword ¶
func (*Store) ShredAuditPseudonyms ¶ added in v2.14.0
ShredAuditPseudonyms deletes the period secrets outside the retention window and returns the periods removed (theauth.AuditPseudonymRotator).
func (*Store) SigninReportByTokenHash ¶ added in v2.14.0
func (s *Store) SigninReportByTokenHash(_ context.Context, tokenHash []byte) (*theauth.SigninReportRecord, error)
SigninReportByTokenHash implements theauth.KnownDeviceStorage.
func (*Store) SuspendDevice ¶ added in v2.14.0
func (*Store) SwapVaultCredential ¶ added in v2.11.0
func (*Store) SweepExpiredJTIs ¶
SweepExpiredJTIs removes all entries whose expiresAt is before the supplied time.
func (*Store) TOTPSecretByUserID ¶
func (*Store) TouchAPITokenLastUsed ¶
func (*Store) TouchBackchannelPoll ¶
func (s *Store) TouchBackchannelPoll(_ context.Context, authReqID string, now time.Time, newInterval int) (theauth.BackchannelRequest, error)
TouchBackchannelPoll satisfies CIBAStorage; the poll time and interval update atomically.
func (*Store) TouchDevice ¶ added in v2.10.0
func (*Store) TouchKnownDevice ¶ added in v2.14.0
func (s *Store) TouchKnownDevice(_ context.Context, userID theauth.ULID, deviceHash []byte, at time.Time) (bool, error)
TouchKnownDevice implements theauth.KnownDeviceStorage.
func (*Store) TouchSAMLIdentityLastLogin ¶
func (*Store) TouchSCIMTokenLastUsed ¶
func (*Store) TouchSession ¶
func (*Store) TouchTrustedDevice ¶ added in v2.10.0
func (*Store) TrustedDeviceByTokenHash ¶ added in v2.10.0
func (*Store) UpdateAgentCredentialLastUsed ¶
func (*Store) UpdateAgentExpiry ¶ added in v2.12.0
func (*Store) UpdateAgentLastActive ¶
func (*Store) UpdateAgentStatus ¶
func (*Store) UpdateBackchannelRequest ¶
func (*Store) UpdateJWKSKeyState ¶
func (*Store) UpdateOAuthClient ¶
func (s *Store) UpdateOAuthClient(_ context.Context, c theauth.OAuthClient) (theauth.OAuthClient, error)
func (*Store) UpdateOrganization ¶
func (*Store) UpdateRoleRow ¶
func (*Store) UpdateSAMLConnectionRow ¶
func (*Store) UpdateSessionAuthLevel ¶
UpdateSessionAuthLevel rewrites the AuthLevel column, e.g. to promote a pending_2fa session after a successful TOTP verify.
func (*Store) UpdateUserSCIM ¶
func (*Store) UpdateWebAuthnBackupFlags ¶
func (s *Store) UpdateWebAuthnBackupFlags(_ context.Context, credentialID []byte, backupEligible, backupState bool) error
UpdateWebAuthnBackupFlags records BE/BS flags for trust-on-first-use reconciliation of legacy synced passkeys. A missing credential is a no-op.
func (*Store) UpdateWebAuthnSignCount ¶
func (*Store) UpsertOAuthAccount ¶
func (s *Store) UpsertOAuthAccount(_ context.Context, a theauth.OAuthAccount) (theauth.OAuthAccount, error)
UpsertOAuthAccount mirrors the Postgres ON CONFLICT upsert: an existing (provider, provider_user_id) row keeps its ID and CreatedAt.
func (*Store) UpsertOrganizationMember ¶
func (*Store) UpsertPendingTOTPSecret ¶
func (*Store) UpsertSAMLIdentity ¶
func (s *Store) UpsertSAMLIdentity(_ context.Context, i theauth.SAMLIdentity) (theauth.SAMLIdentity, error)
func (*Store) UserByEmail ¶
func (*Store) UserByEmailWithPassword ¶
func (*Store) UserByExternalIDInOrg ¶
func (*Store) UserClientTokenRefs ¶ added in v2.14.0
func (*Store) UserOAuthGrantEvidence ¶ added in v2.14.0
func (*Store) UserPasswordHashByID ¶
UserPasswordHashByID returns the stored Argon2id PHC string, or "" when the user has no password set.
func (*Store) VaultCredentialByUserProvider ¶ added in v2.11.0
func (*Store) VerifyAuditChain ¶ added in v2.11.0
VerifyAuditChain walks every chain in seq order and reports the first mismatched row. Stored fields are rehashed from the live event, so an edit to a row after it was written is a break.
func (*Store) VoteToolApproval ¶ added in v2.14.0
func (s *Store) VoteToolApproval(_ context.Context, id, approver string, now time.Time) (theauth.ToolApprovalVote, error)
VoteToolApproval implements theauth.ToolApprovalQuorumStorage under the store mutex.
func (*Store) WebAuthnCredentialByCredentialID ¶
func (*Store) WebAuthnCredentialsByUserID ¶
Source Files
¶
- audit_chain.go
- audit_rotation.go
- doc.go
- memory.go
- memory_apitokens.go
- memory_ciba.go
- memory_connected_apps.go
- memory_data_export.go
- memory_device.go
- memory_email_change.go
- memory_hardening.go
- memory_iotdevice.go
- memory_jwtbearer.go
- memory_lifecycle.go
- memory_opaque.go
- memory_par.go
- memory_session_families.go
- memory_sessions.go
- memory_signin_notices.go
- memory_sso_domains.go
- memory_tokenvault.go
- memory_toolapprovals.go
- memory_v07.go
- memory_v10.go
- memory_v20.go