armor

package
v0.3.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCharacterLimit = &CharacterLimitOptions{
	Limit: 15500,
}

Functions

func BlockFieldSuggestionPresenter

func BlockFieldSuggestionPresenter() func(ctx context.Context, e error) *gqlerror.Error

BlockFieldSuggestionPresenter returns a new error presenter that masks field suggestions

Types

type AliasLimit

type AliasLimit struct {
	Func func(ctx context.Context, rc *graphql.OperationContext) int
	// contains filtered or unexported fields
}

AliasLimit allows you to define a limit on alias usage in a query.

If a query is submitted that exceeds the limit, a 422 status code will be returned.

func FixedAliasLimit

func FixedAliasLimit(limit int) *AliasLimit

func (*AliasLimit) ExtensionName

func (a *AliasLimit) ExtensionName() string

func (AliasLimit) MutateOperationContext

func (c AliasLimit) MutateOperationContext(ctx context.Context, rc *graphql.OperationContext) *gqlerror.Error

func (*AliasLimit) Validate

func (a *AliasLimit) Validate(schema graphql.ExecutableSchema) error

type AliasStats

type AliasStats struct {
	Alias      int
	AliasLimit int
}

func GetAliasStats

func GetAliasStats(ctx context.Context) *AliasStats

type CharacterLimit

type CharacterLimit struct {
	// contains filtered or unexported fields
}

CharacterLimit allows you to define a limit on character usage in a query.

If a query is submitted that exceeds the limit, a 422 status code will be returned.

func FixedCharacterLimit

func FixedCharacterLimit(options *CharacterLimitOptions) *CharacterLimit

func (*CharacterLimit) ExtensionName

func (c *CharacterLimit) ExtensionName() string

func (CharacterLimit) MutateOperationParameters

func (c CharacterLimit) MutateOperationParameters(ctx context.Context, request *graphql.RawParams) *gqlerror.Error

func (*CharacterLimit) Validate

func (c *CharacterLimit) Validate(schema graphql.ExecutableSchema) error

type CharacterLimitOptions

type CharacterLimitOptions struct {
	// Limit is the maximum number of characters allowed in a query.
	Limit int
}

type CharacterStats

type CharacterStats struct {
	Characters     int
	CharacterLimit int
}

Jump to

Keyboard shortcuts

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