RigInboundGateway.ApiProxy.Validations (Reactive Interaction Gateway v3.0.0-alpha.2) View Source

Used to validate APIs configuration for reverse proxy. Validates use cases such as setting "target" to "kafka" but not "topic", which is required in such case.

When any error occurs during RIG start -> process will exit. When any error occurs during REST API request -> process won't exit, but instead API returns 400 -- bad request.

Link to this section Summary

Link to this section Types

Specs

error_list_t() :: [{String.t(), error_t()}]

Specs

error_map_t() :: %{
  required(String.t()) => [%{required(String.t() | atom()) => String.t()}]
}

Specs

error_t() :: [{:error, String.t() | atom(), atom(), String.t()}]

Link to this section Functions

Specs

config() :: any()

Returns module configuration.

If application environment contains values in Keyword or Map struct, defaults from macro usage will be recursively merged with application configuration.

If one of the configuration parameters does not exist or can not be resolved, raises ArgumentError.

Specs

to_map(error_list_t()) :: error_map_t()
Link to this function

type_validation(map, key, type, fun)

View Source

Specs

type_validation(map(), String.t(), String.t(), function()) :: error_list_t()

Specs

Specs

Specs

Link to this function

validate_auth(errors, api)

View Source

Specs

Specs

validate_auth_type(RigInboundGateway.ApiProxy.Api.t()) :: error_t()
Link to this function

validate_endpoint_target(endpoint, targets)

View Source

Specs

validate_endpoint_target(RigInboundGateway.ApiProxy.Api.endpoint(), [String.t()]) ::
  boolean()
Link to this function

validate_endpoints(errors, api)

View Source

Specs

Link to this function

validate_integer(map, key)

View Source

Specs

validate_integer(map(), String.t()) :: error_list_t()

Specs

validate_list(map(), String.t()) :: error_list_t()

Specs

Link to this function

validate_required_props(errors, api)

View Source

Specs

validate_required_props(error_list_t(), RigInboundGateway.ApiProxy.Api.t()) ::
  error_list_t()
Link to this function

validate_secured_endpoint(api, arg2)

View Source

Specs

Link to this function

validate_string(map, key)

View Source

Specs

validate_string(map(), String.t()) :: error_list_t()
Link to this function

validate_version_data(arg1)

View Source

Specs

validate_version_data(RigInboundGateway.ApiProxy.Api.t()) :: error_list_t()
Link to this function

with_any_error(errors, min_errors \\ 1)

View Source

Specs

with_any_error(error_list_t(), integer()) :: error_list_t()
Link to this function

with_nested_presence(arg1, key, map)

View Source

Specs

with_nested_presence(boolean(), String.t() | atom(), map()) :: error_t()