preprocessor

package
v1.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2019 License: Apache-2.0 Imports: 16 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessKeyValidationPreprocessor

type AccessKeyValidationPreprocessor struct {
	ClientKey string
	MasterKey string
	AppName   string
}

AccessKeyValidationPreprocessor provides preprocess method to check the API key of the request.

func (AccessKeyValidationPreprocessor) Preprocess

func (p AccessKeyValidationPreprocessor) Preprocess(payload *router.Payload, response *router.Response) int

type ConnPreprocessor

type ConnPreprocessor struct {
	AppName       string
	AccessControl string
	DBOpener      skydb.DBOpener
	DBImpl        string
	Option        string
	DBConfig      skydb.DBConfig
}

func (ConnPreprocessor) Preprocess

func (p ConnPreprocessor) Preprocess(payload *router.Payload, response *router.Response) int

type DevOnlyProcessor

type DevOnlyProcessor struct {
	DevMode bool
}

func (DevOnlyProcessor) Preprocess

func (p DevOnlyProcessor) Preprocess(payload *router.Payload, response *router.Response) int

type EnsurePluginReadyPreprocessor

type EnsurePluginReadyPreprocessor struct {
	PluginContext *plugin.Context
	ClientKey     string
	MasterKey     string
}

func (*EnsurePluginReadyPreprocessor) Preprocess

func (p *EnsurePluginReadyPreprocessor) Preprocess(
	payload *router.Payload,
	response *router.Response,
) int

type InjectAuth added in v1.5.0

type InjectAuth struct {
	PwExpiryDays int
	Required     bool
}

InjectAuth preprocessor checks the auth_id in the request and get the auth object from the database. It can be configured to

func (InjectAuth) Preprocess added in v1.5.0

func (p InjectAuth) Preprocess(payload *router.Payload, response *router.Response) (status int)

type InjectDatabase

type InjectDatabase struct {
}

func (InjectDatabase) Preprocess

func (p InjectDatabase) Preprocess(payload *router.Payload, response *router.Response) int

type InjectPublicDatabase

type InjectPublicDatabase struct {
}

func (InjectPublicDatabase) Preprocess

func (p InjectPublicDatabase) Preprocess(payload *router.Payload, response *router.Response) int

type InjectUser added in v1.5.0

type InjectUser struct {
	HookRegistry      *hook.Registry `inject:"HookRegistry"`
	AssetStore        asset.Store    `inject:"AssetStore"`
	Required          bool
	CheckVerification bool
}

InjectUser injects a user record to the payload

An AuthInfo must be injected before this, if it is not found, the preprocessor would just skip the injection

If AuthInfo is injected but a user record is not found, the preprocessor would create a new user record and inject it to the payload

func (InjectUser) Preprocess added in v1.5.0

func (p InjectUser) Preprocess(payload *router.Payload, response *router.Response) int

type NotificationPreprocessor

type NotificationPreprocessor struct {
	NotificationSender push.Sender
}

func (NotificationPreprocessor) Preprocess

func (p NotificationPreprocessor) Preprocess(payload *router.Payload, response *router.Response) int

type Null added in v1.5.0

type Null struct {
}

func (Null) Preprocess added in v1.5.0

func (p Null) Preprocess(payload *router.Payload, response *router.Response) int

type RequireAdminOrMasterKey added in v1.1.0

type RequireAdminOrMasterKey struct {
}

func (RequireAdminOrMasterKey) Preprocess added in v1.1.0

func (p RequireAdminOrMasterKey) Preprocess(payload *router.Payload, response *router.Response) int

type RequireMasterKey added in v1.2.0

type RequireMasterKey struct {
}

func (RequireMasterKey) Preprocess added in v1.2.0

func (p RequireMasterKey) Preprocess(payload *router.Payload, response *router.Response) int

type UserAuthenticator

type UserAuthenticator struct {
	ClientKey          string
	MasterKey          string
	AppName            string
	TokenStore         authtoken.Store
	BypassUnauthorized bool
}

UserAuthenticator provides preprocess method to authenicate a user with access token or non-login user without api key. It inject AuthInfoID and related context. If BypassUnauthorized is true, UserAuthenticator will return StatusOK instead of StatusUnauthorized if the request is not authenticated. It is for plugin so even handler or lambda that are not user_required, we can still get the AuthInfoID from context.

func (*UserAuthenticator) Preprocess

func (p *UserAuthenticator) Preprocess(payload *router.Payload, response *router.Response) int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL