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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ configuration.

Currently, the following OIDF features are supported:
* automatic client registration using a Request Object (passing it by value)
* federation participation limiting based on Trust Marks
* endpoint for issuing configuration entity statement (statement about itself)
* fetch endpoint for issuing statements about subordinates (registered clients)

Expand Down
9 changes: 5 additions & 4 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
- Key rollover support - you can now define additional (new) private / public key pair which will be published on
relevant JWKS endpoint or contained in JWKS property. In this way, you can "announce" new public key which can then
be fetched by RPs, and do the switch between "old" and "new" key pair when you find appropriate.
- OpenID capabilities
- New federation endpoints:
- endpoint for issuing configuration entity statement (statement about itself)
- fetch endpoint for issuing statements about subordinates (registered clients)
- OpenID Federation capabilities:
- Automatic client registration using a Request Object (passing it by value)
- Federation participation limiting based on Trust Marks
- Endpoint for issuing configuration entity statement (statement about itself)
- Fetch endpoint for issuing statements about subordinates (registered clients)
- Clients can now be configured with new properties:
- Entity Identifier
- Supported OpenID Federation Registration Types
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"psr/container": "^2.0",
"psr/log": "^3",
"simplesamlphp/composer-module-installer": "^1.3",
"simplesamlphp/openid": "dev-master",
"simplesamlphp/openid": "^0",
"spomky-labs/base64url": "^2.0",
"symfony/expression-language": "^6.3",
"symfony/psr-http-message-bridge": "^7.1",
Expand Down
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
]);

$rectorConfig->paths([
// TODO mivanci also go trough commented out paths...
// TODO v7 mivanci also go trough commented out paths...
//__DIR__ . '/docker',
//__DIR__ . '/hooks',
//__DIR__ . '/public',
Expand Down
4 changes: 0 additions & 4 deletions routing/routes/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,4 @@
$routes->add(RoutesEnum::FederationFetch->name, RoutesEnum::FederationFetch->value)
->controller([EntityStatementController::class, 'fetch'])
->methods([HttpMethodsEnum::GET->value]);

// TODO mivanci delete
$routes->add('test', 'test')
->controller(\SimpleSAML\Module\oidc\Controllers\Federation\Test::class);
};
7 changes: 7 additions & 0 deletions src/Bridges/SspBridge/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace SimpleSAML\Module\oidc\Bridges\SspBridge;

use SimpleSAML\Utils\Attributes;
use SimpleSAML\Utils\Auth;
use SimpleSAML\Utils\Config;
use SimpleSAML\Utils\HTTP;
Expand All @@ -15,6 +16,7 @@ class Utils
protected static ?HTTP $http = null;
protected static ?Random $random = null;
protected static ?Auth $auth = null;
protected static ?Attributes $attributes = null;

public function config(): Config
{
Expand All @@ -35,4 +37,9 @@ public function auth(): Auth
{
return self::$auth ??= new Auth();
}

public function attributes(): Attributes
{
return self::$attributes ??= new Attributes();
}
}
2 changes: 1 addition & 1 deletion src/Controllers/Admin/ClientController.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public function edit(Request $request): Response
}

/**
* TODO mivanci Move to ClientEntityFactory::fromRegistrationData on dynamic client registration implementation.
* TODO v7 mivanci Move to ClientEntityFactory::fromRegistrationData on dynamic client registration implementation.
* @throws \SimpleSAML\Module\oidc\Exceptions\OidcException
*/
protected function buildClientEntityFromFormData(
Expand Down
4 changes: 2 additions & 2 deletions src/Controllers/EndSessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(
*/
public function __invoke(ServerRequestInterface $request): Response
{
// TODO Back-Channel Logout: https://openid.net/specs/openid-connect-backchannel-1_0.html
// TODO v7 Back-Channel Logout: https://openid.net/specs/openid-connect-backchannel-1_0.html
// [] Refresh tokens issued without the offline_access property to a session being logged out SHOULD
// be revoked. Refresh tokens issued with the offline_access property normally SHOULD NOT be revoked.
// - offline_access scope is now handled.
Expand Down Expand Up @@ -147,7 +147,7 @@ public static function logoutHandler(): void
$sessionLogoutTickets = $sessionLogoutTicketStore->getAll();

if (!empty($sessionLogoutTickets)) {
// TODO low mivanci This could brake since interface does not mandate type. Move to strong typing.
// TODO v7 low mivanci This could brake since interface does not mandate type. Move to strong typing.
/** @var array $sessionLogoutTicket */
foreach ($sessionLogoutTickets as $sessionLogoutTicket) {
$sid = (string)$sessionLogoutTicket['sid'];
Expand Down
8 changes: 4 additions & 4 deletions src/Controllers/Federation/EntityStatementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function configuration(): Response
)),
ClaimsEnum::FederationFetchEndpoint->value =>
$this->moduleConfig->getModuleUrl(RoutesEnum::FederationFetch->value),
// TODO mivanci Add when ready. Use ClaimsEnum for keys.
// TODO v7 mivanci Add when ready. Use ClaimsEnum for keys.
// https://openid.net/specs/openid-federation-1_0.html#name-federation-entity
//'federation_list_endpoint',
//'federation_resolve_endpoint',
Expand Down Expand Up @@ -149,7 +149,7 @@ public function configuration(): Response
$builder = $builder->withClaim(ClaimsEnum::TrustMarks->value, $trustMarks);
}

// TODO mivanci Continue
// TODO v7 mivanci Continue
// Remaining claims, add if / when ready.
// * crit

Expand Down Expand Up @@ -235,14 +235,14 @@ public function fetch(Request $request): Response
ClaimsEnum::PostLogoutRedirectUris->value => $client->getPostLogoutRedirectUri(),
],
)),
// TODO mivanci Continue
// TODO v7 mivanci Continue
// https://openid.net/specs/openid-connect-registration-1_0.html#ClientMetadata
// https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#client-metadata
],
],
);

// TODO mivanci Continue
// TODO v7 mivanci Continue
// Note: claims which can be present in subordinate statements:
// * metadata_policy
// * constraints
Expand Down
152 changes: 0 additions & 152 deletions src/Controllers/Federation/Test.php

This file was deleted.

17 changes: 14 additions & 3 deletions src/Factories/FormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@

use Nette\Forms\Form;
use SimpleSAML\Error\Exception;
use SimpleSAML\Module\oidc\Bridges\SspBridge;
use SimpleSAML\Module\oidc\Forms\Controls\CsrfProtection;
use SimpleSAML\Module\oidc\Helpers;
use SimpleSAML\Module\oidc\ModuleConfig;

class FormFactory
{
public function __construct(private readonly ModuleConfig $moduleConfig, protected CsrfProtection $csrfProtection)
{
public function __construct(
protected readonly ModuleConfig $moduleConfig,
protected readonly CsrfProtection $csrfProtection,
protected readonly SspBridge $sspBridge,
protected readonly Helpers $helpers,
) {
}

/**
Expand All @@ -39,6 +45,11 @@ public function build(string $classname): Form
}

/** @psalm-suppress UnsafeInstantiation */
return new $classname($this->moduleConfig, $this->csrfProtection);
return new $classname(
$this->moduleConfig,
$this->csrfProtection,
$this->sspBridge,
$this->helpers,
);
}
}
Loading