Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
8c74a9b
Update datacenters.json
Oct 16, 2023
cda4e4a
Added basename sanitize to original snippet name, preventing path tra…
ivanviduka Oct 27, 2023
adeb687
Merge pull request #671 from favicode/fix/path-traversal-in-create-sn…
vvuksan Oct 27, 2023
df67613
Merge pull request #670 from fastly/datacenters-json-auto-update-2023…
vvuksan Oct 27, 2023
de9abca
Merge pull request #669 from DataDome/release
vvuksan Oct 27, 2023
fc5c716
Bump to 1.2.208
vvuksan Oct 27, 2023
855bfa0
Update datacenters.json
Oct 30, 2023
584cb2d
Merge pull request #672 from fastly/datacenters-json-auto-update-2023…
vvuksan Oct 30, 2023
6b3772f
wp
dpotkoc Nov 3, 2023
23f5b16
Update datacenters.json
Nov 6, 2023
b4c8e66
Merge pull request #674 from fastly/datacenters-json-auto-update-2023…
vvuksan Nov 6, 2023
28444f8
Merge pull request #673 from favicode/fix/admin-acl
vvuksan Nov 6, 2023
aa4150a
Bump to 1.2.209
vvuksan Nov 6, 2023
354f906
netacea integration v5.7.0
rswalkden Nov 9, 2023
535739d
Update datacenters.json
Dec 4, 2023
f5f8575
Merge pull request #677 from fastly/datacenters-json-auto-update-2023…
vvuksan Dec 5, 2023
f2fd567
Merge pull request #675 from rswalkden/patch-3
vvuksan Dec 5, 2023
32166f9
Bump to 1.2.210
vvuksan Dec 5, 2023
8f8fc49
Release notes update for 1.2.210
vvuksan Dec 5, 2023
3143c34
Update datacenters.json
Dec 18, 2023
607af58
php 8.3
dpotkoc Dec 19, 2023
f07b46e
Merge pull request #680 from favicode/php8.3
vvuksan Dec 19, 2023
91d0329
Merge pull request #679 from fastly/datacenters-json-auto-update-2023…
vvuksan Dec 19, 2023
e342c24
added opensearch
dpotkoc Dec 20, 2023
3d9e121
Merge pull request #681 from favicode/opensearch-yml
vvuksan Dec 21, 2023
658b22e
fix for #682
dpotkoc Jan 4, 2024
07fa0a4
fix for #682
dpotkoc Jan 4, 2024
9b89cfb
Merge pull request #683 from favicode/fix/logging_condition
vvuksan Jan 8, 2024
e8dfde5
Bump to 1.2.211
vvuksan Jan 8, 2024
738d768
fix #682
dpotkoc Jan 11, 2024
6ae7fae
updating to DataDome Fastly Module 2.19.4
MickaelDatadome Jan 16, 2024
63d7602
Merge branch 'master' into datadome-2.19.4
MickaelDatadome Jan 16, 2024
ce32d82
Merge pull request #685 from DataDome/datadome-2.19.4
vvuksan Jan 30, 2024
292b490
Merge pull request #684 from favicode/fix/real-time-logging-v2
vvuksan Jan 30, 2024
e700354
Bump to 1.2.212
vvuksan Jan 30, 2024
21a7132
ci: Use GITHUB_OUTPUT envvar instead of set-output command
arunsathiya Feb 6, 2024
0631b57
Module and documentation updates
mizdebski-netacea Feb 9, 2024
ad1cc76
Documenation wording change
mizdebski-netacea Feb 9, 2024
83663a9
Spelling fix
mizdebski-netacea Feb 9, 2024
de57a20
Add support for Brotli static compression
vvuksan Feb 13, 2024
4262d2b
Merge pull request #687 from mizdebski-netacea/documentation-and-modu…
vvuksan Feb 13, 2024
1238194
Merge pull request #688 from fastly/brotli
vvuksan Feb 13, 2024
f48a796
Merge pull request #686 from arunsathiya/master
vvuksan Feb 13, 2024
2da1203
Add testing for 2.4.6 and PHP 8.3
vvuksan Feb 13, 2024
183810f
Bump to 1.2.213
vvuksan Feb 13, 2024
775b5a1
Merge branch 'brotli'
vvuksan Feb 13, 2024
a4416ca
Rate limiting improvement
dpotkoc Mar 7, 2024
8a3ea3e
fix code quality
dpotkoc Mar 7, 2024
c8dcab8
Merge pull request #689 from favicode/fix/rate-limiting
vvuksan Mar 7, 2024
a5748c1
Bump to 1.2.214
Mar 7, 2024
d985098
Netacea Magento module updated with additional logging
mizdebski-netacea Mar 8, 2024
a0622b7
Fix for checking if current IP is in maintenance IP list
ivanviduka Mar 14, 2024
2f4e11b
Merge pull request #692 from favicode/fix/maintenance-ips-in-rate-lim…
vvuksan Mar 27, 2024
8c97f4c
Bump to 1.2.215
Mar 27, 2024
1694050
fix GEOIP redirection causes 404 #693
dpotkoc Apr 8, 2024
a49a155
Merge pull request #694 from favicode/fix/geoip
vvuksan Apr 8, 2024
fdd616c
Bump to 1.2.216
Apr 8, 2024
a7dd24b
Merge branch 'master' into chore/PE2-1049/additional-logging
mizdebski-netacea May 6, 2024
8e763fb
Merge pull request #690 from mizdebski-netacea/chore/PE2-1049/additio…
vvuksan May 8, 2024
0ed56f1
Bump to 1.2.217
May 8, 2024
cdb3a34
Netacea Magento module updated with PURGE requests handling
mizdebski-netacea May 9, 2024
37969c8
Fixing deprecated usage - adding cast to string and tags size check
ivanviduka May 13, 2024
0d33b66
Merge branch 'master' into feat/PEB-756/purge-requests-handling
mizdebski-netacea May 24, 2024
7df0309
Merge pull request #697 from favicode/fix/deprecated-functionality
vvuksan May 24, 2024
f8cf114
Merge pull request #696 from mizdebski-netacea/feat/PEB-756/purge-req…
vvuksan May 24, 2024
b172057
Bump to 1.2.218
May 29, 2024
6db3a64
Removing trailing comma in WAF constructor to be compatible with PHP 7.2
ivanviduka Jun 13, 2024
942607b
Merge pull request #698 from favicode/fix/php-compatibility
vvuksan Jun 13, 2024
21d44d4
Bump to 1.2.219
Jun 18, 2024
6539c34
Update datacenters.json
Jul 1, 2024
83e4985
Don't display API keys and tokens on endpoint update - they shouldn't…
ivanviduka Jul 1, 2024
0ff2865
In 2.4 path is /pub/errors
Jul 2, 2024
5a8dd4e
Merge pull request #701 from favicode/fix/api-keys-for-log-endpoints
vvuksan Jul 2, 2024
00b55d9
Merge pull request #700 from fastly/datacenters-json-auto-update-2024…
vvuksan Jul 2, 2024
dd786e2
Bump to 1.2.220
Jul 2, 2024
d79375b
updating to DataDome Fastly Module 2.22.0
MickaelDatadome Oct 24, 2024
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
33 changes: 21 additions & 12 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [master]

