From 571bb5e3240ae09bee94c552c1ef4d08f360082c Mon Sep 17 00:00:00 2001 From: Sahil Sharma Date: Mon, 6 Jan 2025 17:37:43 +1100 Subject: [PATCH] Feature/sd 506 enable basic auth (#570) * Shield module added in tide_core * Enable shield module in tide core * revert file to as on develop --------- Co-authored-by: sharmasahil --- .DS_Store | Bin 8196 -> 10244 bytes composer.json | 1 + tide_core.install | 20 ++++++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/.DS_Store b/.DS_Store index 711a192aa1bc4a27db67fc375641bde48eb29c16..7be137e74611b284d629a02d240440a2a9b2a8c0 100644 GIT binary patch literal 10244 zcmeHMOK;p%6h1eZG&3Y=C$BcCK#a%+sZE+dKmvq1ouq<@M?xkFiP|#E!`AXZ4x|F1NcfKIb8Vkf%msqzI%4qzI%4qzI%4 zoCgH3W^>C91T;OT2&4$42%I3m^`U@+X)&b70hQ8$lWYM%Gq^1cee457rV!F%NRI<5 zqR<)a9#kl*!Yzgh#PPhq?4ZSv9tSiKCl!d33P)Dq4n@i6kSho~sbWCWbBaKUKsN%s zch6Cc4BDouzJGV>HOr~tDH5vZC(xNcq=||wmB@w6K5dan78y&H&fmKb;~%9uIruKn z!r6nIi|+(AYKv?G{rkAT-d=}F%l%OGT z26XETl8IKUN09tdL;Qk_X$#)X=nUzb*eDs{g@2-a;zeC&FZew2qFm~kn6^O*(3wVb zIQUtRnZdCgllwF#Hv&2FhxmIshS|w?qOQ2nE$k0H};f3`n6kiA#lcJ|AD)o**Hs(Xj8)*Q#Gb^6uXx@qiJ@?#5*?N?3P za7Dmu7+|^kzG*j{{gTtR8=lCPg9q7MHdo0{93IZi&R;Lg&&?iPFC4z|!YukPzI=3) z%Z^Xocx|<^W9{0`Czt`63KumR3a(GijA)M~QZwll>TSir+bV_mH`D_?06e{NAVgkt0oA)S|af_>tl9XzOXlW|0M_4c!)O zS~5zvu7_(!bgq&QI?n*TO-r;ux9MFf<2-{%en7EklDOBUUP8SxsfpQgT{Nfy zblEDNv;M?HY}&XNVA90Z9wge}Z$PevjNL`8tKg_YmT{|yK3I^99{Wmtq@i~sGTuM8 z#D0YjjV>xXt=r zSQpffox1RAKHsSfxu*sOhb~^q508uvj}4EHU%oOiK6&-()0O;aty$E&7(Xwmie% z(E6K|{3WmMI+nHKc&2YU_U2s=^=ipCc9-le2P5vGRxP*qk+*KR9%z@$#%9%Zt9H{U z9o)03HN#rAOOEe5yUfYj>W;nQ8mwuhu7r28bPZ|z4z1G;J*3a+3;LSAryuAS`i&l`el@9{Q`gkIdR^UA zZ>smys;aAPWvcsud{3uX@8_qVaMrO$Lma2VDM{6q%7sYy^VvH!5NeU`Qt(_ zWD@sffV4PFoSxzOIi zc(GC^$*Sw`g$*v%qdK{0M&{iIOfm`)Q3&v-lkPiyg^FmnlBmJL{AyC<8DmBz(H{0oMBBuv z+HAyiut*q~VLMr$_(U)A`9ytMnTyU&Jf+J|Cd#)kBUcJIUi2_OS%Q--60e;_BfrA? zSj4!*HzeCQCM1)hHVS6C#_>cO`Q@%HPi!n6iReo-=$bAkY6`X%fAex8aiQzFfCZa9 z#jmSwYzF)yqx0raC3xxN%?sPw_4*_=MwiekRN74uI8O-l2F4TyKyRP^|NnV1IkhE4 zAVuI`MnGj2%Znu_?YvpX_4Bv(0*()HaAUsXfQkrC@;M$DIBhCN- diff --git a/composer.json b/composer.json index f2c32c975..990c0a414 100644 --- a/composer.json +++ b/composer.json @@ -121,6 +121,7 @@ "jquery/inputmask": "5.0.8", "jquery/intl-tel-input": "17.0.19", "progress-tracker/progress-tracker": "2.0.7", + "drupal/shield": "^1.8", "drupal/media_alias_display": "^2.1" }, "repositories": { diff --git a/tide_core.install b/tide_core.install index 79171eb9a..05ce69116 100644 --- a/tide_core.install +++ b/tide_core.install @@ -358,3 +358,23 @@ function tide_core_update_10011() { } } } + +/** + * Enable shield module. + */ +function tide_core_update_10012() { + // Check if the shield module is disabled, enable it. + if (\Drupal::moduleHandler()->moduleExists('shield') === FALSE) { + \Drupal::service('module_installer')->install(['shield']); + } + // Add the new paths to exclude. + $exclude_paths = [ + '/oauth', + '/oauth/authorize', + '/oauth/token', + '/sites/default/files/*', + ]; + $paths_string = implode("\r\n", $exclude_paths); + $shield_config = \Drupal::configFactory()->getEditable('shield.settings'); + $shield_config->set('paths', $paths_string)->save(); +}