Skip to content
Merged
Show file tree
Hide file tree
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
28 changes: 14 additions & 14 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3', '8.4']
php-version: ['8.3', '8.4', '8.5']

uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.6
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.11.0
with:
php-version: ${{ matrix.php-version }}

Expand All @@ -30,7 +30,7 @@ jobs:
strategy:
fail-fast: false

uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.6
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.11.0
with:
enable_eslinter: false
enable_jsonlinter: true
Expand All @@ -45,15 +45,15 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.2', '8.3', '8.4']
php-versions: ['8.3', '8.4', '8.5']

steps:
- name: Setup PHP, with composer and extensions
# https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype, date, dom, filter, hash, intl, mbstring, openssl, pcre, soap, spl, xml
extensions: ctype, date, dom, filter, hash, intl, mbstring, openssl, pcre, soap, spl, sodium, xml
tools: composer
ini-values: error_reporting=E_ALL
coverage: pcov
Expand Down Expand Up @@ -85,15 +85,15 @@ jobs:
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Run unit tests with coverage
if: ${{ matrix.php-versions == '8.4' }}
if: ${{ matrix.php-versions == '8.5' }}
run: vendor/bin/phpunit

- name: Run unit tests (no coverage)
if: ${{ matrix.php-versions != '8.4' }}
if: ${{ matrix.php-versions != '8.5' }}
run: vendor/bin/phpunit --no-coverage

- name: Save coverage data
if: ${{ matrix.php-versions == '8.4' }}
if: ${{ matrix.php-versions == '8.5' }}
uses: actions/upload-artifact@v6
with:
name: coverage-data
Expand All @@ -107,15 +107,15 @@ jobs:
fail-fast: true
matrix:
operating-system: [windows-latest]
php-versions: ['8.2', '8.3', '8.4']
php-versions: ['8.3', '8.4', '8.5']

steps:
- name: Setup PHP, with composer and extensions
# https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype, date, dom, filter, hash, intl, mbstring, openssl, pcre, soap, spl, xml
extensions: ctype, date, dom, filter, hash, intl, mbstring, openssl, pcre, soap, sodium, spl, xml
tools: composer
ini-values: error_reporting=E_ALL
coverage: none
Expand Down Expand Up @@ -161,9 +161,9 @@ jobs:
uses: shivammathur/setup-php@v2
with:
# Should be the higest supported version, so we can use the newest tools
php-version: '8.4'
php-version: '8.5'
tools: composer, composer-require-checker, composer-unused
extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, soap, spl, xml
extensions: ctype, date, dom, filter, hash, intl, mbstring, openssl, pcre, soap, sodium, spl, xml
coverage: none

