Documentation
¶
Index ¶
- type AppleClientSecretCreate
- type RecordUpsert
- func (form *RecordUpsert) DrySubmit(callback func(txApp core.App, drySavedRecord *core.Record) error) errordeprecated
- func (form *RecordUpsert) GrantManagerAccess()
- func (form *RecordUpsert) GrantSuperuserAccess()
- func (form *RecordUpsert) HasManageAccess() bool
- func (form *RecordUpsert) Load(data map[string]any)
- func (form *RecordUpsert) ResetAccess()
- func (form *RecordUpsert) SetApp(app core.App)
- func (form *RecordUpsert) SetContext(ctx context.Context)
- func (form *RecordUpsert) SetRecord(record *core.Record)
- func (form *RecordUpsert) Submit() error
- type TestEmailSend
- type TestS3Filesystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppleClientSecretCreate ¶
type AppleClientSecretCreate struct {
// ClientId is the identifier of your app (aka. Service ID).
ClientId string `form:"clientId" json:"clientId"`
// TeamId is a 10-character string associated with your developer account
// (usually could be found next to your name in the Apple Developer site).
TeamId string `form:"teamId" json:"teamId"`
// KeyId is a 10-character key identifier generated for the "Sign in with Apple"
// private key associated with your developer account.
KeyId string `form:"keyId" json:"keyId"`
// PrivateKey is the private key associated to your app.
// Usually wrapped within -----BEGIN PRIVATE KEY----- X -----END PRIVATE KEY-----.
PrivateKey string `form:"privateKey" json:"privateKey"`
// Duration specifies how long the generated JWT should be considered valid.
// The specified value must be in seconds and max 15777000 (~6months).
Duration int `form:"duration" json:"duration"`
// contains filtered or unexported fields
}
AppleClientSecretCreate is a form struct to generate a new Apple Client Secret.
Reference: https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens
func NewAppleClientSecretCreate ¶
func NewAppleClientSecretCreate(app core.App) *AppleClientSecretCreate
NewAppleClientSecretCreate creates a new AppleClientSecretCreate form with initializer config created from the provided core.App instances.
func (*AppleClientSecretCreate) Submit ¶
func (form *AppleClientSecretCreate) Submit() (string, error)
Submit validates the form and returns a new Apple Client Secret JWT.
func (*AppleClientSecretCreate) Validate ¶
func (form *AppleClientSecretCreate) Validate() error
Validate makes the form validatable by implementing validation.Validatable interface.
type RecordUpsert ¶
type RecordUpsert struct {
// contains filtered or unexported fields
}
func NewRecordUpsert ¶
func NewRecordUpsert(app core.App, record *core.Record) *RecordUpsert
NewRecordUpsert creates a new RecordUpsert form from the provided core.App and core.Record instances (for create you could pass a pointer to an empty Record - core.NewRecord(collection)).
func (*RecordUpsert) DrySubmit
deprecated
func (form *RecordUpsert) DrySubmit(callback func(txApp core.App, drySavedRecord *core.Record) error) error
Deprecated: It was previously used as part of the record create action but it is not needed anymore and will be removed in the future.
DrySubmit performs a temp form submit within a transaction and reverts it at the end. For actual record persistence, check the [RecordUpsert.Submit()] method.
This method doesn't perform validations, handle file uploads/deletes or trigger app save events!
func (*RecordUpsert) GrantManagerAccess ¶
func (form *RecordUpsert) GrantManagerAccess()
GrantManagerAccess updates the form access level to "manager" allowing directly changing some system record fields (often used with auth collection records).
func (*RecordUpsert) GrantSuperuserAccess ¶
func (form *RecordUpsert) GrantSuperuserAccess()
GrantSuperuserAccess updates the form access level to "superuser" allowing directly changing all system record fields, including those marked as "Hidden".
func (*RecordUpsert) HasManageAccess ¶
func (form *RecordUpsert) HasManageAccess() bool
HasManageAccess reports whether the form has "manager" or "superuser" level access.
func (*RecordUpsert) Load ¶
func (form *RecordUpsert) Load(data map[string]any)
Load loads the provided data into the form and the related record.
func (*RecordUpsert) ResetAccess ¶
func (form *RecordUpsert) ResetAccess()
ResetAccess resets the form access level to the accessLevelDefault.
func (*RecordUpsert) SetApp ¶
func (form *RecordUpsert) SetApp(app core.App)
SetApp replaces the current form app instance.
This could be used for example if you want to change at later stage before submission to change from regular -> transactional app instance.
func (*RecordUpsert) SetContext ¶
func (form *RecordUpsert) SetContext(ctx context.Context)
SetContext assigns ctx as context of the current form.
func (*RecordUpsert) SetRecord ¶
func (form *RecordUpsert) SetRecord(record *core.Record)
SetRecord replaces the current form record instance.
func (*RecordUpsert) Submit ¶
func (form *RecordUpsert) Submit() error
Submit validates the form specific validations and attempts to save the form record.
type TestEmailSend ¶
type TestEmailSend struct {
Email string `form:"email" json:"email"`
// contains filtered or unexported fields
}
TestEmailSend proves the configured SMTP settings can deliver a message.
It used to render one of the auth-record email templates against a throwaway record, which made "can this deployment send mail" answerable only through a flow this fork no longer has: verification and email-change were removed with the rest of local auth, so both branches described pages that do not exist and endpoints that answer 404. The remaining question is the one an operator actually has after editing SMTP settings, and it needs no template, no collection and no record — just a message that either arrives or does not.
func NewTestEmailSend ¶
func NewTestEmailSend(app core.App) *TestEmailSend
NewTestEmailSend creates and initializes new TestEmailSend form.
func (*TestEmailSend) Submit ¶
func (form *TestEmailSend) Submit() error
Submit validates and sends a test email to the form.Email address.
func (*TestEmailSend) Validate ¶
func (form *TestEmailSend) Validate() error
Validate makes the form validatable by implementing validation.Validatable interface.
type TestS3Filesystem ¶
type TestS3Filesystem struct {
// The name of the filesystem - storage or backups
Filesystem string `form:"filesystem" json:"filesystem"`
// contains filtered or unexported fields
}
TestS3Filesystem defines a S3 filesystem connection test.
func NewTestS3Filesystem ¶
func NewTestS3Filesystem(app core.App) *TestS3Filesystem
NewTestS3Filesystem creates and initializes new TestS3Filesystem form.
func (*TestS3Filesystem) Submit ¶
func (form *TestS3Filesystem) Submit() error
Submit validates and performs a S3 filesystem connection test.
func (*TestS3Filesystem) Validate ¶
func (form *TestS3Filesystem) Validate() error
Validate makes the form validatable by implementing validation.Validatable interface.