Connectors final class
Minn\Runtime\Connectors · public/minn/src/Minn/Runtime/Connectors.php · 221 lines
The connectors registry: the external services a site talks to (AI providers, spam filters, cloud services) and how each authenticates. Rows are normalised on the way in, the way the reference keeps them; the facade class hands them back to plugin code.
Constants and properties
| private | Methods = array ( 0 => 'api_key', 1 => 'application_password', 2 => 'none', ) | |
| private | AuthenticationKeys = array ( 0 => 'method', 1 => 'credentials_url', 2 => 'setting_name', 3 => 'constant_name', 4 => 'env_var_name', ) | |
| private | MaskCap = 16 | The reference stops adding bullets after sixteen, whatever the key's length. |
| private | array $rows |
Public
| method | register(string $id, array $args): ?Minn\Runtime\Refusal# | Registers a connector, or the refusal. | ||||||
| method | unregister(string $id): ?array# | Forgets a connector; its row, or null. @return array<string, mixed>|null the row that was registered, null when there was none | ||||||
| method | all(): array# | Every connector. @return array<string, array<string, mixed>> | ||||||
| method | get(string $id): ?array# | One connector, or null. | ||||||
| method | has(string $id): bool# | Whether a connector is registered. | ||||||
| method | registerAiProviders(Closure $loaded): void# | The reference's three AI providers. Whether a provider's plugin is active is asked of the caller's closure, by the connector's id, when asked (probe connector-defaults).
| ||||||
| method | registerAkismet(Closure $loaded): void# | Akismet, the spam filter connector the reference adds after the AI providers. Whether its plugin is active is asked of the caller's closure.
| ||||||
| static | mask(string $key): string# | Keys of four characters or fewer are shown whole; longer ones keep their last four behind at most sixteen bullets. | ||||||
| static | keySource(string $setting, string $envVar, string $constant, Closure $option): string# | Where a key comes from, in the reference's precedence: the environment, then a constant, then the stored option; empty values do not count.
| ||||||
| static | parseCredentials(string $value): array# | "user:password" split at the first colon, both halves trimmed; anything else is empty credentials. | ||||||
| static | sanitizeCredentials(mixed $value, Closure $clean): array# | Stored credentials are an array of two text fields; a string, even a "user:password" one, is not accepted from storage.
| ||||||
| static | credentials(array $auth, Closure $option, Closure $clean): array# | The credentials a connector authenticates with, from the same three sources as a key, plus where they came from.
|
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | normalise(string $id, array $args, array $authentication, array $plugin): array# | @return array<string, mixed> |
Nothing matches.