Skip to content

Commit e779e59

Browse files
committed
Merge branch 'master' into wip-version-7
2 parents 271f829 + 4c254af commit e779e59

File tree

6 files changed

+60
-3
lines changed

6 files changed

+60
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"psr/container": "^2.0",
3232
"psr/log": "^3",
3333
"simplesamlphp/composer-module-installer": "^1.3",
34-
"simplesamlphp/openid": "^0",
34+
"simplesamlphp/openid": "~0.0.18",
3535
"spomky-labs/base64url": "^2.0",
3636
"symfony/expression-language": "^6.3",
3737
"symfony/psr-http-message-bridge": "^7.1",

config/module_oidc.php.dist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,13 @@ $config = [
410410
],
411411
],
412412

413+
// (optional) Trust Mark Status Endpoint Usage Policy. Check the TrustMarkStatusEndpointUsagePolicyEnum for the
414+
// available options. Default is RequiredIfEndpointProvidedForNonExpiringTrustMarksOnly, meaning that the
415+
// Trust Mark Status Endpoint will be used to check the status of non-expiring Trust Marks if the
416+
// Trust Mark Status Endpoint is provided by the Trust Mark Issuer.
417+
ModuleConfig::OPTION_FEDERATION_TRUST_MARK_STATUS_ENDPOINT_USAGE_POLICY =>
418+
\SimpleSAML\OpenID\Codebooks\TrustMarkStatusEndpointUsagePolicyEnum::RequiredIfEndpointProvidedForNonExpiringTrustMarksOnly,
419+
413420
// (optional) Dedicated federation cache adapter, used to cache federation artifacts like trust chains, entity
414421
// statements, etc. It will also be used for token reuse check in federation context. Setting this option is
415422
// recommended in production environments. If set to null, no caching will be used. Can be set to any

docs/6-oidc-upgrade.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ capabilities are to be used):
9393
statements
9494
- federation participation limiting based on Trust Marks for RPs
9595
- (from v6.1) own Trust Marks to dynamically fetch
96+
- (from v6.3) Trust Mark Status Endpoint Usage Policy
9697
- signer algorithm
9798
- entity statement duration
9899
- organization name
@@ -150,6 +151,13 @@ menu in the Administration area.
150151
`config-templates/module_oidc.php` to `config/module_oidc.php.dist`.
151152
This is only relevant for new installations, since initially it is necessary
152153
to copy the template file to the default SSP config dir.
154+
- (from v6.3) A new option for Trust Mark Status Endpoint Usage Policy has
155+
been introduced, which can be used to control how the Trust Mark Status
156+
Endpoint is used when validating Trust Marks. The default value is
157+
`RequiredIfEndpointProvidedForNonExpiringTrustMarksOnly`, which
158+
means that the Trust Mark Status Endpoint is only used if the
159+
endpoint is provided by the Trust Mark Issuer, and the Trust
160+
Mark does not expire.
153161

154162
Below are also some internal changes that should not have an impact on the
155163
OIDC OP implementers. However, if you are using this module as a library or

src/Factories/FederationFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public function build(): Federation
4343
maxCacheDuration: $this->moduleConfig->getFederationCacheMaxDurationForFetched(),
4444
cache: $this->federationCache?->cache,
4545
logger: $this->loggerService,
46+
defaultTrustMarkStatusEndpointUsagePolicyEnum:
47+
$this->moduleConfig->getFederationTrustMarkStatusEndpointUsagePolicy(),
4648
);
4749
}
4850
}

src/ModuleConfig.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use SimpleSAML\Module\oidc\Bridges\SspBridge;
2626
use SimpleSAML\Module\oidc\Server\Exceptions\OidcServerException;
2727
use SimpleSAML\OpenID\Codebooks\ScopesEnum;
28+
use SimpleSAML\OpenID\Codebooks\TrustMarkStatusEndpointUsagePolicyEnum;
2829

