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

NGWAF dictionary check #710

Merged
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
10 changes: 10 additions & 0 deletions Controller/Adminhtml/FastlyCdn/Edge/Dictionary/ListAll.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class ListAll extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

const NGWAF_DICTIONARY_NAME = "Edge_Security";

/**
* @var Http
*/
Expand Down Expand Up @@ -96,6 +98,14 @@ public function execute()
]);
}

// This dictionary represents NGWAF, used while migrating customers from WAF. Adobe is requesting that
// their customers shouldn't be able to disable it, so we remove it from Admin listing.
foreach ($dictionaries as $key => $dictionary) {
if (isset($dictionary->name) && $dictionary->name === self::NGWAF_DICTIONARY_NAME) {
array_splice($dictionaries, $key, 1);
}
}

return $result->setData([
'status' => true,
'dictionaries' => $dictionaries
Expand Down
12 changes: 5 additions & 7 deletions view/adminhtml/web/js/edge-dictionaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,11 @@ define([
listDictionaries(active_version, false).done(function (response) {
$('.loading-dictionaries').hide();
if (response.status !== false) {
if (response.status !== false) {
if (response.dictionaries.length > 0) {
dictionaries = response.dictionaries;
processDictionaries(response.dictionaries);
} else {
$('.no-dictionaries').show();
}
if (response.dictionaries.length > 0) {
dictionaries = response.dictionaries;
processDictionaries(response.dictionaries);
} else {
$('.no-dictionaries').show();
}
}
}).fail(function () {
Expand Down
Loading