Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Auth/Source/Negotiate.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
*
* @package simplesamlphp/simplesamlphp-module-negotiate
*/
class Negotiate extends Auth\Source

Check failure on line 34 in src/Auth/Source/Negotiate.php

View workflow job for this annotation

GitHub Actions / Quality control

ClassMustBeFinal

src/Auth/Source/Negotiate.php:34:7: ClassMustBeFinal: Class SimpleSAML\Module\negotiate\Auth\Source\Negotiate is never extended and is not part of the public API, and thus must be made final. (see https://psalm.dev/361)
{
// Constants used in the module
public const STAGEID = '\SimpleSAML\Module\negotiate\Auth\Source\Negotiate.StageId';

Check failure on line 37 in src/Auth/Source/Negotiate.php

View workflow job for this annotation

GitHub Actions / Quality control

MissingClassConstType

src/Auth/Source/Negotiate.php:37:18: MissingClassConstType: Class constant "SimpleSAML\Module\negotiate\Auth\Source\Negotiate::STAGEID" should have a declared type. (see https://psalm.dev/359)

public const AUTHID = '\SimpleSAML\Module\negotiate\Auth\Source\Negotiate.AuthId';

Check failure on line 39 in src/Auth/Source/Negotiate.php

View workflow job for this annotation

GitHub Actions / Quality control

MissingClassConstType

src/Auth/Source/Negotiate.php:39:18: MissingClassConstType: Class constant "SimpleSAML\Module\negotiate\Auth\Source\Negotiate::AUTHID" should have a declared type. (see https://psalm.dev/359)

/** @var string|null */
protected ?string $backend = null;
Expand Down Expand Up @@ -71,7 +71,7 @@
*
* @throws \Exception If the KRB5 extension is not installed or active.
*/
public function __construct(array $info, array $config)

Check warning on line 74 in src/Auth/Source/Negotiate.php

View workflow job for this annotation

GitHub Actions / Quality control

PossiblyUnusedMethod

src/Auth/Source/Negotiate.php:74:21: PossiblyUnusedMethod: Cannot find any calls to method SimpleSAML\Module\negotiate\Auth\Source\Negotiate::__construct (see https://psalm.dev/087)
{
if (!extension_loaded('krb5')) {
throw new Exception('KRB5 Extension not installed');
Expand Down Expand Up @@ -103,7 +103,7 @@
*
* @param array &$state Information about the current authentication.
*/
public function authenticate(array &$state): void

Check failure on line 106 in src/Auth/Source/Negotiate.php

View workflow job for this annotation

GitHub Actions / Quality control

MissingOverrideAttribute

src/Auth/Source/Negotiate.php:106:5: MissingOverrideAttribute: Method SimpleSAML\Module\negotiate\Auth\Source\Negotiate::authenticate should have the "Override" attribute (see https://psalm.dev/358)
{
// set the default backend to config
$state['LogoutState'] = [
Expand Down Expand Up @@ -154,7 +154,7 @@
$reply = null;

try {
if (version_compare(phpversion('krb5'), '1.1.6', '<')) {

Check failure on line 157 in src/Auth/Source/Negotiate.php

View workflow job for this annotation

GitHub Actions / Quality control

PossiblyFalseArgument

src/Auth/Source/Negotiate.php:157:41: PossiblyFalseArgument: Argument 1 of version_compare cannot be false, possibly string value expected (see https://psalm.dev/104)
Logger::debug('Negotiate - authenticate(): Trying to authenticate (channel binding not available).');
$auth = new KRB5NegotiateAuth($this->keytab, $this->spn);
$reply = $this->doAuthentication($auth);
Expand All @@ -178,7 +178,7 @@
}
}

if (!$auth->isChannelBound()) {

Check failure on line 181 in src/Auth/Source/Negotiate.php

View workflow job for this annotation

GitHub Actions / Quality control

PossiblyUndefinedVariable

src/Auth/Source/Negotiate.php:181:30: PossiblyUndefinedVariable: Possibly undefined variable $auth, first seen on line 159 (see https://psalm.dev/018)
throw new Error\Exception(
'Negotiate - authenticate(): Failed to perform channel binding using '
. 'any of the configured certificate hashes.',
Expand All @@ -196,7 +196,7 @@
Logger::info('Negotiate - authenticate(): ' . $userPrincipalName . ' authenticated.');

// Search for the corresponding realm and set current variables
@list($uid, $realmName) = preg_split('/@/', $userPrincipalName, 2);

Check failure on line 199 in src/Auth/Source/Negotiate.php

View workflow job for this annotation

GitHub Actions / Quality control

PossiblyInvalidArrayAccess

src/Auth/Source/Negotiate.php:199:33: PossiblyInvalidArrayAccess: Cannot access array value on non-array variable of type false (see https://psalm.dev/109)

Check failure on line 199 in src/Auth/Source/Negotiate.php

View workflow job for this annotation

GitHub Actions / Quality control

PossiblyInvalidArrayAccess

src/Auth/Source/Negotiate.php:199:27: PossiblyInvalidArrayAccess: Cannot access array value on non-array variable of type false (see https://psalm.dev/109)
/** @psalm-var string $realmName */
Assert::notNull($realmName);

Expand Down Expand Up @@ -364,7 +364,7 @@
throw new Error\Error([500, "Unable to determine auth source."]);
}

/** @psalm-var \SimpleSAML\Auth\Source|null $source */

Check failure on line 367 in src/Auth/Source/Negotiate.php

View workflow job for this annotation

GitHub Actions / Quality control

UnnecessaryVarAnnotation

src/Auth/Source/Negotiate.php:367:24: UnnecessaryVarAnnotation: The @var SimpleSAML\Auth\Source|null annotation for $source is unnecessary (see https://psalm.dev/212)
$source = Auth\Source::getById($authId);
if ($source === null) {
throw new Exception('Could not find authentication source with id ' . $state[self::AUTHID]);
Expand Down Expand Up @@ -406,7 +406,7 @@
try {
return $source->getAttributes($uid);
} catch (Error\Exception $e) {
Logger::debug('Negotiate - ldap lookup failed: ' . $e);

Check failure on line 409 in src/Auth/Source/Negotiate.php

View workflow job for this annotation

GitHub Actions / Quality control

ImplicitToStringCast

src/Auth/Source/Negotiate.php:409:64: ImplicitToStringCast: Right side of concat op expects string, 'SimpleSAML\Error\Exception' provided with a __toString method (see https://psalm.dev/060)
return null;
}
}
Expand All @@ -423,7 +423,7 @@
public function logout(array &$state): void
{
// get the source that was used to authenticate
$authId = $state['LogoutState']['negotiate:backend'];
$authId = $state['negotiate:backend'];
Logger::debug('Negotiate - logout has the following authId: "' . $authId . '"');

if ($authId === null) {
Expand Down
Loading