Documentation
¶
Index ¶
- func GenerateCertificate(serviceName string, privateKey *rsa.PrivateKey, currentTime time.Time) (string, error)
- func TokenForFlowAPI(isFlow bool) func(*Token)
- func TokenUserCreated(userCreated bool) func(*Token)
- func TokenWithIdentityID(identityID uuid.UUID) func(*Token)
- type AuditLog
- type AuditLogType
- type Details
- type Email
- type Emails
- type Flow
- type Flows
- type Identities
- type Identity
- type Jwk
- type OTPSecret
- type Operation
- type Passcode
- type PasswordCredential
- type PrimaryEmail
- type RequestMeta
- type SamlCertificate
- type SamlIDPInitiatedRequest
- type SamlIdentities
- type SamlIdentity
- type SamlState
- type Session
- type Token
- type Transports
- type TrustedDevice
- type User
- func (user *User) DeleteEmail(email Email)
- func (user *User) DeleteOTPSecret()
- func (user *User) DeleteUsername()
- func (user *User) DeleteWebauthnCredential(credentialId string)
- func (user *User) GetEmailByAddress(address string) *Email
- func (user *User) GetEmailById(emailId uuid.UUID) *Email
- func (user *User) GetIdentities() Identities
- func (user *User) GetPasskeys() WebauthnCredentials
- func (user *User) GetSecurityKeys() WebauthnCredentials
- func (user *User) GetUsername() *string
- func (user *User) GetWebauthnCredentialById(credentialId string) *WebauthnCredential
- func (user *User) SetPrimaryEmail(primary *PrimaryEmail)
- func (user *User) SetUsername(username *Username)
- func (user *User) UpdateEmail(email Email)
- func (user *User) Validate(tx *pop.Connection) (*validate.Errors, error)
- func (user *User) WebAuthnCredentials() []webauthn.Credential
- func (user *User) WebAuthnDisplayName() string
- func (user *User) WebAuthnID() []byte
- func (user *User) WebAuthnIcon() string
- func (user *User) WebAuthnName() string
- type UserMetadata
- type Username
- type WebauthnCredential
- type WebauthnCredentialTransport
- type WebauthnCredentialUserHandle
- type WebauthnCredentials
- type WebauthnSessionData
- type WebauthnSessionDataAllowedCredential
- type Webhook
- type WebhookEvent
- type WebhookEvents
- type Webhooks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCertificate ¶
func TokenForFlowAPI ¶
func TokenUserCreated ¶
func TokenWithIdentityID ¶
Types ¶
type AuditLog ¶
type AuditLog struct {
ID uuid.UUID `db:"id" json:"id"`
Type AuditLogType `db:"type" json:"type"`
Error *string `db:"error" json:"error,omitempty"`
MetaHttpRequestId string `db:"meta_http_request_id" json:"meta_http_request_id"`
MetaSourceIp string `db:"meta_source_ip" json:"meta_source_ip"`
MetaUserAgent string `db:"meta_user_agent" json:"meta_user_agent"`
ActorUserId *uuid.UUID `db:"actor_user_id" json:"actor_user_id,omitempty"`
ActorEmail *string `db:"actor_email" json:"actor_email,omitempty" mask:"email"`
Details slices.Map `db:"details" json:"details"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
func NewAuditLog ¶
func NewAuditLog(auditLogType AuditLogType, requestMeta RequestMeta, details Details, user *User, logError error) (AuditLog, error)
type AuditLogType ¶
type AuditLogType string
var ( AuditLogUserLoggedOut AuditLogType = "user_logged_out" AuditLogPasswordSetSucceeded AuditLogType = "password_set_succeeded" AuditLogPasswordSetFailed AuditLogType = "password_set_failed" AuditLogPasswordLoginSucceeded AuditLogType = "password_login_succeeded" AuditLogPasswordLoginFailed AuditLogType = "password_login_failed" AuditLogPasscodeLoginInitSucceeded AuditLogType = "passcode_login_init_succeeded" AuditLogPasscodeLoginInitFailed AuditLogType = "passcode_login_init_failed" AuditLogPasscodeLoginFinalSucceeded AuditLogType = "passcode_login_final_succeeded" AuditLogPasscodeLoginFinalFailed AuditLogType = "passcode_login_final_failed" AuditLogWebAuthnRegistrationInitSucceeded AuditLogType = "webauthn_registration_init_succeeded" AuditLogWebAuthnRegistrationInitFailed AuditLogType = "webauthn_registration_init_failed" AuditLogWebAuthnRegistrationFinalSucceeded AuditLogType = "webauthn_registration_final_succeeded" AuditLogWebAuthnRegistrationFinalFailed AuditLogType = "webauthn_registration_final_failed" AuditLogWebAuthnAuthenticationInitSucceeded AuditLogType = "webauthn_authentication_init_succeeded" AuditLogWebAuthnAuthenticationInitFailed AuditLogType = "webauthn_authentication_init_failed" AuditLogWebAuthnAuthenticationFinalSucceeded AuditLogType = "webauthn_authentication_final_succeeded" AuditLogWebAuthnAuthenticationFinalFailed AuditLogType = "webauthn_authentication_final_failed" AuditLogWebAuthnCredentialUpdated AuditLogType = "webauthn_credential_updated" AuditLogWebAuthnCredentialDeleted AuditLogType = "webauthn_credential_deleted" AuditLogThirdPartySignUpSucceeded AuditLogType = "thirdparty_signup_succeeded" AuditLogThirdPartySignInSucceeded AuditLogType = "thirdparty_signin_succeeded" AuditLogThirdPartyLinkingSucceeded AuditLogType = "thirdparty_linking_succeeded" AuditLogThirdPartySignInSignUpFailed AuditLogType = "thirdparty_signin_signup_failed" AuditLogTokenExchangeSucceeded AuditLogType = "token_exchange_succeeded" AuditLogTokenExchangeFailed AuditLogType = "token_exchange_failed" // Types used by old API and new/flow API AuditLogUserCreated AuditLogType = "user_created" AuditLogEmailCreated AuditLogType = "email_created" AuditLogEmailVerified AuditLogType = "email_verified" AuditLogEmailDeleted AuditLogType = "email_deleted" AuditLogPrimaryEmailChanged AuditLogType = "primary_email_changed" AuditLogUserDeleted AuditLogType = "user_deleted" // New/flow API types AuditLogLoginSuccess AuditLogType = "login_success" AuditLogLoginFailure AuditLogType = "login_failure" AuditLogOTPCreated AuditLogType = "otp_created" AuditLogPasskeyCreated AuditLogType = "passkey_created" AuditLogPasskeyDeleted AuditLogType = "passkey_deleted" AuditLogSecurityKeyCreated AuditLogType = "security_key_created" AuditLogUsernameChanged AuditLogType = "username_changed" AuditLogUsernameDeleted AuditLogType = "username_deleted" AuditLogPasswordChanged AuditLogType = "password_changed" AuditLogPasswordDeleted AuditLogType = "password_deleted" )
type Email ¶
type Email struct {
ID uuid.UUID `db:"id" json:"id"`
UserID *uuid.UUID `db:"user_id" json:"user_id,omitempty"` // TODO: should not be a pointer anymore
Address string `db:"address" json:"address"`
Verified bool `db:"verified" json:"verified"`
PrimaryEmail *PrimaryEmail `has_one:"primary_emails" json:"primary_emails,omitempty"`
User *User `belongs_to:"user" json:"user,omitempty"`
Identities Identities `has_many:"identities" json:"identity,omitempty"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
Email is used by pop to map your users database table to your go code.
func (*Email) GetSamlIdentityForDomain ¶
func (email *Email) GetSamlIdentityForDomain(domain string) *SamlIdentity
type Emails ¶
type Emails []Email
func (*Emails) GetEmailByAddress ¶
func (*Emails) GetPrimary ¶
func (*Emails) GetVerified ¶
func (*Emails) HasUnverified ¶
type Flow ¶
type Flow struct {
ID uuid.UUID `json:"id" db:"id"`
Data string `json:"data" db:"data"`
Version int `json:"version" db:"version"`
CSRFToken string `json:"csrf_token" db:"csrf_token"`
ExpiresAt time.Time `json:"expires_at" db:"expires_at"`
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
}
Flow is used by pop to map your flows database table to your go code.
func (*Flow) ToFlowpilotModel ¶
func (*Flow) Validate ¶
Validate gets run every time you call a "pop.validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.
func (*Flow) ValidateCreate ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*Flow) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.
type Identities ¶
type Identities []Identity
func (Identities) GetIdentity ¶
func (identities Identities) GetIdentity(providerID string, providerUserID string) *Identity
type Identity ¶
type Identity struct {
ID uuid.UUID `json:"id" db:"id"`
ProviderUserID string `json:"provider_user_id" db:"provider_user_id"`
ProviderID string `json:"provider_id" db:"provider_id"`
Data slices.Map `json:"data" db:"data"`
EmailID uuid.UUID `json:"email_id" db:"email_id"`
Email *Email `json:"email,omitempty" belongs_to:"email"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
SamlIdentity *SamlIdentity `json:"saml_identity" has_one:"saml_identity"`
}
Identity is used by pop to map your identities database table to your go code.
func NewIdentity ¶
type Jwk ¶
type OTPSecret ¶
type Passcode ¶
type Passcode struct {
ID uuid.UUID `db:"id"`
UserId *uuid.UUID `db:"user_id"`
EmailID *uuid.UUID `db:"email_id"`
Ttl int `db:"ttl"` // in seconds
Code string `db:"code"`
TryCount int `db:"try_count"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
Email Email `belongs_to:"email"`
}
Passcode is used by pop to map your passcodes database table to your go code.
type PasswordCredential ¶
type PasswordCredential struct {
ID uuid.UUID `db:"id"`
UserId uuid.UUID `db:"user_id"`
Password string `db:"password"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
func NewPasswordCredential ¶
func NewPasswordCredential(userId uuid.UUID, password string) *PasswordCredential
func (*PasswordCredential) Validate ¶
func (password *PasswordCredential) Validate(tx *pop.Connection) (*validate.Errors, error)
type PrimaryEmail ¶
type PrimaryEmail struct {
ID uuid.UUID `db:"id" json:"id"`
EmailID uuid.UUID `db:"email_id" json:"email_id"`
UserID uuid.UUID `db:"user_id" json:"-"`
Email *Email `belongs_to:"email" json:"email"`
User *User `belongs_to:"user" json:"-"`
CreatedAt time.Time `db:"created_at" json:"-"`
UpdatedAt time.Time `db:"updated_at" json:"-"`
}
func NewPrimaryEmail ¶
func NewPrimaryEmail(emailId uuid.UUID, userId uuid.UUID) *PrimaryEmail
func (*PrimaryEmail) Validate ¶
func (primaryEmail *PrimaryEmail) Validate(tx *pop.Connection) (*validate.Errors, error)
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.
type RequestMeta ¶
type SamlCertificate ¶
type SamlCertificate struct {
ID uuid.UUID `json:"id" db:"id"`
CertData string `json:"cert_data" db:"cert_data"`
CertKey string `json:"cert_key" db:"cert_key"`
EncryptionKey string `json:"encryption_key" db:"encryption_key"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
}
SamlCertificate is used by pop to map your saml_certs database table to your go code.
func NewSamlCertificate ¶
func NewSamlCertificate(serviceName string) (*SamlCertificate, error)
func (*SamlCertificate) DecryptCertKey ¶
func (s *SamlCertificate) DecryptCertKey() ([]byte, error)
func (*SamlCertificate) Validate ¶
func (s *SamlCertificate) Validate(_ *pop.Connection) (*validate.Errors, error)
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.
type SamlIDPInitiatedRequest ¶
type SamlIDPInitiatedRequest struct {
ID uuid.UUID `db:"id"`
ResponseID string `db:"response_id"`
Issuer string `db:"issuer"`
ExpiresAt time.Time `db:"expires_at"`
CreatedAt time.Time `db:"created_at"`
}
func NewSamlIDPInitiatedRequest ¶
func NewSamlIDPInitiatedRequest(responseID, issuer string, expiresAt time.Time) (*SamlIDPInitiatedRequest, error)
func (SamlIDPInitiatedRequest) TableName ¶
func (samlIDPInitiatedRequest SamlIDPInitiatedRequest) TableName() string
func (*SamlIDPInitiatedRequest) Validate ¶
func (r *SamlIDPInitiatedRequest) Validate(tx *pop.Connection) (*validate.Errors, error)
type SamlIdentities ¶
type SamlIdentities []SamlIdentity
type SamlIdentity ¶
type SamlIdentity struct {
ID uuid.UUID `json:"id" db:"id"`
IdentityID uuid.UUID `json:"identity_id" db:"identity_id"`
Domain string `json:"domain" db:"domain"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
}
func (*SamlIdentity) Validate ¶
func (i *SamlIdentity) Validate(tx *pop.Connection) (*validate.Errors, error)
type SamlState ¶
type Session ¶
type Session struct {
ID uuid.UUID `db:"id" json:"id"`
UserID uuid.UUID `db:"user_id" json:"user_id"`
UserAgent nulls.String `db:"user_agent" json:"user_agent"`
IpAddress nulls.String `db:"ip_address" json:"ip_address"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
ExpiresAt *time.Time `db:"expires_at" json:"expires_at"`
LastUsed time.Time `db:"last_used" json:"last_used"`
}
type Token ¶
type Token struct {
ID uuid.UUID `db:"id"`
UserID uuid.UUID `db:"user_id"`
IdentityID *uuid.UUID `db:"identity_id"`
IsFlow bool `db:"is_flow"`
Value string `db:"value"`
UserCreated bool `db:"user_created"`
ExpiresAt time.Time `db:"expires_at"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
type Transports ¶
type Transports []WebauthnCredentialTransport
func (Transports) GetNames ¶
func (transports Transports) GetNames() []string
type TrustedDevice ¶
type TrustedDevice struct {
ID uuid.UUID `db:"id"`
UserID uuid.UUID `db:"user_id"`
DeviceToken string `db:"device_token"`
ExpiresAt time.Time `db:"expires_at"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
func (*TrustedDevice) Validate ¶
func (trustedDevice *TrustedDevice) Validate(tx *pop.Connection) (*validate.Errors, error)
type User ¶
type User struct {
ID uuid.UUID `db:"id" json:"id"`
WebauthnCredentials WebauthnCredentials `has_many:"webauthn_credentials" json:"webauthn_credentials,omitempty"`
Emails Emails `has_many:"emails" json:"-"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
Username *Username `has_one:"username" json:"username,omitempty"`
OTPSecret *OTPSecret `has_one:"otp_secret" json:"-"`
PasswordCredential *PasswordCredential `has_one:"password_credentials" json:"-"`
Metadata *UserMetadata `has_one:"user_metadata" json:"-"`
}
User is used by pop to map your users database table to your go code.
func (*User) DeleteEmail ¶
func (*User) DeleteOTPSecret ¶
func (user *User) DeleteOTPSecret()
func (*User) DeleteUsername ¶
func (user *User) DeleteUsername()
func (*User) DeleteWebauthnCredential ¶
func (*User) GetEmailByAddress ¶
func (*User) GetIdentities ¶
func (user *User) GetIdentities() Identities
func (*User) GetPasskeys ¶
func (user *User) GetPasskeys() WebauthnCredentials
func (*User) GetSecurityKeys ¶
func (user *User) GetSecurityKeys() WebauthnCredentials
func (*User) GetUsername ¶
func (*User) GetWebauthnCredentialById ¶
func (user *User) GetWebauthnCredentialById(credentialId string) *WebauthnCredential
func (*User) SetPrimaryEmail ¶
func (user *User) SetPrimaryEmail(primary *PrimaryEmail)
func (*User) SetUsername ¶
func (*User) UpdateEmail ¶
func (*User) Validate ¶
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.
func (*User) WebAuthnCredentials ¶
func (user *User) WebAuthnCredentials() []webauthn.Credential
func (*User) WebAuthnDisplayName ¶
func (*User) WebAuthnID ¶
func (*User) WebAuthnIcon ¶
func (*User) WebAuthnName ¶
type UserMetadata ¶
type UserMetadata struct {
ID uuid.UUID `db:"id"`
UserID uuid.UUID `db:"user_id"`
Public nulls.String `db:"public_metadata"`
Private nulls.String `db:"private_metadata"`
Unsafe nulls.String `db:"unsafe_metadata"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
func (*UserMetadata) Validate ¶
func (m *UserMetadata) Validate(tx *pop.Connection) (*validate.Errors, error)
type Username ¶
type WebauthnCredential ¶
type WebauthnCredential struct {
ID string `db:"id" json:"id"`
Name *string `db:"name" json:"name"`
UserId uuid.UUID `db:"user_id" json:"user_id"`
PublicKey string `db:"public_key" json:"public_key"`
AttestationType string `db:"attestation_type" json:"attestation_type"`
AAGUID uuid.UUID `db:"aaguid" json:"aaguid"`
SignCount int `db:"sign_count" json:"sign_count"`
LastUsedAt *time.Time `db:"last_used_at" json:"last_used_at"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
Transports Transports `has_many:"webauthn_credential_transports" json:"transports"`
BackupEligible bool `db:"backup_eligible" json:"backup_eligible"`
BackupState bool `db:"backup_state" json:"backup_state"`
MFAOnly bool `db:"mfa_only" json:"mfa_only"`
UserHandleID *uuid.UUID `db:"user_handle_id" json:"-"`
UserHandle *WebauthnCredentialUserHandle `belongs_to:"webauthn_credential_user_handle" fk_id:"webauthn_credential_user_handle_fkey" json:"user_handle,omitempty"`
}
WebauthnCredential is used by pop to map your webauthn_credentials database table to your go code.
func (*WebauthnCredential) GetWebauthnDescriptor ¶
func (credential *WebauthnCredential) GetWebauthnDescriptor() (*protocol.CredentialDescriptor, error)
func (*WebauthnCredential) GetWebauthnTransports ¶
func (credential *WebauthnCredential) GetWebauthnTransports() []protocol.AuthenticatorTransport
func (*WebauthnCredential) Validate ¶
func (credential *WebauthnCredential) Validate(tx *pop.Connection) (*validate.Errors, error)
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.
type WebauthnCredentialTransport ¶
type WebauthnCredentialTransport struct {
ID uuid.UUID `db:"id"`
Name string `db:"name"`
WebauthnCredentialID string `db:"webauthn_credential_id"`
WebauthnCredential *WebauthnCredential `belongs_to:"webauthn_credential"`
}
WebauthnCredentialTransport is used by pop to map your webauthn_credential_transport table to your go code.
func (*WebauthnCredentialTransport) Validate ¶
func (transport *WebauthnCredentialTransport) Validate(tx *pop.Connection) (*validate.Errors, error)
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.
type WebauthnCredentialUserHandle ¶
type WebauthnCredentialUserHandle struct {
ID uuid.UUID `db:"id" json:"id"`
UserID uuid.UUID `db:"user_id" json:"user_id"`
Handle string `db:"handle" json:"handle"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
func (*WebauthnCredentialUserHandle) Validate ¶
func (userHandle *WebauthnCredentialUserHandle) Validate(tx *pop.Connection) (*validate.Errors, error)
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.
type WebauthnCredentials ¶
type WebauthnCredentials []WebauthnCredential
func (WebauthnCredentials) GetWebauthnDescriptors ¶
func (credentials WebauthnCredentials) GetWebauthnDescriptors() ([]protocol.CredentialDescriptor, error)
type WebauthnSessionData ¶
type WebauthnSessionData struct {
ID uuid.UUID `db:"id"`
Challenge string `db:"challenge"`
UserId uuid.UUID `db:"user_id"`
UserVerification string `db:"user_verification"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
Operation Operation `db:"operation"`
AllowedCredentials []WebauthnSessionDataAllowedCredential `has_many:"webauthn_session_data_allowed_credentials"`
ExpiresAt nulls.Time `db:"expires_at"`
}
WebauthnSessionData is used by pop to map your webauthn_session_data database table to your go code.
func NewWebauthnSessionDataFrom ¶
func NewWebauthnSessionDataFrom(sessionData *webauthn.SessionData, operation Operation) (*WebauthnSessionData, error)
func (*WebauthnSessionData) ToSessionData ¶
func (sd *WebauthnSessionData) ToSessionData() *webauthn.SessionData
func (*WebauthnSessionData) Validate ¶
func (sd *WebauthnSessionData) Validate(tx *pop.Connection) (*validate.Errors, error)
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.
type WebauthnSessionDataAllowedCredential ¶
type WebauthnSessionDataAllowedCredential struct {
ID uuid.UUID `db:"id"`
CredentialId string `db:"credential_id"`
WebauthnSessionDataID uuid.UUID `db:"webauthn_session_data_id"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
WebauthnSessionData *WebauthnSessionData `belongs_to:"webauthn_session_data"`
}
WebauthnSessionDataAllowedCredential is used by pop to map your webauthn_session_data_allowed_credential database table to your go code.
func (*WebauthnSessionDataAllowedCredential) Validate ¶
func (credential *WebauthnSessionDataAllowedCredential) Validate(tx *pop.Connection) (*validate.Errors, error)
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method.
type Webhook ¶
type Webhook struct {
ID uuid.UUID `json:"id" db:"id"`
Callback string `json:"callback" db:"callback"`
Enabled bool `json:"enabled" db:"enabled"`
Failures int `json:"failures" db:"failures"`
ExpiresAt time.Time `json:"expires_at" db:"expires_at"`
WebhookEvents WebhookEvents `json:"events" has_many:"webhook_events"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
}
Webhook is used by pop to map your webhooks database table to your go code.
type WebhookEvent ¶
type WebhookEvent struct {
ID uuid.UUID `json:"id" db:"id"`
Webhook *Webhook `json:"-" belongs_to:"webhook"`
WebhookID uuid.UUID `json:"-" db:"webhook_id"`
Event string `json:"event" db:"event"`
CreatedAt time.Time `json:"-" db:"created_at"`
UpdatedAt time.Time `json:"-" db:"updated_at"`
}
WebhookEvent is used by pop to map your webhook_events database table to your go code.
func (*WebhookEvent) Validate ¶
func (w *WebhookEvent) Validate(tx *pop.Connection) (*validate.Errors, error)
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.
type WebhookEvents ¶
type WebhookEvents []WebhookEvent
WebhookEvents is not required by pop and may be deleted
Source Files
¶
- audit_log.go
- email.go
- flow.go
- identity.go
- jwk.go
- otp_secret.go
- passcode.go
- password_credential.go
- primary_email.go
- saml_certificate.go
- saml_identity.go
- saml_idp_initiated_request.go
- saml_state.go
- session.go
- token.go
- trusted_device.go
- user.go
- user_metadata.go
- username.go
- webauthn_credential.go
- webauthn_credential_transport.go
- webauthn_credential_user_handle.go
- webauthn_session_data.go
- webauthn_session_data_allowed_credential.go
- webhook.go
- webhook_event.go