- name: Setup problem matchers for PHP
Expand Down Expand Up @@ -215,8 +215,8 @@ jobs:
uses: shivammathur/setup-php@v2
with:
# Should be the lowest supported version
php-version: '8.2'
extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, soap, spl, xml
php-version: '8.3'
extensions: ctype, date, dom, filter, hash, intl, mbstring, openssl, pcre, soap, sodium, spl, xml
tools: composer
coverage: none

Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"require": {
"php": "^8.2",
"php": "^8.3",
"ext-date": "*",
"ext-dom": "*",
"ext-filter": "*",
Expand All @@ -29,18 +29,18 @@
"nyholm/psr7": "~1.8",
"psr/clock": "~1.0",
"psr/http-message": "~2.0",
"psr/log": "~2.3 || ~3.0",
"psr/log": "~3.0",
"simplesamlphp/assert": "~1.9",
"simplesamlphp/xml-common": "~2.4",
"simplesamlphp/xml-security": "~2.0",
"simplesamlphp/xml-soap": "~2.0"
"simplesamlphp/xml-common": "~2.5",
"simplesamlphp/xml-security": "~2.1",
"simplesamlphp/xml-soap": "~2.1"
},
"require-dev": {
"ext-intl": "*",

"beste/clock": "~3.0",
"mockery/mockery": "~1.6",
"simplesamlphp/simplesamlphp-test-framework": "~1.10"
"simplesamlphp/simplesamlphp-test-framework": "~1.11"
},
"suggest": {
"ext-soap": "*"
Expand All @@ -58,7 +58,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "v5.1.x-dev"
"dev-master": "v6.1.x-dev"
}
},
"config": {
Expand Down
13 changes: 3 additions & 10 deletions src/Binding/HTTPArtifact.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class HTTPArtifact extends Binding implements AsynchronousBindingInterface, Rela


/**
* @psalm-suppress UndefinedDocblockClass
* @psalm-suppress UndefinedClass
* @var \SimpleSAML\Configuration
*/
private Configuration $spMetadata;
Expand All @@ -58,16 +56,15 @@ class HTTPArtifact extends Binding implements AsynchronousBindingInterface, Rela
/**
* Create the redirect URL for a message.
*
* @param \SimpleSAML\SAML2\XML\samlp\AbstractMessage $message The message.
* @param \SimpleSAML\SAML2\XML\samlp\AbstractMessage $message The message.
* @return string The URL the user should be redirected to in order to send a message.
*
* @throws \Exception
* @return string The URL the user should be redirected to in order to send a message.
*/
public function getRedirectURL(AbstractMessage $message): string
{
/** @psalm-suppress UndefinedClass */
$config = Configuration::getInstance();

/** @psalm-suppress UndefinedClass */
$store = StoreFactory::getInstance($config->getString('store.type'));
if ($store === false) {
throw new Exception('Unable to send artifact without a datastore configured.');
Expand Down Expand Up @@ -97,7 +94,6 @@ public function getRedirectURL(AbstractMessage $message): string
$params['RelayState'] = $relayState;
}

/** @psalm-suppress UndefinedClass */
$httpUtils = new HTTP();
return $httpUtils->addURLparameters($destination, $params);
}
Expand Down Expand Up @@ -211,8 +207,6 @@ public function receive(ServerRequestInterface $request): AbstractMessage

/**
* @param \SimpleSAML\Configuration $sp
*
* @psalm-suppress UndefinedClass
*/
public function setSPMetadata(Configuration $sp): void
{
Expand All @@ -225,7 +219,6 @@ public function setSPMetadata(Configuration $sp): void
*
* @param \SimpleSAML\SAML2\XML\samlp\ArtifactResponse $message
* @param \SimpleSAML\XMLSecurity\XMLSecurityKey $key
* @return bool
*/
public static function validateSignature(ArtifactResponse $message, XMLSecurityKey $key): bool
{
Expand Down
1 change: 1 addition & 0 deletions src/Binding/HTTPPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public function send(AbstractMessage $message): ResponseInterface
*
* @param \Psr\Http\Message\ServerRequestInterface $request
* @return \SimpleSAML\SAML2\XML\samlp\AbstractMessage The received message.
*
* @throws \Exception
*/
public function receive(ServerRequestInterface $request): AbstractMessage
Expand Down
1 change: 1 addition & 0 deletions src/Binding/HTTPRedirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public function send(AbstractMessage $message): ResponseInterface
*
* @param \Psr\Http\Message\ServerRequestInterface $request
* @return \SimpleSAML\SAML2\XML\samlp\AbstractMessage The received message.
*
* @throws \Exception
*
* NPath is currently too high but solving that just moves code around.
Expand Down
4 changes: 0 additions & 4 deletions src/Binding/RelayStateInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@ interface RelayStateInterface
{
/**
* Set the RelayState associated with he message.
*
* @param string|null $relayState The RelayState.
*/
public function setRelayState(?string $relayState = null): void;


/**
* Get the RelayState associated with the message.
*
* @return string|null The RelayState.
*/
public function getRelayState(): ?string;
}
6 changes: 0 additions & 6 deletions src/Binding/RelayStateTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ trait RelayStateTrait
{
/**
* The relay state.
*
* @var string|null
*/
protected ?string $relayState = null;


/**
* Set the RelayState associated with he message.
*
* @param string|null $relayState The RelayState.
*/
public function setRelayState(?string $relayState = null): void
{
Expand All @@ -35,8 +31,6 @@ public function setRelayState(?string $relayState = null): void

/**
* Get the RelayState associated with the message.
*
* @return string|null The RelayState.
*/
public function getRelayState(): ?string
{
Expand Down
7 changes: 4 additions & 3 deletions src/Binding/SOAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ class SOAP extends Binding implements SynchronousBindingInterface
{
/**
* @param \SimpleSAML\SAML2\XML\samlp\AbstractMessage $message
* @throws \Exception
* @return string|false The XML or false on error
*
* @throws \Exception
*/
public function getOutputToSend(AbstractMessage $message)
public function getOutputToSend(AbstractMessage $message): string|false
{
$header = new Header();

Expand Down Expand Up @@ -113,7 +114,7 @@ public function receive(/** @scrutinizer ignore-unused */ServerRequestInterface
/**
* @return string|false
*/
protected function getInputStream()
protected function getInputStream(): string|false
{
return file_get_contents('php://input');
}
Expand Down
13 changes: 3 additions & 10 deletions src/Certificate/Key.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
class Key implements ArrayAccess
{
// Possible key usages
public const USAGE_SIGNING = 'signing';
public const string USAGE_SIGNING = 'signing';

public const USAGE_ENCRYPTION = 'encryption';
public const string USAGE_ENCRYPTION = 'encryption';


/** @var array */
Expand All @@ -43,8 +43,6 @@ public function __construct(array $keyData)
/**
* Whether or not the key is configured to be used for usage given
*
* @param string $usage
* @return bool
* @throws \SimpleSAML\SAML2\Exception\InvalidArgumentException
*/
public function canBeUsedFor(string $usage): bool
Expand All @@ -62,8 +60,8 @@ public function canBeUsedFor(string $usage): bool

/**
* @param mixed $offset
*
* @throws \SimpleSAML\SAML2\Exception\InvalidArgumentException
* @return bool
*/
public function offsetExists(mixed $offset): bool
{
Expand All @@ -75,9 +73,7 @@ public function offsetExists(mixed $offset): bool


/**
* @param mixed $offset
* @throws \SimpleSAML\SAML2\Exception\InvalidArgumentException
* @return mixed
*/
public function offsetGet($offset): mixed
{
Expand All @@ -89,8 +85,6 @@ public function offsetGet($offset): mixed


/**
* @param mixed $offset
* @param mixed $value
* @throws \SimpleSAML\SAML2\Exception\InvalidArgumentException
*/
public function offsetSet(mixed $offset, mixed $value): void
Expand All @@ -103,7 +97,6 @@ public function offsetSet(mixed $offset, mixed $value): void


/**
* @param mixed $offset
* @throws \SimpleSAML\SAML2\Exception\InvalidArgumentException
*/
public function offsetUnset(mixed $offset): void
Expand Down
5 changes: 1 addition & 4 deletions src/Certificate/KeyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ class KeyCollection extends ArrayCollection
* Add a key to the collection
*
* @param \SimpleSAML\SAML2\Certificate\Key $element
* @throws \SimpleSAML\Assert\AssertionFailedException if assertions are false
*
* Type hint not possible due to upstream method signature
* @psalm-suppress MoreSpecificImplementedParamType
* @throws \SimpleSAML\Assert\AssertionFailedException if assertions are false
*/
public function add($element): void
{
/** @psalm-suppress RedundantConditionGivenDocblockType */
Assert::isInstanceOf($element, Key::class);
parent::add($element);
}
Expand Down
Loading
Loading