graphqlsec

package
v1.63.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 7 Imported by: 0

README

GraphQL Threat Monitoring

This package provides dyngo support for GraphQL operations, which are listened to according to the following sequence diagram:

sequenceDiagram
  participant Root
  participant Request
  participant Execution
  participant Field

  Root ->>+ Request: graphqlsec.StartRequest(...)

  Request ->>+ Execution: grapgqlsec.StartExecution(...)

  par for each field
  Execution ->>+ Field: graphqlsec.StartField(...)
  Field -->>- Execution: field.Finish(...)
  end

  Execution -->>- Request: execution.Finish(...)

  Request -->>- Root: request.Finish(...)

Documentation

Overview

Package graphql is the GraphQL instrumentation API and contract for AppSec defining an abstract run-time representation of AppSec middleware. GraphQL integrations must use this package to enable AppSec features for GraphQL, which listens to this package's operation events.

Package graphql is the GraphQL instrumentation API and contract for AppSec defining an abstract run-time representation of AppSec middleware. GraphQL integrations must use this package to enable AppSec features for GraphQL, which listens to this package's operation events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext[T dyngo.Operation](ctx context.Context) T

FromContext returns the operation of the given type from the context. Returns the zero-value of T if no such operation is found.

func StartExecutionOperation

StartExecutionOperation starts a new GraphQL query operation, along with the given arguments, and emits a start event up in the operation stack. The operation is tracked on the returned context, and can be extracted later on using FromContext.

func StartRequestOperation

func StartRequestOperation(ctx context.Context, parent dyngo.Operation, span trace.TagSetter, args types.RequestOperationArgs) (context.Context, *types.RequestOperation)

StartRequestOperation starts a new GraphQL request operation, along with the given arguments, and emits a start event up in the operation stack. The operation is usually linked to tge global root operation. The operation is tracked on the returned context, and can be extracted later on using FromContext.

func StartResolveOperation

StartResolveOperation starts a new GraphQL Resolve operation, along with the given arguments, and emits a start event up in the operation stack. The operation is tracked on the returned context, and can be extracted later on using FromContext.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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