Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-8059: Check if basic_auth is already enabled #98

Merged
merged 1 commit into from
Apr 20, 2023
Merged
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
11 changes: 7 additions & 4 deletions helfi_api_base.install
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,19 @@ function helfi_api_base_update_9009() : void {
]);
foreach ($endpoints as $endpoint) {
$config = $endpoint->get('configuration');
$config['authentication'][] = 'basic_auth';
$endpoint->set('configuration', $config);
$endpoint->save();

if (!in_array('basic_auth', $config['authentication'])) {
$config['authentication'][] = 'basic_auth';
$endpoint->set('configuration', $config);
$endpoint->save();
}
}
}
}

/**
* Create 'debug_api' role for hel.fi projects.
*/
function helfi_api_base_update_9011() : void {
function helfi_api_base_update_9012() : void {
helfi_api_base_install();
}