Files
computer-playbook/roles/web-app-wordpress/files/mu-plugins/infinito-http-ca-trust.php
kevinveenbirkenbach fd6bc6e7f4 fix(lint): read the mirrored-test scope from the suffix, not the directory
A role-files-layout exemption frees a tree from files/<lang>/ because
its import paths are fixed from outside. The mirrored-test lint derived
its scope from that same directory, so every layout exemption silently
became a test exemption nobody ever argued for.

The language now comes from the file suffix. Test code is excluded by
scope rather than exempted: a test-* role and a files/playwright/ or
files/test/ tree are the tests, so demanding a test of them is circular.
The eleven files this newly reaches are framework-instantiated and carry
a stated reason each.
2026-08-22 22:32:31 +02:00

26 lines
794 B
PHP

<?php
// nocheck: mirrored-unit-test - registers add_filter('http_request_args') at load; the body only runs inside a booted WordPress request
/**
* Plugin Name: Infinito.Nexus HTTP CA Trust
* Description: Point the WP HTTP API at the injected internal CA bundle so server-side wp_remote_* TLS (OIDC token exchange) verifies.
*/
if (!defined('ABSPATH')) {
exit;
}
add_filter('http_request_args', static function (array $args): array {
$candidates = [
getenv('CURL_CA_BUNDLE') ?: '',
getenv('CA_TRUST_CERT') ?: '',
getenv('SSL_CERT_FILE') ?: '',
];
foreach ($candidates as $bundle) {
if ($bundle !== '' && is_readable($bundle)) {
$args['sslcertificates'] = $bundle;
break;
}
}
return $args;
}, 10, 1);