Documentation
¶
Index ¶
- func New(config Config) http.Handler
- type API
- type APIKey
- type APIKeyInfo
- type AuditEvent
- type AuthIdentity
- type AuthSession
- type AuthSessionInfo
- type Config
- type CustomEndpoint
- type CustomEndpointScope
- type LocaleOptions
- type LoginMetadata
- type PluginEndpoint
- type PreviewToken
- type RequestErrorEvent
- type RequestObservation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIKeyInfo ¶
type AuditEvent ¶
type AuthIdentity ¶
type AuthIdentity struct {
Collection schema.CollectionSlug
Actor store.Document
PreviewEpoch uint64
}
type AuthSession ¶
type AuthSessionInfo ¶
type Config ¶
type Config struct {
Manifest schema.Manifest
ManifestForRequest func(context.Context, *AuthIdentity) (schema.Snapshot, error)
Engine *operationengine.Engine
AdminAssets fs.FS
MaxBodyBytes int64
SecureCookies bool
Login func(context.Context, string, string, string, LoginMetadata) (AuthSession, error)
Session func(context.Context, string) (AuthSession, error)
RotateSession func(context.Context, string) (AuthSession, error)
Logout func(context.Context, string) error
LogoutAll func(context.Context, string) error
Sessions func(context.Context, string) ([]AuthSessionInfo, error)
RevokeSession func(context.Context, string, string) error
RequestPasswordReset func(context.Context, string, string) error
ResetPassword func(context.Context, string, string, string) error
RequestVerification func(context.Context, string, string) error
VerifyEmail func(context.Context, string, string) error
ChangePassword func(context.Context, string, string, string) error
AuthBootstrapAvailable func(context.Context, string) (bool, error)
CreateAuthUser func(context.Context, string, store.Values, string, *AuthIdentity) (store.Document, error)
CreateAuthUserLocalized func(context.Context, string, store.Values, string, *AuthIdentity, LocaleOptions) (store.Document, error)
CreateAPIKey func(context.Context, string, string, time.Time) (APIKey, error)
APIKeys func(context.Context, string) ([]APIKeyInfo, error)
RevokeAPIKey func(context.Context, string, string) error
AuthenticateAPIKey func(context.Context, string) (AuthIdentity, error)
AuthenticateExternal func(context.Context, map[string][]string) (AuthIdentity, error)
PreviewLifecycleEpoch func() uint64
CreateCollectionPreviewToken func(context.Context, string, string, *AuthIdentity) (PreviewToken, error)
CreateGlobalPreviewToken func(context.Context, string, *AuthIdentity) (PreviewToken, error)
RevokePreviewToken func(context.Context, string, *AuthIdentity) error
FindCollectionPreview func(context.Context, string, string, string) (store.Document, error)
FindGlobalPreview func(context.Context, string, string) (store.Document, error)
GetPreference func(context.Context, *AuthIdentity, string) (json.RawMessage, error)
SetPreference func(context.Context, *AuthIdentity, string, json.RawMessage) (json.RawMessage, error)
DeletePreference func(context.Context, *AuthIdentity, string) error
ResetPreferences func(context.Context, *AuthIdentity) error
ForceUnlock func(context.Context, string, string, *AuthIdentity) error
DocumentLock func(context.Context, string, string, *AuthIdentity) (protocol.DocumentLockEnvelope, error)
AcquireDocumentLock func(context.Context, string, string, bool, *AuthIdentity) (protocol.DocumentLockEnvelope, error)
ReleaseDocumentLock func(context.Context, string, string, *AuthIdentity) error
SchedulePublish func(context.Context, string, string, time.Time, int, *AuthIdentity) (store.ScheduledPublish, error)
ScheduledPublishes func(context.Context, string, string, *AuthIdentity) ([]store.ScheduledPublish, error)
CancelScheduledPublish func(context.Context, string, string, string, *AuthIdentity) error
AllowAuthIPAttempt func(context.Context, string, string, int, time.Duration) (bool, error)
AllowAuthAttempt func(context.Context, string, string, string, int, time.Duration) (bool, error)
AllowedOrigins []string
AllowedRequestHeaders []string
AllowedHosts []string
TrustedProxies []netip.Prefix
AuthRateLimit int
AuthRateWindow time.Duration
Audit func(AuditEvent)
Ready func(context.Context) error
Observe func(RequestObservation)
RequestError func(RequestErrorEvent)
RequestTimeout time.Duration
ContentSecurityPolicy string
DisableContentSecurityPolicy bool
StrictTransportSecurity string
AcquireUpload func(context.Context, string) (release func(), err error)
Upload func(context.Context, string, string, io.Reader, store.Values, *AuthIdentity, bool) (store.Document, error)
RemoteUpload func(context.Context, string, string, store.Values, *AuthIdentity) (store.Document, error)
UploadLocalized func(context.Context, string, string, io.Reader, store.Values, *AuthIdentity, LocaleOptions, bool) (store.Document, error)
RemoteUploadLocalized func(context.Context, string, string, store.Values, *AuthIdentity, LocaleOptions) (store.Document, error)
UpdateUploadImage func(context.Context, string, string, float64, float64, float64, float64, float64, float64, int, *AuthIdentity) (store.Document, error)
Duplicate func(context.Context, string, string, store.Values, *AuthIdentity, LocaleOptions) (store.Document, error)
OpenUpload func(context.Context, string, string, *AuthIdentity) (io.ReadCloser, storage.Object, error)
PluginEndpoints []PluginEndpoint
PluginTransports []PluginEndpoint
CustomEndpoints []CustomEndpoint
}
type CustomEndpoint ¶
type CustomEndpoint struct {
Method string
Pattern string
Scope CustomEndpointScope
Resource schema.CollectionSlug
MaxBodyBytes int64
Handler func(http.ResponseWriter, *http.Request, string, string, map[string]string, *store.Document, schema.CollectionSlug, func(context.Context, string, string) error, func(error, string))
}
type CustomEndpointScope ¶
type CustomEndpointScope uint8
const ( CustomEndpointRoot CustomEndpointScope = iota CustomEndpointCollection CustomEndpointGlobal )
type LocaleOptions ¶
type LocaleOptions struct {
Locale string
FallbackLocales []schema.LocaleCode
DisableFallback bool
AllLocales bool
}
LocaleOptions carries the validated transport-level localization selection into storage-aware application operations such as upload duplication.
type LoginMetadata ¶
type PluginEndpoint ¶
type PreviewToken ¶
type RequestErrorEvent ¶
Click to show internal directories.
Click to hide internal directories.