env:
MAGENTO_CODING_STANDARD: "v25"
MAGENTO_CODING_STANDARD: "v30"

jobs:
static_code_check:
Expand Down Expand Up @@ -47,16 +47,17 @@ jobs:
--health-interval=10s
--health-timeout=5s
--health-retries=3
es:
image: docker.elastic.co/elasticsearch/elasticsearch:${{ matrix.elasticsearch }}
os:
image: opensearchproject/opensearch:${{ matrix.opensearch }}
env:
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m"

ports:
- 9200:9200
options: >-
-e "discovery.type=single-node"
-e "xpack.security.enabled=false"
-e "plugins.security.disabled=true"
--name "opensearch-node"
--health-cmd="curl --silent --fail localhost:9200/_cluster/health || exit 1"
--health-interval=30s
--health-timeout=30s
Expand All @@ -66,21 +67,28 @@ jobs:
matrix:
# https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/system-requirements.html
include:
- magento: "2.4.3"
php: "7.4"
composer: "v1"
elasticsearch: "7.10.2"
# Higher matching version 4.6.1 of magento/magento2-functional-testing-framework was found in public repository packagist.org
# than 4.4.2 in private https://mirror.mage-os.org. Public package might've been taken over by a malicious entity,
# please investigate and update package requirement to match the version from the private repository
#- magento: "2.4.3-p3"
# php: "7.4"
# composer: "v1"
# elasticsearch: "7.10.2"

