Relyra.Testing (relyra v1.9.0)

Copy Markdown View Source

Public framework-neutral testing fixtures for Relyra adopters.

The helpers in this namespace produce explicit testing fixture data for the real verifier path. They do not mutate application environment, persistent terms, ETS tables, or production resolver state.

Summary

Functions

Builds Relyra.consume_response/3 options for a testing fixture.

Builds a signed fixture whose returned trust material does not match the signing key.

Builds POST parameters for a testing fixture.

Builds a signed success testing fixture.

Builds a signed fixture whose signed assertion content is mutated after signing.

Builds a signed fixture whose assertion audience differs from the configured SP audience.

Types

consume_opt()

@type consume_opt() :: {atom(), term()}

Functions

consume_opts(fixture, opts \\ [])

@spec consume_opts(
  Relyra.Testing.Fixture.t(),
  keyword()
) :: [consume_opt()]

Builds Relyra.consume_response/3 options for a testing fixture.

The returned options use public Relyra.Testing.Adapters.* modules and thread all trust/correlation inputs through explicit fixture data.

invalid_signature(opts \\ [])

@spec invalid_signature(keyword()) :: Relyra.Testing.Fixture.t()

Builds a signed fixture whose returned trust material does not match the signing key.

post_params(fixture, opts \\ [])

@spec post_params(
  Relyra.Testing.Fixture.t(),
  keyword()
) :: map()

Builds POST parameters for a testing fixture.

By default this returns %{"SAMLResponse" => fixture.encoded_response} and includes "RelayState" only when the fixture has a non-empty relay state.

signed_success(opts \\ [])

@spec signed_success(keyword()) :: Relyra.Testing.Fixture.t()

Builds a signed success testing fixture.

The fixture contains a signed test response, Base64 POST payload, matching test certificate, connection, request intent, relay state, and expected outcome. It is test-only data for the real verifier path; it is not an IdP, broker, or production trust source.

tampered_digest(opts \\ [])

@spec tampered_digest(keyword()) :: Relyra.Testing.Fixture.t()

Builds a signed fixture whose signed assertion content is mutated after signing.

wrong_audience(opts \\ [])

@spec wrong_audience(keyword()) :: Relyra.Testing.Fixture.t()

Builds a signed fixture whose assertion audience differs from the configured SP audience.