The adapter Tier 1 runs first and the seam's tests bind. Its rules are a
table in an Agent, one per test. A test binds it through the
configuration override as {Mediate.Test.Fake, rules: pid}. An entry
allows one holder one operation on one object or on any object of a
type. A holder is one subject, an account whatever its kind, or any
subject. The fake allows nothing else.
Without a table the fake answers with the verdict option, which is
:deny unless the test says otherwise.
It returns a value of the real type everywhere the real adapters do.
scope returns a real dynamic. A table told to fail/2 answers every
call with the reason :engine_unreachable, so the port's fail-closed
path runs against it.
Summary
Types
A holder, an operation, and an object reference whose id can be :any.
Who an entry allows: one subject, an account whatever kind asks, or anyone.
Functions
Allow the holder to perform operation on the object reference, whose id can be :any.
The answer the fake gives with no table bound.
The entries, sorted.
Make every call fail with the detail. nil makes the calls answer again.
Empty the table and clear any failure.
Remove one entry.
Starts an empty rule table, unnamed.
Types
@type entry() :: {holder(), atom(), {atom(), Mediate.Id.t() | term() | :any}}
A holder, an operation, and an object reference whose id can be :any.
@type holder() :: Mediate.subject() | Mediate.Id.t() | :any
Who an entry allows: one subject, an account whatever kind asks, or anyone.
Functions
Allow the holder to perform operation on the object reference, whose id can be :any.
@spec answer(keyword()) :: Mediate.Answer.t()
The answer the fake gives with no table bound.
The entries, sorted.
Make every call fail with the detail. nil makes the calls answer again.
@spec reset(pid()) :: :ok
Empty the table and clear any failure.
Remove one entry.
@spec start_link() :: Agent.on_start()
Starts an empty rule table, unnamed.