Skip to content

Commit

Permalink
Remove UiTiDv1 login option
Browse files Browse the repository at this point in the history
  • Loading branch information
Koen Eelen committed Jul 18, 2024
1 parent b5cafa3 commit a646069
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 37 deletions.
7 changes: 1 addition & 6 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,8 @@ function () use ($app, $options) {
/**
* Authentication services
*/
$app['external_auth_enabled'] = (isset($app['config']['auth0']['enable']) && $app['config']['auth0']['enable'] === true) || (isset($app['config']['keycloak']['enable']) && $app['config']['keycloak']['enable'] === true);

if ($app['external_auth_enabled']) {
$app->register(new AuthServiceProvider());
} else {
$app->register(new CultuurNet\UiTIDProvider\Auth\AuthServiceProvider());
}
$app->register(new AuthServiceProvider());

/**
* UiTID User services.
Expand Down
31 changes: 5 additions & 26 deletions bootstrap/logging.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

const MESSAGE_FORMAT = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\nTime: {total_time}s\n--------\n{curl_stderr}";

$app['third_party_api_log'] = $app->share(
$app['third_party_api_log'] = $app::share(
function () {
$handler = new \Monolog\Handler\StreamHandler(
__DIR__ . '/../log/third_party_api.log'
Expand All @@ -19,7 +19,7 @@ function () {
}
);

$app['third_party_api_logger_factory'] = $app->protect(
$app['third_party_api_logger_factory'] = $app::protect(
function ($name) use ($app) {
$logger = new Monolog\Logger($name);
$logger->pushHandler(
Expand All @@ -30,31 +30,10 @@ function ($name) use ($app) {
}
);

if (!$app['external_auth_enabled']) {
$app['uitid_auth_service'] = $app->share(
$app->extend(
'uitid_auth_service',
function (\CultuurNet\Auth\Guzzle\Service $service, \Silex\Application $app) {
/** @var \Psr\Log\LoggerInterface $logger */
$logger = $app['third_party_api_logger_factory']('cultuurnet_auth');

$logPlugin = new \Guzzle\Plugin\Log\LogPlugin(
new \Guzzle\Log\PsrLogAdapter($logger),
MESSAGE_FORMAT
);

$service->addSubscriber($logPlugin);

return $service;
}
)
);
}

/**
* Enable logging on the guzzle client of Culturefeed.
*/
$app['culturefeed_http_client_guzzle'] = $app->share(
$app['culturefeed_http_client_guzzle'] = $app::share(
$app->extend(
'culturefeed_http_client_guzzle',
function (\Guzzle\Http\Client $service, \Silex\Application $app) {
Expand All @@ -73,7 +52,7 @@ function (\Guzzle\Http\Client $service, \Silex\Application $app) {
)
);

$app['expense_report_api'] = $app->share(
$app['expense_report_api'] = $app::share(
$app->extend(
'expense_report_api',
function (\CultuurNet\UiTPASBeheer\ExpenseReport\ExpenseReportApiService $service, \Silex\Application $app) {
Expand All @@ -92,7 +71,7 @@ function (\CultuurNet\UiTPASBeheer\ExpenseReport\ExpenseReportApiService $servic
)
);

$app['datavalidation_guzzle_client'] = $app->share(
$app['datavalidation_guzzle_client'] = $app::share(
$app->extend(
'datavalidation_guzzle_client',
function (\Guzzle\Http\Client $service, \Silex\Application $app) {
Expand Down
6 changes: 1 addition & 5 deletions web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@
/**
* API callbacks for authentication.
*/
if ($app['external_auth_enabled']) {
$app->mount('culturefeed/oauth', new AuthControllerProvider());
} else {
$app->mount('culturefeed/oauth', new \CultuurNet\UiTIDProvider\Auth\AuthControllerProvider());
}
$app->mount('culturefeed/oauth', new AuthControllerProvider());

/**
* API callbacks for UiTID user data and methods.
Expand Down

0 comments on commit a646069

Please sign in to comment.