Skip to content

feat: implement NTLM support #332

feat: implement NTLM support

feat: implement NTLM support #332

Triggered via push August 28, 2024 13:40
Status Success
Total duration 52s
Artifacts

ci.yml

on: push
Code Quality
42s
Code Quality
Matrix: Build PHP
Fit to window
Zoom out
Zoom in

Annotations

9 warnings
Code Quality: 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));
Code Quality: 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']; }
Code Quality: 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']; }
Code Quality: 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']; }
Code Quality: 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') {
Code Quality: 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) { } /**
Code Quality: 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) { } /**
Code Quality: 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); } }
Code Quality: 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); } }