You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An integration plugin has two halves. admin() and client() cover the one
that faces the panel, signing and retrying every call. The other half is
the service the plugin exists to connect the panel to, and the SDK had
nothing to say about it: a plugin built its own curl handle, which meant
the half most worth testing could not be reached from a test.
Plugin::http() hands back the injected client, or a default curl one
built from the configured timeout. A test that passes Plugin::create() a
fake now sees both halves. Its two arguments are for the case that
differs from the default, a service behind a certificate nothing in the
trust store signed, and are ignored when a client was injected so that
asking for them in production code cannot defeat a fake in a test.
FakeHttpClient moves out of the SDK's own tests and ships. Every plugin
needs exactly it, and writing it again in each one is how plugins end up
with slightly different ideas of what an HTTP failure looks like.
Manifest::directory() is the plugin's own root, for reading a file it
ships rather than one the panel wrote. Resolved through realpath,
because it ends up in front of an operator as a path to type: a manifest
discovered from public/index.php would otherwise hand back a path with
"/public/.." in the middle of it.
Also corrects what UiResponse::redirect() says about itself. It claimed
an external URL opens in a new tab. The panel follows only its own
paths and logs that it refused anything else, so a link out belongs in a
Text::markdown() component, where the viewer can see where it goes
before they take it.