2930
class ModuleConfig
3031
{
@@ -82,14 +83,16 @@ class ModuleConfig
8283
final public const OPTION_FEDERATION_TRUST_ANCHORS = 'federation_trust_anchors';
8384
final public const OPTION_FEDERATION_TRUST_MARK_TOKENS = 'federation_trust_mark_tokens';
8485
final public const OPTION_FEDERATION_DYNAMIC_TRUST_MARKS = 'federation_dynamic_trust_mark_tokens';
86+
final public const OPTION_FEDERATION_PARTICIPATION_LIMIT_BY_TRUST_MARKS =
87+
'federation_participation_limit_by_trust_marks';
88+
final public const OPTION_FEDERATION_TRUST_MARK_STATUS_ENDPOINT_USAGE_POLICY =
89+
'federation_trust_mark_status_endpoint_usage_policy';
8590
final public const OPTION_FEDERATION_CACHE_DURATION_FOR_PRODUCED = 'federation_cache_duration_for_produced';
8691
final public const OPTION_PROTOCOL_CACHE_ADAPTER = 'protocol_cache_adapter';
8792
final public const OPTION_PROTOCOL_CACHE_ADAPTER_ARGUMENTS = 'protocol_cache_adapter_arguments';
8893
final public const OPTION_PROTOCOL_USER_ENTITY_CACHE_DURATION = 'protocol_user_entity_cache_duration';
8994
final public const OPTION_PROTOCOL_CLIENT_ENTITY_CACHE_DURATION = 'protocol_client_entity_cache_duration';
9095
final public const OPTION_PROTOCOL_DISCOVERY_SHOW_CLAIMS_SUPPORTED = 'protocol_discover_show_claims_supported';
91-
final public const OPTION_FEDERATION_PARTICIPATION_LIMIT_BY_TRUST_MARKS =
92-
'federation_participation_limit_by_trust_marks';
9396

9497
final public const OPTION_PKI_NEW_PRIVATE_KEY_PASSPHRASE = 'new_private_key_passphrase';
9598
final public const OPTION_PKI_NEW_PRIVATE_KEY_FILENAME = 'new_privatekey';
@@ -817,6 +820,21 @@ public function getFederationParticipationLimitByTrustMarks(): array
817820
);
818821
}
819822

823+
public function getFederationTrustMarkStatusEndpointUsagePolicy(): TrustMarkStatusEndpointUsagePolicyEnum
824+
{
825+
/** @psalm-suppress MixedAssignment */
826+
$policy = $this->config()->getOptionalValue(
827+
self::OPTION_FEDERATION_TRUST_MARK_STATUS_ENDPOINT_USAGE_POLICY,
828+
null,
829+
);
830+
831+
if ($policy instanceof TrustMarkStatusEndpointUsagePolicyEnum) {
832+
return $policy;
833+
}
834+
835+
return TrustMarkStatusEndpointUsagePolicyEnum::RequiredIfEndpointProvidedForNonExpiringTrustMarksOnly;
836+
}
837+
820838
/**
821839
* @throws \SimpleSAML\Error\ConfigurationError
822840
*/

tests/unit/src/ModuleConfigTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use SimpleSAML\Module\oidc\Bridges\SspBridge;
1616
use SimpleSAML\Module\oidc\ModuleConfig;
1717
use SimpleSAML\Module\oidc\Server\Exceptions\OidcServerException;
18+
use SimpleSAML\OpenID\Codebooks\TrustMarkStatusEndpointUsagePolicyEnum;
1819
use SimpleSAML\Utils\Config;
1920
use SimpleSAML\Utils\HTTP;
2021
use stdClass;
@@ -476,4 +477,25 @@ public function testCanGetIsFederationParticipationLimitedByTrustMarksFor(): voi
476477
$this->sut()->isFederationParticipationLimitedByTrustMarksFor('https://ta.example.org/'),
477478
);
478479
}
480+
481+
public function testCanGetFederationTrustMarkStatusEndpointUsagePolicy(): void
482+
{
483+
// Assert default policy.
484+
$this->assertSame(
485+
TrustMarkStatusEndpointUsagePolicyEnum::RequiredIfEndpointProvidedForNonExpiringTrustMarksOnly,
486+
$this->sut()->getFederationTrustMarkStatusEndpointUsagePolicy(),
487+
);
488+
489+
// Assert custom configuration.
490+
$sut = $this->sut(
491+
overrides: [
492+
ModuleConfig::OPTION_FEDERATION_TRUST_MARK_STATUS_ENDPOINT_USAGE_POLICY =>
493+
TrustMarkStatusEndpointUsagePolicyEnum::Required,
494+
],
495+
);
496+
$this->assertSame(
497+
TrustMarkStatusEndpointUsagePolicyEnum::Required,
498+
$sut->getFederationTrustMarkStatusEndpointUsagePolicy(),
499+
);
500+
}
479501
}

0 commit comments

Comments
 (0)