- magento: "2.4.4"
php: "8.1"
composer: "v2"
elasticsearch: "7.16.3"
opensearch: "1.2.0"

- magento: "2.4.5"
php: "8.1"
composer: "v2"
elasticsearch: "7.17.5"
opensearch: "1.2.0"

- magento: "2.4.6"
php: "8.2"
composer: "v2"
opensearch: "2.5.0"
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -144,4 +152,5 @@ jobs:
run: echo "::add-matcher::${{ github.workspace }}/app/code/Fastly/Cdn/.github/tests/phpunit_matcher.json"

- name: Run tests
run: vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist --teamcity app/code/Fastly/Cdn/
run: ../../../vendor/bin/phpunit -c ../unit/phpunit.xml.dist --teamcity ../../../app/code/Fastly/Cdn/
working-directory: dev/tests/integration
6 changes: 3 additions & 3 deletions .github/workflows/shielding-check-cron-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
run: |
cat ./temp.json | jq . > etc/shielding/datacenters.json
rm -f ./temp.json
echo "::set-output name=diff-count::$(git diff --name-only | wc -l)"
echo "diff-count=$(git diff --name-only | wc -l)" >> "$GITHUB_OUTPUT"
SHA1=`sha1sum etc/shielding/datacenters.json | awk '{print $1}'`
echo "::set-output name=sha1::$SHA1"
echo "::set-output name=pr-count::$(gh pr list --search "${SHA1} in:title is:open" --json title -q '.[] | .title' | wc -l)"
echo "sha1=$SHA1" >> "$GITHUB_OUTPUT"
echo "pr-count=$(gh pr list --search "${SHA1} in:title is:open" --json title -q '.[] | .title' | wc -l)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check diff and create PR
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/shielding-check-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
run: |
cat ./temp.json | jq . > etc/shielding/datacenters.json
rm -f ./temp.json
echo "::set-output name=diff-count::$(git diff --name-only | wc -l)"
echo "diff-count=$(git diff --name-only | wc -l)" >> "$GITHUB_OUTPUT"
SHA1=`sha1sum etc/shielding/datacenters.json | awk '{print $1}'`
echo "::set-output name=sha1::$SHA1"
echo "::set-output name=pr-count::$(gh pr list --search "${SHA1} in:title is:open" --json title -q '.[] | .title' | wc -l)"
echo "sha1=$SHA1" >> "$GITHUB_OUTPUT"
echo "pr-count=$(gh pr list --search "${SHA1} in:title is:open" --json title -q '.[] | .title' | wc -l)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check diff and create PR
Expand Down
20 changes: 11 additions & 9 deletions Block/GeoIp/GetAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @copyright Copyright (c) 2016 Fastly, Inc. (http://www.fastly.com)
* @license BSD, see LICENSE_FASTLY_CDN.txt
*/

namespace Fastly\Cdn\Block\GeoIp;

use Fastly\Cdn\Model\Config;
Expand Down Expand Up @@ -60,13 +61,14 @@ class GetAction extends AbstractBlock
* @param EncoderInterface $urlEncoder
*/
public function __construct(
Config $config,
Context $context,
Response $response,
Url $url,
Config $config,
Context $context,
Response $response,
Url $url,
EncoderInterface $urlEncoder,
array $data = []
) {
array $data = []
)
{
$this->config = $config;
$this->response = $response;
$this->url = $url;
Expand All @@ -92,8 +94,8 @@ protected function _toHtml() // @codingStandardsIgnoreLine - required by parent
$currentUrl = $this->url->getCurrentUrl();
$baseUrl = $this->url->getBaseUrl();
$webTypeUrl = $this->url->getBaseUrl(['_type' => Url::URL_TYPE_WEB]);
if (strpos($currentUrl, $baseUrl) !== false) {

if (strpos($currentUrl, rtrim($baseUrl, "/")) !== false) {
$targetUrl = $currentUrl;
} else {
$targetUrl = str_replace($webTypeUrl, $baseUrl, $currentUrl);
Expand All @@ -109,7 +111,7 @@ protected function _toHtml() // @codingStandardsIgnoreLine - required by parent
$this->response->setHeader("x-esi", "1");
}
// Due to Varnish parser limitations HTTPS ESIs are not supported so we need to turn them into HTTP URLs
// This does not mean that request will go over HTTP. ESI subrequest will go out to the backend that is
// This does not mean that request will go over HTTP. ESI subrequest will go out to the backend that is
// currently specified so if it's HTTPS it will go over HTTPS
return sprintf(
'<esi:include src=\'%s\' />',
Expand Down
2 changes: 2 additions & 0 deletions Controller/Adminhtml/FastlyCdn/Advanced/CheckTlsSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
*/
class CheckTlsSetting extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Api
*/
Expand Down
2 changes: 2 additions & 0 deletions Controller/Adminhtml/FastlyCdn/Advanced/ForceTls.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
*/
class ForceTls extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Http
*/
Expand Down
2 changes: 2 additions & 0 deletions Controller/Adminhtml/FastlyCdn/Backend/ConfigureBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
*/
class ConfigureBackend extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

use ValidationTrait;

/**
Expand Down
2 changes: 2 additions & 0 deletions Controller/Adminhtml/FastlyCdn/Backend/CreateBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
*/
class CreateBackend extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

use ValidationTrait;

/**
Expand Down
2 changes: 2 additions & 0 deletions Controller/Adminhtml/FastlyCdn/Backend/DeleteBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
*/
class DeleteBackend extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Http
*/
Expand Down
2 changes: 2 additions & 0 deletions Controller/Adminhtml/FastlyCdn/Backend/GetBackends.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
*/
class GetBackends extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Http
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
*/
class CheckAuthDictionary extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Api
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
*/
class CheckAuthSetting extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Api
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
*/
class CheckAuthUsersAvailable extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Api
*/
Expand Down
2 changes: 2 additions & 0 deletions Controller/Adminhtml/FastlyCdn/BasicAuthentication/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
*/
class Create extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Http
*/
Expand Down
2 changes: 2 additions & 0 deletions Controller/Adminhtml/FastlyCdn/BasicAuthentication/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
*/
class Delete extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Http
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
*/
class EnableAuth extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Http
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
*/
class Create extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Http
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
*/
class Delete extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Http
*/
Expand Down
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';

/**
* @var Http
*/
Expand Down
2 changes: 2 additions & 0 deletions Controller/Adminhtml/FastlyCdn/Blocking/AbstractBlocking.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

abstract class AbstractBlocking extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

protected $configWriter;

public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
*/
class CheckBlockingSetting extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Api
*/
Expand Down
2 changes: 2 additions & 0 deletions Controller/Adminhtml/FastlyCdn/Configuration/CustomerInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
*/
class CustomerInfo extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Api
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
*/
class GetFastlyServiceInfo extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Api
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
*/
class IsAlreadyConfigured extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Api
*/
Expand Down
2 changes: 2 additions & 0 deletions Controller/Adminhtml/FastlyCdn/Configuration/ServiceInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
*/
class ServiceInfo extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Api
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
*/
class TestConnection extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var Api
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
class ChangeUpdateFlag extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var JsonFactory
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
*/
namespace Fastly\Cdn\Controller\Adminhtml\FastlyCdn\CustomSnippet;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\App\Response\Http\FileFactory;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\Filesystem\Directory\WriteFactory;
Expand All @@ -37,6 +37,8 @@
*/
class CheckCustomSnippet extends Action
{
const ADMIN_RESOURCE = 'Magento_Config::config';

/**
* @var FileFactory
*/
Expand Down
Loading