Documentation
¶
Index ¶
- func AuthMiddleware(deps AuthDeps) app.HandlerFunc
- func AuthenticateRequest(ctx context.Context, deps AuthDeps, token string, path string) (context.Context, error)
- func CorsMiddleware(c context.Context, ctx *app.RequestContext)
- func DecryptDeviceRequest(ctx context.Context, c *app.RequestContext, secret string, ...) error
- func DeviceMiddleware(configProvider func() config.DeviceConfig, replayStore deviceauth.ReplayStore) app.HandlerFunc
- func EncryptDeviceResponse(c *app.RequestContext, secret string) error
- func LoggerMiddleware(enrichers ...requestmeta.Enricher) app.HandlerFunc
- func NotifyMiddleware(store PaymentStore) app.HandlerFunc
- func OptionalAuthMiddleware(deps AuthDeps) app.HandlerFunc
- func PaymentNotifyContext(ctx context.Context, store PaymentStore, platform, token string) (context.Context, error)
- func TraceMiddleware() app.HandlerFunc
- type AuthDeps
- type PaymentParams
- type PaymentStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(deps AuthDeps) app.HandlerFunc
func AuthenticateRequest ¶
func CorsMiddleware ¶
func CorsMiddleware(c context.Context, ctx *app.RequestContext)
func DecryptDeviceRequest ¶
func DecryptDeviceRequest(ctx context.Context, c *app.RequestContext, secret string, replayStore deviceauth.ReplayStore) error
DecryptDeviceRequest accepts only authenticated envelopes. All validation completes before plaintext is installed; unsigned query parameters cannot be mixed into an authenticated body or accepted on a bodyless POST.
func DeviceMiddleware ¶
func DeviceMiddleware(configProvider func() config.DeviceConfig, replayStore deviceauth.ReplayStore) app.HandlerFunc
func EncryptDeviceResponse ¶
func EncryptDeviceResponse(c *app.RequestContext, secret string) error
EncryptDeviceResponse preserves the data/time format and adds a signature.
func LoggerMiddleware ¶
func LoggerMiddleware(enrichers ...requestmeta.Enricher) app.HandlerFunc
func NotifyMiddleware ¶
func NotifyMiddleware(store PaymentStore) app.HandlerFunc
func OptionalAuthMiddleware ¶
func OptionalAuthMiddleware(deps AuthDeps) app.HandlerFunc
OptionalAuthMiddleware authenticates a request when it supplies an Authorization header, while preserving anonymous access for routes that intentionally support guest checkout. Handlers on those routes must still explicitly require an authenticated user before operating on a user-owned resource.
func PaymentNotifyContext ¶
func TraceMiddleware ¶
func TraceMiddleware() app.HandlerFunc
Types ¶
type PaymentParams ¶
type PaymentStore ¶
type PaymentStore interface {
Payment() repository.PaymentRepo
}
Click to show internal directories.
Click to hide internal directories.