Skip to content

Commit

Permalink
Merge pull request #332 from UN-OCHA/develop
Browse files Browse the repository at this point in the history
chore: Prevent user enumeration, cleanup migrations and update workflows.
  • Loading branch information
cafuego authored Jul 19, 2023
2 parents 7164399 + 00e3b3e commit a6bfe80
Show file tree
Hide file tree
Showing 196 changed files with 4,184 additions and 13,550 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
!docker
!html/modules/custom
!html/themes/custom
!patches
!PATCHES
!scripts
!composer.json
!composer.lock
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
uses: docker/[email protected]
with:
registry: public.ecr.aws
username: ${{ secrets.ECR_AWS_ACCESS_KEY_I }}
username: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
password: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
env:
AWS_REGION: us-east-1
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
id: fc
if: ${{ !env.ACT }}
with:
github: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Build output
Expand All @@ -178,7 +178,7 @@ jobs:
uses: peter-evans/create-or-update-comment@v2
if: ${{ !env.ACT }}
with:
github: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/username_enumeration_prevention.module b/username_enumeration_prevention.module
index 1038f75b1d823887965f79df9d3b76fc396031a1..075abaa22c8392f810093e066990934328fdd01c 100644
--- a/username_enumeration_prevention.module
+++ b/username_enumeration_prevention.module
@@ -86,3 +86,15 @@ function username_enumeration_prevention_pass_submit($form, FormStateInterface $
\Drupal::messenger()->addMessage(t('If the username or email address exists and is active, further instructions have been sent to your email address.'));
$form_state->setRedirect('user.page');
}
+
+/**
+ * Implements hook_js_settings_alter().
+ *
+ * Remove drupalSettings.path.currentPath on 404 responses.
+ */
+function username_enumeration_prevention_js_settings_alter(&$settings) {
+ if (\Drupal::routeMatch()->getRouteName() === "system.404" ) {
+ $settings['path']['currentPath'] = '';
+ }
+}
+
20 changes: 6 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unocha/starterkit",
"description": "Starterkit",
"name": "unocha/gms-site",
"description": "GMS Site",
"type": "project",
"license": "GPL-2.0-or-later",
"authors": [
Expand Down Expand Up @@ -97,7 +97,6 @@
"ckeditor-plugin/panelbutton": "^4.11",
"composer/installers": "^1.10",
"cweagans/composer-patches": "^1.7",
"drupal-composer/preserve-paths": "^0.1.6",
"drupal/acl": "^1.0@beta",
"drupal/admin_denied": "^2",
"drupal/admin_toolbar": "^3.1",
Expand Down Expand Up @@ -146,10 +145,6 @@
"drupal/menu_firstchild": "^2.0",
"drupal/menu_link_attributes": "^1.2",
"drupal/metatag": "^1.16",
"drupal/migrate_file": "^2.0",
"drupal/migrate_plus": "^5.1",
"drupal/migrate_tools": "^5.0",
"drupal/migrate_upgrade": "^3.2",
"drupal/modules_weight": "^1.9",
"drupal/noreqnewpass": "^1.2",
"drupal/onomasticon": "^2.0",
Expand All @@ -167,9 +162,10 @@
"drupal/superfish": "^1.4",
"drupal/tb_megamenu": "^1.3",
"drupal/token": "^1.9",
"drupal/token_filter": "^1.2",
"drupal/token_filter": "^2.0",
"drupal/tome": "^1.4",
"drupal/user_expire": "^1.0",
"drupal/username_enumeration_prevention": "^1.3",
"drupal/userprotect": "^1.1",
"drupal/video_embed_field": "^2.4",
"drupal/views_base_url": "^2.0@beta",
Expand Down Expand Up @@ -206,7 +202,6 @@
"composer/installers": true,
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"drupal-composer/preserve-paths": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true,
"drupal/console-extend-plugin": true,
Expand All @@ -231,6 +226,8 @@
"html/modules/contrib/{$name}": ["type:drupal-module"],
"html/profiles/contrib/{$name}": ["type:drupal-profile"],
"html/themes/contrib/{$name}": ["type:drupal-theme"],
"html/modules/custom/{$name}": ["type:drupal-custom-module"],
"html/themes/custom/{$name}": ["type:drupal-custom-theme"],
"drush/Commands/{$name}": ["type:drupal-drush"]
},
"drupal-scaffold": {
Expand All @@ -253,11 +250,6 @@
"replace": false,
"merge-extra": false
},
"preserve-paths": [
"html/modules/custom",
"html/themes/custom",
"html/sites/default"
],
"patches-file": "composer.patches.json",
"composer-exit-on-patch-failure": true
},
Expand Down
Loading

0 comments on commit a6bfe80

Please sign in to comment.