Skip to content

Commit eb5a895

Browse files
committed
Container binding demo
1 parent be9cc74 commit eb5a895

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

routing/routes/routes.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,8 @@
101101
$routes->add(RoutesEnum::FederationList->name, RoutesEnum::FederationList->value)
102102
->controller([SubordinateListingsController::class, 'list'])
103103
->methods([HttpMethodsEnum::GET->value]);
104+
105+
// Demo
106+
$routes->add('demo', 'demo')
107+
->controller(\SimpleSAML\Module\oidc\Controllers\DemoController::class);
104108
};

routing/services/services.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ services:
1717
Psr\Http\Message\StreamFactoryInterface: '@Laminas\Diactoros\StreamFactory'
1818
Psr\Http\Message\UploadedFileFactoryInterface: '@Laminas\Diactoros\UploadedFileFactory'
1919
League\OAuth2\Server\AuthorizationValidators\AuthorizationValidatorInterface: '@SimpleSAML\Module\oidc\Server\Validators\BearerTokenValidator'
20+
SimpleSAML\Configuration $globalConfig: '@simplesaml.configuration.global'
21+
SimpleSAML\Configuration $moduleConfig: '@simplesaml.configuration.module_config'
2022

2123
SimpleSAML\Module\oidc\Controllers\:
2224
resource: '../../src/Controllers/*'
@@ -131,3 +133,16 @@ services:
131133
# SSP
132134
SimpleSAML\Database:
133135
factory: [ 'SimpleSAML\Database', 'getInstance' ]
136+
137+
138+
# Demo
139+
simplesaml.configuration.global:
140+
class: SimpleSAML\Configuration
141+
factory: [ 'SimpleSAML\Configuration', 'getInstance' ]
142+
public: true
143+
144+
simplesaml.configuration.module_config:
145+
class: SimpleSAML\Configuration
146+
factory: [ 'SimpleSAML\Configuration', 'getConfig' ]
147+
public: true
148+
arguments: [ 'module_oidc.php' ]

src/Controllers/DemoController.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace SimpleSAML\Module\oidc\Controllers;
4+
5+
use SimpleSAML\Configuration;
6+
use Symfony\Component\HttpFoundation\Response;
7+
8+
class DemoController
9+
{
10+
public function __construct(
11+
protected readonly Configuration $globalConfig,
12+
protected readonly Configuration $moduleConfig,
13+
)
14+
{
15+
}
16+
17+
public function __invoke(): Response
18+
{
19+
dd(
20+
$this->globalConfig->toArray(),
21+
$this->moduleConfig->toArray(),
22+
);
23+
}
24+
}

0 commit comments

Comments
 (0)