Documentation
¶
Overview ¶
Package id defines TypeID-based identity types for all AuthSome entities.
Every entity in AuthSome uses a single ID struct with a prefix that identifies the entity type. IDs are K-sortable (UUIDv7-based), globally unique, and URL-safe in the format "prefix_suffix".
Index ¶
- type APIKeyID
- type AgentGrantID
- type AgentID
- type AnyID
- type AppClientConfigID
- type AppID
- type AppSessionConfigID
- type AuthCodeID
- type BrandingConfigID
- type ConsentID
- type DelegationID
- type DeviceCodeID
- type DeviceID
- type EnvironmentID
- type FormConfigID
- type ID
- func MustParse(s string) ID
- func MustParseWithPrefix(s string, expected Prefix) ID
- func New(prefix Prefix) ID
- func NewAPIKeyID() ID
- func NewAgentGrantID() ID
- func NewAgentID() ID
- func NewAppClientConfigID() ID
- func NewAppID() ID
- func NewAppSessionConfigID() ID
- func NewAuthCodeID() ID
- func NewBrandingConfigID() ID
- func NewConsentID() ID
- func NewDelegationID() ID
- func NewDeviceCodeID() ID
- func NewDeviceID() ID
- func NewEnvironmentID() ID
- func NewFormConfigID() ID
- func NewInvitationID() ID
- func NewMFAID() ID
- func NewMemberID() ID
- func NewNotificationID() ID
- func NewOAuth2ClientID() ID
- func NewOAuth2GrantID() ID
- func NewOAuthConnectionID() ID
- func NewOrgID() ID
- func NewPasskeyID() ID
- func NewPasswordResetID() ID
- func NewPermissionID() ID
- func NewRecoveryCodeID() ID
- func NewRetentionJobID() ID
- func NewRetentionRefID() ID
- func NewRoleID() ID
- func NewSCIMConfigID() ID
- func NewSCIMLogID() ID
- func NewSCIMTokenID() ID
- func NewSSFEventID() ID
- func NewSSFLinkID() ID
- func NewSSFSignalID() ID
- func NewSSFStreamID() ID
- func NewSSOConnectionID() ID
- func NewServiceAccountID() ID
- func NewSessionFamilyID() ID
- func NewSessionID() ID
- func NewSettingID() ID
- func NewTeamID() ID
- func NewUserEmailID() ID
- func NewUserID() ID
- func NewVerificationID() ID
- func NewWaitlistID() ID
- func NewWebhookID() ID
- func Parse(s string) (ID, error)
- func ParseAPIKeyID(s string) (ID, error)
- func ParseAgentGrantID(s string) (ID, error)
- func ParseAgentID(s string) (ID, error)
- func ParseAny(s string) (ID, error)
- func ParseAppClientConfigID(s string) (ID, error)
- func ParseAppID(s string) (ID, error)
- func ParseAppSessionConfigID(s string) (ID, error)
- func ParseAuthCodeID(s string) (ID, error)
- func ParseBrandingConfigID(s string) (ID, error)
- func ParseConsentID(s string) (ID, error)
- func ParseDelegationID(s string) (ID, error)
- func ParseDeviceCodeID(s string) (ID, error)
- func ParseDeviceID(s string) (ID, error)
- func ParseEnvironmentID(s string) (ID, error)
- func ParseFormConfigID(s string) (ID, error)
- func ParseInvitationID(s string) (ID, error)
- func ParseMFAID(s string) (ID, error)
- func ParseMemberID(s string) (ID, error)
- func ParseNotificationID(s string) (ID, error)
- func ParseOAuth2ClientID(s string) (ID, error)
- func ParseOAuth2GrantID(s string) (ID, error)
- func ParseOAuthConnectionID(s string) (ID, error)
- func ParseOrgID(s string) (ID, error)
- func ParsePasskeyID(s string) (ID, error)
- func ParsePasswordResetID(s string) (ID, error)
- func ParsePermissionID(s string) (ID, error)
- func ParseRecoveryCodeID(s string) (ID, error)
- func ParseRetentionJobID(s string) (ID, error)
- func ParseRetentionRefID(s string) (ID, error)
- func ParseRoleID(s string) (ID, error)
- func ParseSCIMConfigID(s string) (ID, error)
- func ParseSCIMLogID(s string) (ID, error)
- func ParseSCIMTokenID(s string) (ID, error)
- func ParseSSOConnectionID(s string) (ID, error)
- func ParseServiceAccountID(s string) (ID, error)
- func ParseSessionFamilyID(s string) (ID, error)
- func ParseSessionID(s string) (ID, error)
- func ParseSettingID(s string) (ID, error)
- func ParseTeamID(s string) (ID, error)
- func ParseUserEmailID(s string) (ID, error)
- func ParseUserID(s string) (ID, error)
- func ParseVerificationID(s string) (ID, error)
- func ParseWaitlistID(s string) (ID, error)
- func ParseWebhookID(s string) (ID, error)
- func ParseWithPrefix(s string, expected Prefix) (ID, error)
- func (i ID) IsNil() bool
- func (i ID) MarshalBSONValue() (bsonType byte, data []byte, err error)
- func (i ID) MarshalText() ([]byte, error)
- func (i ID) Prefix() Prefix
- func (i *ID) Scan(src any) error
- func (i ID) String() string
- func (i *ID) UnmarshalBSONValue(t byte, data []byte) error
- func (i *ID) UnmarshalText(data []byte) error
- func (i ID) Value() (driver.Value, error)
- type InvitationID
- type MFAID
- type MemberID
- type NotificationID
- type OAuth2ClientID
- type OAuth2GrantID
- type OAuthConnectionID
- type OrgID
- type PasskeyID
- type PasswordResetID
- type PermissionID
- type Prefix
- type RecoveryCodeID
- type RetentionJobID
- type RetentionRefID
- type RoleID
- type SCIMConfigID
- type SCIMLogID
- type SCIMTokenID
- type SSFEventID
- type SSFLinkID
- type SSFSignalID
- type SSFStreamID
- type SSOConnectionID
- type ServiceAccountID
- type SessionFamilyID
- type SessionID
- type SettingID
- type TeamID
- type UserEmailID
- type UserID
- type VerificationID
- type WaitlistID
- type WebhookID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeyID ¶
type APIKeyID = ID
APIKeyID is a type-safe identifier for API keys (prefix: "akey").
type AgentGrantID ¶
type AgentGrantID = ID
AgentGrantID is a type-safe identifier for agent grants (prefix: "aagr").
type AppClientConfigID ¶
type AppClientConfigID = ID
AppClientConfigID is a type-safe identifier for app client configs (prefix: "aacf").
type AppSessionConfigID ¶
type AppSessionConfigID = ID
AppSessionConfigID is a type-safe identifier for app session configs (prefix: "ascf").
type AuthCodeID ¶
type AuthCodeID = ID
AuthCodeID is a type-safe identifier for authorization codes (prefix: "aaco").
type BrandingConfigID ¶
type BrandingConfigID = ID
BrandingConfigID is a type-safe identifier for branding configurations (prefix: "abrd").
type ConsentID ¶
type ConsentID = ID
ConsentID is a type-safe identifier for consent records (prefix: "acns").
type DelegationID ¶
type DelegationID = ID
DelegationID is a type-safe identifier for delegation grants (prefix: "adel"). A delegation records that one principal may act on behalf of another.
type DeviceCodeID ¶
type DeviceCodeID = ID
DeviceCodeID is a type-safe identifier for OAuth2 device codes (prefix: "advc").
type EnvironmentID ¶
type EnvironmentID = ID
EnvironmentID is a type-safe identifier for environments (prefix: "aenv").
type FormConfigID ¶
type FormConfigID = ID
FormConfigID is a type-safe identifier for form configurations (prefix: "afcf").
type ID ¶
type ID struct {
// contains filtered or unexported fields
}
ID is the primary identifier type for all AuthSome entities. It wraps a TypeID providing a prefix-qualified, globally unique, sortable, URL-safe identifier in the format "prefix_suffix".
var Nil ID
Nil is the zero-value ID.
func MustParseWithPrefix ¶
MustParseWithPrefix is like ParseWithPrefix but panics on error.
func New ¶
New generates a new globally unique ID with the given prefix. It panics if prefix is not a valid TypeID prefix (programming error).
func NewAgentGrantID ¶
func NewAgentGrantID() ID
NewAgentGrantID generates a new unique agent grant ID.
func NewAppClientConfigID ¶
func NewAppClientConfigID() ID
NewAppClientConfigID generates a new unique app client config ID.
func NewAppSessionConfigID ¶
func NewAppSessionConfigID() ID
NewAppSessionConfigID generates a new unique app session config ID.
func NewAuthCodeID ¶
func NewAuthCodeID() ID
NewAuthCodeID generates a new unique authorization code ID.
func NewBrandingConfigID ¶
func NewBrandingConfigID() ID
NewBrandingConfigID generates a new unique branding config ID.
func NewDelegationID ¶
func NewDelegationID() ID
NewDelegationID generates a new unique delegation ID.
func NewDeviceCodeID ¶
func NewDeviceCodeID() ID
NewDeviceCodeID generates a new unique device code ID.
func NewEnvironmentID ¶
func NewEnvironmentID() ID
NewEnvironmentID generates a new unique environment ID.
func NewFormConfigID ¶
func NewFormConfigID() ID
NewFormConfigID generates a new unique form config ID.
func NewInvitationID ¶
func NewInvitationID() ID
NewInvitationID generates a new unique invitation ID.
func NewNotificationID ¶
func NewNotificationID() ID
NewNotificationID generates a new unique notification ID.
func NewOAuth2ClientID ¶
func NewOAuth2ClientID() ID
NewOAuth2ClientID generates a new unique OAuth2 client ID.
func NewOAuth2GrantID ¶
func NewOAuth2GrantID() ID
NewOAuth2GrantID generates a new unique OAuth2 consent grant ID.
func NewOAuthConnectionID ¶
func NewOAuthConnectionID() ID
NewOAuthConnectionID generates a new unique OAuth connection ID.
func NewPasswordResetID ¶
func NewPasswordResetID() ID
NewPasswordResetID generates a new unique password reset ID.
func NewPermissionID ¶
func NewPermissionID() ID
NewPermissionID generates a new unique permission ID.
func NewRecoveryCodeID ¶
func NewRecoveryCodeID() ID
NewRecoveryCodeID generates a new unique recovery code ID.
func NewRetentionJobID ¶
func NewRetentionJobID() ID
NewRetentionJobID generates a new unique retention outbox job ID.
func NewRetentionRefID ¶
func NewRetentionRefID() ID
NewRetentionRefID generates a new unique retention contact ref ID.
func NewSCIMConfigID ¶
func NewSCIMConfigID() ID
NewSCIMConfigID generates a new unique SCIM config ID.
func NewSCIMLogID ¶
func NewSCIMLogID() ID
NewSCIMLogID generates a new unique SCIM provision log ID.
func NewSSFLinkID ¶
func NewSSFLinkID() ID
NewSSFLinkID generates a new Shared Signals subject link ID.
func NewSSFSignalID ¶
func NewSSFSignalID() ID
NewSSFSignalID generates a new Shared Signals risk signal ID.
func NewSSFStreamID ¶
func NewSSFStreamID() ID
NewSSFStreamID generates a new Shared Signals stream ID.
func NewSSOConnectionID ¶
func NewSSOConnectionID() ID
NewSSOConnectionID generates a new unique SSO connection ID.
func NewServiceAccountID ¶
func NewServiceAccountID() ID
NewServiceAccountID generates a new unique service account ID.
func NewSessionFamilyID ¶
func NewSessionFamilyID() ID
NewSessionFamilyID generates a new unique session-family ID. Every fresh sign-in begins a new family; refresh rotations inherit the parent family.
func NewUserEmailID ¶
func NewUserEmailID() ID
NewUserEmailID generates a new unique user email record ID.
func NewVerificationID ¶
func NewVerificationID() ID
NewVerificationID generates a new unique verification ID.
func NewWaitlistID ¶
func NewWaitlistID() ID
NewWaitlistID generates a new unique waitlist entry ID.
func Parse ¶
Parse parses a TypeID string (e.g., "ausr_01h2xcejqtf2nbrexx3vqjhp41") into an ID. Returns an error if the string is not valid.
func ParseAPIKeyID ¶
ParseAPIKeyID parses a string and validates the "akey" prefix.
func ParseAgentGrantID ¶
ParseAgentGrantID parses a string and validates the "aagr" prefix.
func ParseAgentID ¶
ParseAgentID parses a string and validates the "aagt" prefix.
func ParseAppClientConfigID ¶
ParseAppClientConfigID parses a string and validates the "aacf" prefix.
func ParseAppID ¶
ParseAppID parses a string and validates the "aapp" prefix.
func ParseAppSessionConfigID ¶
ParseAppSessionConfigID parses a string and validates the "ascf" prefix.
func ParseAuthCodeID ¶
ParseAuthCodeID parses a string and validates the "aaco" prefix.
func ParseBrandingConfigID ¶
ParseBrandingConfigID parses a string and validates the "abrd" prefix.
func ParseConsentID ¶
ParseConsentID parses a string and validates the "acns" prefix.
func ParseDelegationID ¶
ParseDelegationID parses a string and validates the "adel" prefix.
func ParseDeviceCodeID ¶
ParseDeviceCodeID parses a string and validates the "advc" prefix.
func ParseDeviceID ¶
ParseDeviceID parses a string and validates the "adev" prefix.
func ParseEnvironmentID ¶
ParseEnvironmentID parses a string and validates the "aenv" prefix.
func ParseFormConfigID ¶
ParseFormConfigID parses a string and validates the "afcf" prefix.
func ParseInvitationID ¶
ParseInvitationID parses a string and validates the "ainv" prefix.
func ParseMFAID ¶
ParseMFAID parses a string and validates the "amfa" prefix.
func ParseMemberID ¶
ParseMemberID parses a string and validates the "amem" prefix.
func ParseNotificationID ¶
ParseNotificationID parses a string and validates the "antf" prefix.
func ParseOAuth2ClientID ¶
ParseOAuth2ClientID parses a string and validates the "aoac" prefix.
func ParseOAuth2GrantID ¶
ParseOAuth2GrantID parses a string and validates the "aoag" prefix.
func ParseOAuthConnectionID ¶
ParseOAuthConnectionID parses a string and validates the "aoau" prefix.
func ParseOrgID ¶
ParseOrgID parses a string and validates the "aorg" prefix.
func ParsePasskeyID ¶
ParsePasskeyID parses a string and validates the "apsk" prefix.
func ParsePasswordResetID ¶
ParsePasswordResetID parses a string and validates the "apwr" prefix.
func ParsePermissionID ¶
ParsePermissionID parses a string and validates the "aprm" prefix.
func ParseRecoveryCodeID ¶
ParseRecoveryCodeID parses a string and validates the "arec" prefix.
func ParseRetentionJobID ¶
ParseRetentionJobID parses a string and validates the "artj" prefix.
func ParseRetentionRefID ¶
ParseRetentionRefID parses a string and validates the "artr" prefix.
func ParseRoleID ¶
ParseRoleID parses a string and validates the "arol" prefix.
func ParseSCIMConfigID ¶
ParseSCIMConfigID parses a string and validates the "ascm" prefix.
func ParseSCIMLogID ¶
ParseSCIMLogID parses a string and validates the "ascl" prefix.
func ParseSCIMTokenID ¶
ParseSCIMTokenID parses a string and validates the "asct" prefix.
func ParseSSOConnectionID ¶
ParseSSOConnectionID parses a string and validates the "asso" prefix.
func ParseServiceAccountID ¶
ParseServiceAccountID parses a string and validates the "svc" prefix.
func ParseSessionFamilyID ¶
ParseSessionFamilyID parses a string and validates the "asfm" prefix.
func ParseSessionID ¶
ParseSessionID parses a string and validates the "ases" prefix.
func ParseSettingID ¶
ParseSettingID parses a string and validates the "aset" prefix.
func ParseTeamID ¶
ParseTeamID parses a string and validates the "atm" prefix.
func ParseUserEmailID ¶
ParseUserEmailID parses a string and validates the "auem" prefix.
func ParseUserID ¶
ParseUserID parses a string and validates the "ausr" prefix.
func ParseVerificationID ¶
ParseVerificationID parses a string and validates the "avrf" prefix.
func ParseWaitlistID ¶
ParseWaitlistID parses a string and validates the "awlt" prefix.
func ParseWebhookID ¶
ParseWebhookID parses a string and validates the "awhk" prefix.
func ParseWithPrefix ¶
ParseWithPrefix parses a TypeID string and validates that its prefix matches the expected value.
func (ID) MarshalBSONValue ¶
MarshalBSONValue satisfies bson.ValueMarshaler (mongo-driver v2) so the ID is stored as a BSON string instead of an opaque struct. No bson import needed because Go uses structural typing for interface satisfaction.
func (ID) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (ID) String ¶
String returns the full TypeID string representation (prefix_suffix). Returns an empty string for the Nil ID.
func (*ID) UnmarshalBSONValue ¶
UnmarshalBSONValue satisfies bson.ValueUnmarshaler (mongo-driver v2).
func (*ID) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type InvitationID ¶
type InvitationID = ID
InvitationID is a type-safe identifier for invitations (prefix: "ainv").
type MFAID ¶
type MFAID = ID
MFAID is a type-safe identifier for MFA enrollment records (prefix: "amfa").
type MemberID ¶
type MemberID = ID
MemberID is a type-safe identifier for organization members (prefix: "amem").
type NotificationID ¶
type NotificationID = ID
NotificationID is a type-safe identifier for notifications (prefix: "antf").
type OAuth2ClientID ¶
type OAuth2ClientID = ID
OAuth2ClientID is a type-safe identifier for OAuth2 clients (prefix: "aoac").
type OAuth2GrantID ¶
type OAuth2GrantID = ID
OAuth2GrantID is a type-safe identifier for OAuth2 consent grants (prefix: "aoag").
type OAuthConnectionID ¶
type OAuthConnectionID = ID
OAuthConnectionID is a type-safe identifier for OAuth connections (prefix: "aoau").
type PasskeyID ¶
type PasskeyID = ID
PasskeyID is a type-safe identifier for passkeys (prefix: "apsk").
type PasswordResetID ¶
type PasswordResetID = ID
PasswordResetID is a type-safe identifier for password reset tokens (prefix: "apwr").
type PermissionID ¶
type PermissionID = ID
PermissionID is a type-safe identifier for permissions (prefix: "aprm").
type Prefix ¶
type Prefix string
Prefix identifies the entity type encoded in a TypeID.
const ( PrefixUser Prefix = "ausr" PrefixSession Prefix = "ases" PrefixApp Prefix = "aapp" PrefixOrg Prefix = "aorg" PrefixMember Prefix = "amem" PrefixTeam Prefix = "atm" PrefixInvitation Prefix = "ainv" PrefixDevice Prefix = "adev" PrefixWebhook Prefix = "awhk" PrefixNotification Prefix = "antf" PrefixVerification Prefix = "avrf" PrefixPasswordReset Prefix = "apwr" PrefixAPIKey Prefix = "akey" PrefixOAuthConnection Prefix = "aoau" PrefixPasskey Prefix = "apsk" PrefixMFA Prefix = "amfa" PrefixEnvironment Prefix = "aenv" PrefixRole Prefix = "arol" PrefixPermission Prefix = "aprm" PrefixRecoveryCode Prefix = "arec" PrefixSSOConnection Prefix = "asso" PrefixConsent Prefix = "acns" PrefixFormConfig Prefix = "afcf" PrefixBrandingConfig Prefix = "abrd" PrefixAppSessionCfg Prefix = "ascf" PrefixOAuth2Client Prefix = "aoac" PrefixOAuth2Grant Prefix = "aoag" PrefixAuthCode Prefix = "aaco" PrefixSetting Prefix = "aset" PrefixAppClientConfig Prefix = "aacf" PrefixDeviceCode Prefix = "advc" PrefixSCIMConfig Prefix = "ascm" PrefixSCIMToken Prefix = "asct" PrefixSCIMLog Prefix = "ascl" PrefixWaitlist Prefix = "awlt" PrefixSessionFamily Prefix = "asfm" PrefixServiceAccount Prefix = "svc" PrefixUserEmail Prefix = "auem" PrefixDelegation Prefix = "adel" PrefixSSFStream Prefix = "assf" PrefixSSFLink Prefix = "assl" PrefixSSFEvent Prefix = "asse" PrefixSSFSignal Prefix = "assg" PrefixAgent Prefix = "aagt" PrefixAgentGrant Prefix = "aagr" PrefixRetentionJob Prefix = "artj" PrefixRetentionRef Prefix = "artr" )
Prefix constants for all AuthSome entity types.
type RecoveryCodeID ¶
type RecoveryCodeID = ID
RecoveryCodeID is a type-safe identifier for MFA recovery codes (prefix: "arec").
type RetentionJobID ¶
type RetentionJobID = ID
RetentionJobID is a type-safe identifier for retention outbox jobs (prefix: "artj").
type RetentionRefID ¶
type RetentionRefID = ID
RetentionRefID is a type-safe identifier for retention contact refs (prefix: "artr").
type SCIMConfigID ¶
type SCIMConfigID = ID
SCIMConfigID is a type-safe identifier for SCIM configurations (prefix: "ascm").
type SCIMLogID ¶
type SCIMLogID = ID
SCIMLogID is a type-safe identifier for SCIM provision logs (prefix: "ascl").
type SCIMTokenID ¶
type SCIMTokenID = ID
SCIMTokenID is a type-safe identifier for SCIM bearer tokens (prefix: "asct").
type SSFSignalID ¶
type SSFSignalID = ID
SSFSignalID identifies a stored Shared Signals risk signal.
type SSOConnectionID ¶
type SSOConnectionID = ID
SSOConnectionID is a type-safe identifier for SSO connections (prefix: "asso").
type ServiceAccountID ¶
type ServiceAccountID = ID
ServiceAccountID is a type-safe identifier for service accounts (prefix: "svc").
type SessionFamilyID ¶
type SessionFamilyID = ID
SessionFamilyID is a type-safe identifier for refresh-token session families (prefix: "asfm"). All sessions descended from a single sign-in (via successive refresh-token rotations) share the same SessionFamilyID, enabling cascade revocation when a refresh-token replay is detected (RFC 6819 §5.2.2.3).
type SessionID ¶
type SessionID = ID
SessionID is a type-safe identifier for sessions (prefix: "ases").
type SettingID ¶
type SettingID = ID
SettingID is a type-safe identifier for settings (prefix: "aset").
type UserEmailID ¶
type UserEmailID = ID
UserEmailID is a type-safe identifier for user email records (prefix: "auem").
type VerificationID ¶
type VerificationID = ID
VerificationID is a type-safe identifier for verification tokens (prefix: "avrf").
type WaitlistID ¶
type WaitlistID = ID
WaitlistID is a type-safe identifier for waitlist entries (prefix: "awlt").