Bourse.ExchangeAcceptanceFixtures (bourse v0.1.0)

Copy Markdown View Source

Records and replays fixture-signed requests whose live equivalents exchanges accepted.

Live request material stays in memory. A golden contains the same request rebuilt with committed fixture credentials and frozen clock overrides, never live keys or signature bytes.

Summary

Functions

Returns the ten first-class venues covered by this oracle.

Returns one venue's accepted-request golden path.

Returns one signed profile's accepted-request golden path.

Returns the accepted-request fixture root.

Loads every golden named by the manifest.

Returns the accepted-request manifest path.

Returns every configured {venue, method} signed acceptance profile.

Calls a venue with one signed profile and returns its fixture-signed golden.

Calls every signed profile for one venue and returns safe fixture-signed goldens.

Deterministically rebuilds and checks one committed fixture-signed golden.

Rejects a term containing any supplied live credential or authentication value.

Types

golden()

@type golden() :: %{required(String.t()) => term()}

record_option()

@type record_option() :: {:transport, transport()}

transport()

@type transport() :: (Req.Request.t() ->
                  {Req.Request.t(), Req.Response.t() | Exception.t()})

Functions

first_class_venues()

@spec first_class_venues() :: [String.t()]

Returns the ten first-class venues covered by this oracle.

fixture_path(venue)

@spec fixture_path(String.t()) :: Path.t()

Returns one venue's accepted-request golden path.

fixture_path(venue, method)

@spec fixture_path(String.t(), atom()) :: Path.t()

Returns one signed profile's accepted-request golden path.

fixture_root()

@spec fixture_root() :: Path.t()

Returns the accepted-request fixture root.

load_all!()

@spec load_all!() :: [golden()]

Loads every golden named by the manifest.

manifest_path()

@spec manifest_path() :: Path.t()

Returns the accepted-request manifest path.

profiles()

@spec profiles() :: [{String.t(), atom()}]

Returns every configured {venue, method} signed acceptance profile.

record(venue, opts \\ [])

@spec record(String.t(), [record_option()]) :: {:ok, golden()} | {:error, term()}

Calls a venue with one signed profile and returns its fixture-signed golden.

record_all(venue, opts \\ [])

@spec record_all(String.t(), [record_option()]) ::
  {:ok, [golden()]} | {:error, term()}

Calls every signed profile for one venue and returns safe fixture-signed goldens.

replay(map)

@spec replay(golden()) :: :ok | {:error, term()}

Deterministically rebuilds and checks one committed fixture-signed golden.

validate_no_material(value, forbidden_values)

@spec validate_no_material(term(), [String.t()]) ::
  :ok | {:error, :sensitive_material_present}

Rejects a term containing any supplied live credential or authentication value.