grapesy
Safe HaskellNone
LanguageHaskell2010

Network.GRPC.Common.Headers

Description

Utilities for working with headers

Synopsis

Documentation

class Traversable h => HasRequiredHeaders (h :: (Type -> Type) -> Type) where Source #

Required headers

Required headers are headers that grapesy needs to know in order to function. For example, we need to know which compression algorithm the peer is using for their messages to us.

Associated Types

data RequiredHeaders (h :: (Type -> Type) -> Type) Source #

Methods

requiredHeaders :: h (Checked e) -> Either e (RequiredHeaders h) Source #

verifyRequired :: HasRequiredHeaders h => h (Checked (InvalidHeaders HandledSynthesized)) -> Either (InvalidHeaders HandledSynthesized) (RequiredHeaders h) Source #

Validate only the required headers

By default, we only check those headers grapesy needs to function.

verifyAll :: HasRequiredHeaders h => h (Checked (InvalidHeaders HandledSynthesized)) -> Either (InvalidHeaders HandledSynthesized) (h Undecorated, RequiredHeaders h) Source #

Validate all headers

Validate all headers; we do this only if connVerifyHeaders (on the client) or serverVerifyHeaders (on the server) is enabled.

verifyAllIf :: HasRequiredHeaders h => Bool -> h (Checked (InvalidHeaders HandledSynthesized)) -> Either (InvalidHeaders HandledSynthesized) (RequiredHeaders h) Source #

Convenience wrapper, conditionally verifying all headers