package
0.0.0-20230101183712-202847b4b89b
Repository: https://github.com/corestoreio/csfw.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# Functions
MakeTransparent creates a new hash writer.
MustNew same as New() but panics on error.
New creates a new signing middleware for signature creation and validation.
NewContentHMAC creates a new header HMAC object with default hex encoding/decoding to write and parse the Content-HMAC field.
NewContentSignature creates a new header signature object with default hex encoding/decoding to write and parse the Content-Signature field.
NewOptionFactories creates a new struct and initializes the internal map for the registration of different option factories.
OptionsError helper function to be used within the backend package or other sub-packages whose functions may return an OptionFactoryFunc.
WithAllowedMethods sets the allowed HTTP methods which can transport a signature hash.
WithDebugLog creates a new standard library based logger with debug mode enabled.
WithDefaultConfig applies the default signed configuration settings based for a specific scope.
WithDisable disables the current service and calls the next HTTP handler.
WithErrorHandler adds a custom error handler.
WithHash sets the hashing algorithm to create a new hash and verify an incoming hash.
WithHeaderHandler sets the writer and the parser.
WithLogger convenient helper function to apply a logger to the Service type.
WithMarkPartiallyApplied if set to true marks a configuration for a scope as partially applied with functional options set via source code.
WithOptionFactory applies a function which lazily loads the options from a slow backend (config.Getter) depending on the incoming scope within a request.
WithRootConfig sets the root configuration service to retrieve the scoped base configuration.
WithServiceErrorHandler sets the error handler on the Service object.
WithTrailer allows to write the hash sum into the trailer.
WithTransparent allows to write the hashes into the Cacher with a time-to-live.
# Constants
DefaultHashName identifies the default hash when creating a new scoped configuration.
Content* constants are used as HTTP header key names.
Content* constants are used as HTTP header key names.
# Structs
ContentHMAC writes a simple Content-HMAC header.
ContentSignature represents an HTTP Header or Trailer entry with the default header key Content-Signature.
OptionFactories allows to register multiple OptionFactoryFunc identified by their names.
ScopedConfig scoped based configuration and should not be embedded into your own types.
Service creates a middleware that facilitates using a hash function to sign a HTTP body and validate the HTTP body of a request.
Transparent stores the calculated hashes in memory with a TTL using the Cacher interface.
# Interfaces
Cacher defines a custom cache type in conjunction with Transparent hashing.
HeaderParseWriter knows how to read and write the HTTP header in regards to the hash.
# Type aliases
DecodeFn decodes a raw signature from the header to a byte slice.
EncodeFn encodes a raw signature byte slice to a string.
Option can be used as an argument in NewService to configure it with different settings.
OptionFactoryFunc a closure around a scoped configuration to figure out which options should be returned depending on the scope brought to you during a request.