diff --git a/composer.json b/composer.json index 36e11fe99..bac2a2b57 100755 --- a/composer.json +++ b/composer.json @@ -72,6 +72,7 @@ "composer/installers": "^1.2", "cweagans/composer-patches": "^1.6", "drupal/access_by_ref": "^3.0", + "drupal/advanced_cors": "^1.5", "drupal/auditfiles": "^4.1@beta", "drupal/better_exposed_filters": "^6.0", "drupal/block_exclude_pages": "^2.0", diff --git a/composer.lock b/composer.lock index 4fa5263da..a07920442 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "098040d296a700e68841c661b3770946", + "content-hash": "493c4b723f39037bc8da9096c5edd7d5", "packages": [ { "name": "access/drupal_seamless_cilogon", @@ -2440,6 +2440,58 @@ "source": "https://git.drupalcode.org/project/access_by_ref" } }, + { + "name": "drupal/advanced_cors", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/advanced_cors.git", + "reference": "8.x-1.5" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/advanced_cors-8.x-1.5.zip", + "reference": "8.x-1.5", + "shasum": "600169c960921a86fb72458466fd52affdeb37d5" + }, + "require": { + "drupal/core": ">=8" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "8.x-1.5", + "datestamp": "1694615950", + "security-coverage": { + "status": "not-covered", + "message": "Project has not opted into security advisory coverage!" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Artem Vilkov", + "homepage": "https://www.drupal.org/user/3500951" + }, + { + "name": "sergei_semipiadniy", + "homepage": "https://www.drupal.org/user/2910879" + } + ], + "description": "Advanced CORS - Provides possibility to customize settings CORS by path patterns.", + "homepage": "http://drupal.org/project/advanced_cors", + "keywords": [ + "Drupal" + ], + "support": { + "source": "https://git.drupalcode.org/project/advanced_cors", + "issues": "https://www.drupal.org/project/issues/advanced_cors" + } + }, { "name": "drupal/auditfiles", "version": "4.1.0-beta2", diff --git a/web/sites/default/config/default/advanced_cors.route_config.apis.yml b/web/sites/default/config/default/advanced_cors.route_config.apis.yml new file mode 100644 index 000000000..b93e24562 --- /dev/null +++ b/web/sites/default/config/default/advanced_cors.route_config.apis.yml @@ -0,0 +1,14 @@ +uuid: bf6f0448-48a8-4679-acd0-6f8b816a4905 +langcode: en +status: true +dependencies: { } +id: apis +label: APIs +weight: 0 +patterns: "/api/1.0/affinity_groups/*\r\n/api/1.0/kb/*\r\n/api/1.0/events/ag/*\r\n/api/1.1/events/ag/*\r\n/access_news/api\r\n" +allowed_headers: '*' +allowed_methods: '*' +allowed_origins: '*' +exposed_headers: '' +max_age: '' +supports_credentials: 'true' diff --git a/web/sites/default/config/default/core.extension.yml b/web/sites/default/config/default/core.extension.yml index 4cc32853d..a201ef865 100644 --- a/web/sites/default/config/default/core.extension.yml +++ b/web/sites/default/config/default/core.extension.yml @@ -12,6 +12,7 @@ module: access_shortcodes: 0 action: 0 actions_permissions: 0 + advanced_cors: 0 auditfiles: 0 automated_cron: 0 better_exposed_filters: 0 diff --git a/web/sites/default/services.yml b/web/sites/default/services.yml index 0f765086d..679f411e2 100644 --- a/web/sites/default/services.yml +++ b/web/sites/default/services.yml @@ -170,22 +170,3 @@ parameters: - sftp - webcal - rtsp - - # Configure Cross-Site HTTP requests (CORS). - # Read https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS - # for more information about the topic in general. - # Note: By default the configuration is disabled. - cors.config: - enabled: false - # Specify allowed headers, like 'x-allowed-header'. - allowedHeaders: [] - # Specify allowed request methods, specify ['*'] to allow all possible ones. - allowedMethods: [] - # Configure requests allowed from specific origins. - allowedOrigins: ['*'] - # Sets the Access-Control-Expose-Headers header. - exposedHeaders: false - # Sets the Access-Control-Max-Age header. - maxAge: false - # Sets the Access-Control-Allow-Credentials header. - supportsCredentials: false