Documentation
¶
Overview ¶
Schema indirection (authkit issue 69).
Every SQL statement in authkit — the sqlc-generated constants in this package and the few raw statements in core — is schema-qualified with the literal prefix "profiles.". Hosts embed authkit with a pgx pool that is SHARED with their own queries, so pointing authkit at a different schema via search_path on the pool is ruled out (it would leak into host queries). Instead the qualifier stays in the SQL text and becomes a variable: ForSchema wraps a DBTX so the "profiles." prefix is rewritten to "<schema>." on every statement at execution time. This is a deliberate, documented string substitution: schema names are validated against a strict identifier grammar (ValidSchemaName) at configuration time, every authkit table/function reference is written as `profiles.<name>` (guarded by a test in this package), and the rewrite is the identity (no wrapper at all) for the default schema, so existing embedders see zero change.
Index ¶
- Constants
- func RewriteSQL(sql, schema string) string
- func ValidSchemaName(s string) bool
- type DBTX
- type GlobalRoleUpsertParams
- type GlobalUserHasActiveRoleParams
- type GlobalUserRoleDeleteBySlugParams
- type GlobalUserRoleDeleteParams
- type GlobalUserRoleExistsParams
- type GlobalUserRoleInsertParams
- type IdentityUpdateUserEmailParams
- type IdentityUpdateUserUsernameParams
- type IdentityUserByIDRow
- type IdentityUsersByIDsRow
- type NamespaceOrgBySlugRow
- type NamespaceOrgRenameBySlugRow
- type NamespaceUserBySlugRow
- type NamespaceUserRenameBySlugRow
- type OrgBySlugRow
- type OrgBySlugViaRenameRow
- type OrgIDPersonalBySlugRow
- type OrgIDReservedBySlugRow
- type OrgInsertParams
- type OrgInsertRow
- type OrgInsertWithStateParams
- type OrgInviteForUpdateRow
- type OrgInviteInsertParams
- type OrgInviteInsertRow
- type OrgInviteRevokeParams
- type OrgInviteSetStatusParams
- type OrgInvitesByOrgRow
- type OrgInvitesByOrgStatusParams
- type OrgInvitesByOrgStatusRow
- type OrgInvitesByUserRow
- type OrgInvitesByUserStatusParams
- type OrgInvitesByUserStatusRow
- type OrgMemberAddParams
- type OrgMemberHasRoleParams
- type OrgMemberRoleParams
- type OrgMemberRolePrincipalParams
- type OrgMemberSoftDeleteParams
- type OrgMemberSoftDeletePrincipalParams
- type OrgMembershipExistsParams
- type OrgMembershipResetRoleParams
- type OrgMembershipSetRoleParams
- type OrgMembershipUpsertRoleParams
- type OrgMembershipUpsertRolePrincipalParams
- type OrgMetadataPatchParams
- type OrgNamespaceStateByIDRow
- type OrgRenameInsertParams
- type OrgRoleDefineParams
- type OrgRoleDeleteParams
- type OrgRoleExistsParams
- type OrgRoleHasPermissionsParams
- type OrgRoleMemberCountParams
- type OrgRolePermissionInsertParams
- type OrgRolePermissionsDeleteParams
- type OrgRolePermissionsParams
- type OrgRolesForPrincipalParams
- type OrgRolesForPrincipalRow
- type OrgRolesSeedOwnerMemberParams
- type OrgSetNamespaceStateParams
- type OrgSetReservedParams
- type OrgSlugAndPersonalByIDRow
- type OrgUpdateSlugParams
- type OrgUpdateSlugUnconditionalParams
- type OwnerSlugConflictExistsParams
- type OwnerSlugOrgExistsParams
- type OwnerSlugOrgRenameHeldParams
- type OwnerSlugUserExistsParams
- type OwnerSlugUserRenameHeldParams
- type PersonalOrgByOwnerRow
- type PersonalOrgIDSlugByOwnerRow
- type PersonalOrgIDSlugReservedByOwnerRow
- type PersonalOrgInsertBasicParams
- type PersonalOrgUpsertParams
- type ProfilesGlobalRole
- type ProfilesGlobalUserRole
- type ProfilesOrg
- type ProfilesOrgInvite
- type ProfilesOrgMembership
- type ProfilesOrgRename
- type ProfilesOrgRole
- type ProfilesOrgRolePermission
- type ProfilesOwnerReservedName
- type ProfilesRefreshSession
- type ProfilesRemoteApplication
- type ProfilesRemoteApplicationAttributeDef
- type ProfilesRemoteApplicationPermission
- type ProfilesServiceToken
- type ProfilesServiceTokenPermission
- type ProfilesServiceTokenResource
- type ProfilesTwoFactorSetting
- type ProfilesUser
- type ProfilesUserPassword
- type ProfilesUserProvider
- type ProfilesUserRename
- type ProviderLinkByIssuerParams
- type ProviderLinkByIssuerRow
- type ProviderLinkBySlugParams
- type ProviderLinkBySlugRow
- type Queries
- func (q *Queries) GlobalActiveAdminCount(ctx context.Context, roleID string) (int64, error)
- func (q *Queries) GlobalAdminRoleIDForUpdate(ctx context.Context) (string, error)
- func (q *Queries) GlobalRoleIDBySlug(ctx context.Context, slug string) (string, error)
- func (q *Queries) GlobalRoleSlugsByUser(ctx context.Context, userID string) ([]string, error)
- func (q *Queries) GlobalRoleUpsert(ctx context.Context, arg GlobalRoleUpsertParams) error
- func (q *Queries) GlobalUserHasActiveRole(ctx context.Context, arg GlobalUserHasActiveRoleParams) (bool, error)
- func (q *Queries) GlobalUserRoleDelete(ctx context.Context, arg GlobalUserRoleDeleteParams) (int64, error)
- func (q *Queries) GlobalUserRoleDeleteBySlug(ctx context.Context, arg GlobalUserRoleDeleteBySlugParams) (int64, error)
- func (q *Queries) GlobalUserRoleExists(ctx context.Context, arg GlobalUserRoleExistsParams) (bool, error)
- func (q *Queries) GlobalUserRoleInsert(ctx context.Context, arg GlobalUserRoleInsertParams) error
- func (q *Queries) IdentityCurrentOrgSlug(ctx context.Context, slug string) (string, error)
- func (q *Queries) IdentityCurrentUsername(ctx context.Context, username *string) (*string, error)
- func (q *Queries) IdentityForwardOrgSlug(ctx context.Context, fromSlug string) (string, error)
- func (q *Queries) IdentityForwardUsername(ctx context.Context, fromSlug string) (*string, error)
- func (q *Queries) IdentityUpdateUserEmail(ctx context.Context, arg IdentityUpdateUserEmailParams) error
- func (q *Queries) IdentityUpdateUserUsername(ctx context.Context, arg IdentityUpdateUserUsernameParams) error
- func (q *Queries) IdentityUserByID(ctx context.Context, id string) (IdentityUserByIDRow, error)
- func (q *Queries) IdentityUserIDByUsername(ctx context.Context, username *string) (string, error)
- func (q *Queries) IdentityUsersByIDs(ctx context.Context, ids []string) ([]IdentityUsersByIDsRow, error)
- func (q *Queries) NamespaceOrgBySlug(ctx context.Context, slug string) (NamespaceOrgBySlugRow, error)
- func (q *Queries) NamespaceOrgRenameBySlug(ctx context.Context, fromSlug string) (NamespaceOrgRenameBySlugRow, error)
- func (q *Queries) NamespaceUserBySlug(ctx context.Context, username *string) (NamespaceUserBySlugRow, error)
- func (q *Queries) NamespaceUserRenameBySlug(ctx context.Context, fromSlug string) (NamespaceUserRenameBySlugRow, error)
- func (q *Queries) OrgAliases(ctx context.Context, orgID string) ([]string, error)
- func (q *Queries) OrgBySlug(ctx context.Context, slug string) (OrgBySlugRow, error)
- func (q *Queries) OrgBySlugViaRename(ctx context.Context, fromSlug string) (OrgBySlugViaRenameRow, error)
- func (q *Queries) OrgDefinedRoles(ctx context.Context, orgID string) ([]string, error)
- func (q *Queries) OrgIDPersonalBySlug(ctx context.Context, slug string) (OrgIDPersonalBySlugRow, error)
- func (q *Queries) OrgIDReservedBySlug(ctx context.Context, slug string) (OrgIDReservedBySlugRow, error)
- func (q *Queries) OrgInsert(ctx context.Context, arg OrgInsertParams) (OrgInsertRow, error)
- func (q *Queries) OrgInsertWithState(ctx context.Context, arg OrgInsertWithStateParams) (string, error)
- func (q *Queries) OrgInviteForUpdate(ctx context.Context, id string) (OrgInviteForUpdateRow, error)
- func (q *Queries) OrgInviteInsert(ctx context.Context, arg OrgInviteInsertParams) (OrgInviteInsertRow, error)
- func (q *Queries) OrgInviteMarkExpired(ctx context.Context, id string) error
- func (q *Queries) OrgInviteRevoke(ctx context.Context, arg OrgInviteRevokeParams) (int64, error)
- func (q *Queries) OrgInviteSetStatus(ctx context.Context, arg OrgInviteSetStatusParams) error
- func (q *Queries) OrgInvitesByOrg(ctx context.Context, orgID string) ([]OrgInvitesByOrgRow, error)
- func (q *Queries) OrgInvitesByOrgStatus(ctx context.Context, arg OrgInvitesByOrgStatusParams) ([]OrgInvitesByOrgStatusRow, error)
- func (q *Queries) OrgInvitesByUser(ctx context.Context, userID string) ([]OrgInvitesByUserRow, error)
- func (q *Queries) OrgInvitesByUserStatus(ctx context.Context, arg OrgInvitesByUserStatusParams) ([]OrgInvitesByUserStatusRow, error)
- func (q *Queries) OrgLastRenamedAt(ctx context.Context, orgID string) (time.Time, error)
- func (q *Queries) OrgMemberAdd(ctx context.Context, arg OrgMemberAddParams) error
- func (q *Queries) OrgMemberHasRole(ctx context.Context, arg OrgMemberHasRoleParams) (bool, error)
- func (q *Queries) OrgMemberIDs(ctx context.Context, orgID string) ([]string, error)
- func (q *Queries) OrgMemberRole(ctx context.Context, arg OrgMemberRoleParams) (string, error)
- func (q *Queries) OrgMemberRolePrincipal(ctx context.Context, arg OrgMemberRolePrincipalParams) (string, error)
- func (q *Queries) OrgMemberSoftDelete(ctx context.Context, arg OrgMemberSoftDeleteParams) error
- func (q *Queries) OrgMemberSoftDeletePrincipal(ctx context.Context, arg OrgMemberSoftDeletePrincipalParams) error
- func (q *Queries) OrgMembershipExists(ctx context.Context, arg OrgMembershipExistsParams) (bool, error)
- func (q *Queries) OrgMembershipResetRole(ctx context.Context, arg OrgMembershipResetRoleParams) error
- func (q *Queries) OrgMembershipSetRole(ctx context.Context, arg OrgMembershipSetRoleParams) error
- func (q *Queries) OrgMembershipUpsertRole(ctx context.Context, arg OrgMembershipUpsertRoleParams) error
- func (q *Queries) OrgMembershipUpsertRolePrincipal(ctx context.Context, arg OrgMembershipUpsertRolePrincipalParams) error
- func (q *Queries) OrgMetadata(ctx context.Context, id string) ([]byte, error)
- func (q *Queries) OrgMetadataPatch(ctx context.Context, arg OrgMetadataPatchParams) (int64, error)
- func (q *Queries) OrgNamespaceStateByID(ctx context.Context, id string) (OrgNamespaceStateByIDRow, error)
- func (q *Queries) OrgRenameInsert(ctx context.Context, arg OrgRenameInsertParams) error
- func (q *Queries) OrgRoleDefine(ctx context.Context, arg OrgRoleDefineParams) error
- func (q *Queries) OrgRoleDelete(ctx context.Context, arg OrgRoleDeleteParams) error
- func (q *Queries) OrgRoleExists(ctx context.Context, arg OrgRoleExistsParams) (bool, error)
- func (q *Queries) OrgRoleHasPermissions(ctx context.Context, arg OrgRoleHasPermissionsParams) (bool, error)
- func (q *Queries) OrgRoleMemberCount(ctx context.Context, arg OrgRoleMemberCountParams) (int64, error)
- func (q *Queries) OrgRolePermissionInsert(ctx context.Context, arg OrgRolePermissionInsertParams) error
- func (q *Queries) OrgRolePermissions(ctx context.Context, arg OrgRolePermissionsParams) ([]string, error)
- func (q *Queries) OrgRolePermissionsDelete(ctx context.Context, arg OrgRolePermissionsDeleteParams) error
- func (q *Queries) OrgRolesForPrincipal(ctx context.Context, arg OrgRolesForPrincipalParams) ([]OrgRolesForPrincipalRow, error)
- func (q *Queries) OrgRolesSeedOwnerMember(ctx context.Context, arg OrgRolesSeedOwnerMemberParams) error
- func (q *Queries) OrgSetNamespaceState(ctx context.Context, arg OrgSetNamespaceStateParams) (int64, error)
- func (q *Queries) OrgSetReserved(ctx context.Context, arg OrgSetReservedParams) error
- func (q *Queries) OrgSlugAndPersonalByID(ctx context.Context, id string) (OrgSlugAndPersonalByIDRow, error)
- func (q *Queries) OrgSlugsByUser(ctx context.Context, userID string) ([]string, error)
- func (q *Queries) OrgUpdateSlug(ctx context.Context, arg OrgUpdateSlugParams) error
- func (q *Queries) OrgUpdateSlugUnconditional(ctx context.Context, arg OrgUpdateSlugUnconditionalParams) error
- func (q *Queries) OwnerReservedNameDelete(ctx context.Context, slug string) (int64, error)
- func (q *Queries) OwnerReservedNameExists(ctx context.Context, slug string) (bool, error)
- func (q *Queries) OwnerReservedNameUpsert(ctx context.Context, slug string) error
- func (q *Queries) OwnerSlugConflictExists(ctx context.Context, arg OwnerSlugConflictExistsParams) (bool, error)
- func (q *Queries) OwnerSlugOrgExists(ctx context.Context, arg OwnerSlugOrgExistsParams) (bool, error)
- func (q *Queries) OwnerSlugOrgRenameHeld(ctx context.Context, arg OwnerSlugOrgRenameHeldParams) (bool, error)
- func (q *Queries) OwnerSlugUserExists(ctx context.Context, arg OwnerSlugUserExistsParams) (bool, error)
- func (q *Queries) OwnerSlugUserRenameHeld(ctx context.Context, arg OwnerSlugUserRenameHeldParams) (bool, error)
- func (q *Queries) PersonalOrgByOwner(ctx context.Context, ownerUserID string) (PersonalOrgByOwnerRow, error)
- func (q *Queries) PersonalOrgIDSlugByOwner(ctx context.Context, ownerUserID string) (PersonalOrgIDSlugByOwnerRow, error)
- func (q *Queries) PersonalOrgIDSlugReservedByOwner(ctx context.Context, ownerUserID string) (PersonalOrgIDSlugReservedByOwnerRow, error)
- func (q *Queries) PersonalOrgInsertBasic(ctx context.Context, arg PersonalOrgInsertBasicParams) error
- func (q *Queries) PersonalOrgUpsert(ctx context.Context, arg PersonalOrgUpsertParams) (string, error)
- func (q *Queries) ProviderLinkByIssuer(ctx context.Context, arg ProviderLinkByIssuerParams) (ProviderLinkByIssuerRow, error)
- func (q *Queries) ProviderLinkBySlug(ctx context.Context, arg ProviderLinkBySlugParams) (ProviderLinkBySlugRow, error)
- func (q *Queries) RemoteAppAttributeDefDelete(ctx context.Context, arg RemoteAppAttributeDefDeleteParams) (int64, error)
- func (q *Queries) RemoteAppAttributeDefGet(ctx context.Context, arg RemoteAppAttributeDefGetParams) (RemoteAppAttributeDefGetRow, error)
- func (q *Queries) RemoteAppAttributeDefGetLatest(ctx context.Context, arg RemoteAppAttributeDefGetLatestParams) (RemoteAppAttributeDefGetLatestRow, error)
- func (q *Queries) RemoteAppAttributeDefUpsert(ctx context.Context, arg RemoteAppAttributeDefUpsertParams) (RemoteAppAttributeDefUpsertRow, error)
- func (q *Queries) RemoteAppAttributeDefsList(ctx context.Context, remoteApplicationID string) ([]RemoteAppAttributeDefsListRow, error)
- func (q *Queries) RemoteApplicationByIssuer(ctx context.Context, issuer string) (RemoteApplicationByIssuerRow, error)
- func (q *Queries) RemoteApplicationBySlug(ctx context.Context, slug string) (RemoteApplicationBySlugRow, error)
- func (q *Queries) RemoteApplicationDelete(ctx context.Context, issuer string) (int64, error)
- func (q *Queries) RemoteApplicationPermissionDelete(ctx context.Context, arg RemoteApplicationPermissionDeleteParams) (int64, error)
- func (q *Queries) RemoteApplicationPermissionInsert(ctx context.Context, arg RemoteApplicationPermissionInsertParams) error
- func (q *Queries) RemoteApplicationPermissions(ctx context.Context, remoteApplicationID string) ([]string, error)
- func (q *Queries) RemoteApplicationUpsert(ctx context.Context, arg RemoteApplicationUpsertParams) (RemoteApplicationUpsertRow, error)
- func (q *Queries) RemoteApplicationsAll(ctx context.Context) ([]RemoteApplicationsAllRow, error)
- func (q *Queries) RemoteApplicationsEnabled(ctx context.Context) ([]RemoteApplicationsEnabledRow, error)
- func (q *Queries) ServiceTokenByKeyID(ctx context.Context, keyID string) (ServiceTokenByKeyIDRow, error)
- func (q *Queries) ServiceTokenInsert(ctx context.Context, arg ServiceTokenInsertParams) (ServiceTokenInsertRow, error)
- func (q *Queries) ServiceTokenPermissionInsert(ctx context.Context, arg ServiceTokenPermissionInsertParams) error
- func (q *Queries) ServiceTokenPermissionsByTokenID(ctx context.Context, serviceTokenID string) ([]string, error)
- func (q *Queries) ServiceTokenPermissionsByTokenIDs(ctx context.Context, ids []string) ([]ServiceTokenPermissionsByTokenIDsRow, error)
- func (q *Queries) ServiceTokenResourceInsert(ctx context.Context, arg ServiceTokenResourceInsertParams) error
- func (q *Queries) ServiceTokenResourcesByTokenID(ctx context.Context, tokenID string) ([]ServiceTokenResourcesByTokenIDRow, error)
- func (q *Queries) ServiceTokenResourcesByTokenIDs(ctx context.Context, ids []string) ([]ServiceTokenResourcesByTokenIDsRow, error)
- func (q *Queries) ServiceTokenRevoke(ctx context.Context, arg ServiceTokenRevokeParams) (int64, error)
- func (q *Queries) ServiceTokenTouchLastUsed(ctx context.Context, id string) error
- func (q *Queries) ServiceTokensByOrg(ctx context.Context, orgID string) ([]ServiceTokensByOrgRow, error)
- func (q *Queries) SessionByCurrentTokenHash(ctx context.Context, arg SessionByCurrentTokenHashParams) (SessionByCurrentTokenHashRow, error)
- func (q *Queries) SessionByPreviousTokenHash(ctx context.Context, arg SessionByPreviousTokenHashParams) (SessionByPreviousTokenHashRow, error)
- func (q *Queries) SessionFreshSince(ctx context.Context, arg SessionFreshSinceParams) (time.Time, error)
- func (q *Queries) SessionIDByCurrentTokenHash(ctx context.Context, arg SessionIDByCurrentTokenHashParams) (string, error)
- func (q *Queries) SessionInsert(ctx context.Context, arg SessionInsertParams) (SessionInsertRow, error)
- func (q *Queries) SessionMarkAuthenticated(ctx context.Context, arg SessionMarkAuthenticatedParams) (int64, error)
- func (q *Queries) SessionRevokeByID(ctx context.Context, arg SessionRevokeByIDParams) (string, error)
- func (q *Queries) SessionRevokeByIDForUser(ctx context.Context, arg SessionRevokeByIDForUserParams) (string, error)
- func (q *Queries) SessionRotate(ctx context.Context, arg SessionRotateParams) error
- func (q *Queries) SessionsCountActive(ctx context.Context, arg SessionsCountActiveParams) (int64, error)
- func (q *Queries) SessionsDeleteRevokedOrExpired(ctx context.Context) error
- func (q *Queries) SessionsEvictOldest(ctx context.Context, arg SessionsEvictOldestParams) ([]string, error)
- func (q *Queries) SessionsListByUser(ctx context.Context, arg SessionsListByUserParams) ([]SessionsListByUserRow, error)
- func (q *Queries) SessionsRevokeAll(ctx context.Context, arg SessionsRevokeAllParams) ([]string, error)
- func (q *Queries) SessionsRevokeAllExcept(ctx context.Context, arg SessionsRevokeAllExceptParams) ([]string, error)
- func (q *Queries) SessionsRevokeAllQuiet(ctx context.Context, arg SessionsRevokeAllQuietParams) error
- func (q *Queries) SessionsRevokeFamily(ctx context.Context, familyID string) ([]SessionsRevokeFamilyRow, error)
- func (q *Queries) TwoFactorDisable(ctx context.Context, userID string) error
- func (q *Queries) TwoFactorEnable(ctx context.Context, arg TwoFactorEnableParams) error
- func (q *Queries) TwoFactorSetBackupCodes(ctx context.Context, arg TwoFactorSetBackupCodesParams) error
- func (q *Queries) TwoFactorSettingsByUser(ctx context.Context, userID string) (ProfilesTwoFactorSetting, error)
- func (q *Queries) UserApplyEmailChange(ctx context.Context, arg UserApplyEmailChangeParams) error
- func (q *Queries) UserApplyPhoneChange(ctx context.Context, arg UserApplyPhoneChangeParams) error
- func (q *Queries) UserBan(ctx context.Context, arg UserBanParams) error
- func (q *Queries) UserByEmail(ctx context.Context, email string) (UserByEmailRow, error)
- func (q *Queries) UserByID(ctx context.Context, id string) (UserByIDRow, error)
- func (q *Queries) UserByPhone(ctx context.Context, phoneNumber *string) (UserByPhoneRow, error)
- func (q *Queries) UserBySlug(ctx context.Context, username *string) (UserBySlugRow, error)
- func (q *Queries) UserBySlugViaRename(ctx context.Context, fromSlug string) (UserBySlugViaRenameRow, error)
- func (q *Queries) UserByUsername(ctx context.Context, username *string) (UserByUsernameRow, error)
- func (q *Queries) UserClearBan(ctx context.Context, id string) error
- func (q *Queries) UserClearLoginIdentifiers(ctx context.Context, id string) error
- func (q *Queries) UserDeleteHard(ctx context.Context, id string) error
- func (q *Queries) UserDiscordUsername(ctx context.Context, id string) (*string, error)
- func (q *Queries) UserEmailByID(ctx context.Context, id string) (*string, error)
- func (q *Queries) UserEmailOrUsernameExists(ctx context.Context, arg UserEmailOrUsernameExistsParams) (bool, error)
- func (q *Queries) UserEmailOrUsernameTaken(ctx context.Context, arg UserEmailOrUsernameTakenParams) (UserEmailOrUsernameTakenRow, error)
- func (q *Queries) UserHasPassword(ctx context.Context, userID string) (bool, error)
- func (q *Queries) UserIDReservedByUsername(ctx context.Context, username *string) (UserIDReservedByUsernameRow, error)
- func (q *Queries) UserImportInsert(ctx context.Context, arg UserImportInsertParams) error
- func (q *Queries) UserImportUpdate(ctx context.Context, arg UserImportUpdateParams) (string, error)
- func (q *Queries) UserInsert(ctx context.Context, arg UserInsertParams) (UserInsertRow, error)
- func (q *Queries) UserIsReserved(ctx context.Context, id string) (bool, error)
- func (q *Queries) UserLastRenamedAt(ctx context.Context, userID string) (time.Time, error)
- func (q *Queries) UserMetadata(ctx context.Context, id string) ([]byte, error)
- func (q *Queries) UserMetadataPatch(ctx context.Context, arg UserMetadataPatchParams) (int64, error)
- func (q *Queries) UserPasswordDelete(ctx context.Context, userID string) error
- func (q *Queries) UserPasswordInsert(ctx context.Context, arg UserPasswordInsertParams) error
- func (q *Queries) UserPasswordRow(ctx context.Context, userID string) (UserPasswordRowRow, error)
- func (q *Queries) UserPasswordUpsert(ctx context.Context, arg UserPasswordUpsertParams) error
- func (q *Queries) UserPhoneOrUsernameExists(ctx context.Context, arg UserPhoneOrUsernameExistsParams) (bool, error)
- func (q *Queries) UserPhoneOrUsernameTaken(ctx context.Context, arg UserPhoneOrUsernameTakenParams) (UserPhoneOrUsernameTakenRow, error)
- func (q *Queries) UserPreferredLocale(ctx context.Context, id string) (UserPreferredLocaleRow, error)
- func (q *Queries) UserProviderDeleteBySlug(ctx context.Context, arg UserProviderDeleteBySlugParams) error
- func (q *Queries) UserProviderDeleteOtherSubjects(ctx context.Context, arg UserProviderDeleteOtherSubjectsParams) error
- func (q *Queries) UserProviderInsertSimple(ctx context.Context, arg UserProviderInsertSimpleParams) error
- func (q *Queries) UserProviderLinkExists(ctx context.Context, arg UserProviderLinkExistsParams) (bool, error)
- func (q *Queries) UserProviderMergeProfile(ctx context.Context, arg UserProviderMergeProfileParams) error
- func (q *Queries) UserProviderSetUsername(ctx context.Context, arg UserProviderSetUsernameParams) error
- func (q *Queries) UserProviderSlugs(ctx context.Context, userID string) ([]string, error)
- func (q *Queries) UserProviderSlugsDistinct(ctx context.Context, userID string) ([]string, error)
- func (q *Queries) UserProviderSubjectByIssuer(ctx context.Context, arg UserProviderSubjectByIssuerParams) (string, error)
- func (q *Queries) UserProviderSubjectProfileByIssuer(ctx context.Context, arg UserProviderSubjectProfileByIssuerParams) (UserProviderSubjectProfileByIssuerRow, error)
- func (q *Queries) UserProviderUpsertByIssuer(ctx context.Context, arg UserProviderUpsertByIssuerParams) error
- func (q *Queries) UserProviderUsername(ctx context.Context, arg UserProviderUsernameParams) (*string, error)
- func (q *Queries) UserProvidersCount(ctx context.Context, userID string) (int64, error)
- func (q *Queries) UserProvidersDeleteByUser(ctx context.Context, userID string) error
- func (q *Queries) UserRenameInsert(ctx context.Context, arg UserRenameInsertParams) error
- func (q *Queries) UserRestore(ctx context.Context, id string) error
- func (q *Queries) UserSetBiography(ctx context.Context, arg UserSetBiographyParams) error
- func (q *Queries) UserSetEmailAndUnverify(ctx context.Context, arg UserSetEmailAndUnverifyParams) error
- func (q *Queries) UserSetEmailVerified(ctx context.Context, arg UserSetEmailVerifiedParams) error
- func (q *Queries) UserSetLastLogin(ctx context.Context, arg UserSetLastLoginParams) error
- func (q *Queries) UserSetPhoneAndVerified(ctx context.Context, arg UserSetPhoneAndVerifiedParams) error
- func (q *Queries) UserSetPhoneVerifiedByID(ctx context.Context, arg UserSetPhoneVerifiedByIDParams) error
- func (q *Queries) UserSetPhoneVerifiedByIDAndPhone(ctx context.Context, arg UserSetPhoneVerifiedByIDAndPhoneParams) error
- func (q *Queries) UserSetPreferredLocale(ctx context.Context, arg UserSetPreferredLocaleParams) error
- func (q *Queries) UserSetReserved(ctx context.Context, arg UserSetReservedParams) error
- func (q *Queries) UserSetUsername(ctx context.Context, arg UserSetUsernameParams) error
- func (q *Queries) UserSlugAliases(ctx context.Context, userID string) ([]string, error)
- func (q *Queries) UserSoftDelete(ctx context.Context, id string) error
- func (q *Queries) UserUsernameByID(ctx context.Context, id string) (string, error)
- func (q *Queries) UserUsernameExists(ctx context.Context, username *string) (bool, error)
- func (q *Queries) UsersPurgeCandidates(ctx context.Context, arg UsersPurgeCandidatesParams) ([]string, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type RemoteAppAttributeDefDeleteParams
- type RemoteAppAttributeDefGetLatestParams
- type RemoteAppAttributeDefGetLatestRow
- type RemoteAppAttributeDefGetParams
- type RemoteAppAttributeDefGetRow
- type RemoteAppAttributeDefUpsertParams
- type RemoteAppAttributeDefUpsertRow
- type RemoteAppAttributeDefsListRow
- type RemoteApplicationByIssuerRow
- type RemoteApplicationBySlugRow
- type RemoteApplicationPermissionDeleteParams
- type RemoteApplicationPermissionInsertParams
- type RemoteApplicationUpsertParams
- type RemoteApplicationUpsertRow
- type RemoteApplicationsAllRow
- type RemoteApplicationsEnabledRow
- type ServiceTokenByKeyIDRow
- type ServiceTokenInsertParams
- type ServiceTokenInsertRow
- type ServiceTokenPermissionInsertParams
- type ServiceTokenPermissionsByTokenIDsRow
- type ServiceTokenResourceInsertParams
- type ServiceTokenResourcesByTokenIDRow
- type ServiceTokenResourcesByTokenIDsRow
- type ServiceTokenRevokeParams
- type ServiceTokensByOrgRow
- type SessionByCurrentTokenHashParams
- type SessionByCurrentTokenHashRow
- type SessionByPreviousTokenHashParams
- type SessionByPreviousTokenHashRow
- type SessionFreshSinceParams
- type SessionIDByCurrentTokenHashParams
- type SessionInsertParams
- type SessionInsertRow
- type SessionMarkAuthenticatedParams
- type SessionRevokeByIDForUserParams
- type SessionRevokeByIDParams
- type SessionRotateParams
- type SessionsCountActiveParams
- type SessionsEvictOldestParams
- type SessionsListByUserParams
- type SessionsListByUserRow
- type SessionsRevokeAllExceptParams
- type SessionsRevokeAllParams
- type SessionsRevokeAllQuietParams
- type SessionsRevokeFamilyRow
- type TwoFactorEnableParams
- type TwoFactorSetBackupCodesParams
- type UserApplyEmailChangeParams
- type UserApplyPhoneChangeParams
- type UserBanParams
- type UserByEmailRow
- type UserByIDRow
- type UserByPhoneRow
- type UserBySlugRow
- type UserBySlugViaRenameRow
- type UserByUsernameRow
- type UserEmailOrUsernameExistsParams
- type UserEmailOrUsernameTakenParams
- type UserEmailOrUsernameTakenRow
- type UserIDReservedByUsernameRow
- type UserImportInsertParams
- type UserImportUpdateParams
- type UserInsertParams
- type UserInsertRow
- type UserMetadataPatchParams
- type UserPasswordInsertParams
- type UserPasswordRowRow
- type UserPasswordUpsertParams
- type UserPhoneOrUsernameExistsParams
- type UserPhoneOrUsernameTakenParams
- type UserPhoneOrUsernameTakenRow
- type UserPreferredLocaleRow
- type UserProviderDeleteBySlugParams
- type UserProviderDeleteOtherSubjectsParams
- type UserProviderInsertSimpleParams
- type UserProviderLinkExistsParams
- type UserProviderMergeProfileParams
- type UserProviderSetUsernameParams
- type UserProviderSubjectByIssuerParams
- type UserProviderSubjectProfileByIssuerParams
- type UserProviderSubjectProfileByIssuerRow
- type UserProviderUpsertByIssuerParams
- type UserProviderUsernameParams
- type UserRenameInsertParams
- type UserSetBiographyParams
- type UserSetEmailAndUnverifyParams
- type UserSetEmailVerifiedParams
- type UserSetLastLoginParams
- type UserSetPhoneAndVerifiedParams
- type UserSetPhoneVerifiedByIDAndPhoneParams
- type UserSetPhoneVerifiedByIDParams
- type UserSetPreferredLocaleParams
- type UserSetReservedParams
- type UserSetUsernameParams
- type UsersPurgeCandidatesParams
Constants ¶
const DefaultSchema = "profiles"
DefaultSchema is the historical hard-coded schema name. All SQL in this package is written against it; ForSchema rewrites it when a host configures a different schema.
Variables ¶
This section is empty.
Functions ¶
func RewriteSQL ¶ added in v0.26.0
RewriteSQL returns sql with every literal "profiles." qualifier replaced by schema+".". Callers must have validated schema via ValidSchemaName.
func ValidSchemaName ¶ added in v0.26.0
ValidSchemaName reports whether s is acceptable as a configured schema name: lowercase snake_case identifier, at most 63 bytes (the Postgres identifier limit, so the name is never silently truncated server-side).
Types ¶
type DBTX ¶
type DBTX interface {
Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
Query(context.Context, string, ...interface{}) (pgx.Rows, error)
QueryRow(context.Context, string, ...interface{}) pgx.Row
}
func ForSchema ¶ added in v0.26.0
ForSchema wraps d so every statement executed through it has its "profiles." qualifiers rewritten to the given schema. For the default schema (or empty, meaning default) it returns d unchanged, so the default path has zero overhead. The per-call strings.ReplaceAll is negligible next to the network round trip and keeps the wrapper stateless, which matters because transaction-scoped wrappers are created per transaction.
type GlobalRoleUpsertParams ¶
type IdentityUserByIDRow ¶
type IdentityUsersByIDsRow ¶
type NamespaceOrgBySlugRow ¶ added in v0.30.0
type NamespaceOrgRenameBySlugRow ¶ added in v0.30.0
type NamespaceUserBySlugRow ¶
type OrgBySlugRow ¶ added in v0.30.0
type OrgBySlugViaRenameRow ¶ added in v0.30.0
type OrgIDPersonalBySlugRow ¶ added in v0.30.0
type OrgIDReservedBySlugRow ¶ added in v0.30.0
type OrgInsertParams ¶ added in v0.30.0
type OrgInsertRow ¶ added in v0.30.0
type OrgInsertWithStateParams ¶ added in v0.30.0
type OrgInviteForUpdateRow ¶ added in v0.30.0
type OrgInviteInsertParams ¶ added in v0.30.0
type OrgInviteInsertRow ¶ added in v0.30.0
type OrgInviteRevokeParams ¶ added in v0.30.0
type OrgInviteSetStatusParams ¶ added in v0.30.0
type OrgInvitesByOrgRow ¶ added in v0.30.0
type OrgInvitesByOrgStatusParams ¶ added in v0.30.0
type OrgInvitesByOrgStatusRow ¶ added in v0.30.0
type OrgInvitesByUserRow ¶ added in v0.30.0
type OrgInvitesByUserStatusParams ¶ added in v0.30.0
type OrgInvitesByUserStatusRow ¶ added in v0.30.0
type OrgMemberAddParams ¶ added in v0.30.0
type OrgMemberHasRoleParams ¶ added in v0.30.0
type OrgMemberRoleParams ¶ added in v0.30.0
type OrgMemberRolePrincipalParams ¶ added in v0.30.0
type OrgMemberSoftDeleteParams ¶ added in v0.30.0
type OrgMemberSoftDeletePrincipalParams ¶ added in v0.30.0
type OrgMembershipExistsParams ¶ added in v0.30.0
type OrgMembershipResetRoleParams ¶ added in v0.30.0
type OrgMembershipSetRoleParams ¶ added in v0.30.0
type OrgMembershipUpsertRoleParams ¶ added in v0.30.0
type OrgMembershipUpsertRolePrincipalParams ¶ added in v0.30.0
type OrgMetadataPatchParams ¶ added in v0.30.0
type OrgNamespaceStateByIDRow ¶ added in v0.30.0
type OrgRenameInsertParams ¶ added in v0.30.0
type OrgRoleDefineParams ¶ added in v0.30.0
type OrgRoleDeleteParams ¶ added in v0.30.0
type OrgRoleExistsParams ¶ added in v0.30.0
type OrgRoleHasPermissionsParams ¶ added in v0.30.0
type OrgRoleMemberCountParams ¶ added in v0.30.0
type OrgRolePermissionInsertParams ¶ added in v0.30.0
type OrgRolePermissionsDeleteParams ¶ added in v0.30.0
type OrgRolePermissionsParams ¶ added in v0.30.0
type OrgRolesForPrincipalParams ¶ added in v0.30.0
type OrgRolesForPrincipalRow ¶ added in v0.30.0
type OrgRolesSeedOwnerMemberParams ¶ added in v0.30.0
type OrgSetNamespaceStateParams ¶ added in v0.30.0
type OrgSetReservedParams ¶ added in v0.30.0
type OrgSlugAndPersonalByIDRow ¶ added in v0.30.0
type OrgUpdateSlugParams ¶ added in v0.30.0
type OrgUpdateSlugUnconditionalParams ¶ added in v0.30.0
type OwnerSlugOrgExistsParams ¶ added in v0.30.0
type OwnerSlugOrgRenameHeldParams ¶ added in v0.30.0
type PersonalOrgByOwnerRow ¶ added in v0.30.0
type PersonalOrgIDSlugByOwnerRow ¶ added in v0.30.0
type PersonalOrgIDSlugReservedByOwnerRow ¶ added in v0.30.0
type PersonalOrgInsertBasicParams ¶ added in v0.30.0
type PersonalOrgUpsertParams ¶ added in v0.30.0
type ProfilesGlobalRole ¶
type ProfilesGlobalUserRole ¶
type ProfilesOrg ¶ added in v0.30.0
type ProfilesOrgInvite ¶ added in v0.30.0
type ProfilesOrgMembership ¶ added in v0.30.0
type ProfilesOrgRename ¶ added in v0.30.0
type ProfilesOrgRole ¶ added in v0.30.0
type ProfilesOrgRolePermission ¶ added in v0.30.0
type ProfilesRefreshSession ¶
type ProfilesRemoteApplication ¶ added in v0.27.0
type ProfilesRemoteApplication struct {
ID string
Slug string
// Creator-audit only (nullable, SET NULL on user delete). Ownership lives in org_id.
OwnerUserID *string
Issuer string
JwksUri string
Mode string
PublicKeys []byte
Audiences []string
Enabled bool
Metadata []byte
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time
OrgID *string
}
Federation principals: external systems that authenticate by signing JWTs verified against their JWKS/public keys. Members of orgs with roles via polymorphic org_memberships.
type ProfilesRemoteApplicationAttributeDef ¶ added in v0.27.0
type ProfilesRemoteApplicationAttributeDef struct {
RemoteApplicationID string
Key string
Version int32
Definition []byte
CreatedAt time.Time
UpdatedAt time.Time
}
REFERENCE-mode attribute definitions: (remote_application_id, key, version) -> opaque definition jsonb. AuthKit transports + serves, never interprets (#75).
type ProfilesRemoteApplicationPermission ¶ added in v0.28.0
type ProfilesRemoteApplicationPermission struct {
RemoteApplicationID string
Permission string
CreatedAt time.Time
}
Direct permissions assigned to a remote_application principal (#76): STORED authority for the JWKS self-token, mirroring service_token_permissions. Opaque to AuthKit.
type ProfilesServiceToken ¶
type ProfilesTwoFactorSetting ¶
type ProfilesTwoFactorSetting struct {
UserID string
Enabled bool
// Preferred 2FA method: email or sms
Method string
PhoneNumber *string
// Hashed backup codes for account recovery (10 codes)
BackupCodes []string
CreatedAt time.Time
UpdatedAt time.Time
}
Two-factor authentication settings per user (admin accounts)
type ProfilesUser ¶
type ProfilesUser struct {
ID string
Email *string
Username *string
DiscordUsername *string
EmailVerified bool
// E.164 format phone number (e.g., +14155551234)
PhoneNumber *string
// Whether the phone number has been verified via SMS code
PhoneVerified *bool
// When the user was banned
BannedAt *time.Time
// When a temporary ban expires (NULL for permanent)
BannedUntil *time.Time
// Reason for ban
BanReason *string
// User ID of admin who imposed ban
BannedBy *string
DeletedAt *time.Time
Biography *string
// Arbitrary user metadata (internal/admin flags such as reserved)
Metadata []byte
CreatedAt time.Time
UpdatedAt time.Time
LastLogin *time.Time
// User communication/auth locale, e.g. en, es, de, ko, zh-CN
PreferredLocale *string
// Source of preferred_locale, e.g. registration or explicit
PreferredLocaleSource *string
// When preferred_locale was last set
PreferredLocaleUpdatedAt *time.Time
}
type ProfilesUserPassword ¶
type ProfilesUserProvider ¶
type ProfilesUserRename ¶
type ProviderLinkByIssuerRow ¶
type ProviderLinkBySlugRow ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) GlobalActiveAdminCount ¶
func (*Queries) GlobalAdminRoleIDForUpdate ¶
func (*Queries) GlobalRoleIDBySlug ¶
func (*Queries) GlobalRoleSlugsByUser ¶
Global (platform) role queries (core/service.go).
func (*Queries) GlobalRoleUpsert ¶
func (q *Queries) GlobalRoleUpsert(ctx context.Context, arg GlobalRoleUpsertParams) error
func (*Queries) GlobalUserHasActiveRole ¶
func (*Queries) GlobalUserRoleDelete ¶
func (*Queries) GlobalUserRoleDeleteBySlug ¶
func (*Queries) GlobalUserRoleExists ¶
func (*Queries) GlobalUserRoleInsert ¶
func (q *Queries) GlobalUserRoleInsert(ctx context.Context, arg GlobalUserRoleInsertParams) error
func (*Queries) IdentityCurrentOrgSlug ¶ added in v0.30.0
Rename-history forwarding (identity/renames.go).
func (*Queries) IdentityCurrentUsername ¶
func (*Queries) IdentityForwardOrgSlug ¶ added in v0.30.0
func (*Queries) IdentityForwardUsername ¶
func (*Queries) IdentityUpdateUserEmail ¶
func (q *Queries) IdentityUpdateUserEmail(ctx context.Context, arg IdentityUpdateUserEmailParams) error
func (*Queries) IdentityUpdateUserUsername ¶
func (q *Queries) IdentityUpdateUserUsername(ctx context.Context, arg IdentityUpdateUserUsernameParams) error
func (*Queries) IdentityUserByID ¶
func (*Queries) IdentityUserIDByUsername ¶
func (*Queries) IdentityUsersByIDs ¶
func (q *Queries) IdentityUsersByIDs(ctx context.Context, ids []string) ([]IdentityUsersByIDsRow, error)
Identity store queries (identity package).
func (*Queries) NamespaceOrgBySlug ¶ added in v0.30.0
func (*Queries) NamespaceOrgRenameBySlug ¶ added in v0.30.0
func (*Queries) NamespaceUserBySlug ¶
func (q *Queries) NamespaceUserBySlug(ctx context.Context, username *string) (NamespaceUserBySlugRow, error)
Namespace lookup probes (core/owner_namespace_lookup.go). These read soft- deleted rows on purpose (deleted_at IS NOT NULL surfaces as a flag).
func (*Queries) NamespaceUserRenameBySlug ¶
func (*Queries) OrgAliases ¶ added in v0.30.0
func (*Queries) OrgBySlug ¶ added in v0.30.0
Org + membership + role queries (core/service_orgs.go).
func (*Queries) OrgBySlugViaRename ¶ added in v0.30.0
func (q *Queries) OrgBySlugViaRename(ctx context.Context, fromSlug string) (OrgBySlugViaRenameRow, error)
OrgBySlugViaRename resolves a historical slug (issue #58). The org_renames row's org_id always points at the live owner, so any historical slug resolves to the org currently holding it; most recent row wins (hard-delete + reuse).
func (*Queries) OrgDefinedRoles ¶ added in v0.30.0
func (*Queries) OrgIDPersonalBySlug ¶ added in v0.30.0
func (*Queries) OrgIDReservedBySlug ¶ added in v0.30.0
func (*Queries) OrgInsert ¶ added in v0.30.0
func (q *Queries) OrgInsert(ctx context.Context, arg OrgInsertParams) (OrgInsertRow, error)
func (*Queries) OrgInsertWithState ¶ added in v0.30.0
func (*Queries) OrgInviteForUpdate ¶ added in v0.30.0
func (*Queries) OrgInviteInsert ¶ added in v0.30.0
func (q *Queries) OrgInviteInsert(ctx context.Context, arg OrgInviteInsertParams) (OrgInviteInsertRow, error)
Org invite queries (core/service_org_invites.go).
func (*Queries) OrgInviteMarkExpired ¶ added in v0.30.0
func (*Queries) OrgInviteRevoke ¶ added in v0.30.0
func (*Queries) OrgInviteSetStatus ¶ added in v0.30.0
func (q *Queries) OrgInviteSetStatus(ctx context.Context, arg OrgInviteSetStatusParams) error
func (*Queries) OrgInvitesByOrg ¶ added in v0.30.0
func (*Queries) OrgInvitesByOrgStatus ¶ added in v0.30.0
func (q *Queries) OrgInvitesByOrgStatus(ctx context.Context, arg OrgInvitesByOrgStatusParams) ([]OrgInvitesByOrgStatusRow, error)
func (*Queries) OrgInvitesByUser ¶ added in v0.30.0
func (*Queries) OrgInvitesByUserStatus ¶ added in v0.30.0
func (q *Queries) OrgInvitesByUserStatus(ctx context.Context, arg OrgInvitesByUserStatusParams) ([]OrgInvitesByUserStatusRow, error)
func (*Queries) OrgLastRenamedAt ¶ added in v0.30.0
func (*Queries) OrgMemberAdd ¶ added in v0.30.0
func (q *Queries) OrgMemberAdd(ctx context.Context, arg OrgMemberAddParams) error
OrgMemberAdd intentionally does NOT change role on conflict (re-adding an existing member only revives a soft-deleted row).
func (*Queries) OrgMemberHasRole ¶ added in v0.30.0
func (*Queries) OrgMemberIDs ¶ added in v0.30.0
func (*Queries) OrgMemberRole ¶ added in v0.30.0
func (*Queries) OrgMemberRolePrincipal ¶ added in v0.30.0
func (*Queries) OrgMemberSoftDelete ¶ added in v0.30.0
func (q *Queries) OrgMemberSoftDelete(ctx context.Context, arg OrgMemberSoftDeleteParams) error
func (*Queries) OrgMemberSoftDeletePrincipal ¶ added in v0.30.0
func (q *Queries) OrgMemberSoftDeletePrincipal(ctx context.Context, arg OrgMemberSoftDeletePrincipalParams) error
func (*Queries) OrgMembershipExists ¶ added in v0.30.0
func (*Queries) OrgMembershipResetRole ¶ added in v0.30.0
func (q *Queries) OrgMembershipResetRole(ctx context.Context, arg OrgMembershipResetRoleParams) error
func (*Queries) OrgMembershipSetRole ¶ added in v0.30.0
func (q *Queries) OrgMembershipSetRole(ctx context.Context, arg OrgMembershipSetRoleParams) error
func (*Queries) OrgMembershipUpsertRole ¶ added in v0.30.0
func (q *Queries) OrgMembershipUpsertRole(ctx context.Context, arg OrgMembershipUpsertRoleParams) error
func (*Queries) OrgMembershipUpsertRolePrincipal ¶ added in v0.30.0
func (q *Queries) OrgMembershipUpsertRolePrincipal(ctx context.Context, arg OrgMembershipUpsertRolePrincipalParams) error
Polymorphic remote_application memberships: a remote_app holds org roles via the SAME org_memberships/org_roles machinery as users (#74).
func (*Queries) OrgMetadata ¶ added in v0.30.0
func (*Queries) OrgMetadataPatch ¶ added in v0.30.0
func (*Queries) OrgNamespaceStateByID ¶ added in v0.30.0
func (*Queries) OrgRenameInsert ¶ added in v0.30.0
func (q *Queries) OrgRenameInsert(ctx context.Context, arg OrgRenameInsertParams) error
func (*Queries) OrgRoleDefine ¶ added in v0.30.0
func (q *Queries) OrgRoleDefine(ctx context.Context, arg OrgRoleDefineParams) error
func (*Queries) OrgRoleDelete ¶ added in v0.30.0
func (q *Queries) OrgRoleDelete(ctx context.Context, arg OrgRoleDeleteParams) error
func (*Queries) OrgRoleExists ¶ added in v0.30.0
func (*Queries) OrgRoleHasPermissions ¶ added in v0.30.0
func (*Queries) OrgRoleMemberCount ¶ added in v0.30.0
func (*Queries) OrgRolePermissionInsert ¶ added in v0.30.0
func (q *Queries) OrgRolePermissionInsert(ctx context.Context, arg OrgRolePermissionInsertParams) error
func (*Queries) OrgRolePermissions ¶ added in v0.30.0
func (q *Queries) OrgRolePermissions(ctx context.Context, arg OrgRolePermissionsParams) ([]string, error)
Org RBAC role-permission queries (core/org_role_permissions.go).
func (*Queries) OrgRolePermissionsDelete ¶ added in v0.30.0
func (q *Queries) OrgRolePermissionsDelete(ctx context.Context, arg OrgRolePermissionsDeleteParams) error
func (*Queries) OrgRolesForPrincipal ¶ added in v0.30.0
func (q *Queries) OrgRolesForPrincipal(ctx context.Context, arg OrgRolesForPrincipalParams) ([]OrgRolesForPrincipalRow, error)
func (*Queries) OrgRolesSeedOwnerMember ¶ added in v0.30.0
func (q *Queries) OrgRolesSeedOwnerMember(ctx context.Context, arg OrgRolesSeedOwnerMemberParams) error
func (*Queries) OrgSetNamespaceState ¶ added in v0.30.0
func (*Queries) OrgSetReserved ¶ added in v0.30.0
func (q *Queries) OrgSetReserved(ctx context.Context, arg OrgSetReservedParams) error
func (*Queries) OrgSlugAndPersonalByID ¶ added in v0.30.0
func (*Queries) OrgSlugsByUser ¶ added in v0.30.0
func (*Queries) OrgUpdateSlug ¶ added in v0.30.0
func (q *Queries) OrgUpdateSlug(ctx context.Context, arg OrgUpdateSlugParams) error
func (*Queries) OrgUpdateSlugUnconditional ¶ added in v0.30.0
func (q *Queries) OrgUpdateSlugUnconditional(ctx context.Context, arg OrgUpdateSlugUnconditionalParams) error
OrgUpdateSlugUnconditional intentionally has no deleted_at filter — it rides the user-rename transaction in updateUsernameImpl.
func (*Queries) OwnerReservedNameDelete ¶
func (*Queries) OwnerReservedNameExists ¶
Owner-namespace queries (core/service_owner_namespace*.go, core/owner_namespace_lookup.go).
func (*Queries) OwnerReservedNameUpsert ¶
func (*Queries) OwnerSlugConflictExists ¶
func (q *Queries) OwnerSlugConflictExists(ctx context.Context, arg OwnerSlugConflictExistsParams) (bool, error)
Recent rename history blocks reuse without a separate hold table. Joins to owner rows without filtering soft deletes: soft deletion keeps the namespace held, while hard deletion removes/cascades the owner row and allows eventual reuse.
func (*Queries) OwnerSlugOrgExists ¶ added in v0.30.0
func (*Queries) OwnerSlugOrgRenameHeld ¶ added in v0.30.0
func (*Queries) OwnerSlugUserExists ¶
func (q *Queries) OwnerSlugUserExists(ctx context.Context, arg OwnerSlugUserExistsParams) (bool, error)
Slug-availability probes (core/service_owner_namespace.go ownerSlugAvailable).
func (*Queries) OwnerSlugUserRenameHeld ¶
func (*Queries) PersonalOrgByOwner ¶ added in v0.30.0
func (*Queries) PersonalOrgIDSlugByOwner ¶ added in v0.30.0
func (*Queries) PersonalOrgIDSlugReservedByOwner ¶ added in v0.30.0
func (*Queries) PersonalOrgInsertBasic ¶ added in v0.30.0
func (q *Queries) PersonalOrgInsertBasic(ctx context.Context, arg PersonalOrgInsertBasicParams) error
func (*Queries) PersonalOrgUpsert ¶ added in v0.30.0
func (*Queries) ProviderLinkByIssuer ¶
func (q *Queries) ProviderLinkByIssuer(ctx context.Context, arg ProviderLinkByIssuerParams) (ProviderLinkByIssuerRow, error)
func (*Queries) ProviderLinkBySlug ¶
func (q *Queries) ProviderLinkBySlug(ctx context.Context, arg ProviderLinkBySlugParams) (ProviderLinkBySlugRow, error)
func (*Queries) RemoteAppAttributeDefDelete ¶ added in v0.27.0
func (*Queries) RemoteAppAttributeDefGet ¶ added in v0.27.0
func (q *Queries) RemoteAppAttributeDefGet(ctx context.Context, arg RemoteAppAttributeDefGetParams) (RemoteAppAttributeDefGetRow, error)
func (*Queries) RemoteAppAttributeDefGetLatest ¶ added in v0.27.0
func (q *Queries) RemoteAppAttributeDefGetLatest(ctx context.Context, arg RemoteAppAttributeDefGetLatestParams) (RemoteAppAttributeDefGetLatestRow, error)
func (*Queries) RemoteAppAttributeDefUpsert ¶ added in v0.27.0
func (q *Queries) RemoteAppAttributeDefUpsert(ctx context.Context, arg RemoteAppAttributeDefUpsertParams) (RemoteAppAttributeDefUpsertRow, error)
Attribute definition registry (#75): REFERENCE-mode opaque definitions.
func (*Queries) RemoteAppAttributeDefsList ¶ added in v0.27.0
func (*Queries) RemoteApplicationByIssuer ¶ added in v0.27.0
func (*Queries) RemoteApplicationBySlug ¶ added in v0.27.0
func (*Queries) RemoteApplicationDelete ¶ added in v0.27.0
func (*Queries) RemoteApplicationPermissionDelete ¶ added in v0.28.0
func (*Queries) RemoteApplicationPermissionInsert ¶ added in v0.28.0
func (q *Queries) RemoteApplicationPermissionInsert(ctx context.Context, arg RemoteApplicationPermissionInsertParams) error
Remote application direct-permission grants (core/remote_application_permissions.go, #76). STORED authority for a JWKS principal acting as itself; mirrors the service_token_permissions grant.
func (*Queries) RemoteApplicationPermissions ¶ added in v0.28.0
func (*Queries) RemoteApplicationUpsert ¶ added in v0.27.0
func (q *Queries) RemoteApplicationUpsert(ctx context.Context, arg RemoteApplicationUpsertParams) (RemoteApplicationUpsertRow, error)
Remote application registry (core/service_remote_applications.go). A remote_application is the federation PRINCIPAL: it authenticates by signing JWTs verified against its JWKS/public keys (#74).
func (*Queries) RemoteApplicationsAll ¶ added in v0.27.0
func (q *Queries) RemoteApplicationsAll(ctx context.Context) ([]RemoteApplicationsAllRow, error)
func (*Queries) RemoteApplicationsEnabled ¶ added in v0.27.0
func (q *Queries) RemoteApplicationsEnabled(ctx context.Context) ([]RemoteApplicationsEnabledRow, error)
func (*Queries) ServiceTokenByKeyID ¶
func (*Queries) ServiceTokenInsert ¶
func (q *Queries) ServiceTokenInsert(ctx context.Context, arg ServiceTokenInsertParams) (ServiceTokenInsertRow, error)
Service token queries (core/service_tokens.go).
func (*Queries) ServiceTokenPermissionInsert ¶
func (q *Queries) ServiceTokenPermissionInsert(ctx context.Context, arg ServiceTokenPermissionInsertParams) error
func (*Queries) ServiceTokenPermissionsByTokenID ¶
func (*Queries) ServiceTokenPermissionsByTokenIDs ¶
func (*Queries) ServiceTokenResourceInsert ¶
func (q *Queries) ServiceTokenResourceInsert(ctx context.Context, arg ServiceTokenResourceInsertParams) error
func (*Queries) ServiceTokenResourcesByTokenID ¶
func (*Queries) ServiceTokenResourcesByTokenIDs ¶
func (*Queries) ServiceTokenRevoke ¶
func (*Queries) ServiceTokenTouchLastUsed ¶
func (*Queries) ServiceTokensByOrg ¶ added in v0.30.0
func (*Queries) SessionByCurrentTokenHash ¶
func (q *Queries) SessionByCurrentTokenHash(ctx context.Context, arg SessionByCurrentTokenHashParams) (SessionByCurrentTokenHashRow, error)
func (*Queries) SessionByPreviousTokenHash ¶
func (q *Queries) SessionByPreviousTokenHash(ctx context.Context, arg SessionByPreviousTokenHashParams) (SessionByPreviousTokenHashRow, error)
func (*Queries) SessionFreshSince ¶
func (*Queries) SessionIDByCurrentTokenHash ¶
func (*Queries) SessionInsert ¶
func (q *Queries) SessionInsert(ctx context.Context, arg SessionInsertParams) (SessionInsertRow, error)
Refresh-session queries (core/service_sessions.go).
func (*Queries) SessionMarkAuthenticated ¶
func (*Queries) SessionRevokeByID ¶
func (*Queries) SessionRevokeByIDForUser ¶
func (*Queries) SessionRotate ¶
func (q *Queries) SessionRotate(ctx context.Context, arg SessionRotateParams) error
func (*Queries) SessionsCountActive ¶
func (*Queries) SessionsDeleteRevokedOrExpired ¶
func (*Queries) SessionsEvictOldest ¶
func (*Queries) SessionsListByUser ¶
func (q *Queries) SessionsListByUser(ctx context.Context, arg SessionsListByUserParams) ([]SessionsListByUserRow, error)
func (*Queries) SessionsRevokeAll ¶
func (*Queries) SessionsRevokeAllExcept ¶
func (*Queries) SessionsRevokeAllQuiet ¶
func (q *Queries) SessionsRevokeAllQuiet(ctx context.Context, arg SessionsRevokeAllQuietParams) error
SessionsRevokeAllQuiet is AdminDeleteUser's pre-delete sweep; unlike SessionsRevokeAll it returns nothing (no per-session revoke logging).
func (*Queries) SessionsRevokeFamily ¶
func (*Queries) TwoFactorDisable ¶
func (*Queries) TwoFactorEnable ¶
func (q *Queries) TwoFactorEnable(ctx context.Context, arg TwoFactorEnableParams) error
Two-factor settings queries (core/service.go).
func (*Queries) TwoFactorSetBackupCodes ¶
func (q *Queries) TwoFactorSetBackupCodes(ctx context.Context, arg TwoFactorSetBackupCodesParams) error
func (*Queries) TwoFactorSettingsByUser ¶
func (*Queries) UserApplyEmailChange ¶
func (q *Queries) UserApplyEmailChange(ctx context.Context, arg UserApplyEmailChangeParams) error
func (*Queries) UserApplyPhoneChange ¶
func (q *Queries) UserApplyPhoneChange(ctx context.Context, arg UserApplyPhoneChangeParams) error
func (*Queries) UserByEmail ¶
func (*Queries) UserByPhone ¶
func (*Queries) UserBySlug ¶
func (*Queries) UserBySlugViaRename ¶
func (q *Queries) UserBySlugViaRename(ctx context.Context, fromSlug string) (UserBySlugViaRenameRow, error)
Fallback to renames table (issue #58). Most-recent rename wins when a slug has been used by multiple users at different times (only possible after hard-delete + reuse).
func (*Queries) UserByUsername ¶
func (*Queries) UserClearLoginIdentifiers ¶
func (*Queries) UserDeleteHard ¶
func (*Queries) UserDiscordUsername ¶
func (*Queries) UserEmailByID ¶
User-row queries (core/service.go).
func (*Queries) UserEmailOrUsernameExists ¶
func (*Queries) UserEmailOrUsernameTaken ¶
func (q *Queries) UserEmailOrUsernameTaken(ctx context.Context, arg UserEmailOrUsernameTakenParams) (UserEmailOrUsernameTakenRow, error)
func (*Queries) UserHasPassword ¶
func (*Queries) UserIDReservedByUsername ¶
func (*Queries) UserImportInsert ¶
func (q *Queries) UserImportInsert(ctx context.Context, arg UserImportInsertParams) error
func (*Queries) UserImportUpdate ¶
func (*Queries) UserInsert ¶
func (q *Queries) UserInsert(ctx context.Context, arg UserInsertParams) (UserInsertRow, error)
func (*Queries) UserIsReserved ¶
func (*Queries) UserLastRenamedAt ¶
func (*Queries) UserMetadata ¶
func (*Queries) UserMetadataPatch ¶
func (*Queries) UserPasswordDelete ¶
func (*Queries) UserPasswordInsert ¶
func (q *Queries) UserPasswordInsert(ctx context.Context, arg UserPasswordInsertParams) error
func (*Queries) UserPasswordRow ¶
func (*Queries) UserPasswordUpsert ¶
func (q *Queries) UserPasswordUpsert(ctx context.Context, arg UserPasswordUpsertParams) error
func (*Queries) UserPhoneOrUsernameExists ¶
func (*Queries) UserPhoneOrUsernameTaken ¶
func (q *Queries) UserPhoneOrUsernameTaken(ctx context.Context, arg UserPhoneOrUsernameTakenParams) (UserPhoneOrUsernameTakenRow, error)
func (*Queries) UserPreferredLocale ¶
func (*Queries) UserProviderDeleteBySlug ¶
func (q *Queries) UserProviderDeleteBySlug(ctx context.Context, arg UserProviderDeleteBySlugParams) error
func (*Queries) UserProviderDeleteOtherSubjects ¶
func (q *Queries) UserProviderDeleteOtherSubjects(ctx context.Context, arg UserProviderDeleteOtherSubjectsParams) error
func (*Queries) UserProviderInsertSimple ¶
func (q *Queries) UserProviderInsertSimple(ctx context.Context, arg UserProviderInsertSimpleParams) error
func (*Queries) UserProviderLinkExists ¶
func (q *Queries) UserProviderLinkExists(ctx context.Context, arg UserProviderLinkExistsParams) (bool, error)
HTTP-layer provider lookups (http/reauth.go, http/user_me_get.go).
func (*Queries) UserProviderMergeProfile ¶
func (q *Queries) UserProviderMergeProfile(ctx context.Context, arg UserProviderMergeProfileParams) error
func (*Queries) UserProviderSetUsername ¶
func (q *Queries) UserProviderSetUsername(ctx context.Context, arg UserProviderSetUsernameParams) error
func (*Queries) UserProviderSlugs ¶
func (*Queries) UserProviderSlugsDistinct ¶
func (*Queries) UserProviderSubjectByIssuer ¶
func (*Queries) UserProviderSubjectProfileByIssuer ¶
func (q *Queries) UserProviderSubjectProfileByIssuer(ctx context.Context, arg UserProviderSubjectProfileByIssuerParams) (UserProviderSubjectProfileByIssuerRow, error)
func (*Queries) UserProviderUpsertByIssuer ¶
func (q *Queries) UserProviderUpsertByIssuer(ctx context.Context, arg UserProviderUpsertByIssuerParams) error
func (*Queries) UserProviderUsername ¶
func (*Queries) UserProvidersCount ¶
Provider-link queries (core/service.go).
func (*Queries) UserProvidersDeleteByUser ¶
func (*Queries) UserRenameInsert ¶
func (q *Queries) UserRenameInsert(ctx context.Context, arg UserRenameInsertParams) error
func (*Queries) UserSetBiography ¶
func (q *Queries) UserSetBiography(ctx context.Context, arg UserSetBiographyParams) error
func (*Queries) UserSetEmailAndUnverify ¶
func (q *Queries) UserSetEmailAndUnverify(ctx context.Context, arg UserSetEmailAndUnverifyParams) error
func (*Queries) UserSetEmailVerified ¶
func (q *Queries) UserSetEmailVerified(ctx context.Context, arg UserSetEmailVerifiedParams) error
func (*Queries) UserSetLastLogin ¶
func (q *Queries) UserSetLastLogin(ctx context.Context, arg UserSetLastLoginParams) error
func (*Queries) UserSetPhoneAndVerified ¶
func (q *Queries) UserSetPhoneAndVerified(ctx context.Context, arg UserSetPhoneAndVerifiedParams) error
func (*Queries) UserSetPhoneVerifiedByID ¶
func (q *Queries) UserSetPhoneVerifiedByID(ctx context.Context, arg UserSetPhoneVerifiedByIDParams) error
func (*Queries) UserSetPhoneVerifiedByIDAndPhone ¶
func (q *Queries) UserSetPhoneVerifiedByIDAndPhone(ctx context.Context, arg UserSetPhoneVerifiedByIDAndPhoneParams) error
func (*Queries) UserSetPreferredLocale ¶
func (q *Queries) UserSetPreferredLocale(ctx context.Context, arg UserSetPreferredLocaleParams) error
func (*Queries) UserSetReserved ¶
func (q *Queries) UserSetReserved(ctx context.Context, arg UserSetReservedParams) error
Reserved-account + metadata queries (core/service_reserved_accounts.go).
func (*Queries) UserSetUsername ¶
func (q *Queries) UserSetUsername(ctx context.Context, arg UserSetUsernameParams) error
func (*Queries) UserSlugAliases ¶
func (*Queries) UserSoftDelete ¶
func (*Queries) UserUsernameByID ¶
func (*Queries) UserUsernameExists ¶
func (*Queries) UsersPurgeCandidates ¶
type RemoteAppAttributeDefDeleteParams ¶ added in v0.27.0
type RemoteAppAttributeDefGetLatestParams ¶ added in v0.27.0
type RemoteAppAttributeDefGetLatestRow ¶ added in v0.27.0
type RemoteAppAttributeDefGetParams ¶ added in v0.27.0
type RemoteAppAttributeDefGetRow ¶ added in v0.27.0
type RemoteAppAttributeDefUpsertParams ¶ added in v0.27.0
type RemoteAppAttributeDefUpsertRow ¶ added in v0.27.0
type RemoteAppAttributeDefsListRow ¶ added in v0.27.0
type RemoteApplicationByIssuerRow ¶ added in v0.27.0
type RemoteApplicationBySlugRow ¶ added in v0.27.0
type RemoteApplicationPermissionDeleteParams ¶ added in v0.28.0
type RemoteApplicationPermissionInsertParams ¶ added in v0.28.0
type RemoteApplicationUpsertParams ¶ added in v0.27.0
type RemoteApplicationUpsertRow ¶ added in v0.27.0
type RemoteApplicationsAllRow ¶ added in v0.27.0
type RemoteApplicationsEnabledRow ¶ added in v0.27.0
type ServiceTokenByKeyIDRow ¶
type ServiceTokenInsertRow ¶
type ServiceTokensByOrgRow ¶ added in v0.30.0
type SessionFreshSinceParams ¶
type SessionInsertParams ¶
type SessionInsertRow ¶
type SessionRevokeByIDParams ¶
type SessionRotateParams ¶
type SessionsListByUserRow ¶
type SessionsRevokeAllParams ¶
type SessionsRevokeFamilyRow ¶
type TwoFactorEnableParams ¶
type UserBanParams ¶
type UserByEmailRow ¶
type UserByEmailRow struct {
ID string
Email *string
PhoneNumber *string
Username *string
DiscordUsername *string
EmailVerified bool
PhoneVerified bool
BannedAt *time.Time
BannedUntil *time.Time
BanReason *string
BannedBy *string
DeletedAt *time.Time
Biography *string
CreatedAt time.Time
UpdatedAt time.Time
LastLogin *time.Time
}
type UserByIDRow ¶
type UserByIDRow struct {
ID string
Email *string
PhoneNumber *string
Username *string
DiscordUsername *string
EmailVerified bool
PhoneVerified bool
BannedAt *time.Time
BannedUntil *time.Time
BanReason *string
BannedBy *string
DeletedAt *time.Time
Biography *string
CreatedAt time.Time
UpdatedAt time.Time
LastLogin *time.Time
}
type UserByPhoneRow ¶
type UserByPhoneRow struct {
ID string
Email *string
PhoneNumber *string
Username *string
DiscordUsername *string
EmailVerified bool
PhoneVerified bool
BannedAt *time.Time
BannedUntil *time.Time
BanReason *string
BannedBy *string
DeletedAt *time.Time
Biography *string
CreatedAt time.Time
UpdatedAt time.Time
LastLogin *time.Time
}
type UserBySlugRow ¶
type UserBySlugViaRenameRow ¶
type UserByUsernameRow ¶
type UserByUsernameRow struct {
ID string
Email *string
PhoneNumber *string
Username *string
DiscordUsername *string
EmailVerified bool
PhoneVerified bool
BannedAt *time.Time
BannedUntil *time.Time
BanReason *string
BannedBy *string
DeletedAt *time.Time
Biography *string
CreatedAt time.Time
UpdatedAt time.Time
LastLogin *time.Time
}