diff --git a/CHANGELOG.md b/CHANGELOG.md index d5f69ec8f..21030ae62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Unreleased changes are available as `avenga/couper:edge` container. * **Added** * Modifier (`set/add/remove_form_params`) for the form parameters ([#223](https://github.com/avenga/couper/pull/223)) + * Modifier (`set_response_status`) to be able to modify the response HTTP status code ([#250](https://github.com/avenga/couper/pull/250)) * **Changed** * Stronger configuration check for `path` and `path_prefix` attributes, possibly resulting in configuration errors ([#232](https://github.com/avenga/couper/pull/232)) diff --git a/config/backend.go b/config/backend.go index 7bc6d7994..2a5ea9fac 100644 --- a/config/backend.go +++ b/config/backend.go @@ -50,11 +50,12 @@ func (b Backend) Schema(inline bool) *hcl.BodySchema { type Inline struct { meta.Attributes - BasicAuth string `hcl:"basic_auth,optional"` - Hostname string `hcl:"hostname,optional"` - Origin string `hcl:"origin,optional"` - PathPrefix string `hcl:"path_prefix,optional"` - ProxyURL string `hcl:"proxy,optional"` + BasicAuth string `hcl:"basic_auth,optional"` + Hostname string `hcl:"hostname,optional"` + Origin string `hcl:"origin,optional"` + PathPrefix string `hcl:"path_prefix,optional"` + ProxyURL string `hcl:"proxy,optional"` + ResponseStatus *uint8 `hcl:"set_response_status,optional"` } schema, _ = gohcl.ImpliedBodySchema(&Inline{}) diff --git a/config/endpoint.go b/config/endpoint.go index 77da46867..60ee1dff4 100644 --- a/config/endpoint.go +++ b/config/endpoint.go @@ -40,8 +40,9 @@ func (e Endpoint) Schema(inline bool) *hcl.BodySchema { type Inline struct { meta.Attributes - Requests Requests `hcl:"request,block"` - Proxies Proxies `hcl:"proxy,block"` + Proxies Proxies `hcl:"proxy,block"` + Requests Requests `hcl:"request,block"` + ResponseStatus *uint8 `hcl:"set_response_status,optional"` } schema, _ := gohcl.ImpliedBodySchema(&Inline{}) return schema diff --git a/config/error_handler.go b/config/error_handler.go index e76f46e8f..eede6f83d 100644 --- a/config/error_handler.go +++ b/config/error_handler.go @@ -39,8 +39,9 @@ func (e ErrorHandler) Schema(inline bool) *hcl.BodySchema { type Inline struct { meta.Attributes - Proxies Proxies `hcl:"proxy,block"` - Requests Requests `hcl:"request,block"` + Proxies Proxies `hcl:"proxy,block"` + Requests Requests `hcl:"request,block"` + ResponseStatus *uint8 `hcl:"set_response_status,optional"` } schema, _ := gohcl.ImpliedBodySchema(&Inline{}) diff --git a/docs/README.md b/docs/README.md index 3aad94dda..944f11d55 100644 --- a/docs/README.md +++ b/docs/README.md @@ -102,33 +102,33 @@ the gateway. There are a large number of options, but let's focus on the main st ```hcl server "my_project" { files { - ... + # ... } spa { - ... + # ... } api { access_control = ["foo"] endpoint "/bar" { proxy { - backend {...} + backend { } } request "sub-request" { - backend {...} + backend { } } - response {...} + response { } } } } definitions { - ... + # ... } settings { - ... + # ... } ``` diff --git a/docs/REFERENCE.md b/docs/REFERENCE.md index fcc215552..9c7dc8c74 100644 --- a/docs/REFERENCE.md +++ b/docs/REFERENCE.md @@ -1,96 +1,97 @@ -* [Reference](#reference) - * [Block Reference](#block-reference) - * [Server Block](#server-block) - * [Files Block](#files-block) - * [SPA Block](#spa-block) - * [API Block](#api-block) - * [Endpoint Block](#endpoint-block) - * [Proxy Block](#proxy-block) - * [Request Block](#request-block) - * [Response Block](#response-block) - * [Backend Block](#backend-block) - * [Transport Settings Attributes](#transport-settings-attributes) - * [Timings](#timings) - * [OpenAPI Block](#openapi-block) - * [CORS Block](#cors-block) - * [OAuth2 Block](#oauth2-block) - * [Definitions Block](#definitions-block) - * [Basic Auth Block](#basic-auth-block) - * [JWT Block](#jwt-block) - * [JWT Signing Profile Block](#jwt-signing-profile-block) - * [SAML Block](#saml-block) - * [Settings Block](#settings-block) - * [Access Control](#access-control) - * [Health-Check](#health-check) - * [Variables](#variables) - * [env](#env) - * [request](#request) - * [backend_requests](#backend_requests) - * [backend_responses](#backend_responses) - * [Functions](#functions) - * [Modifier](#modifier) - * [Request Header](#request-header) - * [Response Header](#response-header) - * [Parameters](#parameters) - * [Query Parameter](#query-parameter) - * [Form Parameter](#form-parameter) - * [Path Parameter](#path-parameter) +- [Reference](#reference) + - [Block Reference](#block-reference) + - [Server Block](#server-block) + - [Files Block](#files-block) + - [SPA Block](#spa-block) + - [API Block](#api-block) + - [Endpoint Block](#endpoint-block) + - [Proxy Block](#proxy-block) + - [Request Block](#request-block) + - [Response Block](#response-block) + - [Backend Block](#backend-block) + - [Transport Settings Attributes](#transport-settings-attributes) + - [Timings](#timings) + - [OpenAPI Block](#openapi-block) + - [CORS Block](#cors-block) + - [OAuth2 Block](#oauth2-block) + - [Definitions Block](#definitions-block) + - [Basic Auth Block](#basic-auth-block) + - [JWT Block](#jwt-block) + - [JWT Signing Profile Block](#jwt-signing-profile-block) + - [SAML Block](#saml-block) + - [Settings Block](#settings-block) + - [Access Control](#access-control) + - [Health-Check](#health-check) + - [Variables](#variables) + - [env](#env) + - [request](#request) + - [backend_requests](#backend_requests) + - [backend_responses](#backend_responses) + - [Functions](#functions) + - [Modifier](#modifier) + - [Request Header](#request-header) + - [Response Header](#response-header) + - [Set Response Status](#set-response-status) + - [Parameters](#parameters) + - [Query Parameter](#query-parameter) + - [Form Parameter](#form-parameter) + - [Path Parameter](#path-parameter) # Reference -## Block Reference +## Block Reference ### Server Block The `server` block is the main configuration block of Couper's configuration file. -| Block | Description | -|:-------------------------------------|:------------| -| *context* | Root of the configuration file. | -| *label* | ⚠ Mandatory. | -| **Nested blocks** | **Description** | -| [CORS Block](#cors-block) | Configures CORS behavior for [Files Block](#files-block), [SPA Block](#spa-block) and [API Block(s)](#api-block) contexts. | -| [Files Block](#files-block) | Configures the file serving. | -| [SPA Block](#spa-block) | Configures the Web serving for SPA assets. | -| [API Block(s)](#api-block) | Configures routing and communication with backend(s). | -| [Endpoint Block(s)](#endpoint-block) | Configures specific endpoint(s) for current `Server Block` context. | -| **Attributes** | **Description** | -| `base_path` | | -| `hosts` | | -| `error_file` | | -| `access_control` | | +| Block | Description | +| :----------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| _context_ | Root of the configuration file. | +| _label_ | ⚠ Mandatory. | +| **Nested blocks** | **Description** | +| [CORS Block](#cors-block) | Configures CORS behavior for [Files Block](#files-block), [SPA Block](#spa-block) and [API Block(s)](#api-block) contexts. | +| [Files Block](#files-block) | Configures the file serving. | +| [SPA Block](#spa-block) | Configures the Web serving for SPA assets. | +| [API Block(s)](#api-block) | Configures routing and communication with backend(s). | +| [Endpoint Block(s)](#endpoint-block) | Configures specific endpoint(s) for current `Server Block` context. | +| **Attributes** | **Description** | +| `base_path` | | +| `hosts` | | +| `error_file` | | +| `access_control` | | ### Files Block The `files` block configures the file serving. -| Block | Description | -|:--------------------------|:------------| -| *context* | [Server Block](#server-block). | -| *label* | Not implemented. | -| **Nested blocks** | **Description** | -| [CORS Block](#cors-block) | Configures CORS behavior for the current `Files Block` context. Overrides the CORS behavior of the parent [Server Block](#server-block). | -| **Attributes** | **Description** | -| `base_path` | | -| `document_root` | | -| `error_file` | | -| `access_control` | | +| Block | Description | +| :------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| _context_ | [Server Block](#server-block). | +| _label_ | Not implemented. | +| **Nested blocks** | **Description** | +| [CORS Block](#cors-block) | Configures CORS behavior for the current `Files Block` context. Overrides the CORS behavior of the parent [Server Block](#server-block). | +| **Attributes** | **Description** | +| `base_path` | | +| `document_root` | | +| `error_file` | | +| `access_control` | | ### SPA Block The `spa` block configures the Web serving for SPA assets. -| Block | Description | -|:--------------------------|:------------| -| *context* | [Server Block](#server-block). | -| *label* | Not implemented. | -| **Nested blocks** | **Description** | -| [CORS Block](#cors-block) | Configures CORS behavior for the current `SPA Block` context. Overrides the CORS behavior of the parent [Server Block](#server-block). | -| **Attributes** | **Description** | -| `base_path` | | -| `bootstrap_file` | | -| `paths` | | -| `access_control` | | +| Block | Description | +| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| _context_ | [Server Block](#server-block). | +| _label_ | Not implemented. | +| **Nested blocks** | **Description** | +| [CORS Block](#cors-block) | Configures CORS behavior for the current `SPA Block` context. Overrides the CORS behavior of the parent [Server Block](#server-block). | +| **Attributes** | **Description** | +| `base_path` | | +| `bootstrap_file` | | +| `paths` | | +| `access_control` | | ### API Block @@ -100,39 +101,39 @@ remote/local backend service(s), configured in the nested `Server Block`. If an error occurred for api endpoints the response gets processed as json error with an error body payload. This can be customized via `error_file`. -| Block | Description | -|:-------------------------------------|:------------| -| *context* | [Server Block](#server-block). | -| *label* | Optional. | -| **Nested blocks** | **Description** | -| [Endpoint Block(s)](#endpoint-block) | Configures specific endpoint(s) for current `API Block` context. | -| [CORS Block](#cors-block) | Configures CORS behavior for the current `API Block` context. Overrides the CORS behavior of the parent [Server Block](#server-block). | -| **Attributes** | **Description** | -| `base_path` | | -| `error_file` | | -| `access_control` | | +| Block | Description | +| :----------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| _context_ | [Server Block](#server-block). | +| _label_ | Optional. | +| **Nested blocks** | **Description** | +| [Endpoint Block(s)](#endpoint-block) | Configures specific endpoint(s) for current `API Block` context. | +| [CORS Block](#cors-block) | Configures CORS behavior for the current `API Block` context. Overrides the CORS behavior of the parent [Server Block](#server-block). | +| **Attributes** | **Description** | +| `base_path` | | +| `error_file` | | +| `access_control` | | ### Endpoint Block -The `endpoint` blocks define the entry points of Couper. The mandatory *label* +The `endpoint` blocks define the entry points of Couper. The mandatory _label_ defines the path suffix for the incoming client request. The `path` attribute changes the path for the outgoing request (compare [request routing example](./README.md#request-routing-example)). Each `Endpoint Block` must produce an explicit or implicit client response. -| Block | Description | -|:-----------------------------------|:------------| -| *context* | [Server Block](#server-block), [API Block](#api-block) | -| *label* | | -| **Nested blocks** | **Description** | -| [Proxy Block(s)](#proxy-block) | | -| [Request Block(s)](#request-block) | | -| [Response Block](#response-block) | | -| **Attributes** | **Description** | -| `request_body_limit` | | -| `path` | | -| `access_control` | | -| [Modifier](#modifier) | | +| Block | Description | +| :--------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| _context_ | [Server Block](#server-block), [API Block](#api-block) | +| _label_ | | +| **Nested blocks** | **Description** | +| [Proxy Block(s)](#proxy-block) | | +| [Request Block(s)](#request-block) | | +| [Response Block](#response-block) | | +| **Attributes** | **Description** | +| `request_body_limit` | | +| `path` | | +| `access_control` | | +| [Modifier](#modifier) | | ### Proxy Block @@ -140,16 +141,16 @@ The `proxy` block creates and executes a proxy request to a backend service. ⚠ Multiple `proxy` and `request` blocks are executed in parallel. -| Block | Description | -|:----------------------------------------------------|:------------| -| *context* | [Endpoint Block](#endpoint-block). | -| *label* | | -| **Nested blocks** | **Description** | -| [Backend Block](#backend-block) | | -| **Attributes** | **Description** | -| [Backend Block Reference](#backend-block) | | -| `url` | | -| [Modifier](#modifier) | | +| Block | Description | +| :---------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| _context_ | [Endpoint Block](#endpoint-block). | +| _label_ | | +| **Nested blocks** | **Description** | +| [Backend Block](#backend-block) | | +| **Attributes** | **Description** | +| [Backend Block Reference](#backend-block) | | +| `url` | | +| [Modifier](#modifier) | | ### Request Block @@ -157,74 +158,74 @@ The `request` block creates and executes a request to a backend service. ⚠ Multiple `proxy` and `request` blocks are executed in parallel. -| Block | Description | -|:----------------------------------------------------|:------------| -| *context* | [Endpoint Block](#endpoint-block). | -| *label* | | -| **Nested blocks** | **Description** | -| [Backend Block](#backend-block) | | -| **Attributes** | **Description** | -| [Backend Block Reference](#backend-block) | | -| `url` | | -| `body` | | -| `json_body` | | -| `form_body` | | -| `method` | | -| `headers` | | -| `query_params` | | +| Block | Description | +| :---------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| _context_ | [Endpoint Block](#endpoint-block). | +| _label_ | | +| **Nested blocks** | **Description** | +| [Backend Block](#backend-block) | | +| **Attributes** | **Description** | +| [Backend Block Reference](#backend-block) | | +| `url` | | +| `body` | | +| `json_body` | | +| `form_body` | | +| `method` | | +| `headers` | | +| `query_params` | | ### Response Block The `response` block creates and sends a client response. -| Block | Description | -|:---------------|:------------| -| *context* | [Endpoint Block](#endpoint-block). | -| *label* | Not implemented. | -| **Attributes** | **Description** | -| `body` | | +| Block | Description | +| :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------- | +| _context_ | [Endpoint Block](#endpoint-block). | +| _label_ | Not implemented. | +| **Attributes** | **Description** | +| `body` | | | `json_body` | | -| `status` | | -| `headers` | | +| `status` | | +| `headers` | | ### Backend Block A `backend` defines the connection to a local/remote backend service. Backends -can be defined in the [Definitions Block](#definitions-block) and use the *label* +can be defined in the [Definitions Block](#definitions-block) and use the _label_ as reference. -| Block | Description | -|:--------------------------------|:------------| -| *context* | [Definitions Block](#definitions-block), [Proxy Block](#proxy-block), [Request Block](#request-block). | -| *label* | ⚠ Mandatory in the [Definitions Block](#definitions-block). | -| **Nested blocks** | **Description** | -| [OpenAPI Block](#openapi-block) | | -| [OAuth2 Block](#oauth2-block) | -| **Attributes** | **Description** | -| `basic_auth` | | +| Block | Description | +| :------------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| _context_ | [Definitions Block](#definitions-block), [Proxy Block](#proxy-block), [Request Block](#request-block). | +| _label_ | ⚠ Mandatory in the [Definitions Block](#definitions-block). | +| **Nested blocks** | **Description** | +| [OpenAPI Block](#openapi-block) | | +| [OAuth2 Block](#oauth2-block) | | +| **Attributes** | **Description** | +| `basic_auth` | | | `hostname` | | -| `origin` | | -| `path` | | -| `path_prefix` | -| [Modifier](#modifier) | | +| `origin` | | +| `path` | | +| `path_prefix` | | +| [Modifier](#modifier) | | #### Transport Settings Attributes -| Name | Type | Default | Description | -|:---------------------------------|:-------------------|:----------------|:------------| -| `connect_timeout` | [Timing](#timings) | `10s` | The total timeout for dialing and connect to the origin. | -| `disable_certificate_validation` | bool | `false` | Disables the peer certificate validation. | -| `disable_connection_reuse` | bool | `false` | Disables reusage of connections to the origin. | -| `http2` | bool | `false` | Enables the HTTP2 support. | -| `max_connections` | int | `0` (unlimited) | The maximum number of concurrent connections in any state (*active* or *idle*) to the origin. | -| `proxy` | string | (no default) | A proxy URL for the related origin request. Example: `http://SERVER-IP_OR_NAME:PORT`. | -| `timeout` | [Timing](#timings) | `300s` | The total deadline duration a backend request has for write and read/pipe. | -| `ttfb_timeout` | [Timing](#timings) | `60s` | The duration from writing the full request to the origin and receiving the answer. | +| Name | Type | Default | Description | +| :------------------------------- | :----------------- | :-------------- | :-------------------------------------------------------------------------------------------- | +| `connect_timeout` | [Timing](#timings) | `10s` | The total timeout for dialing and connect to the origin. | +| `disable_certificate_validation` | bool | `false` | Disables the peer certificate validation. | +| `disable_connection_reuse` | bool | `false` | Disables reusage of connections to the origin. | +| `http2` | bool | `false` | Enables the HTTP2 support. | +| `max_connections` | int | `0` (unlimited) | The maximum number of concurrent connections in any state (_active_ or _idle_) to the origin. | +| `proxy` | string | (no default) | A proxy URL for the related origin request. Example: `http://SERVER-IP_OR_NAME:PORT`. | +| `timeout` | [Timing](#timings) | `300s` | The total deadline duration a backend request has for write and read/pipe. | +| `ttfb_timeout` | [Timing](#timings) | `60s` | The duration from writing the full request to the origin and receiving the answer. | #### Timings | Valid time unit | Description | -|:----------------|:-------------| +| :-------------- | :----------- | | `ns` | nanoseconds | | `us` (or `µs`) | microseconds | | `ms` | milliseconds | @@ -241,88 +242,87 @@ requests, and the Couper client from invalid answers. An example can be found To do so Couper uses the [OpenAPI 3 standard](https://www.openapis.org/) to load the definitions from a given document defined with the `file` attribute. -| Block | Description | -|:-----------------------------|:------------| -| *context* | [Backend Block](#backend-block). | -| *label* | Not implemented. | -| **Attributes** | **Description** | -| `file` | | -| `ignore_request_violations` | | +| Block | Description | +| :--------------------------- | :--------------------------------------------------------------------------------------------------------------- | +| _context_ | [Backend Block](#backend-block). | +| _label_ | Not implemented. | +| **Attributes** | **Description** | +| `file` | | +| `ignore_request_violations` | | | `ignore_response_violations` | | **Caveats**: While ignoring request violations an invalid method or path would -lead to a non-matching *route* which is still required for response validations. +lead to a non-matching _route_ which is still required for response validations. In this case the response validation will fail if not ignored too. ### CORS Block The CORS block configures the CORS (Cross-Origin Resource Sharing) behavior in Couper. -| Block | Description | -|:--------------------|:------------| -| *context* | [Server Block](#server-block), [Files Block](#files-block), [SPA Block](#spa-block), [API Block](#api-block). | -| *label* | Not implemented. | -| **Attributes** | **Description** | +| Block | Description | +| :------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| _context_ | [Server Block](#server-block), [Files Block](#files-block), [SPA Block](#spa-block), [API Block](#api-block). | +| _label_ | Not implemented. | +| **Attributes** | **Description** | | `allowed_origins` | | -| `allow_credentials` | | -| `disable` | | -| `max_age` | | +| `allow_credentials` | | +| `disable` | | +| `max_age` | | ### OAuth2 Block -| Block | Description | -|:--------------------------------|:------------| -| *context* | [Backend Block](#backend-block). | -| *label* | Not implemented. | -| **Nested blocks** | **Description** | -| [Backend Block](#backend-block) | Optional. | -| **Attributes** | **Description** | -| `backend` | | -| `grant_type` | | -| `token_endpoint` | | -| `client_id` | | -| `client_secret` | | -| `retries` | | +| Block | Description | +| :------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| _context_ | [Backend Block](#backend-block). | +| _label_ | Not implemented. | +| **Nested blocks** | **Description** | +| [Backend Block](#backend-block) | Optional. | +| **Attributes** | **Description** | +| `backend` | | +| `grant_type` | | +| `token_endpoint` | | +| `client_id` | | +| `client_secret` | | +| `retries` | | | `token_endpoint_auth_method` | | -| `scope` | | - +| `scope` | | ### Definitions Block Use the `definitions` block to define configurations you want to reuse. [Access Control](#access-control) is **always** defined in the `Definitions Block`. -| Block | Description | -|:-----------------------------------------|:------------| -| *context* | Root of the configuration file. | -| *label* | Not implemented. | -| **Nested blocks** | **Description** | -| [Backend Block(s)](#backend-block) | Defines `Backend Block(s)`. | -| [Basic Auth Block(s)](#basic-auth-block) | Defines `Basic Auth Block(s)`. | -| [JWT Block(s)](#jwt-block) | Defines `JWT Block(s)`. | +| Block | Description | +| :--------------------------------------------------------- | :-------------------------------------- | +| _context_ | Root of the configuration file. | +| _label_ | Not implemented. | +| **Nested blocks** | **Description** | +| [Backend Block(s)](#backend-block) | Defines `Backend Block(s)`. | +| [Basic Auth Block(s)](#basic-auth-block) | Defines `Basic Auth Block(s)`. | +| [JWT Block(s)](#jwt-block) | Defines `JWT Block(s)`. | | [JWT Signing Profile Block(s)](#jwt-signing-profile-block) | Defines `JWT Signing Profile Block(s)`. | -| [SAML Block(s)](#saml-block) | Defines `SAML Block(s)`. | +| [SAML Block(s)](#saml-block) | Defines `SAML Block(s)`. | ### Basic Auth Block The `basic_auth` block lets you configure basic auth for your gateway. Like all [Access Control](#access-control) types, the `Basic Auth` block is defined in the [Definitions Block](#definitions-block) and can be referenced in all configuration -blocks by its mandatory *label*. +blocks by its mandatory _label_. If both `user`/`password` and `htpasswd_file` are configured, the incoming credentials from the `Authorization` request HTTP header field are checked against `user`/`password` if the user matches, and against the data in the file referenced by `htpasswd_file` otherwise. -| Block | Description | -|:----------------|:------------| -| *context* | [Definitions Block](#definitions-block). | -| *label* | ⚠ Mandatory. | -| **Attributes** | **Description** | -| `user` | | -| `password` | | -| `htpasswd_file` | | +| Block | Description | +| :-------------- | :----------------------------------------------------------------------------------------------------------- | +| _context_ | [Definitions Block](#definitions-block). | +| _label_ | ⚠ Mandatory. | +| **Attributes** | **Description** | +| `user` | | +| `password` | | +| `htpasswd_file` | | | `realm` | | ### JWT Block @@ -330,37 +330,37 @@ by `htpasswd_file` otherwise. The `jwt` block lets you configure JSON Web Token access control for your gateway. Like all [Access Control](#access-control) types, the `jwt` block is defined in the `definitions` block and can be referenced in all configuration blocks by its -mandatory *label*. - -| Block | Description | -|:---------------------------|:------------| -| *context* | [Definitions Block](#definitions-block). | -| *label* | ⚠ Mandatory. | -| **Attributes** | **Description** | -| `cookie = "AccessToken"` | | +mandatory _label_. + +| Block | Description | +| :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | +| _context_ | [Definitions Block](#definitions-block). | +| _label_ | ⚠ Mandatory. | +| **Attributes** | **Description** | +| `cookie = "AccessToken"` | | | `header = "Authorization"` | | -| `key` | | -| `key_file` | | -| `signature_algorithm` | | -| **`claims`** | | -| **`required_claims`** | | +| `key` | | +| `key_file` | | +| `signature_algorithm` | | +| **`claims`** | | +| **`required_claims`** | | ### JWT Signing Profile Block The `jwt_signing_profile` block lets you configure a JSON Web Token signing profile for your gateway. It is referenced in the [`jwt_sign()` function](#functions) -by its mandatory *label*. - -| Name | Description | -|:--------------------------|:------------| -| *context* | [Definitions Block](#definitions-block). | -| *label* | ⚠ Mandatory. | -| **Attributes** | **Description** | -| `key` | | -| `key_file` | | -| `signature_algorithm` | | -| `ttl` | | -| **`claims`** | | +by its mandatory _label_. + +| Name | Description | +| :-------------------- | :-------------------------------------------------------------------------------------------------------------------- | +| _context_ | [Definitions Block](#definitions-block). | +| _label_ | ⚠ Mandatory. | +| **Attributes** | **Description** | +| `key` | | +| `key_file` | | +| `signature_algorithm` | | +| `ttl` | | +| **`claims`** | | ### SAML Block @@ -368,42 +368,42 @@ The `saml` block lets you configure the `saml_sso_url()` [function](#functions) control for a SAML Assertion Consumer Service (ACS) endpoint. Like all [Access Control](#access-control) types, the `saml` block is defined in the `definitions` block and can be referenced in all configuration blocks by its -mandatory *label*. - -| Block | Description | -|:---------------------------|:------------| -| *context* | [Definitions Block](#definitions-block). | -| *label* | ⚠ Mandatory. | -| **Attributes** | **Description** | -| `idp_metadata_file` | | -| `sp_acs_url` | | -| `sp_entity_id` | | -| `array_attributes` | | +mandatory _label_. + +| Block | Description | +| :------------------ | :------------------------------------------------------------------------------------------------------ | +| _context_ | [Definitions Block](#definitions-block). | +| _label_ | ⚠ Mandatory. | +| **Attributes** | **Description** | +| `idp_metadata_file` | | +| `sp_acs_url` | | +| `sp_entity_id` | | +| `array_attributes` | | Some information from the assertion consumed at the ACS endpoint is provided in the context at `request.context.