Name | Summary |
---|---|
Provides a consistent way to generate access tokens.
This is the main entry point for lambda invocations using the V1 payload format. It uses the local environment to instantiate the HttpHandler which can be used for further invocations.
This is the main entry point for lambda invocations using the V2 payload format. It uses the local environment to instantiate the HttpHandler which can be used for further invocations.
Checks the presence of the named Api Key parameter. Filter returns 401 if Api-Key is not found in request.
Renders the contract contents in OpenApi JSON format.
This is the main entry point for lambda invocations coming from an Application LoadBalancer. It uses the local environment to instantiate the HttpHandler which can be used for further invocations.
(extensions in package org.http4k.server) |
(extensions in package org.http4k.server) |
Determines which parts of the HttpMessage will be compared.
The backing store where the approved and actual content will be stored.
Standard Approval JUnit5 extension. Can be used to compare any HttpMessages.
Coordinates the comparison of the content for a test.
Provides a consistent way to manage authorization codes
Provides a mechanism to track OAuth authorization parameters to be used later (i.e. can be used later to generate code and/or tokens)
This is the generic interface used to configure auto-mapping functionality for message format libraries. The various methods here can be used to provide custom mapping behaviour (say for domain classes).
Common base type for all format libraries which can convert directly from String -> Classes
Base JUnit extension for injecting an Approver into a JUnit5 test-case. Implement this to provide custom approval behaviours, or
Checks the presence of basic auth credentials. Filter returns 401 if auth fails.
Checks the presence of bearer auth credentials. Filter returns 401 if auth fails.
Encapsulates the type of bad behaviour to apply to the response.
A BiDiBodyLens provides the bi-directional extraction of an entity from a target body, or the insertion of an entity into a target body.
Represents a bi-directional extraction of an entity from a target Body, or an insertion into a target Body.
A BiDiLens provides the bi-directional extraction of an entity from a target, or the insertion of an entity into a target.
Represents a bi-directional extraction of an entity from a target, or an insertion into a target.
A BiDiMapping defines a reusable bidirectional transformation between an input and output type
Represents a bi-directional extraction of a list of entities from a target, or an insertion into a target.
A BiDiWsMessageLens provides the bi-directional extraction of an entity from a target body, or the insertion of an entity into a target WsMessage.
Represents a bi-directional extraction of an entity from a target Body, or an insertion into a target WsMessage.
If this Body is NOT being returned to the caller (via a Server implementation or otherwise), close() should be called.
A BodyLens provides the uni-directional extraction of an entity from a target body.
Represents a uni-directional extraction of an entity from a target Body.
BodyMode represents a choice between working lazily with streams or eagerly storing the body contents in memory.
(extensions in package org.http4k.format) |
Custom set of By implementations for testing http4k applications. As the backing store is JSoup we are limited to implementing selectors which are supported by that.
(extensions in package org.http4k) |
Useful filters for applying Cache-Controls to request/responses
The Chaos Engine controls the lifecycle of applying Chaotic behaviour to traffic, which is exposed as a standard Http4k Filter. Chaos can be programmatically updated and enabled/disabled. By default, the engine is deactivated, so activate() needs to be called to witness any change in behaviour,
Provides a consistent way to retrieve clients attempting to use an authorization code flow
Result of multiple checks, for which it reports an overall result (ie. any failure is fatal).
Approval testing JUnit5 extension that checks the expected content type is present in the
Basic reporting of ReadinessCheckResults
OpenWhisk Base64 encodes Binary requests and responses when they are sent to the deployed Function. This interface allows for custom implementations of that logic, which might be required if your function supports more than one endpoint (with mixed request/response types).
This models the runtime environment of the shell where the app is running. Optionally pass a separator to use for multi-values otherwise a standard comma is used - this means you MUST override the separator if you have single values which contain commas, otherwise singular environment keys will just retrieve the first value.
This models the key used to get a value out of the Environment using the standard Lens mechanic. Note that if your values contain commas, either use a EnvironmentKey.(mapping).multi.required()/optional()/defaulted() to retrieve the entire list, or override the comma separator in your initial Environment.
Implemented according to https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11
Represents a meaningful “happening” in an app.
Useful EventFilters used in building event processing pipelines to add various types of metadata to the events
This Server provides auto-login functionality without the need for user action.
(extensions in package org.http4k.filter) |
(extensions in package org.http4k.client) |
(extensions in package org.http4k.cloudnative) |
(extensions in package org.http4k.server) |
(extensions in package org.http4k.events) |
(extensions in package org.http4k.routing) |
(extensions in package org.http4k.servlet) |
(extensions in package org.http4k.testing) |
(extensions in package org.http4k.template) |
(extensions in package org.http4k.chaos) |
Read a file from a repository using the GitHub API.
(extensions in package org.http4k.format) |
To implement custom JSON configuration, create your own object singleton. Extra mappings can be added before done() is called.
(extensions in package org.http4k.format) |
Handlebars templating support. Use the function in the constructor to configure the instance.
Represents the set of operational endpoints to ensure that a particular app is working ok. By default provides Readiness and Liveness endpoints, but extra routes can be passed, as can a different renderer implementation for the ReadinessCheck results.
Approval JUnit5 extension configured to compare prettified-HTML messages. Note that this strips
Exposed to allow for insertion into a customised Apache WebServer instance
Exposed to allow for insertion into a customised Netty server instance
A K8S server consists of a main application and a health application, running on 2 different ports. This class provides unified start/stop control.
OpenTracing works using a set of named Singletons. We use the the constant name here to make it simple to get the instances of the required objects.
Exposed to allow for insertion into a customised Apache WebServer instance
Adapts between the Servlet and http4k APIs
Exposed to allow for insertion into a customised Undertow server instance
Simple servlet which wraps an http4k HttpHandler
HttpMessages are designed to be immutable, so any mutation methods return a modified copy of the message.
(extensions in package org.http4k.serverless) |
(extensions in package org.http4k.servlet) |
This is an example implementation which stores CSRF and AccessToken values in an INSECURE client-side cookie. Access-tokens for end-services are fully available to the browser so do not use this in production!
General controls for the Servirtium interactions and how they are recorded to the storage format. The manipulations are used to replace/remove any dynamic parts of the request (eg. “Date” header) so that the traffic can be correctly matched during the replay process.
Provides storage for the recorded Servirtium interaction data.
This is the main entry point for lambda invocations using the direct invocations. It uses the local environment to instantiate the HttpHandler which can be used for further invocations.
To implement custom JSON configuration, create your own object singleton. Extra mappings can be added before done() is called.
To implement custom XML configuration, create your own object singleton. Extra mappings can be added before done() is called.
Jade4j templating support. Use the function in the constructor to configure the instance.
Use this legacy Java client when you’re not yet on Java 11.
Basic JDK-based Client.
This is the contract for all JSON implementations
(extensions in package org.http4k.format) |
Approval JUnit5 extension configured to compare prettified-JSON messages.
(extensions in package org.http4k.format) |
(extensions in package org.http4k.chaos) |
Reporting of ReadinessCheckResults in a JSON tree
(extensions in package org.http4k.format) |
To implement custom JSON configuration, create your own object singleton. Extra mappings can be added before done() is called.
(extensions in package org.http4k.format) |
To implement custom JSON configuration, create your own object singleton extending ConfigurableKotlinxSerialization, passing in the JSON configuration block
A Lens provides the uni-directional extraction of an entity from a target.
Represents a uni-directional extraction of an entity from a target.
(extensions in package org.http4k.core) |
(extensions in package org.http4k.core.body) |
The Liveness check is used to determine if an app is alive.
(extensions in package org.http4k.core) |
Represents a body that is backed by an in-memory ByteBuffer. Closing this has no effect.
Utility class to decode MIME texts.
To implement custom JSON configuration, create your own object singleton. Extra mappings can be added before done() is called.
Represents a uni-directional extraction of a list of entities from a target.
Represents a Multi-part that is backed by a stream, which should be closed after handling the content. The gotchas which apply to StreamBody also apply here..
Default NoOp security filter. Filter allows all traffic through.
Provides persistence for OAuth lifecycle values:
Provides a configured set of objects for use with an OAuth2 provider.
Provide help creating OAuth Authorization Server with Authorization Code Flow
(extensions in package org.http4k.format) |
Contract renderer for OpenApi2 format JSON. Note that for the JSON schema generation, auto-naming of object models is used as the input relies on JSON objects and not JVM classees.
Contract renderer for OpenApi3 format JSON. For the JSON schema generation, naming of object models will default to either reflective or hashcode based depending on if a Auto Json is passed.
Converts a API to OpenApi3 format JSON.
Provides a way to apply extensions to the OpenAPI JSON document.
For creating custom origin policy for allowing CORS
A simple parser intended to parse sequences of name/value pairs.
Represents a uni-directional extraction of an entity from a target path segment.
A PolyHandler represents the combined routing logic of an multiple protocol handlers
Standard interface for creating a configured WebServer which supports Websockets
The Readiness check is used to determine if an app is prepared to receive live traffic.
A Readiness check is used to determine if the pod is ready to receive traffic. An example is to test if the app can talk to it’s database.
The result of a Readiness check. Checks can be combined together with +()
to provide an overall result.
Renders the results of a readiness check
Combined Read/Write storage models, optimised for retrieval.
Combined Read/Write storage models, optimised for replay.
Simple recording events that can be used in tests
A set of endpoints to an application which will control the setting and toggling chaos behaviour. The added endpoints are: GET //status <- check the on off/status of the injected chaos POST //activate <- turn on the chaos. optionally POST a JSON body to set a list of new stages to use. POST //deactivate <- turn off the chaos POST //toggle <- toggle the chaos
This hierarchy of exceptions should be used to indicate that an upstream remote system has failed with a non-successful status code which caused us to stop processing. They are designed to be used with the Server and Client filters which will allow automatic handling and propagation of erroneous responses from upstream.
Provides a stream of traffic for replaying purposes.
In-memory RequestContext store. Override the storeId to use multiple stores in one app.
A little convenience thunk to simplify implementing Router for resource loaders.
Provides HTTP Handlers which respond using pre-stored Requests.
Matches requests for routing purposes.
The result of a matching operation. May or may not contain a matched HttpHandler.
Composite HttpHandler which can potentially service many different URL patterns. Should return a 404 Response if it cannot service a particular Request.
A secret is a value which tries very hard not to expose itself as a string, by storing it’s value in a byte array. You can “use” the value only once, after which the value is destroyed
Endpoint security. Provides filter to be applied to endpoints for all requests.
Provides rendering of Security models in to OpenApi specs.
JUnit 5 extension for recording HTTP traffic to disk in Servirtium format.
JUnit 5 extension for replaying HTTP traffic from disk in Servirtium format.
Convenience class to create Moshi Adapter Factory
Defines a periodic element during which a particular ChaosBehaviour is active.
Represents a body that is backed by a (lazy) InputStream. Operating with StreamBody has a number of potential gotchas:
(extensions in package org.http4k.core) |
(extensions in package org.http4k.contract) |
(extensions in package org.http4k) |
(extensions in package org.http4k.routing) |
(extensions in package org.http4k.routing.inspect) |
A set of standardised String <-> Type conversions which are used throughout http4k
(extensions in package org.http4k) |
Supported template implementations for templating engine implementations
A class that is used for offline testing of a routed Websocket, without starting up a Server. Calls are routed synchronously to the receiving Websocket, and error are propagated to the caller.
Runs through a list of lenses and extracts the values from each one, collecting the errors
Represents a connected Websocket instance, and can be passed around an application. This is configured to react to events on the WS event stream by attaching listeners.
A WsMessageLens provides the extraction of an entity from a target WsMessage.
Represents a extraction of an entity from a target WsMessage.
Approval JUnit5 extension configured to compare prettified-XML messages.