feat: implement NTLM support #332
Annotations
9 warnings
src/Client/RestClient.php#L52
Escaped Mutant for Mutator "MethodCallRemoval":
@@ @@
{
$this->useNtlm = $this->configuration->getUseNtlm();
$stack = HandlerStack::create();
- // CurlHandler is necessary to use NTLM
- $stack->setHandler(new CurlHandler());
+
$stack->push((new UserAgentMiddleware())($this->configuration->getUserAgentAddition()));
if (!$this->useNtlm) {
$stack->push((new AuthorisationMiddleware())($this->authorisationToken));
|
src/Client/RestClient.php#L60
Escaped Mutant for Mutator "ArrayItemRemoval":
@@ @@
if (!$this->useNtlm) {
$stack->push((new AuthorisationMiddleware())($this->authorisationToken));
}
- $options = [...$this->configuration->getClientOptions()->toArray(), ...['base_uri' => $configuration->getJobRouterSystem()->getBaseUrl(), 'handler' => $stack, 'synchronous' => true]];
+ $options = [...$this->configuration->getClientOptions()->toArray(), ...['handler' => $stack, 'synchronous' => true]];
if ($this->useNtlm) {
$options['auth'] = ['', '', 'ntlm'];
}
|
src/Client/RestClient.php#L61
Escaped Mutant for Mutator "ArrayItem":
@@ @@
if (!$this->useNtlm) {
$stack->push((new AuthorisationMiddleware())($this->authorisationToken));
}
- $options = [...$this->configuration->getClientOptions()->toArray(), ...['base_uri' => $configuration->getJobRouterSystem()->getBaseUrl(), 'handler' => $stack, 'synchronous' => true]];
+ $options = [...$this->configuration->getClientOptions()->toArray(), ...['base_uri' > $configuration->getJobRouterSystem()->getBaseUrl(), 'handler' => $stack, 'synchronous' => true]];
if ($this->useNtlm) {
$options['auth'] = ['', '', 'ntlm'];
}
|
src/Client/RestClient.php#L63
Escaped Mutant for Mutator "TrueValue":
@@ @@
if (!$this->useNtlm) {
$stack->push((new AuthorisationMiddleware())($this->authorisationToken));
}
- $options = [...$this->configuration->getClientOptions()->toArray(), ...['base_uri' => $configuration->getJobRouterSystem()->getBaseUrl(), 'handler' => $stack, 'synchronous' => true]];
+ $options = [...$this->configuration->getClientOptions()->toArray(), ...['base_uri' => $configuration->getJobRouterSystem()->getBaseUrl(), 'handler' => $stack, 'synchronous' => false]];
if ($this->useNtlm) {
$options['auth'] = ['', '', 'ntlm'];
}
|
src/Client/RestClient.php#L148
Escaped Mutant for Mutator "UnwrapLtrim":
@@ @@
if (!\is_array($data)) {
throw new RestClientException(\sprintf('data must be an array, "%s" given', \get_debug_type($data)), 1578233543);
}
- $resource = \ltrim($resource, '/');
+ $resource = $resource;
$contentType = $this->routeContentTypeMapper->getRequestContentTypeForRoute($method, $resource);
try {
if ($contentType === 'multipart/form-data') {
|
src/Configuration/ClientOptions.php#L23
Escaped Mutant for Mutator "DecrementInteger":
@@ @@
*/
final class ClientOptions
{
- public function __construct(private readonly bool $allowRedirects = false, private readonly int $maxRedirects = 5, private readonly int|float $timeout = 0, private readonly bool $verify = true, private readonly ?string $proxy = null)
+ public function __construct(private readonly bool $allowRedirects = false, private readonly int $maxRedirects = 4, private readonly int|float $timeout = 0, private readonly bool $verify = true, private readonly ?string $proxy = null)
{
}
/**
|
src/Configuration/ClientOptions.php#L23
Escaped Mutant for Mutator "IncrementInteger":
@@ @@
*/
final class ClientOptions
{
- public function __construct(private readonly bool $allowRedirects = false, private readonly int $maxRedirects = 5, private readonly int|float $timeout = 0, private readonly bool $verify = true, private readonly ?string $proxy = null)
+ public function __construct(private readonly bool $allowRedirects = false, private readonly int $maxRedirects = 6, private readonly int|float $timeout = 0, private readonly bool $verify = true, private readonly ?string $proxy = null)
{
}
/**
|
src/Mapper/MultipartFormDataMapper.php#L62
Escaped Mutant for Mutator "UnwrapArrayValues":
@@ @@
}
// @phpstan-ignore-next-line Use value object over return of values
return ['name' => $name, 'contents' => (string) $value];
- }, \array_keys($data), \array_values($data));
+ }, \array_keys($data), $data);
}
}
|
src/Middleware/UserAgentMiddleware.php#L40
Escaped Mutant for Mutator "UnwrapRtrim":
@@ @@
}
private function compileUserAgent(string $userAgentAddition): string
{
- return \rtrim(\sprintf(self::USER_AGENT_TEMPLATE, (new Version())->getVersion(), $userAgentAddition));
+ return \sprintf(self::USER_AGENT_TEMPLATE, (new Version())->getVersion(), $userAgentAddition);
}
}
|
This job succeeded
Loading